Route header mode selections through the shared home - #1801
Conversation
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:9 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:8fbb7f7b3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
BigSimmo
commented
Aug 10, 2026
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch codex/universal-mode-home-routing at starting commit 8fbb7f7; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:codex/universal-mode-home-routing, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
This PR standardizes app-mode switching from the header so that all mode selections route to the shared universal home (/?mode=<mode>), carrying any current query only as an unsubmitted draft (q) and preventing accidental re-submission (run=1). It updates both the dashboard-owned and standalone shell behavior, retargets mode-menu prefetching to the shared-home URLs, and adjusts tests to lock in the new navigation contract introduced after the mode-aware shared home (#1790).
Changes:
- Route header mode selections from results/answers/mode homes back to
/?mode=<mode>while preserving the current query as a draft (q) and clearing result/answer state. - Prevent auto-run submission when returning to
/withoutrun=1, including the “transition frame” immediately after a UI-triggered mode change. - Update prefetching and regression/e2e tests to assert shared-home destinations (and no implicit mode-route submissions).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ui-tools.spec.ts | Updates Chromium e2e coverage to assert mode switches land on shared home with q draft and cleared results/answer state. |
| tests/search-route-ownership.test.ts | Tightens routing-contract assertions to ensure mode picks never carry run=1 and always target shared-home selection hrefs. |
| tests/mode-menu-prefetch.dom.test.tsx | Retargets DOM prefetch expectations from mode-owned routes to shared-home selection URLs. |
| tests/audit-navigation-auth-regressions.test.ts | Updates regression assertions for the renamed/retargeted mode prefetch function and its event wiring. |
| src/components/ClinicalDashboard.tsx | Implements shared-home mode-selection routing, draft preservation without auto-run, and result/answer clearing on mode picks. |
| src/components/clinical-dashboard/master-search-header.tsx | Retargets mode-option prefetching to appModeSelectionHref and renames the helper accordingly. |
| src/components/clinical-dashboard/global-search-shell.tsx | Ensures standalone shell mode changes route to shared-home selection hrefs with q draft but without run=1. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #9614 (cancelled). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
Mode picks return to the shared home while the dashboard stays mounted, so an Answer still in flight could applySearchResult and rewrite run=1 over the draft. Call stopSearch() before clearModeResultState().
Babysit / unblock progress
Merge left until required CI settles. |
Mode picks suppress stale run=1 auto-run via modeChangeFromUiRef, but that also blocked intentional Ask-this navigations and left the pending Answer shell with no /api/answer/stream request. Allow auto-run when URL mode still matches, and explicitly executeSearch after crossModeSearch pushes run=1.
Production UI shard 1 still failed locator.check({ force }) on the
controlled sr-only CBT cycle radio. Click the visible label instead.
Give DSM compare remove navigation a longer URL wait under shard load.Uh oh!
There was an error while loading. Please reload this page.
Summary
/?mode=<mode>, regardless of the current mode, result, answer, or detail page.qdraft while removing submission authority, so changing mode never auto-runs the old search.Why
After the shared mode-aware home landed in #1790, switching modes from another page could still route back to each mode's legacy homepage. This makes the shared home the universal landing surface for mode changes while preserving the user's draft and requiring an explicit submit before loading mode-specific results.
Areas touched
Verification
npm run format— passed on the exactorigin/main-based branch before push; no formatting delta remained.npm run lint:changed:internal -- <7 changed files>— passed before the clean transplant onto currentmain.npm run typecheck:source— passed before the clean transplant.npm run test -- tests/app-modes.test.ts tests/audit-navigation-auth-regressions.test.ts tests/search-route-ownership.test.ts tests/mode-menu-prefetch.dom.test.tsx— 4 files passed, 53 tests passed before the clean transplant.npm run test:e2e -- tests/ui-tools.spec.ts --project=chromium --grep "dashboard mode switches return answer results|header mode switches return results"— isolated production build passed; 2 Chromium tests passed in 7.3s.git diff --check origin/main...HEAD— passed.8fbb7f7b3c3c3864258dcda2c089a996a95775e1.Verification limitations
DATABASE_HEAVY_RUN_ADMISSION_BUSYfor its optional lint/typecheck rerun; CI still enforces both.npm run verify:pr-localpreviously passed runtime, installed-lock parity, changed formatting, full lint, and full typecheck, then stopped in the full unit suite: 547 files / 5917 tests passed, with unrelated failures intests/bundle-budget.test.tsfixture parsing and Windowstests/pr-handoff-stop.test.tsprocess/link cleanup. The one directly affected assertion was corrected and passed in the focused 53-test run.Risk and compatibility
RAG impact: no retrieval behaviour change — this changes header navigation and unsubmitted URL state only; retrieval, ranking, answer generation, and explicit submission destinations are unchanged.
Follow-up to #1790.