Skip to content

feat(app): automatic pagination with bundled fonts (#7) - #24

Open
rotespferd wants to merge 4 commits into
mainfrom
feat/issue-7
Open

rotespferd wants to merge 4 commits into
mainfrom
feat/issue-7

Conversation

@rotespferd

@rotespferd rotespferd commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #7. Pages are a derived view: measured Block heights go in, Pages come out.

<Worksheet>
  useBlockHeights()                  # scrollHeight of each Block's content, via ResizeObserver
  layout(heights)                    # src/worksheet/layout.ts
    paginate(heights, pageHeight, spacing)   # src/worksheet/paginate.ts, pure
  <page-stack>
    <Page> x N                       # fixed A4 backgrounds (src/worksheet/page-format.ts)
    <BlockHost> x blocks             # one flat list, absolutely positioned
  • Blocks are never split. A Block that doesn't fit moves whole to the next Page.
  • Blocks stay in one flat list, so moving between Pages does not remount the Tiptap editors.
  • A Block taller than a Page gets its own Page, is clipped to the Page's content area and shows a red warning at the cut. This deviates from the original "overflows it"; the ticket and ADR-0001 are updated.
  • Worksheet content uses bundled Inter (400/700, normal/italic) with no system fallback; app chrome keeps system-ui.

Evidence

  • Before: one .page with min-height, Blocks flowed forever, system fonts.
    After: WebKitGTK screenshots read for the empty Page with hint, 24 Headings over 2 A4 Pages, and an oversized Block clipped at 979 px with the warning.
paginate([40, 61, 10], pageHeight 100)  -> [[0], [1, 2]]   # fails before, passes now
paginate([30, 150, 20])                 -> [[0], [1], [2]], oversized {1}
layout([979 + 500]).placements[0].height -> 979            # clipped

90 tests pass, plus typecheck and lint. Not checked: dark mode, real typing across a Page break in WebKitGTK (component tests simulate heights).

Merge Danger

Door: two-way

Blast Radius: editor layout

Blocks are now absolutely positioned and the drop target is .page-stack; drag-and-drop and the insertion line were adapted and tested in jsdom only. A Block that stops fitting jumps to the next Page while typing, as specified. A clearer hint is captured as an idea.

🤖 Generated with Claude Code

rotespferd and others added 4 commits October 20, 2026 17:54
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: automatic pagination with bundled fonts

1 participant