Skip to content

Route header mode selections through the shared home - #1801

Merged
BigSimmo merged 5 commits into
mainfrom
codex/universal-mode-home-routing
Aug 10, 2026
Merged

Route header mode selections through the shared home#1801
BigSimmo merged 5 commits into
mainfrom
codex/universal-mode-home-routing

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Route every header mode selection to the shared universal home at /?mode=<mode>, regardless of the current mode, result, answer, or detail page.
  • Preserve the current query as an unsubmitted q draft while removing submission authority, so changing mode never auto-runs the old search.
  • Clear result and answer state when returning home, while keeping dedicated mode pages available for explicit submissions and mode-owned workflows.
  • Retarget header prefetching and regression coverage to the shared-home destinations.

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

  • Shared dashboard navigation and URL synchronization.
  • Global search-shell route handling.
  • Header mode-selection links and prefetch targets.
  • Focused DOM, static routing-contract, auth-regression, and Chromium journey coverage.

Verification

  • npm run format — passed on the exact origin/main-based branch before push; no formatting delta remained.
  • npm run lint:changed:internal -- <7 changed files> — passed before the clean transplant onto current main.
  • 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.
  • Push succeeded at 8fbb7f7b3c3c3864258dcda2c089a996a95775e1.

Verification limitations

  • Exact-base focused Vitest and typecheck reruns were requested but denied by the repository coordinator because another worktree was running the full Vitest suite. The pre-push guard likewise reported DATABASE_HEAVY_RUN_ADMISSION_BUSY for its optional lint/typecheck rerun; CI still enforces both.
  • npm run verify:pr-local previously 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 in tests/bundle-budget.test.ts fixture parsing and Windows tests/pr-handoff-stop.test.ts process/link cleanup. The one directly affected assertion was corrected and passed in the focused 53-test run.
  • Physical iPhone Safari and installed-PWA checks were not run; this routing change has production Chromium proof only.
  • No provider-backed clinical, retrieval, Supabase, production, or deployment checks were run.

Risk and compatibility

  • No API, schema, dependency, retrieval, ranking, clinical-output, or submitted-search destination changes.
  • Existing dedicated mode routes remain available; only header mode selection now uses the shared home.
  • Existing favourites authentication gating remains covered.

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.

@supabase

supabaseBot commented Aug 10, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitaiBot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ee1062cd-c961-48de-8d77-fb45662a8986

📥 Commits

Reviewing files that changed from the base of the PR and between 0647290 and d52c3c9.

📒 Files selected for processing (9)
  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/mode-menu-prefetch.dom.test.tsx
  • tests/search-route-ownership.test.ts
  • tests/ui-formulation.spec.ts
  • tests/ui-route-coverage.spec.ts
  • tests/ui-tools.spec.ts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment threadsrc/components/ClinicalDashboard.tsx
@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

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".

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / without run=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
FileDescription
tests/ui-tools.spec.tsUpdates Chromium e2e coverage to assert mode switches land on shared home with q draft and cleared results/answer state.
tests/search-route-ownership.test.tsTightens routing-contract assertions to ensure mode picks never carry run=1 and always target shared-home selection hrefs.
tests/mode-menu-prefetch.dom.test.tsxRetargets DOM prefetch expectations from mode-owned routes to shared-home selection URLs.
tests/audit-navigation-auth-regressions.test.tsUpdates regression assertions for the renamed/retargeted mode prefetch function and its event wiring.
src/components/ClinicalDashboard.tsxImplements shared-home mode-selection routing, draft preservation without auto-run, and result/answer clearing on mode picks.
src/components/clinical-dashboard/master-search-header.tsxRetargets mode-option prefetching to appModeSelectionHref and renames the helper accordingly.
src/components/clinical-dashboard/global-search-shell.tsxEnsures 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.

@github-actions

github-actionsBot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Production UI (1)needs investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

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().
@cursor

cursorBot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Babysit / unblock progress

  • Tip:a70bb6c7f703 after P1 fix + sync with main (Preserve contextual back navigation and recent answers #1788)
  • Sync / merge-tree: was BEHIND 1 (clean merge-tree); merged origin/main cleanly
  • Blocked by: Codex P1 — in-flight Answer could re-apply after mode pick while dashboard stays mounted
  • Fixed:stopSearch() before clearModeResultState() in selectSearchMode leave-results path; contract test in tests/search-route-ownership.test.ts (17 passed)
  • Threads: P1 resolved
  • Required CI: waiting on new tip; will squash-merge when CLEAN/green

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.
@BigSimmo
BigSimmo merged commit 3f4d67b into mainAug 10, 2026
26 checks passed
@BigSimmo
BigSimmo deleted the codex/universal-mode-home-routing branch August 10, 2026 13:26
Sign up for freeto 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.

3 participants

@BigSimmo@cursoragent