fix(typed-pages): start pages that open with a title where plain text starts #55
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/18-typed-page-margins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #18
Why pages with a title sat low
A typed title's line box is 150 tall, plain text's 70 (measured 2026-10-15, docs/verification.md). The page file only carries
pos_y, and from the samepos_ythe tablet puts a title's baseline 80 lower than a plain line's. So every page that opens with# Titlestarted ~80px (≈4% of the page) lower than one that opens with text, on every template.The fix
Lines.Writer.text_page/3raisespos_yby the first paragraph's extra lead (Lines.Text.first_line_lead/1: title 80, subheading 17.6, plain 0), clamped at the page top. The first line's baseline now lands 18 above the layout'spos_ywhatever its style.priv/typed_page_layouts.json: Lines smallpos_y133.5 → 213.5. It was tuned on the dev page's sample, which starts with a title, so title-first pages land exactly where you tuned them; plain-first pages on Lines small now match them (they used to sit 80 higher).pos_y234): a title-first page's title baseline moves from y≈296 to y≈216, where the tablet starts plain typed text./dev/typed-pagesdraws its text box and pink start guide at thepos_yactually written, and says when it's been raised.Tests
pos_ynever goes above 0. Both fail on main.mix precommit: 909 passed.Checking it on the tablet
/dev/typed-pages, pick a notebook on a template you use (try Blank and P Lines small).# Offsite planning summary) and click Add to notebook; then change the sample's first line to plain text and add it again.