Consolidate Documents and Medications into the shared mode home - #2614
Conversation
Retires the bare /documents and /medications pages as distinct content.
Both now redirect to the shared home (/?mode=documents, /?mode=prescribing)
when idle, matching the ten already-consolidated modes; submitted searches
keep working exactly as before on /documents/search and
/?mode=prescribing&q=...&run=1 respectively.
Documents joins the shared consolidatedModeHomePaths map used by the other
ten modes. Medications keeps its own bespoke redirect (src/proxy.ts,
medicationsHomeTarget()) since it has no separate /medications/search route
for that map's generic ${pathname}/search logic to target — its submitted
searches already went straight to the dashboard-owned prescribing surface.
Neither idle view held clinical data (dose/safety/monitoring content lives
entirely in the submitted-search results, untouched by this change) — both
were purely navigational shortcuts. Sources was investigated in the same
session and deliberately left out of scope: it shipped as an approved,
standalone design the day before this change and has no results route to
redirect submitted searches into.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqN4tP2Tj6UziaSti4fFdk
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f58b7266-6f82-444d-8907-ca53a1dd1f72) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…s-architecture-378ktx # Conflicts: # data/repo-awareness-snapshot.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56dd7d0399
ℹ️ 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".
medicationsHomeTarget() and the medications/page.tsx backstop both called
appModeSelectionHref("prescribing") with no options on an unsubmitted
visit, silently dropping every incoming param — including the PWA
manifest shortcut's focus=1 and a draft q/queryMode link. Forward the
draft query, focus flag, and navigation context instead, matching how
the already-consolidated modes handle the same case.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PqN4tP2Tj6UziaSti4fFdk
…laude/clinical-guide-redesign-ir5zcj Sync with the Documents/Medications consolidation (#2614) merged into this branch by another session, before pushing the CI-failure inbox notes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015uRvqm44emrLDMyPF7Pame
…ealth-n17dvm Three conflicts. Two were generated files (data/repo-awareness-snapshot.json, docs/site-map.md) and were regenerated with the repo's own tooling rather than hand-resolved. The third was the mode-homes paragraph in docs/codebase-index.md, which #2614 rewrote on main to consolidate Documents and Medications onto the shared home. Main's rewrite is the newer structure, so it wins; the On Call facts are re-applied on top of it — seventeen modes, and /on-call as a thirteenth consolidated redirect stub whose section pages live one level down. Full offline suite on the merged tree: 1 failed, 15,126 passed. The one failure is the stale drift manifest, unchanged and still blocking. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LL9gE67N6yorjPcssuK4bC
Claude-Session: https://claude.ai/code/session_01PqN4tP2Tj6UziaSti4fFdk Co-authored-by: Claude <noreply@anthropic.com>
Summary
/documentsand/medicationsno longer render their own idle-view content. Visiting either with no query now redirects (a real server-side 307, not a client-side flash) to the shared home —/?mode=documentsand/?mode=prescribing— matching the ten modes already consolidated this way (dsm, forms, services, differentials, specifiers, formulation, calculators, therapy-compass, factsheets, dictionary). Submitted searches are untouched:/documents?q=...&run=1still lands on/documents/search, and/medications?q=...&run=1still lands on/?mode=prescribing&q=...&run=1, exactly as before.consolidatedModeHomePathsmap (src/lib/consolidated-mode-home-redirect.ts) the other ten modes already use — it has a real/documents/searchroute, so the map's generic logic applies unchanged.src/proxy.ts,medicationsHomeTarget()) rather than joining that map, because it has no separate/medications/searchroute for the map's generic${pathname}/searchsubmitted-target logic to target — its submitted searches already went straight to the dashboard-owned/?mode=prescribingsurface, and that's unchanged./documentsis repointed to the shared home so it can't loop through the now-retired route.docs/site-map.md,docs/design-system/adoption-manifest.json,data/repo-awareness-snapshot.json(the last one twice — once for the mode changes, again after merging inmain's own snapshot update to resolve a conflict)./sources/searchroute to redirect submitted searches into and three secondary pages (Topics/Publishers/Method) with no equivalent elsewhere — a materially bigger, separate piece of work.Verification
npx tsc --noEmit) — clean.npx vitest run) — all green except two pre-existing failures unrelated to this change (tests/clinical-hazard-controls.test.ts,tests/rag-plan-package-parity.test.ts, both reference git commit hashes unavailable in this shallow-clone environment) — confirmed by stashing this change and re-running both in isolation against the unmodified tree, where they fail identically.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH+scripts/run-playwright.mjs(not the CLI directly):tests/ui-route-coverage.spec.ts+tests/ui-tools.spec.tsin full (110/110 passed), the Documents/Medication-relevant subset oftests/ui-smoke.spec.ts(5/5),tests/ui-overlap.spec.ts+tests/ui-stress.spec.ts(3/3). Two unrelatedui-smoke.spec.tsPDF-canvas tests fail on both this branch and the clean base (confirmed via the same stash-and-rerun method) — pre-existing, not caused by this change.npm run verify:cheap— passed (41/41 gates); the one snapshot-staleness note it raised (data/repo-awareness-snapshot.json) was fixed by regenerating it.npm run check:repo-awareness-snapshot— re-run after mergingmainin to resolve a snapshot conflict; confirmed back in step.npm run verify:pr-localnpm run verify:uiVerification not run:
verify:pr-localand the fullverify:ui/test:e2e:prsuite were not run as separate steps —verify:cheapplus the targeted real-browser Playwright runs above cover typecheck, lint, the full static gate set, the full offline unit suite, and every UI journey this change actually touches. Running the entire multi-project Playwright suite on top of that would re-prove journeys this PR doesn't affect.Risk and rollout
tests/consolidated-mode-home-redirect.test.tsand the real-browser search-flow tests listed above./documentsand/medicationsreturn to rendering their own idle content with no other cleanup required.Clinical Governance Preflight
This PR trips the clinical-risk file classifier because it edits
src/lib/app-modes.ts(a comment-only change describing theprescribingmode's navigation) andmedications/prescribing-named files — not because it changes any clinical behavior, dosing content, or answer/citation logic. All items below hold unchanged; the last item is not applicable because no clinical decision-support behavior changed, only navigation to the existing, unchanged medication search surface.Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
Two source-code comments (
tests/ui-route-coverage.spec.ts's former "Medications index serves the Medication mode home" test, andsrc/lib/consolidated-mode-home-redirect.ts's doc comment) recorded that Documents and Medications were each pulled out of exactly this redirect pattern once before — Documents after a shipped regression that deleted its three idle-view affordances without anyone noticing, Medications for a reason that didn't survive this repo's squash-merged git history. This change reverses both, deliberately and with the product owner's explicit, informed sign-off after reviewing what would be lost (confirmed to hold no clinical content) — not a mechanical re-application of the same mistake.🤖 Generated with Claude Code
https://claude.ai/code/session_01PqN4tP2Tj6UziaSti4fFdk
Generated by Claude Code
Note
Medium Risk
Routing and redirect wiring across proxy, shell, and bookmarks; submitted-search query forwarding is test-covered but wrong behavior would break deep links and document search mounting.
Overview
/documentsand/medicationsno longer render their own idle homes. Unsubmitted visits now get a server 307 to the shared shell —/?mode=documentsand/?mode=prescribing— like the other consolidated modes. Submitted deep links are unchanged:/documents?q=…&run=1still goes to/documents/search, and medication searches still land on/?mode=prescribing&q=…&run=1.Documents joins
consolidatedModeHomePathsand the proxy fast-path; the dedicatedDocumentsHomeClientand dashboard-owned bare/documentsshell wiring are removed (dashboardOwnedModeHomePathsis empty)./documentsalone stays on an exact-match standalone-shell list so/documents/searchand/documents/[id]keep mountingClinicalDashboard.Medications uses a bespoke
medicationsHomeTarget()insrc/proxy.ts(and a matching page backstop) instead of the shared map, because there is no/medications/searchroute. The prescribing workspace client component is deleted.Navigation and prefs are aligned: sidebar pins, default landing for Documents, and shell props point at
/?mode=…rather than the retired routes. Generated artifacts (docs/site-map.md, adoption manifest, repo-awareness snapshot) and Playwright/unit tests are updated for redirects and for reaching document shortcuts via the composer options menu instead of retired home tiles.Reviewed by Cursor Bugbot for commit c33dacf. Configure here.