Skip to content

Remove QtWebEngine and replace with system browser#3847

Open
rozyczko wants to merge 3 commits intomainfrom
3511-use-native-browser-for-help
Open

Remove QtWebEngine and replace with system browser#3847
rozyczko wants to merge 3 commits intomainfrom
3511-use-native-browser-for-help

Conversation

@rozyczko
Copy link
Member

Description

This is a preliminary version of the QtWebEngine-less SasView.
All calls have been converted to consistent system browser calls.
References to QtWebEngine were removed.
Tests updated (although we don't run these tests, anyway)

Fixes #3511

How Has This Been Tested?

Locally on Win11

Review Checklist:

[if using the editor, use [x] in place of [ ] to check a box]

Documentation (check at least one)

  • There is nothing that needs documenting
  • Documentation changes are in this PR
  • There is an issue open for the documentation (link?)

Installers

  • There is a chance this will affect the installers, if so
    • Windows installer (GH artifact) has been tested (installed and worked)
    • MacOSX installer (GH artifact) has been tested (installed and worked)
    • Wheels installer (GH artifact) has been tested (installed and worked)

Licensing (untick if necessary)

  • The introduced changes comply with SasView license (BSD 3-Clause)

@rozyczko rozyczko marked this pull request as draft January 24, 2026 13:43
@llimeht
Copy link
Contributor

llimeht commented Jan 25, 2026

Will this get us to only needing PySide6-Essentials as a (build)dependency? (no need for PySide6-Addons)?

Some quick grepping makes me think you might have already got there. That would be fantastic.

@rozyczko
Copy link
Member Author

There's still one remaining Addons dependency:

from PySide6.QtDataVisualization import Q3DScatter, QScatter3DSeries, QScatterDataItem, QValue3DAxis

We need it for the Shape2SAS 3D scatter plot viewer. Replacing it with something from Essentials (e.g., matplotlib 3D plots or a custom implementation) to fully drop the Addons dependency.

@rozyczko
Copy link
Member Author

This PR can go Ready as soon as the ADR #3511 is agreed on.

@rozyczko rozyczko requested a review from krzywon January 26, 2026 13:03
@jamescrake-merani
Copy link
Contributor

There's still one remaining Addons dependency:

QtDataVisualization is actually deprecated. iirc it caused some issues with the Flatpak, although I don't remember how it was resolved. According to the QT documentation, we're supposed to use QT Graphs instead.

https://doc.qt.io/qt-6/qtgraphs-migration-guide.html

@rozyczko rozyczko marked this pull request as ready for review February 3, 2026 17:59
return type('Enum', (), enums)


def _get_online_docs_url(relative_path: Path) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing locally, I deleted my docs folder after launching the app and the base fitting help url becomes https://www.sasview.org/docs/v6.1.2.dev159+g77be83657/C:/Users/jkrzywon/AppData/Local/sasview/SasView/6.1.2/doc/build/html/user/qtgui/Perspectives/Fitting/fitting_help.html, which gives a 404 error.

The extended version and HELP_SYSTEM.path passed to showHelp() will need to be accounted for.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having file path / URL calculations in both GuiManager.py:showHelp() and GuiUtils.py:showHelp() feels fragile - getting the separation of concerns sorted out helps avoid the double-calculation and all the associated bugs that we have struggled with in the docs for so long.

I wonder if both should end up in src/sas/system/_help.py, taking logic out of the GUI and putting it one place, with a couple of tests in test/system/utest_help.py that check the logic remains robust.

I'm also curious what we see as being the use-case for the online fallback - I think we still want to distribute the docs - that's an important principle for the user to have the documentation to hand.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also curious what we see as being the use-case for the online fallback - I think we still want to distribute the docs - that's an important principle for the user to have the documentation to hand.

When I wrote the ADR, my idea was that the online fallback would only be used if there is a bug in retrieving/packaging the offline documentation. Ideally, this should never have to be used but if there is a bug, we should probably show some documentation rather than just nothing.

def _get_online_docs_url(relative_path: Path) -> str:
"""Construct online documentation URL for the current SasView version."""
from sas.system.version import __version__
base_url = f"https://www.sasview.org/docs/v{__version__}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at that version string in Jeff's URL, perhaps __version__ isn't what we want, particularly during development/pre-release. The reduced_version from src/sas/qtgui/Utilities/WhatsNew/newer.py could move to src/sas/system/version.py, and/or expose __version_tuple__ in version.py.

from sas.system.version import __version__
base_url = f"https://www.sasview.org/docs/v{__version__}"
# Ensure forward slashes for URL (Windows paths use backslashes)
path_str = str(relative_path).replace("\\", "/")
Copy link
Contributor

@llimeht llimeht Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a Path coming in, then there are library methods for this already - relative_path.as_posix() https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.as_posix

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.

4 participants