Skip to content

feat(nav): shared mode secondary navigation (from #1319) - #1336

Merged
BigSimmo merged 8 commits into
mainfrom
cursor/mode-secondary-navigation-dc4e
Jul 28, 2026
Merged

feat(nav): shared mode secondary navigation (from #1319)#1336
BigSimmo merged 8 commits into
mainfrom
cursor/mode-secondary-navigation-dc4e

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Ports the unique product value from superseded PR chore: organize dirty work from codex/chat-mode-page-navigation-2328 #1319 onto current main without replaying its stale search-chrome rewrite.
  • Adds shared mode secondary navigation (mode-secondary-navigation registry + SecondaryNavigation / PageSecondaryNavigation) and wires it into GlobalSearchShell for namespaced modes.
  • Babysit fixes: bridged searchParamString (no useSearchParams under standalone body), suppress DocumentViewer-owned routes, require submitted query for /documents/search, horizontal-only active-chip rail scroll, and bind service “On this page” targets to real service-detail-page section ids.

Verification

  • Focused secondary-nav + contract tests: 62 passed
  • npm run verify:cheap on prior tip — full unit suite 4189 passed (4 skipped); lint/typecheck/docs/guards green
  • npx tsc --noEmit exit 0
  • eslint on touched files --max-warnings 0 exit 0
  • npm run build exit 0 (prior tip)
  • Merged origin/main (merge-tree clean)
  • UI verification not run: verify:ui / verify:phone-chrome not executed locally; hosted Production UI re-running on tip
  • npm run verify:pr-local before merge handoff

Risk and rollout

  • Risk: Medium — touches global-search-shell and service detail anchors; mitigated by DocumentViewer ownership suppression, bridged search params (search-chrome invariant 17), and horizontal-only chip scroll
  • Rollback: Revert the commits; secondary nav is additive
  • Provider or production effects: None

Notes

  • Codex review threads on tip addressed and resolved (P1 horizontal scroll + P2 service section ids).
  • Follow-ups (optional): wire answer/documents (ClinicalDashboard), land section ids on remaining detail families, Playwright phone-chrome proof.

RAG impact: no retrieval behaviour change — navigation chrome only; no retrieval/ranking/eval surfaces.

Open in Web Open in Cursor 

Add the shared secondary-navigation system (SecondaryNavigation,
PageSecondaryNavigation, mode-secondary-navigation registry) and wire it
into GlobalSearchShell for its owned namespaced modes.

- New: src/components/secondary-navigation.tsx, page-secondary-navigation.tsx,
  src/lib/mode-secondary-navigation.ts (+ 3 test files, 51 tests).
- GlobalSearchShell renders PageSecondaryNavigation in normal flow at the top of
  #main-content; it self-suppresses on clean mode homes, locally-owned detail
  routes (medications, factsheets, differentials diagnoses) and Therapy Compass.
- Specifiers/Formulation keep their existing local Subnav, so the shared mode bar
  is skipped for those modes to avoid a duplicate row on their workflow routes.
- Reuses main's richer information-pages.ts (isInformationPage) unchanged.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@supabase

supabase Bot commented Jul 28, 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

coderabbitai Bot commented Jul 28, 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: 34 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: 0a1f308d-4adf-4e2e-85fe-1a43744fddbf

📥 Commits

Reviewing files that changed from the base of the PR and between f39ca98 and 7de9dbf.

📒 Files selected for processing (11)
  • docs/branch-review-ledger.md
  • docs/codebase-index.md
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/page-secondary-navigation.tsx
  • src/components/secondary-navigation.tsx
  • src/components/services/service-detail-page.tsx
  • src/lib/mode-secondary-navigation.ts
  • tests/mode-home-loading-contract.test.ts
  • tests/mode-secondary-navigation.test.ts
  • tests/page-secondary-navigation.dom.test.tsx
  • tests/secondary-navigation.dom.test.tsx

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

@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent Inspect the PR and repository state, identify the root cause of every failing CI check, unresolved review comment, merge conflict, and related defect. Apply the smallest robust fix using existing project patterns and best practices, without unrelated changes. Run Bugbot and all relevant lint, type-check, test, build, and CI-equivalent commands, fix any issues found, then resolve only the review comments that are fully addressed. Summarise the root causes, changes made, validation results, and any remaining blockers.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 28, 2026 08:01
@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

#1336 is merged (b92c2721) with the babysit fixes. Hosted PR required and Production UI were green on the tip before squash.

Root causes found

  1. P1 — useSearchParams under standalone shell body — violated search-chrome invariant 17 (nested Suspense risk).
  2. P1 — Double section nav on /documents/[id] — shared “On this page” competed with DocumentViewerAnchors.
  3. P2 — /documents/search always showed mode nav — clean home got a redundant Search control.
  4. Codex P1 — scrollIntoView on active chips — yanked the page vertically when the in-flow bar was off-screen.
  5. Codex P2 — service section ids missing — registry targets never matched service-detail-page.
  6. CI — Static PR / Format check — Prettier drift in the new tests.

Fixes landed (now on main)

  • Bridge searchParamString from the shell; drop useSearchParams in PageSecondaryNavigation.
  • Treat DocumentViewer-owned routes as locally owned navigation.
  • Require a submitted query for /documents/search secondary nav.
  • Horizontal-only rail scrollTo for active chips.
  • Add service-* section ids + contract test.
  • Prettier-format the babysit tests.

Validation

  • Local: focused vitest 62, verify:cheap 4189, tsc/eslint, build, format:check
  • Hosted tip 7de9dbfa: PR required pass, Production UI pass (14m56s), Static/Unit/Build pass
  • Codex threads replied + resolved
  • Unresolved review threads: 0
  • Merge conflicts: none (merged main during babysit)

Remaining

  • Optional follow-ups (not blockers): wire ClinicalDashboard (/), add section ids on other detail families, local verify:phone-chrome.
  • Ledger closeout PR: #1353 (docs-only).
Open in Web Open in Cursor 

@chatgpt-codex-connector chatgpt-codex-connector Bot 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: d15985733f

ℹ️ 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 thread src/components/secondary-navigation.tsx Outdated
Comment thread src/components/page-secondary-navigation.tsx
@BigSimmo

Copy link
Copy Markdown
Owner Author

@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. 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. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. 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.

Pass the shell-bridged searchParamString into PageSecondaryNavigation
instead of calling useSearchParams under the standalone body. Suppress
document-detail shared section nav so DocumentViewerAnchors stays the
sole owner, and require a submitted query before showing /documents/search
mode secondary nav.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: d15985733f

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

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@cursor review

Bugbot-equivalent babysit on tip: fixed two P1s (standalone-shell useSearchParams under body; DocumentViewer double section nav) and the /documents/search clean-home secondary-nav gate. Please re-scan the latest head.

cursoragent and others added 5 commits July 28, 2026 08:09
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Stop using scrollIntoView for active secondary-nav chips so long record
reading is not yanked vertically when the in-flow bar is off-screen.
Add the service-detail section ids the shared "On this page" registry
targets, with a contract test that keeps them in sync.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo merged commit b92c272 into main Jul 28, 2026
19 checks passed
@BigSimmo
BigSimmo deleted the cursor/mode-secondary-navigation-dc4e branch July 28, 2026 08:44
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.

2 participants