From 96f5824d124f24f6b5ff723253e00e72d9f946d8 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 3 Aug 2026 01:08:43 +0000 Subject: [PATCH] fix(web): simplify printed cut reports --- CutList.Web/Components/Layout/MainLayout.razor | 2 +- CutList.Web/wwwroot/css/report.css | 11 +++++++++-- tests/test_job_results_actions.py | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CutList.Web/Components/Layout/MainLayout.razor b/CutList.Web/Components/Layout/MainLayout.razor index ec6880c..759f45a 100644 --- a/CutList.Web/Components/Layout/MainLayout.razor +++ b/CutList.Web/Components/Layout/MainLayout.razor @@ -6,7 +6,7 @@
-
+ diff --git a/CutList.Web/wwwroot/css/report.css b/CutList.Web/wwwroot/css/report.css index 5572d6f..f33da18 100644 --- a/CutList.Web/wwwroot/css/report.css +++ b/CutList.Web/wwwroot/css/report.css @@ -144,11 +144,18 @@ /* Print styles - Compact layout to save paper */ @media print { body { - -webkit-print-color-adjust: exact; - print-color-adjust: exact; + -webkit-print-color-adjust: economy; + print-color-adjust: economy; font-size: 10pt; } + *, + *::before, + *::after { + background: transparent !important; + box-shadow: none !important; + } + .print-screen-only, .sidebar, .top-row, diff --git a/tests/test_job_results_actions.py b/tests/test_job_results_actions.py index 65ebd1c..985a4c3 100644 --- a/tests/test_job_results_actions.py +++ b/tests/test_job_results_actions.py @@ -7,6 +7,7 @@ from pathlib import Path REPO_ROOT = Path(__file__).resolve().parents[1] JOB_EDITOR = REPO_ROOT / "CutList.Web/Components/Pages/Jobs/Edit.razor" +MAIN_LAYOUT = REPO_ROOT / "CutList.Web/Components/Layout/MainLayout.razor" class JobResultsActionsTests(unittest.TestCase): @@ -29,6 +30,21 @@ class JobResultsActionsTests(unittest.TestCase): self.assertIn(".print-screen-only", report_css) self.assertIn("display: none !important;", report_css) + def test_print_report_hides_workspace_header_and_ready_status(self) -> None: + markup = MAIN_LAYOUT.read_text() + + self.assertIn('class="workspace-header print-screen-only"', markup) + self.assertIn("Cut planning workspace", markup) + self.assertIn("Ready to plan", markup) + + def test_print_report_forces_backgrounds_to_plain_white(self) -> None: + report_css = (REPO_ROOT / "CutList.Web/wwwroot/css/report.css").read_text() + print_styles = report_css[report_css.index("@media print {"):] + + self.assertIn("*::before", print_styles) + self.assertIn("background: transparent !important;", print_styles) + self.assertIn("box-shadow: none !important;", print_styles) + if __name__ == "__main__": unittest.main()