fix: make caption overrides refresh-safe#609
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8c5940f to
0882073
Compare
ec63fd7 to
446c5e2
Compare
0882073 to
bb2c5f8
Compare
e0c88dd to
ce1de64
Compare
bb2c5f8 to
4829dc1
Compare
ce1de64 to
fd62a9d
Compare
4829dc1 to
6161c79
Compare
miguel-heygen
left a comment
There was a problem hiding this comment.
No blocking findings.
I reviewed this on top of #593 at 6161c790e2c4923988071a6de16a2b11a7ecd9ea. The wrapper reuse path is idempotent, wordId propagation through parser/generator/runtime is stable, and the legacy wordIndex fallback remains covered.
Validated locally:
bun run --filter @hyperframes/core test -- src/runtime/captionOverrides.test.tspackages/studio/node_modules/.bin/vitest run --root packages/studio --config /dev/null src/captions/parser.test.ts src/captions/generator.test.tsbun run --filter @hyperframes/core typecheckbun run --filter @hyperframes/studio typecheckbunx oxlint/bunx oxfmt --checkon the changed caption files
Browser smoke: loaded a temporary Studio preview project with stable word IDs plus caption-overrides.json, confirmed the runtime applied the wordId override, reloaded, and confirmed it still had exactly one caption wrapper with the expected transform/font size.
CI is green except Graphite mergeability still appears pending, which I do not consider a code blocker for this review.
6161c79 to
72cceb4
Compare
fd62a9d to
d0abe90
Compare
72cceb4 to
e5f9e95
Compare
Merge activity
|

Summary
This stacked PR makes caption overrides refresh-safe.
Caption edits are still saved to
caption-overrides.json, but override targets are now stable across preview refreshes and regenerated caption HTML.Architecture
TRANSCRIPTarray and emits those IDs on word spans.idfields instead of regenerating index-only identity.wordIdfirst, with the existingwordIndexfallback kept for older overrides.data-caption-wrapper="true"wrapper instead of nesting wrappers on every refresh.User Impact
Users can edit caption word position, scale, rotation, color, opacity, font size, font weight, and font family, then refresh without overrides drifting to the wrong word or accumulating nested wrappers.
Main Files
packages/core/src/runtime/captionOverrides.tspackages/studio/src/captions/generator.tspackages/studio/src/captions/parser.tspackages/studio/src/captions/hooks/useCaptionSync.tsTest Plan