Skip to content

Conversation

@sverhoeven
Copy link

@sverhoeven sverhoeven commented Nov 3, 2025

Renders the https://github.com/jasp-stats-modules/modules-app/ web app in the module menu.

Uses qt webchannel to get info from desktop to web app and to uninstall modules.

image

TODO

  • give feedback to user that module has been installed/updated/uninstalled
  • fix ci

RensDofferhoff and others added 30 commits August 27, 2025 15:29
@JorisGoosen
Copy link
Contributor

Ok so on windows I get crashes in the webengine :s

QWebEnginePage::setUrlRequestInterceptor seems to fail on clicking install, but basically the page just goes blank...

@sverhoeven
Copy link
Author

Ive rebased it on upstream/development but cant push to your repo: https://github.com/JorisGoosen/jasp-desktop/tree/webchannel-test

I gave you push rights

@sverhoeven
Copy link
Author

Ok so on windows I get crashes in the webengine :s

QWebEnginePage::setUrlRequestInterceptor seems to fail on clicking install, but basically the page just goes blank...

Hmm, no so cross-platform then, I will implement install via webchannel instead of via download interceptor

@JorisGoosen
Copy link
Contributor

Well it actually works for a little while with qt 6.9.3, but goes blank as soon as I install...

How did you do the download interceptor?
Because I didnt see any new urlScheme handler in main.cpp of Desktop?

	QQuickWebEngineProfile::defaultProfile()->installUrlSchemeHandler("img", this);
}

void ImgSchemeHandler::createUrlScheme()
{
	QWebEngineUrlScheme imgScheme = QWebEngineUrlScheme("img");
	imgScheme.setFlags(QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
	imgScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
	QWebEngineUrlScheme::registerScheme(imgScheme);
}

See the createUrlScheme functions on the schemehandlers

@JorisGoosen
Copy link
Contributor

JorisGoosen commented Nov 5, 2025

I gave you push rights

merci!

@sverhoeven
Copy link
Author

Well it actually works for a little while with qt 6.9.3, but goes blank as soon as I install...

How did you do the download interceptor? Because I didnt see any new urlScheme handler in main.cpp of Desktop?

	QQuickWebEngineProfile::defaultProfile()->installUrlSchemeHandler("img", this);
}

void ImgSchemeHandler::createUrlScheme()
{
	QWebEngineUrlScheme imgScheme = QWebEngineUrlScheme("img");
	imgScheme.setFlags(QWebEngineUrlScheme::ContentSecurityPolicyIgnored);
	imgScheme.setSyntax(QWebEngineUrlScheme::Syntax::Path);
	QWebEngineUrlScheme::registerScheme(imgScheme);
}

See the createUrlScheme functions on the schemehandlers

Download is handled at
https://github.com/jasp-escience/jasp-desktop/blob/cf9a074fd2542ed60b7d99b2ec60eeb9c13a622b/Desktop/components/JASP/Widgets/ModulesMenu.qml#L366-L394

@JorisGoosen
Copy link
Contributor

That hardly looks like it could be the problem really...

I will also test it on another windows system, maybe its something weird with my build (this is not my main dev laptop). Or the videodriver or something...

@JorisGoosen
Copy link
Contributor

I also noticed the way the webengine view is added to the modulesmenu is a bit wonky, so Ill fix that

@JorisGoosen
Copy link
Contributor

Small nitpick on the scrollbar:
image
Is how it looks in the results (with a manually added line next to it)
Which is more like the scrollbar in JASP, as you can see in the screenshot:

image

The right one there is the builtin one, which has a little box around it, while the one in the module store misses this.
The module store one is also slightly wider (fatter) than the jasp-one. But I suppose if we keep that width and just make an outline box in that and make the slider slightly thinner it should look the same.

@JorisGoosen
Copy link
Contributor

Other thing is the fact that when Ive built JASP myself it says "deinstall" for all the builtin modules, but I just get an error when I try that.

@sverhoeven
Copy link
Author

Small nitpick on the scrollbar: image Is how it looks in the results (with a manually added line next to it) Which is more like the scrollbar in JASP, as you can see in the screenshot:

image The right one there is the builtin one, which has a little box around it, while the one in the module store misses this. The module store one is also slightly wider (fatter) than the jasp-one. But I suppose if we keep that width and just make an outline box in that and make the slider slightly thinner it should look the same.

I have made the scrollbar thinner and gave it a vertical border.
image
image

@sverhoeven
Copy link
Author

Other thing is the fact that when Ive built JASP myself it says "deinstall" for all the builtin modules, but I just get an error when I try that.

Hmm, seems Modules::DynamicModules::dynMods()->uninstallModule(moduleName) can only remove modules from ~/.local/share/JASP/JASP/Modules/module_libs/ dir. Your builtin modules where included in InstalledModules::getInstalledModuleVersions() so the webapp thought they could be unininstalled.

Possible solutions I came up with

  1. Pass a list of modules to module library web app that are uninstallable
  2. Exclude the modules that ship with the jasp-desktop base installation in https://module-library.jasp-stats.org/index.json (which is made from release assets on https://github.com/jasp-stats-modules/modules-app by scrape.tst) .
  3. Remove the uninstall button and re-implement in follow up PR

Which solution do you prefer, or do you have another solution?

Needed for
```shell
Rscript buildAllDefaultJaspModules.R
Rscript buildModuleBundlesLocally.R ModuleBundleBuildDir/Modules/*
```
@sverhoeven
Copy link
Author

I was able to replicate uninstall error with

cd Tools
Rscript buildAllDefaultJaspModules.R
Rscript buildModuleBundlesLocally.R ModuleBundleBuildDir/Modules/jaspBain
# Recompile & run 
image

@sverhoeven
Copy link
Author

Other thing is the fact that when Ive built JASP myself it says "deinstall" for all the builtin modules, but I just get an error when I try that.

Hmm, seems Modules::DynamicModules::dynMods()->uninstallModule(moduleName) can only remove modules from ~/.local/share/JASP/JASP/Modules/module_libs/ dir. Your builtin modules where included in InstalledModules::getInstalledModuleVersions() so the webapp thought they could be unininstalled.

Possible solutions I came up with

  1. Pass a list of modules to module library web app that are uninstallable
  2. Exclude the modules that ship with the jasp-desktop base installation in https://module-library.jasp-stats.org/index.json (which is made from release assets on https://github.com/jasp-stats-modules/modules-app by scrape.tst) .
  3. Remove the uninstall button and re-implement in follow up PR

Which solution do you prefer, or do you have another solution?

Going for solution 1

@sverhoeven
Copy link
Author

More features added:

  1. When Check for updates is unchecked in preferences, then module library webapp is not shown, this is like offline mode showing (including translations):
image
  1. When module is not installed in ~/.local/share/JASP/JASP/Modules/module_libs/ (or non-linux equiv), then the uninstall button is not shown.
image

@JorisGoosen can you take another look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants