Skip to content

Mixed formatting runs within a single text box (#40) - #41

Merged
leogdion merged 3 commits into
v0.1.xfrom
40-mixed-formatting-runs
Jul 31, 2026
Merged

Mixed formatting runs within a single text box (#40)#41
leogdion merged 3 commits into
v0.1.xfrom
40-mixed-formatting-runs

Conversation

@leogdion

@leogdion leogdion commented Jul 31, 2026

Copy link
Copy Markdown
Member

Part of #40. Render verification passed (2026-07-31 human pass). Note on merge order: this PR renames the public DSL surface (TextTextBox), so it should now merge before the v0.1.0 tag — otherwise v0.1.0 ships an API that is renamed immediately after.

Summary

  • DSL — the drawable is now TextBox (renamed from Text); a styled span inside it is Text (renamed from TextRun): TextBox { Text("Bold").bold(); Text(" plain") }. Builders never accept a bare String — every span is an explicit Text. Item-level modifiers on TextBox still style the whole item.
  • LoweringAuthoredSlide.TextItem.Run spans alongside the item-wide fields; hasRunFormatting gates the new path.
  • Surgery — one TSWP.CharacterStyleArchive (registry type 2021) minted per span onto tableCharStyle, keyed by UTF-16 start offset. Plain spans get override-free styles so no entry ever carries a zero-identifier reference. Every minted style gets the full edge set the Text formatting on authored Text items #37 render fix established: stylesheet styles list, storage record header objectReferences, slide-component externalReferences, uuid-map entries in both components, and color via charProperties.tsdFill. The item-wide paragraph-style variation is unchanged and composes with run overrides.
  • Acceptance — new text_runs deck (9th in the catalog) as the render probe; AcceptanceDecks checklist extended.
  • Docsresearch/findings/text_formatting.md rewritten: it still described the abandoned pre-fix char-style spec; now covers both shipped mechanisms and the open render risk.

Test plan

  • swift test — all targets green, incl. new TextRunTests (entries/offsets, override bags, registration edges, plain-runs fallback, item+run composition) and the structural gate over the new deck (full decode + UUID-map invariants)
  • LINT_MODE=STRICT ./Scripts/lint.sh
  • Render verification in Keynote 15.3 (2026-07-31 human pass: mixed formatting renders correctly in one box) — text_runs.key: "Bold red" large bold red, "italic" italic, spans between plain, all in ONE box. Must be render-level (AppleScript slide-image export), not open-level: this mechanism previously opened cleanly but rendered plain (pre-edge-fix attempt). If it renders plain, diff against a Keynote-scripted reference per the findings doc.

🤖 Generated with Claude Code

DSL: TextRun + TextRunsBuilder; Text { runs } init (strings lift to plain
runs). Lowering: AuthoredSlide.TextItem.Run spans (split to +TextItem file).
Surgery: one TSWP.CharacterStyleArchive (type 2021) per span on
tableCharStyle keyed by UTF-16 start offset — plain spans get override-free
styles (never a zero-identifier reference); full registration edges from the
#37 lessons (stylesheet styles list, storage header objectReferences,
slide-component externalReferences, uuid-map entries in both components;
color via tsdFill). Paragraph-style variation still carries item-wide
defaults and composes with run overrides.

New text_runs acceptance deck (#40 render probe). Findings doc rewritten for
the shipped mechanisms; render verification in Keynote 15.3 is the open gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f3ce3258-f829-44e7-8cb8-f1c2522ac895

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Human pass on text_runs.key: per-run character styles on tableCharStyle
render correctly with the full registration edge set — the historical
renders-plain failure belonged to the pre-edge-fix attempt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leogdion
leogdion marked this pull request as ready for review July 31, 2026 14:40
Per review: the drawable is TextBox, a styled span inside it is Text.
TextRunsBuilder no longer lifts free String literals — every span is an
explicit Text element.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@leogdion
leogdion merged commit 45b8c4f into v0.1.x Jul 31, 2026
17 checks passed
@leogdion
leogdion deleted the 40-mixed-formatting-runs branch July 31, 2026 15:51
leogdion pushed a commit that referenced this pull request Jul 31, 2026
- research/findings/acceptance_keynote_open.md: expanded-pass section (9 decks
  incl. text_runs, regression + drawable-depth render columns, #10 live-verify
  extra, tag + merge-to-main steps)
- .claude/PLAN.md, .claude/PARALLEL-WORKTREES.md, .claude/agent-notes.md:
  current position after PR #39 and PR #41 merges (drawable depth, mixed runs,
  TextBox/Text DSL rename) and issue housekeeping

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
leogdion added a commit that referenced this pull request Jul 31, 2026
- research/findings/acceptance_keynote_open.md: expanded-pass section (9 decks
  incl. text_runs, regression + drawable-depth render columns, #10 live-verify
  extra, tag + merge-to-main steps)
- .claude/PLAN.md, .claude/PARALLEL-WORKTREES.md, .claude/agent-notes.md:
  current position after PR #39 and PR #41 merges (drawable depth, mixed runs,
  TextBox/Text DSL rename) and issue housekeeping

Co-authored-by: CI <ci@example.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@leogdion leogdion mentioned this pull request Jul 31, 2026
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.

1 participant