feat(dictionary): add the eight-route Dictionary reference mode - #2096
Conversation
Add Dictionary as a full app mode with a governed 96-entry static catalogue, shared search/filter logic, and eight routes under src/app/(search-app)/dictionary. - Routes: Search, Browse, Topics, Topic detail, Definition, Compare, Sources and the shared mode home. - Unified open result rows, abbreviation ambiguity handling, URL-owned filters, topic collections, responsive comparisons and source governance surfaces. - Reference Spine visual system, simplified definition status, phone disclosures, and shared navigation/search ownership (no second composer, no responsive tables). - Integrated with the application launcher, ModeNav, universal search, tools catalogue, sitemap, codebase index, route reachability and the design-system adoption manifests. - Static source-governed content only: no generated clinical synthesis, no retrieval or ranking surface touched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…-ultimate-dictionary-ultimate # Conflicts: # docs/design-system/COMPONENTS.md # playwright.config.ts # scripts/playwright-pr-shards.mjs # src/components/applications-launcher-page.tsx # src/components/tools/tools-search-results-page.tsx # src/lib/app-mode-icons.ts
…-ultimate-dictionary-ultimate
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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:55 minutes Limit details: You’ve used all 1 included review currently available under your plan. You completed 101 included PR reviews in the past 7 days; at that activity level, included reviews refill at 1 review per hour. 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 (61)
Comment |
…e link proves Three review findings on the Dictionary mode, all about a surface claiming more than it does. Retire the "updated" filter. Every entry shares one `REVIEW` constant, so all 96 carry `checkedOn: "2026-08-18"`, and the predicate compared that against the frozen literal `"2025-08-18"`. "Past year" and "Past 6 months" were therefore identical to each other and to no filter at all: picking either rendered an active, removable filter chip and returned the whole catalogue. Remove the lens, its URL parameter, its chip and its share of the applied-filter count rather than leave a control that advertises narrowing it cannot do. An `updated=` parameter left in an old URL is ignored, which `parseDictionaryFilters` already covers and the test now states. Re-add a real cutoff when entries carry distinct review dates. Rename the review status from `source-checked` to `source-linked`, and rewrite the governance copy to match. Entries are generated from topic seeds: `sourceRefs` carries the source published for the entry's collection, and the status literal is stamped by construction. The sources page previously told a clinician that "editors have confirmed that the link, organisation and paraphrased wording match the stated source scope" — nothing in the pipeline establishes that. It now says attribution is recorded at collection level, is not verified sentence by sentence, and that no clinician has signed off an individual entry. Approval remains pending throughout. Stop calling positional links "governed". `relatedSlugs` is the next four entries in array order, so the term page now says "other entries from the same collection". Also drop `DictionaryTopic.iconKey`: no Dictionary surface ever read it, and an untyped glyph string sitting beside the typed `CategoryIconKey` registry is an invitation to diverge from it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
CI triageCI failed on this PR. Automated classification of the 3 failed job(s):
Compared with main CI run #11965 (cancelled). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
There was a problem hiding this comment.
Pull request overview
Adds a static Clinical Dictionary mode with eight production routes, shared navigation/search integration, source metadata, and responsive UI.
Changes:
- Adds a 96-entry catalogue with search, browse, topics, definitions, comparisons, and sources.
- Integrates Dictionary into app modes, universal search, navigation, tools, and shell ownership.
- Adds unit/UI coverage and generated documentation; the production bundle gate remains unresolved.
Reviewed changes
Copilot reviewed 60 out of 60 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/ui-tools.spec.ts | Updates tools search expectations. |
tests/ui-mode-nav-density.spec.ts | Covers Dictionary navigation density. |
tests/ui-dictionary.spec.ts | Tests all Dictionary routes and responsive behavior. |
tests/shared-home-empty-state.dom.test.tsx | Covers Dictionary home presentation. |
tests/search-results-band-adoption.test.ts | Registers Dictionary search-band ownership. |
tests/mode-secondary-navigation.test.ts | Tests Dictionary secondary navigation. |
tests/mode-nav-addon-slot.dom.test.tsx | Registers Dictionary header owners. |
tests/information-page-shell.dom.test.tsx | Classifies Dictionary information routes. |
tests/dictionary-term-page.dom.test.tsx | Tests term-page content and disclosures. |
tests/dictionary-data.test.ts | Validates catalogue integrity and search. |
tests/design-system-adoption.test.ts | Updates route adoption totals. |
tests/app-modes.test.ts | Covers Dictionary search routing. |
src/lib/universal-search.ts | Adds the Dictionary search adapter. |
src/lib/universal-search-mode-context.ts | Maps Dictionary mode context. |
src/lib/universal-search-domains.ts | Registers the Dictionary domain. |
src/lib/ui-copy.ts | Adds Dictionary home copy. |
src/lib/tools-catalog.ts | Adds Dictionary to the tools catalogue. |
src/lib/search-shell-props.ts | Configures Dictionary shell behavior. |
src/lib/search-route-ownership.ts | Assigns Dictionary route ownership. |
src/lib/mode-secondary-navigation.ts | Defines Dictionary navigation destinations. |
src/lib/information-pages.ts | Recognizes Dictionary detail pages. |
src/lib/dictionary.ts | Implements filtering, search, and comparison helpers. |
src/lib/dictionary-data.ts | Defines the static governed catalogue. |
src/lib/category-identity.ts | Registers Dictionary icon identities. |
src/lib/category-identity-icons.ts | Maps the BookMarked icon. |
src/lib/app-modes.ts | Registers Dictionary as an app mode. |
src/components/mode-nav/registry-mode-nav.tsx | Adds Dictionary navigation icons and density. |
src/components/mode-nav/header-addon-slot.ts | Registers Dictionary header slots. |
src/components/dictionary/dictionary-catalogue-pages.tsx | Implements search, browse, and topic pages. |
src/components/dictionary/dictionary-term-page.tsx | Implements definition detail pages. |
src/components/dictionary/dictionary-sources-page.tsx | Implements source governance UI. |
src/components/dictionary/dictionary-result-row.tsx | Renders mixed Dictionary results. |
src/components/dictionary/dictionary-home-page.tsx | Implements the mode landing page. |
src/components/dictionary/dictionary-compare-page.tsx | Implements term comparisons. |
src/components/ClinicalDashboard.tsx | Updates shared-mode commentary. |
src/components/clinical-dashboard/use-sidebar-pins.ts | Makes Dictionary pinnable. |
src/components/clinical-dashboard/universal-search-command-surface.tsx | Adds Dictionary command results. |
src/components/clinical-dashboard/mode-action-popup.tsx | Adds Dictionary quick actions. |
src/components/clinical-dashboard/master-search-header.tsx | Adds Dictionary mode actions and routing. |
src/components/clinical-dashboard/ClinicalSidebar.tsx | Adds Dictionary to sidebar modes. |
src/app/(search-app)/dictionary/page.tsx | Adds the Dictionary home route. |
src/app/(search-app)/dictionary/search/page.tsx | Adds the search route. |
src/app/(search-app)/dictionary/browse/page.tsx | Adds the browse route. |
src/app/(search-app)/dictionary/topics/page.tsx | Adds the topics route. |
src/app/(search-app)/dictionary/topics/[slug]/page.tsx | Adds topic detail routes. |
src/app/(search-app)/dictionary/[slug]/page.tsx | Adds definition routes. |
src/app/(search-app)/dictionary/compare/page.tsx | Adds the comparison route. |
src/app/(search-app)/dictionary/sources/page.tsx | Adds the sources route. |
src/app/(search-app)/dictionary/layout.tsx | Adds the Dictionary route layout. |
scripts/playwright-pr-shards.mjs | Registers Dictionary UI tests in CI. |
scripts/generate-site-map.ts | Adds the Dictionary mode example. |
playwright.config.ts | Includes Dictionary production tests. |
docs/site-map.md | Documents Dictionary routes. |
docs/redesign/dictionary-reference-spine.md | Defines Dictionary design and governance. |
docs/design-system/COMPONENTS.md | Updates generated component usage. |
docs/design-system/ADOPTION.md | Updates adoption totals. |
docs/design-system/adoption-manifest.json | Registers Dictionary design-system roots. |
docs/design-system/adoption-contract.json | Adds Dictionary routes to the contract. |
docs/codebase-index.md | Documents Dictionary architecture. |
docs/branch-review-records/958545248192195caf5c7b0a29d7daf058011f92c1b70d00c86aec57fb44822b.record.md | Records the prior branch review. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…es, and correct the tool tally Addresses two Copilot review findings on #2096 and the Advisory UI failure. - The "Source organisation" facet rendered one option per source id but labelled each by its organisation, and five of the twelve sources are published by Healthdirect Australia. Users saw five identical options, each filtering to a different single document. The facet is now "Source", labelled by each source's own title, with the organisation kept as search text and the applied chip matching. - The compare page discarded `pair.sourceRefs`. Those references back the curated relationship summary specifically, so MSE vs MMSE declared two comparison sources while the footer counted one. They now count toward the covered-source total and render as links beside the summary they support. - `ui-tools-search-mode-mockup.spec.ts` asserted exactly 13 tool results. The mockup renders the production `ToolsSearchResultsPage` from the shared catalogue, and the Dictionary makes that 14. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…-ultimate-dictionary-ultimate # Conflicts: # docs/design-system/adoption-manifest.json
…ttps://github.com/BigSimmo/Database into codex/chat-dictionary-ultimate-dictionary-ultimate
…-ultimate-dictionary-ultimate
Uh oh!
There was an error while loading. Please reload this page.
Summary
src/app/(search-app)/dictionary/**— Search, Browse, Topics, Topic detail, Definition, Compare, Sources, and the shared mode home.src/lib/dictionary-data.ts, with shared search/filter logic insrc/lib/dictionary.ts. Nothing is generated: no clinical synthesis, no retrieval, no ranking, no provider call. Every definition carries its own source designation and review status, surfaced on/dictionary/sources.docs/site-map.md,docs/codebase-index.md, route reachability, and the design-system adoption manifests. Navigation uses<Link>/router.pushand hrefs built fromapp-modes.ts/tools-catalog.ts; the mode uses the shared shell composer only, so the one-composer-per-page contract holds.Verification
npm run verify:pr-local— one stage is knowingly red; see the bundle budget note below.Gate detail:
check:runtime,check:installed-lock-parity,format:changed,sitemap:check,docs:check-index,docs:check-inventory,docs:check-scripts,docs:check-links,check:branch-review-ledger,check:outstanding-issues,check:ledger-write-discipline,lint,typecheck.Test Files 2 failed | 648 passed | 2 skipped (652)/Tests 2 failed | 6990 passed | 27 skipped (7019). Both failures were run down and neither belongs to this change:tests/private-access-routes.test.tspasses in isolation on this branch:Test Files 1 passed (1)/Tests 145 passed (145). Full-suite contention.tests/session-start-hook.test.tsfails identically on untouchedorigin/main— Windows resolvesbashto WSL'sC:\Windows\System32\bash.exe, which strips drive separators. Pre-existing harness issue.next buildreportedCompiled successfully,check:client-bundle-secretspassed,check:rag:fixtures36 golden cases across 25 suites,check:medication-interactions523 rows,check:medication-lexicon-report28 catalogue terms — all green.check:bundle-budgetfails on the production bucket, and the baseline was deliberately left alone:Measured attribution, because the +10.5% is not all this PR:
mainalone measures 1479.1 KiB (+7.8%) against the same baseline. That number comes from a mockup-only branch built from the same merge base, so it ismain's own drift. The baseline was captured 2026-08-13 (baselineSourceca788d41) and has not been refreshed since._client-reference-manifest.jsfiles. The two largest are about 10 KiB each: the client-side share of the 96-entry catalogue, and the shared Dictionary UI. The catalogue reaches the client because Browse, Search, Compare and Sources filter interactively with URL-owned state.mockupsbucket are all within tolerance.The baseline was not refreshed here: AGENTS.md is explicit that a production failure means finding the regression rather than moving the ceiling, and most of the overage predates this branch. The decision for review is whether to re-baseline
productionin its own change after accounting formain's 7.8% drift, or to require this PR to move the catalogue server-side and thread it into the client pages as props — about 10 KiB, enough to clear the line, but it reworks the mode's filter model.After the final
origin/mainsync (11 further commits),npm run lintandnpm run typecheckwere re-run against the merged tree. The full unit suite and build were not re-run for that sync; the incoming commits touch disjoint files and were already CI-verified onmain.tests/ui-dictionary.spec.tsis registered in the Chromium production spec pattern and in the PR shard map, so CI runs it. It was last run green (6/6) before the merge and was not re-run locally afterwards.npm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changedUI verification not run locally after the merge: the full Chromium gate contends with the repository run coordinator on this machine. The Dictionary journey spec is registered and runs in CI.
npm run verify:releasebefore release or handoff confidence claimsVerification not run: the release gate is provider-backed and was not authorized for this change.
npm run eval:retrieval:quality(must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changedVerification not run: no retrieval, ranking, selection, chunking or scoring behaviour is touched. The Dictionary reads a static local catalogue; it does not enter
src/lib/rag/**,clinical-search,retrieval-selection,ranking-configoranswer-ranking, and the offline RAG fixture check still ran and passed.npm run eval:rag -- --limit 15+npm run eval:quality -- --rag-onlywhen answer generation, the synthesis prompt, or answer post-processing changedVerification not run: answer generation and the synthesis prompt are untouched.
npm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changedVerification not run: no clinical workflow, privacy, environment, Supabase or source-governance behaviour changes — the Dictionary is static local content with no provider, storage or document-access path.
npm run check:deployment-readinesswhen deployment startup, hosting, or rollout behavior changedVerification not run: deployment startup, hosting and rollout behaviour are unchanged.
Risk and rollout
app-modes.ts,universal-search*.ts,search-route-ownership.ts,search-shell-props.ts,tools-catalog.ts,ClinicalDashboard.tsx,ClinicalSidebar.tsx,master-search-header.tsx). The Dictionary itself is read-only static content with no write path, no auth surface and no provider call, so the realistic failure mode is a navigation or search-integration regression rather than a clinical one.src/lib/universal-search.tsremains server-only — the two client modules that reference it use type-only imports, so the catalogue does not enter every route's bundle.Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes on the preflight: every Dictionary entry is static, source-designated content.
/dictionary/sourcesrenders the governance surface, and an entry whose source is unknown or unreviewed displays that status rather than presenting the text as verified fact. The mode introduces no patient data, no document access and no upload or download path. Supabase configuration, service-role credentials and private document access are untouched. The Dictionary defines terminology and does not recommend, diagnose or dose, so it adds no clinical decision-support behaviour and leaves the SaMD/TGA classification unchanged.Notes
codex/chat-dictionary-ultimate-dictionary-ultimateand committed here, thenorigin/mainwas merged in (the branch was 96 commits behind, and a final sync brought it fully current). Six files conflicted; the resolutions worth reviewing are the icon ones, becausemainrefactored icon identity while this branch was open:src/lib/app-mode-icons.tsis now derived fromAPP_MODE_ICONinsrc/lib/category-identity.ts, so the Dictionary glyph moved there:bookMarkedwas added toCATEGORY_ICON_KEYS, resolved to LucideBookMarkedinsrc/lib/category-identity-icons.ts, and registered asdictionary: "bookMarked"(app mode) and"clinical-dictionary": "bookMarked"(tool)."clinical-dictionary"was added to theToolCatalogIdunion insrc/lib/tools-catalog.ts, whichmainintroduced to make the icon record exhaustive by type.launcherIconByIdinapplications-launcher-page.tsx,iconByToolIdintools-search-results-page.tsx) were deleted bymainin favour of that single registry; the merge takesmain's side rather than reviving either copy.playwright.config.tsandscripts/playwright-pr-shards.mjskeepmain's patterns withdictionaryre-inserted;docs/design-system/COMPONENTS.mdand the design-system adoption manifests were regenerated, not hand-merged.