Skip to content

[NRT-836] QA1 Smart Search#1325

Open
ddevdan wants to merge 3 commits into
mainfrom
NRT-836
Open

[NRT-836] QA1 Smart Search#1325
ddevdan wants to merge 3 commits into
mainfrom
NRT-836

Conversation

@ddevdan

@ddevdan ddevdan commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Related issues

Proposed changes

  • Change title of the window to "Ankihub | Smart Search"
  • Fix the flashcard selector appearing to "close" when the file picker is dismissed. It never actually closed: on macOS, dismissing the native file picker opened from the web view (whether cancelling or selecting a file) activates Anki's main window instead of the non-modal dialog the picker was opened from, burying the dialog behind it.
  • Inject a JS watcher on page load in AnkiHubWebViewDialog that reports when a file input's picker closes (cancel/change events), and raise + activate the dialog in response. Lives in the shared base dialog, so it covers any AnkiHub web-view dialog that opens a file picker.

How to reproduce

  1. Open the flashcard selector for a deck with note embeddings.
  2. Click the file picker (attach file) button — the native OS file picker opens.
  3. Click Cancel (or select a file).
  4. Before the fix: the selector appears to close (it's actually hidden behind the main Anki window). After the fix: the selector stays in front.

Further comments

Root-caused via instrumented repro runs: no code path (ours, Anki's, or the web app's) ever closed the dialog — every close/hide/Escape/pycmd path was ruled out, and a window-state probe showed the dialog visible=True, exposed=False (occluded) while the main window became active. The regression test (test_dialog_is_raised_when_file_picker_closes) exercises the real seam (watcher JS → cancel event → pycmd → dialog raised); note it runs in CI on Linux, as the pytest-forked webview harness segfaults on macOS. The underlying macOS focus behavior itself is only observable manually — worth a one-time QA check on macOS.

Screenshots

Daniel C. and others added 3 commits July 14, 2026 16:47
…p flag is on

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…loses

On macOS, dismissing the native file picker opened from a web view (whether
cancelling or selecting a file) activates Anki's main window instead of the
non-modal dialog the picker was opened from, burying the dialog behind it.

Inject a JS watcher on page load that reports when a file input's picker
closes (cancel/change events), and raise + activate the dialog in response.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ddevdan ddevdan changed the title [NRT-836] Keep flashcard selector in front after native file picker closes [NRT-836] QA1 Smart Search Jul 15, 2026
@ddevdan
ddevdan requested a review from a team July 15, 2026 15:52
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.

1 participant