Skip to content

Tech debt: audit Qt-era desktop workarounds in session HTML/MathJax paths #17509

Open

Description

@kevinushey

RStudio Desktop migrated from Qt (QtWebKit, then QtWebEngine) to Electron / Chromium some time ago, and the src/cpp/desktop Qt build is gone. However, several _WIN32 + kSessionProgramModeDesktop code paths in the session still apply workarounds that were specifically targeted at QtWebKit/QtWebEngine. The names and comments reference Qt explicitly, but the code now runs against Chromium.

The workarounds may be vestigial (no longer help, possibly degrade rendering compared to default Chromium behavior). They should be audited and either renamed/repurposed or removed after a Windows desktop smoke test.

Locations:

  • src/cpp/session/modules/SessionHTMLPreview.hpp:19-23 -- kQtMathJaxConfigScript macro: forces HTML-CSS minScaleAdjust: 125 and availableFonts: []. Originally to compensate for QtWebKit font rendering.
  • src/cpp/session/modules/SessionHTMLPreview.cpp:779-786 -- injects kQtMathJaxConfigScript into preview output. Comment explicitly says "qtwebkit".
  • src/cpp/session/modules/rmarkdown/SessionRMarkdown.cpp -- MathjaxFilter::substitute injects kQtMathJaxConfigScript into rendered Rmd output.
  • src/cpp/session/modules/presentation/SlideRequestHandler.cpp:896 -- disables reveal.js transitions in desktop mode because "qtwebkit can't keep up".

Suggested approach:

  1. Verify on a Windows desktop build (Electron) whether each workaround is still needed.
  2. For workarounds that are no longer needed, remove them.
  3. For any that are still needed (against Chromium), rename the symbols/comments to drop the Qt prefix and explain the actual reason.

Activity

  1. added this to the Tech Debt milestone on May 1, 2026
  2. added
    tech debt
    new
    on May 1, 2026
  3. added theissue type on May 3, 2026
  4. jmg421 commented on May 14, 2026

    @jmg421

    Submitted the cleanup in #17638 — removed kQtMathJaxConfigScript and the desktop-mode transition disabling. Net -26 lines.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    newtech debt

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions