Skip to content

fix: stop writing wordSpacing on rich-caption clips#139

Merged
dazzatronus merged 1 commit into
mainfrom
derk/fix-caption-word-spacing
Jul 14, 2026
Merged

fix: stop writing wordSpacing on rich-caption clips#139
dazzatronus merged 1 commit into
mainfrom
derk/fix-caption-word-spacing

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

What changed

RichCaptionStyle deliberately excludes wordSpacing (captions are laid out word-by-word for timed highlighting), but the caption toolbar rendered a word-spacing slider and — worse — the shared spacing controls wrote style.wordSpacing unconditionally on every spacing interaction. Any letter-spacing or line-height change on a caption clip therefore produced a style the schema rejects: every subsequent clip commit threw ZodError: Unrecognized key "wordSpacing", and the invalid style could be persisted, leaving templates that fail strict validation on reopen.

  • The caption toolbar no longer shows a word-spacing slider.
  • Spacing updates consult a new supportsWordSpacing() toolbar hook and omit the key for rich-caption clips; rich-text behaviour is unchanged.

How to verify

New tests in tests/rich-caption-toolbar.test.ts: the caption toolbar renders no word-spacing slider, caption spacing updates omit wordSpacing (both fail on the previous code), and a contrast test pins that rich-text spacing updates still include it. Full suite passes (1864), typecheck and lint clean.

@dazzatronus
dazzatronus merged commit 5f770e0 into main Jul 14, 2026
1 check passed
@dazzatronus
dazzatronus deleted the derk/fix-caption-word-spacing branch July 14, 2026 02:11
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant