mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-21 18:13:26 +00:00
cf3ba5510d
* fix(web): drop repeating print-header, clean page-1 layout, skip empty rows (BUG-626)
Real-print testing after BUG-625 showed the repeating fixed-position
`.print-header` approach is fragile -- even with a generous @page top
margin, Chromium's handling of fixed elements during pagination can
overlap content on the first page, and there's no clean way to
coordinate the header with page-break behavior across browsers.
Replace the repeating header with a page-1 document header in normal
flow and simplify.
## Changes
### Template (+page.svelte)
- Remove `.print-header` entirely; drop the `workspaceStore` import
(no longer needed in print).
- Tag non-computed field-rows with `class:print-empty={isFieldEmpty}`
when the raw value is null / empty string / empty array. Flag at
the template level because :empty can't see FieldEditor children.
### Styles (+page.svelte @media print)
- `.title-row` becomes a flex row: title on the left (20pt, wraps),
item ref on the right (10pt, tabular-nums, nowrap), both aligned to
the title's first-line baseline.
- `.meta-info` gets a 1px bottom border to separate the document
header block from the properties card.
- `.field-row.print-empty { display: none !important; }`.
- Drop all `.print-header*` CSS (dead) and the padding/border shared
rule between header+footer. `.print-footer` now stands alone.
### Global (app.css)
- Shrink @page top margin from 1.25in to 0.6in -- no reserved header
strip means no clearance needed. Bottom margin stays 1in for the
fixed footer + `@bottom-right` page number counter.
## Outcome
- No repeating header, no overlap, no workspace/collection context on
subsequent pages (users who want it can leave browser headers
enabled in the print dialog).
- Page 1 shows: title+ref header row, meta subtitle, border, properties
(with empty rows skipped), body, relationships/children if present.
- Footer repeats on every page with Printed date, URL, and Page N.
- 116-line file net -16 lines smaller, app.css -2.
Verified locally via Ctrl+P preview in Chromium before committing.
* fix(web): flip print title-row order so title is left, ref is right (PR #157)
Address Codex P2: DOM order in the template is `[item-ref, title]`,
so `display: flex; justify-content: space-between` kept the ref on
the left and pushed the (flex:1) title to fill the remaining space on
the right — the opposite of the intended BUG-626 header layout.
Use the flex `order` property to reverse only the visual sequence in
print, keeping the template DOM untouched. `.title` gets `order: 1`,
`.item-ref` gets `order: 2` + `margin-left: auto` so the ref sits
baseline-aligned at the right edge and the title claims everything
to its left.