From 773fe0a2bd0958314cf685abf6e8f55fff7b5f02 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Jul 2026 06:01:56 +0000 Subject: [PATCH] fix(factsheets): demo-status print governance, own composer actions, print isolation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 Claude-Session: https://claude.ai/code/session_01U9NNpe5W616C4XvjRgW6pV --- src/app/globals.css | 19 +++---- .../master-search-header.tsx | 13 ++++- .../clinical-dashboard/mode-action-popup.tsx | 23 +++++++- .../factsheets/factsheet-detail-page.tsx | 57 ++++++++++++++++--- src/components/factsheets/factsheets-data.ts | 8 +++ tests/factsheets-data.test.ts | 8 +++ 6 files changed, 105 insertions(+), 23 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 567962a67b..51bf5214f9 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -2555,20 +2555,17 @@ html[data-motion="reduced"] .source-capsule-hit[aria-expanded="true"]:hover .sou } @media print { - html.factsheets-printing body * { - visibility: hidden !important; - } - - html.factsheets-printing .factsheet-print-sheet, - html.factsheets-printing .factsheet-print-sheet * { - visibility: visible !important; + /* Print only the portaled clean sheet. Removing every other subtree from + * layout flow (display:none — NOT visibility:hidden) means the full-height shell + * chrome (sidebar