Skip to content

feat(gre): back-to-Home nav across GRE surfaces + bigger Home numbers - #5

Open
f15cubing wants to merge 2 commits into
agent/exam-demo-itemsfrom
agent/gre-home-nav
Open

f15cubing wants to merge 2 commits into
agent/exam-demo-itemsfrom
agent/gre-home-nav

Conversation

@f15cubing

Copy link
Copy Markdown
Owner

What & why

Home linked out to the dashboard/exam/method surfaces but nothing linked back. This adds a consistent "← Home" affordance: a shared GreHomeLink.svelte fires a new gre:home webview bridge, wired into the three child dialogs by a small qt/aqt/gre/nav.py helper that reuses the GRE Home singleton and closes the caller. Also enlarges the Home "Your progress" figures. Pure presentation — no rslib/proto/scheduler/undo/collection-store change.

Area(s) touched

qt/aqt/gre_home.py, qt/aqt/gre_dashboard.py, qt/aqt/gre_exam.py, qt/aqt/gre_method.py, qt/aqt/gre/nav.py (new), ts/routes/gre-{dashboard,exam,home,method}/+page.svelte, ts/routes/gre-dashboard/GreHomeLink.svelte (new) — engine/Rust PR? submodule (anki) → engine lane, but UI-only (no engine code).

Docs updated

docs/codebase/qt.md (parent repo, in the pin-bump PR) — new "cross-surface ← Home" subsection.

Test evidence

./ninja check:svelte → Build succeeded; direct svelte-check0 errors, 0 warnings; all changed .py compile; existing GRE bridge handlers preserved.

Engine/Rust extra gate

  • Undo / collection corruption: N/A — no col writes, no OpChanges, read paths unchanged.
  • Read-only invariant: N/A — no new RPC.
  • Rust/Python tests: N/A — no Rust; Qt-UI + Svelte only.
  • Remaining gates (owner-gated): live GUI click-through of the ← Home button (offscreen QtWebEngine won't init headlessly) + a second-agent review (agent reviewer currently billing-blocked; see repo precedent PR Add hooks for context menus ankitects/anki#40 for the documented-deviation fallback).

Made with Cursor

…s numbers

Add a consistent "← Home" affordance so users can return to GRE Home from the
other GRE surfaces (previously Home linked out but nothing linked back).

- New shared ts/routes/gre-dashboard/GreHomeLink.svelte ("← Home") fires a new
  `gre:home` webview bridge; rendered on the dashboard, method, and exam
  setup/results mastheads (guarded by bridgeCommandsAvailable()).
- New qt/aqt/gre/nav.py install_gre_home_bridge() wires the bridge into
  GreDashboard/GreExam/GreMethod; handle_gre_home() in gre_home.py reuses the
  Home singleton (show_gre_home) and closes the calling dialog (deferred close).
- Deliberately omit the link during the active exam/review phase (progress is
  discardable there; the exam already has a confirm-guarded Exit).
- Also enlarge the Home "Your progress" figures (fig-num 1.7->2.6rem,
  fig-den 1.1->1.6rem).

Pure presentation: no rslib/proto/scheduler/undo/store change; read paths
unchanged. Verified: check:svelte 0 errors/0 warnings; all changed .py compile.
Live GUI click-through is the one owner-gated smoke (offscreen QtWebEngine
won't init headlessly).
f15cubing added a commit to f15cubing/speedrun that referenced this pull request Jul 5, 2026
* feat(gre): back-to-Home nav — bump anki pin + docs

Bumps the anki pin e4efa0f6 -> 1f42b3d (f15cubing/anki#5): a shared "<- Home"
control across the GRE dashboard/method/exam surfaces via a new gre:home webview
bridge, plus bigger Home progress numbers. Docs updated in the same change:
qt.md (cross-surface navigation section + Last-verified SHA), an INDEX row, and a
STATUS entry.

Pure presentation UI — no rslib/proto/scheduler/undo/collection-store change;
read paths unchanged. Engine lane (submodule); open for owner GUI smoke + merge.

* docs(status): mark GRE back-to-Home nav merged (#72); owner-waived GUI smoke + agent review

---------

Co-authored-by: Felipe Caicedo <felipecaicedo@Felipes-MacBook-Pro.local>
- main.py: register the GRE gui_hooks inside _install_gre_hooks() instead of at
  module scope. aqt.main and the generated _aqt.hooks form an import cycle, so
  module-scope hook refs tripped a mypy has-type ("Cannot determine type of
  main_window_did_init / collection_did_load") false positive. Runtime is
  identical (runs once at import, before the hooks fire).
- interleave_review.py: wrap the protobuf note_id in NoteId for col.get_note.
- deck_autoimport.py: correct the type: ignore code (attr-defined, not union-attr)
  for mw.reset() where mw is typed object.
- test_gre_dashboard_mediasrv.py: expect the stats + study_next keys that
  build_view_model now emits (shared with GRE Home); dashboard ignores the extras.

Verified: ./ninja-style mypy clean (0 errors) + pytest qt/tests 136 passed.
f15cubing added a commit to f15cubing/speedrun that referenced this pull request Jul 6, 2026
… pin (#74)

* fix(gre): bump anki pin to green the desktop check + record the cycle gotcha

The pinned engine (anki@1f42b3d) failed ./ninja check with 8 mypy errors + 1
qt/tests failure. Bumps the anki pin to 282b6672 (fork agent/gre-home-nav, PR
f15cubing/anki#5), which:
- registers the GRE gui_hooks inside _install_gre_hooks() (module-scope refs
  tripped a cyclic-import mypy has-type false positive between aqt.main and the
  generated _aqt.hooks),
- wraps note_id in NoteId for col.get_note,
- corrects a type: ignore code (attr-defined),
- updates the dashboard mediasrv test for the stats/study_next keys
  build_view_model now emits (shared with GRE Home).

Pure Qt-UI/test/doc — no rslib/proto/scheduler/undo/collection-store change;
read paths unchanged. Green: mypy 0 errors, pytest qt/tests 136 passed.

Also records the has-type/import-cycle gotcha in docs/codebase/qt.md so the next
agent registers main.py hooks inside a function, not at module scope.

* docs(status): record desktop-check-green fix (#74)

---------

Co-authored-by: Felipe Caicedo <felipecaicedo@Felipes-MacBook-Pro.local>
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