Skip to content

feat(app): add Body Text Block Type (#4) - #15

Merged
rotespferd merged 4 commits into
mainfrom
feat/body-text-block-type
Oct 17, 2026
Merged

rotespferd merged 4 commits into
mainfrom
feat/body-text-block-type

Conversation

@rotespferd

Copy link
Copy Markdown
Contributor

Closes #4

Summary

 src/blocks/
 ├── registry.ts              # + 'body-text'
+├── body-text-format.ts      # own format <-> Tiptap doc (ADR-0002)
+├── body-text.tsx            # Block Type: View + Properties Panel buttons
 └── heading.tsx
Body Text data = { paragraphs: TextRun[][] }
TextRun        = { text, bold, italic, underline }   # "\n" = line break (Shift+Enter)

BodyTextView (Tiptap: paragraphs, line breaks, bold/italic/underline only)
  onUpdate -> fromTiptapDoc -> onChange        # no Tiptap structures stored
  focus / click -> activeEditor
BodyTextProperties (Bold / Italic / Underline)
  reads activeEditor -> toggles marks on the text selection

Block Palette, Worksheet view and Properties Panel are unchanged. Palette entries also get 8px spacing.

Evidence

  • Before: no Body Text Block Type; 34 tests.
    After: 44 tests, pnpm typecheck and pnpm lint clean:
convert(paragraphs) -> tiptap -> convert back == original   # text, each mark, combined, multi-paragraph, empty, line break
adjacent runs with same formatting             -> merged
Ctrl+B/I/U                                     -> button aria-pressed = true
select text, click Bold/Italic/Underline       -> stored runs carry the flag, only our keys
click Block B after Block A                    -> buttons follow Block B
paste <ul>, <a>, color, text-align             -> dropped by schema

Real Enter/paste events and Cmd shortcuts on macOS are not covered by automated tests; checked manually in the app.

Merge Danger

Door: two-way

Blast Radius: contained

Adds Tiptap dependencies. A line break is stored as \n in run text, so the future PDF renderer must honour it (not covered by ADR-0002 yet).

🤖 Generated with Claude Code

rotespferd and others added 4 commits October 17, 2026 12:38
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…targeting (#4)

Retarget the Properties Panel at a Body Text editor on any click in its Block.

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>
@rotespferd
rotespferd merged commit 6aad989 into main Oct 17, 2026
1 check passed
@rotespferd rotespferd added the feature New feature or request label Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Body Text Block Type

1 participant