Rebuild Patient Factsheets as a first-class mode from the imported design#879
Conversation
…sign Replace the placeholder factsheet pages (3 generic "sample" sheets in a bespoke local shell) with the imported Patient Factsheets design, wired into the app's universal shell and registered as a proper app mode. Data & content - Rewrite factsheets-data.ts: discriminated Factsheet model with 5 kinds (medRich/medLite/condition/therapy/procedure), 8 plain-language sheets with cited Australian sources, category theming, and print/TOC projections. - Add factsheets-icons.ts mapping icon keys + categories to Lucide glyphs. Pages (rebuilt to the design, using Tailwind + design tokens so dark mode, forced-colors and reduced-motion all work) - Home: shared ModeHomeHero + hero composer slot + browse-by-topic pills + colour-coded featured cards + governance verification footer. - Search: server-driven results, category filter chips, List/Cards toggle, empty state, content-status note. - Detail: category hero band, five kind-specific layouts, sources, more-in-topic, related sheets, sticky sidebar, Easy-read/Standard toggle, Save, and Download PDF that prints a clean A4 sheet (globals.css print rule hides the shell chrome). - [slug] route gains generateStaticParams + dynamicParams=false. Mode registration & shared shell - Register "factsheets" in app-modes (id, definition, namespace-isolated, /factsheets/search query special-case), app-mode-icons, the universal-search domain map, route-ownership, the standalone-home + prefetch in global-search-shell, and the sidebar nav. - Swap factsheets/layout.tsx to GlobalSearchShell; delete the bespoke FactsheetShell. All factsheet routes now share the universal header/sidebar/composer, and the composer drives /factsheets/search. Tests & docs - Rewrite factsheets-data.test.ts for the new model; extend app-modes.test.ts with factsheets coverage; regenerate docs/site-map.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9NNpe5W616C4XvjRgW6pV
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a data-driven patient factsheets library with typed content, home/search/detail pages, static routes, print rendering, and integration with shared application modes, navigation, routing, and sitemap systems. ChangesFactsheets vertical slice
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant FactsheetsSearchRoute
participant FactsheetsData
participant FactsheetsSearchPage
Browser->>FactsheetsSearchRoute: Request factsheets query
FactsheetsSearchRoute->>FactsheetsData: Filter by query and category
FactsheetsData-->>FactsheetsSearchRoute: Return matching factsheets
FactsheetsSearchRoute->>FactsheetsSearchPage: Pass query, category, and results
FactsheetsSearchPage-->>Browser: Render results
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ec0b5ddba
ℹ️ 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".
|
@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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0a444a2a9
ℹ️ 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".
There was a problem hiding this comment.
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 `@src/components/factsheets/factsheets-data.ts`:
- Around line 41-54: Update FactsheetBase and its consumers so reviewedOn is not
treated as clinical approval: add explicit approval status and reviewer
metadata, then conditionally render “Reviewed” and “clinician-reviewed” claims
only when approval is present; otherwise remove those claims. Update
demonstration factsheet data accordingly and run focused verification plus npm
run check:production-readiness.
In `@src/components/factsheets/factsheets-home-page.tsx`:
- Around line 40-53: Replace render-time factsheetIcon calls with the static
glyph helper or direct createElement usage so icon selection does not create
component bindings during render. Apply this across
src/components/factsheets/factsheets-home-page.tsx lines 40-53 and 91-107;
src/components/factsheets/factsheets-search-page.tsx lines 88-104, 135-149, and
183-199; and src/components/factsheets/factsheet-detail-page.tsx lines 223-236,
262-275, and 519-530, while preserving the existing
factsheetCategoryIcons/CategoryIcon rendering behavior.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
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 Plus
Run ID: 5b08fff6-7cac-452c-9b27-e48daea54796
📒 Files selected for processing (20)
docs/site-map.mdscripts/generate-site-map.tssrc/app/factsheets/[slug]/page.tsxsrc/app/factsheets/layout.tsxsrc/app/factsheets/search/page.tsxsrc/app/globals.csssrc/components/clinical-dashboard/ClinicalSidebar.tsxsrc/components/clinical-dashboard/global-search-shell.tsxsrc/components/factsheets/factsheet-detail-page.tsxsrc/components/factsheets/factsheet-shell.tsxsrc/components/factsheets/factsheets-data.tssrc/components/factsheets/factsheets-home-page.tsxsrc/components/factsheets/factsheets-icons.tssrc/components/factsheets/factsheets-search-page.tsxsrc/lib/app-mode-icons.tssrc/lib/app-modes.tssrc/lib/search-route-ownership.tssrc/lib/universal-search-mode-context.tstests/app-modes.test.tstests/factsheets-data.test.ts
💤 Files with no reviewable changes (1)
- src/components/factsheets/factsheet-shell.tsx
…, verifiable sources - Normalize repeated search params: /factsheets/search?q=a&q=b previously threw on .trim() (App Router passes string[]), returning a 500; collapse q/category to the first value like the DSM/Services search routes. - Include the brand suffix (e.g. "(Zoloft)") in factsheet search so brand-name queries resolve even though brand is stored separately from the title. - Make source citations honest: add an optional url to FactsheetSource and render each "Where this information comes from" row as an outbound link only when a verifiable url is present (dropping the external-link glyph otherwise), instead of implying every inert citation is openable. No source URLs are fabricated; governance can attach approved links. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9NNpe5W616C4XvjRgW6pV
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fc2c9a722
ℹ️ 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".
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. The branch was updated while autofix was in progress. Please try again. |
Add real public healthdirect/Beyond Blue/NIMH/Mayo Clinic URLs to every citation so "Where this information comes from" is clickable and checkable. Soften Reviewed/clinician-reviewed UI copy to dated demonstration language, and route icon rendering through static glyph helpers to avoid render-time component bindings. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
The static-components autofix left factsheet-detail-page.tsx and factsheets-search-page.tsx unformatted, failing the Static PR checks `format:check` (prettier --check) gate. Apply prettier --write; no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9NNpe5W616C4XvjRgW6pV
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccb7c30250
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df98fd4540
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 196bf6582f
ℹ️ 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".
Summary
Verification
npm run verify:pr-localRisk and rollout
Clinical Governance Preflight
Factsheets present static, read-only patient information (no ingestion / answer-generation / retrieval / document-access / Supabase changes); the content is clinical in nature, so the preflight is completed below. Governance context: each sheet cites dated sources, and the UI carries "Connect only governance-approved content before publication" (home footer + search content-status note + per-detail disclaimer). It does not touch the RAG corpus or demo-mode synthetic data.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01U9NNpe5W616C4XvjRgW6pV
Summary by CodeRabbit