[NRT-822] Qt5: open Terms & Conditions and Flashcard Selector in the external browser#1317
Draft
RisingOrange wants to merge 1 commit into
Draft
[NRT-822] Qt5: open Terms & Conditions and Flashcard Selector in the external browser#1317RisingOrange wants to merge 1 commit into
RisingOrange wants to merge 1 commit into
Conversation
On Qt5 builds of Anki the embedded webview is Chromium 77, which can't run the modern JS used by the AnkiHub Terms & Conditions and Flashcard Selector pages, leaving them blank/broken. Since the Terms page blocks sync, affected users (old macOS, can't upgrade to Qt6 Anki) are fully stuck. Gate both surfaces on using_qt5() and open them in the user's external browser instead: - Flashcard Selector: openLink(full page) + toast instead of the embedded dialog. - Terms & Conditions: open the terms page externally and detect acceptance via a new ExternalBrowserTermsDialog (bounded auto-poll + manual "Check now"); on detection, resume the blocked sync. Acceptance is checked with a new AnkiHubClient.is_terms_agreement_accepted() that re-issues a guarded request (200 = accepted, 403 = not yet). No backend changes. Claude-Session: https://claude.ai/code/session_01E1qJDe6g6ea63Fusg9fViv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
On Qt5 builds of Anki the embedded webview is Qt WebEngine 5.x (Chromium 77), which can't run the modern JS used by two AnkiHub pages we render in-app, so they show up blank/broken for these users:
These are old-macOS (10.13/10.14) users who can't upgrade to Qt6 Anki yet meet
min_anki_version, so it's a supported config. Refs: TRIAGE-147, ACTV-94; Sentry JAVASCRIPT-18 / JAVASCRIPT-E / JAVASCRIPT-4 (Qt Web Engine 5.14.2).Approach
Gate both surfaces on
using_qt5()and open them in the user's external (modern) browser instead of the dead embedded engine — mirroring how the chatbot is Qt6-gated. No backend changes.flashcard_selector_dialog.py) — on Qt5,openLink(url_flashcard_selector(ah_did))+ a short toast instead of building the embedded dialog.terms_dialog.py) — on Qt5, open the terms page externally and show a newExternalBrowserTermsDialogthat detects acceptance:errors.py).AnkiHubClient.is_terms_agreement_accepted()re-issues a request guarded byHasFilledPersonalInfo(GET /users/decks/): 200 = accepted, 403 = not yet. Verified against the webapp: the terms page sets all gated fields (terms + country + study prefs) atomically, so the 403→200 flip maps exactly onto "user completed the page".Status / open question
The Jira issue is in Ready for Design — the
ExternalBrowserTermsDialogUX (auto-poll vs. manual-only, copy, whether it blocks Anki) is pending a designer's review. This PR is a draft implementation/reference, not final; the Terms dialog UI may change after design.Test plan
https://claude.ai/code/session_01E1qJDe6g6ea63Fusg9fViv