Skip to content

feat(differentials): four-page Search / Diagnoses / Presentations / Compare nav - #1774

Merged
BigSimmo merged 10 commits into
mainfrom
cursor/differentials-four-page-nav-5ebf
Aug 9, 2026
Merged

feat(differentials): four-page Search / Diagnoses / Presentations / Compare nav#1774
BigSimmo merged 10 commits into
mainfrom
cursor/differentials-four-page-nav-5ebf

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep Differentials secondary nav as four equal pages: Search, Diagnoses, Presentations, Compare.
  • Search remains one shared catalogue over presentations and diagnoses, with explicit Presentation / Diagnosis labels on result rows.
  • Search ModeNav restores the latest q with run=1 so returning to Search reopens results.
  • Presentation detail routes mark Presentations current in the active-destination resolver (symmetric with Diagnoses); shell ModeNav stays suppressed on information-page workflow/detail routes by design. Compare is only /differentials/compare.
  • Compare is a real queue page (empty state or selected diagnosis ids). Open comparison launches the catalogue presentation workflow, or an ad-hoc workspace via workspace=1 when selections span presentations.
  • Diagnosis-only compare selection stays URL-backed via ids (existing sync), so Compare stays wired to Search ticks. Queue → Search / Edit selection links preserve those ids.

Verification

  • Focused Vitest: tests/mode-secondary-navigation.test.ts, tests/differentials-navigation.test.ts (47 passed)
  • npm run typecheck
  • npm run lint
  • npm run testTest Files 547 passed (547) / Tests 5897 passed | 4 skipped (5901)
  • npm run check:design-system-contract
  • npm run build + check:bundle-budget — within tolerance (1546.6 KiB gzip vs 1406.4 baseline)
  • Focused Playwright Chromium: differentials compare queue launches presentation comparison (1 passed)
  • npm run format / sitemap:update (compare blurb note)
  • Verification not run: full npm run verify:pr-local after the late remote main-sync merge (lint + typecheck + full unit suite + build/bundle already re-proven for the fix set)
  • UI verification: focused compare journey only; full verify:ui / verify:phone-chrome left to CI Production UI

Risk and rollout

  • Risk: Low–medium UI/navigation change in Differentials mode. Compare now pauses on a queue page instead of immediately entering a workflow.
  • Rollback: Revert this commit; prior Compare handoff redirects return.
  • Provider or production effects: None

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed — navigation/IA only; no new clinical decision logic

Notes

  • Presentations browse and Compare route scaffolding already existed on main from recent PRs; this change finishes the equal-level IA, queue surface, Search restore, kind labels, and active-tab resolver symmetry.
  • Babysit follow-up: RSC queue page (bundle), Search ids preserve, ModeNav route gate, Playwright queue journey; Copilot shell-ModeNav-on-detail dispositioned as information-page ownership.
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added a differential comparison queue with empty and selected states.
    • Users can remove diagnoses, review details, preserve search context and selected items, and launch comparisons.
    • Added catalogue-based and ad-hoc comparison workflows.
    • Added “Presentation” and “Diagnosis” badges to differential results across desktop and mobile views.
  • Bug Fixes

    • Improved navigation so presentation routes, search queries, and selected diagnosis IDs remain correctly preserved.

…Compare nav

Make Presentations and Compare equal-level destinations, restore Search with
q+run=1, show kind labels on unified results, and land Compare on a queue page
before launching the presentation or ad-hoc workspace.

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

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 93492d20-93c9-49a1-b9ba-dcae573d02dc

📥 Commits

Reviewing files that changed from the base of the PR and between ea32866 and b0cd1e2.

📒 Files selected for processing (9)
  • docs/branch-review-ledger.md
  • docs/site-map.md
  • scripts/generate-site-map.ts
  • src/components/differentials/differential-compare-queue-page.tsx
  • src/lib/differentials-navigation.ts
  • src/lib/mode-secondary-navigation.ts
  • tests/differentials-navigation.test.ts
  • tests/mode-secondary-navigation.test.ts
  • tests/ui-tools.spec.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • scripts/generate-site-map.ts
  • tests/mode-secondary-navigation.test.ts
  • src/components/differentials/differential-compare-queue-page.tsx
  • docs/site-map.md
  • tests/differentials-navigation.test.ts
  • src/lib/mode-secondary-navigation.ts
  • docs/branch-review-ledger.md

📝 Walkthrough

Walkthrough

The compare route now shows a diagnosis queue by default and supports presentation or ad-hoc workspace launches. Differential results display type badges. Navigation state and route documentation cover the updated workflows.

Changes

Differential comparison workflow

Layer / File(s) Summary
Compare routing and launch contracts
src/lib/differentials.ts, src/app/.../differentials/compare/page.tsx, docs/site-map.md, scripts/generate-site-map.ts
The route renders the queue unless workspace=1 is present. Helpers resolve catalogue and ad-hoc launch URLs and normalize queue items. Sitemap descriptions document the new states and workflows.
Comparison queue interface
src/components/differentials/differential-compare-queue-page.tsx, src/lib/differentials-navigation.ts
The queue renders empty and populated states, preserves queries, removes selections, and links to diagnosis, search, and workspace routes.
Navigation and result presentation
src/lib/mode-secondary-navigation.ts, src/components/clinical-dashboard/differentials-home.tsx
Presentation routes select the presentations destination. Differential Search adds run=1 when a query is carried. Result cards show Presentation or Diagnosis badges.
Navigation and queue validation
tests/differentials-navigation.test.ts, tests/mode-secondary-navigation.test.ts, tests/ui-tools.spec.ts
Tests cover launch URLs, queue filtering, query and ID preservation, active destinations, and desktop and mobile comparison flows.

Review documentation

Layer / File(s) Summary
Review ledger records
docs/branch-review-ledger.md
The ledger adds and reorders records for dependency, planning, safety-plan, navigation, design-system, mobile, breadcrumb, and DocumentViewer work.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CompareRoute
  participant QueuePage
  participant LaunchHelper
  User->>CompareRoute: Open compare route
  CompareRoute->>QueuePage: Render selected diagnosis queue
  QueuePage->>LaunchHelper: Request launch URL
  LaunchHelper-->>QueuePage: Return presentation or workspace URL
  QueuePage-->>User: Display queue and launch action
Loading

Possibly related PRs

Suggested reviewers: cursoragent, claude

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: establishing four equal-level Differentials navigation pages.
Description check ✅ Passed The description includes all required sections, summarizes the changes, records verification results and gaps, and documents risk, rollback, and governance status.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/differentials-four-page-nav-5ebf

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

@supabase

supabase Bot commented Aug 9, 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 ↗︎.

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

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

CI triage

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

  • Static PR checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Buildneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Production UI (3)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 #9463 (cancelled).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo
BigSimmo marked this pull request as ready for review August 9, 2026 07:31

@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: bdb121d533

ℹ️ 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/differentials/differential-compare-queue-page.tsx Outdated
Comment thread src/app/(search-app)/differentials/compare/page.tsx
…ve GitHub DIRTY/staleness)

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

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/branch-review-ledger.md`:
- Around line 826-835: Restore the original ordering and contents of the
existing rows in the branch-review ledger; do not move or rewrite historical
records. Preserve the merge=ledger driver, then append any new review records
using npm run ledger:append rather than hand-editing the ledger.

In `@src/lib/mode-secondary-navigation.ts`:
- Around line 145-147: Update isModeSecondaryNavigationRoute() to recognize
/differentials/presentations detail paths, including nested slug routes without
a submitted search, so secondary navigation renders with Presentations active.
Add a route-gate test covering the presentation detail prefix.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 379de132-7bbf-4b05-bf23-240765abcfe8

📥 Commits

Reviewing files that changed from the base of the PR and between 199b303 and 5e11e6e.

📒 Files selected for processing (10)
  • docs/branch-review-ledger.md
  • docs/site-map.md
  • scripts/generate-site-map.ts
  • src/app/(search-app)/differentials/compare/page.tsx
  • src/components/clinical-dashboard/differentials-home.tsx
  • src/components/differentials/differential-compare-queue-page.tsx
  • src/lib/differentials.ts
  • src/lib/mode-secondary-navigation.ts
  • tests/differentials-navigation.test.ts
  • tests/mode-secondary-navigation.test.ts

Comment thread docs/branch-review-ledger.md
Comment thread src/lib/mode-secondary-navigation.ts
@BigSimmo

BigSimmo commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@cursoragent Work the current open PR end-to-end. Confirm the PR number and GitHub head first from context. If more than one open PR could apply, stop and say which one you would use and why.

Fetch and start from the remote tip that matches that GitHub head. If the named branch ref is missing or stale, use the PR head ref. Preserve unrelated local WIP, including any local-only ledger commits; do not discard dirty work, and do not treat a local-ahead commit as the reviewed tip. Do not merge the PR, force-push, rebase, or arm auto-merge unless I explicitly ask. No provider-backed gates without separate approval. If you cannot push or resolve threads, diagnose and comment only; if inline replies fail, resolve when possible and put dispositions in the summary comment. If auto-merge is already armed, push only for a real blocker, and avoid pushes that would cancel in-flight required CI unless the push itself clears that blocker.

If the PR is already merged or closed: confirm the head and merge commit, note required-CI outcome, post one summary, and stop.

Goal: deep review plus Bugbot, fix actionable issues with the smallest correct changes, clear merge / required-CI / thread blockers, run strong local offline verification, push fixes, append the review ledger, and post one PR summary. Prefer thoroughness over speed. Regenerate large assets only when a fix requires it; then run the asset check and keep compatibility aliases byte-identical where the repo uses them.

Snapshot the GitHub head SHA: tip, base, behind/ahead, mergeable state, merge-tree versus origin/main (real conflict versus behind-but-clean), required checks on that tip including Production UI when selected, advisory separately, unresolved actionable threads. Missing checks while dirty are not green. If the tip moves mid-work, re-snapshot and continue from the new head.

Ledger-lookup against that GitHub head under the heavy review-and-fix scope for this PR. Already reviewed at this head with clean merge-tree, green required checks, and no new actionable threads → summarize, comment, stop unless I asked for a fresh superseding pass. Follow the repo review protocol.

Unblock once: real conflict → merge origin/main (prefer main’s shared queues; keep this PR’s notes); behind-but-clean → one sync, late if required CI is in flight; clean → leave. Labels like skip-branch-sync do not block a manual sync needed to clear a real blocker. No sync thrash. After any sync or push, re-snapshot tip, merge-tree, and required checks before declaring done. Dedupe the ledger if a merge touched it.

Review high-confidence delta risks only. Separate PR-introduced defects from pre-existing re-emitted debt. For generated assets, review contracts, aliases, cache, and manifests—not every generated line. If protected RAG or ranking surfaces are touched, say so before editing; fix PR-body policy text only when wrong or missing. Ignore bot noise. No nit spam or broad rewrites. Escalate verification by touched risk: clinical / RAG / privacy / migrations / auth → domain check plus production-readiness when warranted; UI / phone-chrome / routing / styling → ensure plus phone-chrome or UI gates when warranted; generated assets or docs inventory/links → asset or docs checks when warranted.

Fix P0/P1 always; clear scoped P2 when locally provable; else disposition and resolve. Required-check failures on this tip only; ignore advisory. Prefer reverting a bad autofix commit. After fixes: format and commit before push; smallest targeted proof; repo cheap gate; repo PR-local gate. No release, lighthouse, live eval, or live provider gates without approval.

Push only this PR’s fix commits. Append ledger for the final GitHub head under the heavy scope. Never push a ledger-only tip—include ledger in a real fix push, or leave a no-change ledger append local and unpushed.

One PR comment: tip, sync/merge-tree, fixed versus dispositioned, threads, required CI, decisive local gate lines, residual risks; merge left to me. Inline only for remaining human-needed P0/P1.

Stop when merge-tree is clean on the current GitHub tip, actionable threads are clear, required checks are green or clearly in progress, heavy gates for scope passed, summary posted, merge left to me.

@cursor

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

PR #1774 · tip 87dd3c9b · merge-tree clean vs main · merge left to you.

Fixed

  • P1: Compare → Search / Edit selection keeps queue ids
  • P1: Playwright compare journey → queue + Open comparison (focused Chromium 1 passed)
  • ModeNav route gate for /differentials/presentations/…
  • Static PR shadow ratchet (queue page)
  • Bundle budget via RSC queue page (1546.6 KiB within tolerance)

Dispositioned

  • Ledger “reorder” → merge=ledger merge artifact
  • Copilot “ModeNav on presentation detail” → information-page ownership (same as diagnoses detail)

Threads / comment

All 5 review threads resolved (GraphQL). Inline replies 403 — dispositions are in the PR summary comment.

Local proof

47 focused nav tests · full suite 5897 passed · design-system contract · typecheck/lint · build+bundle · focused PW compare journey.

Required CI restarted on this tip (policy/mergeability already green; Static/Build/UI re-queuing). Final-tip ledger supersede for 87dd3c9b is local only (not pushed).

Open in Web Open in Cursor 

Copilot AI 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

Adds a four-page Differentials navigation model and a URL-backed comparison queue.

Changes:

  • Restores Search queries and corrects active navigation states.
  • Adds comparison queue and workspace launch behavior.
  • Labels search results as presentations or diagnoses.

Verification: No commands run during this review; author-reported unit, lint, typecheck, and formatting checks were considered.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/mode-secondary-navigation.test.ts Tests query restoration and active tabs.
tests/differentials-navigation.test.ts Tests queue and comparison handoffs.
src/lib/mode-secondary-navigation.ts Updates navigation state and query handling.
src/lib/differentials.ts Adds queue and launch helpers.
src/components/differentials/differential-compare-queue-page.tsx Implements the comparison queue UI.
src/components/clinical-dashboard/differentials-home.tsx Adds result-kind labels.
src/app/(search-app)/differentials/compare/page.tsx Routes between queue and workspace.
scripts/generate-site-map.ts Updates route description generation.
docs/site-map.md Documents comparison queue behavior.
docs/branch-review-ledger.md Records review and verification history.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib/mode-secondary-navigation.ts
BigSimmo and others added 4 commits August 9, 2026 16:33
Preserve Search ids from the compare queue, show ModeNav route gates for
presentation detail paths, convert the queue page to an RSC to stay within
bundle budget, and update the Playwright compare journey for the queue CTA.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Append the heavy review-and-fix ledger row for the fix tip and document that
Compare→Search edit links preserve selected diagnosis ids.

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

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

PR #1774 babysit summary

Tip: 87dd3c9b2be7de7dae396051511c0aaa5d98fb85 (branch cursor/differentials-four-page-nav-5ebf)
Base / sync: merge-tree vs origin/main clean; 0 behind. Remote had an extra main-sync merge (ea328663); local babysit commits were merged on top (no force-push / no rebase).

Fixed

  • P1 (Codex): Compare → Search / Edit selection now preserves queue ids via differentialCompareSearchHref (unit-covered).
  • P1 (Codex): Playwright compare journey updated for queue + Open comparison handoff; focused Chromium run 1 passed.
  • CodeRabbit: isModeSecondaryNavigationRoute includes presentation/compare detail prefixes + route-gate test.
  • Static PR: removed legacy shadow-* aliases from the queue page (design-system contract green).
  • Build / bundle-budget: queue page converted to an RSC (no client chunk); rebuild 1546.6 KiB gzip within 10% of 1406.4 baseline.

Dispositioned (no code change)

  • CodeRabbit ledger reorder: merge=ledger union artifact from main sync; append-only via ledger:append preserved.
  • Copilot ModeNav on presentation detail: information-page ownership (parity with diagnoses detail); shell ModeNav correctly suppressed; local workflow tabs remain.

Threads

All 5 actionable review threads resolved via GraphQL. Inline reply API returned 403 for this token — dispositions are in this summary (and markers would have been on the replies).

Local verification (decisive lines)

  • vitest nav/differentials-navigation: Test Files 2 passed / Tests 47 passed
  • npm run test: Test Files 547 passed / Tests 5897 passed | 4 skipped
  • npm run check:design-system-contract: Design-system contract passed
  • npm run typecheck / npm run lint: exit 0
  • check:bundle-budget: within tolerance (1546.6 KiB gzip)
  • Focused Playwright: 1 passed (differentials compare queue launches presentation comparison)
  • verify:cheap once hit a 30s timeout in design-system-adoption provenance test; isolated re-run passed (flake, not PR delta)

Required CI

Push restarted checks on 87dd3c9b. Prior tip had Static PR + Build red (shadow ratchet + bundle); those are the failures this push targets. Production UI was in progress on the old tip and will re-run.

Residual risks

  • Presentation workflow still uses local section tabs (Compare current in-page), not shell ModeNav — intentional.
  • Bundle headroom remains ~0.4 KiB under the 10% ceiling after main mockup pressure (#252).
  • Final-tip ledger supersede for 87dd3c9b left local/unpushed (no ledger-only tip); heavy-scope review for code tip 384a1bed is on the branch.

Merge left to you.

@BigSimmo
BigSimmo enabled auto-merge (squash) August 9, 2026 09:20
@BigSimmo
BigSimmo merged commit 39973f0 into main Aug 9, 2026
26 checks passed
@BigSimmo
BigSimmo deleted the cursor/differentials-four-page-nav-5ebf branch August 9, 2026 09:31
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.

3 participants