Harden Patient Factsheets demo-status labelling on print/export and give the mode its own composer actions - #955
Conversation
…print isolation Three follow-up fixes flagged during PR #879 review that landed in separate Codex PRs and never merged, reapplied here on the shared feature branch. - Print/export governance (P1): the exported handout now carries a red "Sample — not for clinical use" band at the top and prepends the shared FACTSHEET_DEMO_NOTICE ("Demonstration content — not clinician-approved…") to the print footer, plus an on-screen warning line, so a printed sheet can never read as approved local patient information. Notice is a single shared constant (FACTSHEET_DEMO_NOTICE) with a regression test. - Composer action menu: Factsheets now has its own action set (Search factsheets / Browse all sheets) instead of falling through to the Answer action set. master-search-header routes searchMode "factsheets" to it and dispatches the two actions via onSearchModeChange. - Print isolation: the clean A4 sheet is portaled to <body> and print now removes every other body subtree from layout flow with `display:none` (not `visibility:hidden`), so the full-height shell chrome no longer paginates into trailing blank PDF pages. Mount flag uses useSyncExternalStore to stay clear of the react-hooks/set-state-in-effect lint rule. Factsheets stays visible in production (labelled demo), per prior direction. 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 (6)
📝 WalkthroughWalkthroughFactsheets now have dedicated search and browse actions. Print sheets render through a body portal with print-specific isolation, while shared demonstration notices appear on-screen and in printed output. ChangesFactsheets experience
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Comment |
|
@coderabbitai please resolve the failing branch conflicts for me |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
✅ Merge conflicts resolved successfully! Resolved 1 conflict file(s). Commit: 6 file operation(s)
View agent analysis |
Resolved conflicts in: - src/components/factsheets/factsheet-detail-page.tsx (content) Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Summary
FACTSHEET_DEMO_NOTICE("Demonstration content — not clinician-approved…") to the print footer, alongside an on-screen warning line, so a printed sheet can never read as approved local patient information. The notice is a single shared constant with a regression test.master-search-headerroutessearchMode"factsheets"to it and dispatches the two actions viaonSearchModeChange.<body>and print now removes every other body subtree from layout flow withdisplay:none(notvisibility:hidden), so the full-height shell chrome no longer paginates into trailing blank PDF pages. The mount flag usesuseSyncExternalStoreto stay clear of thereact-hooks/set-state-in-effectlint rule.Verification
check:type-scale,check:icon-scale,brand:check,prettier --check(all six changed files), lint on the changed component files (clean), typecheck (no errors in changed files), and thefactsheets-data+app-modesvitest suites (28 tests pass).npm run verify:pr-localunit run hits pre-existing environment gaps in this container (@testing-library/*is not installed, so untouched*.dom.test.tsxfiles fail typecheck; the Python-OCR worker stack is absent) — both unrelated to this change and green in CI where those deps exist.npm run verify:ui(Playwright/Chromium) was not run for this small follow-up; the print band/footer are print-media-only CSS that was confirmed to compile, and the action-menu wiring reuses the already-QA'd composer pattern from Rebuild Patient Factsheets as a first-class mode from the imported design #879.Risk and rollout
/factsheetsdetail view, print CSS, and additive composer action-set wiring; no API, data, auth, privacy, Supabase, retrieval, or answer-generation behavior changes.Clinical Governance Preflight
These changes strengthen the demo/governance labelling on printed and exported patient information; no ingestion, answer-generation, retrieval, document-access, or Supabase behavior changes.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
@media print, where the app's design tokens are not the concern.display:noneon non-print body subtrees (rather thanvisibility:hidden) so the full-height sidebar<aside>and tall screen article are removed from flow and cannot paginate into blank trailing PDF pages.🤖 Generated with Claude Code
https://claude.ai/code/session_01U9NNpe5W616C4XvjRgW6pV
Generated by Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests