From 7b2419b347470807a6a5a9a6bc395fe9ba51009b Mon Sep 17 00:00:00 2001 From: Grovy311 Date: Sat, 26 Sep 2026 18:00:57 +0200 Subject: [PATCH] Polish the printed rough power balance The printed page kept the dark app background in the page margins, the consumer column wrapped while the empty remark column took the space, an empty "bearbeitet von" label was printed, and numbers were printed as typed (11200). Print margins are white now, the consumer column is wider, empty editors are omitted and numbers print with thousands separators (11.200) like the template. Co-Authored-By: Claude Opus 5.5 --- src/app/globals.css | 28 ++++++++++++++++++- .../estimate-balance-sheet.tsx | 10 ++++++- .../estimate-balance/estimate-draft-input.tsx | 7 ++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 4f0bcb7..dbf49fb 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -2018,10 +2018,36 @@ button.structure-entry-main:focus-visible { display: none !important; } - body:has(.estimate-print-root) { + html:has(.estimate-print-root), + body:has(.estimate-print-root), + body:has(.estimate-print-root) .app-shell, + body:has(.estimate-print-root) .app-shell-content { background: #fff !important; } + /* Der Dunkelmodus setzt color-scheme: dark; Chrome färbt damit auch den + Seitenrand dunkel. Im Druck gilt immer das helle Schema. */ + html:has(.estimate-print-root) { + color-scheme: light !important; + } + + .estimate-print-root .estimate-group-editor.is-empty { + display: none; + } + + /* Verbraucher bekommt den Platz; Anmerkungen bleiben schmal. */ + .estimate-sheet .estimate-col-name { + width: 52mm; + } + + .estimate-sheet .estimate-col-remark { + width: 24mm; + } + + .estimate-sheet .estimate-col-supply { + width: 13mm; + } + body:has(.estimate-print-root) .app-shell { display: block; } diff --git a/src/frontend/estimate-balance/estimate-balance-sheet.tsx b/src/frontend/estimate-balance/estimate-balance-sheet.tsx index 4703397..07dc19c 100644 --- a/src/frontend/estimate-balance/estimate-balance-sheet.tsx +++ b/src/frontend/estimate-balance/estimate-balance-sheet.tsx @@ -31,6 +31,7 @@ import { formatKw, parseGermanDecimal, type DecimalRange, + formatGermanNumber, } from "./estimate-balance-format"; import { DraftInput } from "./estimate-draft-input"; @@ -81,6 +82,7 @@ function NumberInput({ disabled={disabled} format={(current: number) => formatDecimalInput(current)} inputMode="decimal" + printFormat={(current: number) => formatGermanNumber(current, 0, 3)} onCommit={onCommit} onValidityChange={(isValid) => onValidityChange(fieldKey, isValid)} parse={(text) => parseGermanDecimal(text, range)} @@ -461,7 +463,13 @@ export function EstimateBalanceSheet({
{group.title} -