Repository navigation
fix(registry): caption-highlight clears a short word's highlight when the word ends - #7735
Conversation
… the word ends On a word shorter than 0.05 s the 0.15 s fade-in outlived the fade-out, so a frame inside that tail lit the highlight again until the phrase ended.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 69851602
The code fix is correct. The one blocker is in the PR body:
- blocker: the body has no
fails without the fix:line naming the test. That line is only a code comment incaptionLastGroup.chromium.test.ts. The "Red first" bullet describes the check but isn't the required line. Add one to the body, e.g.fails without the fix: packages/cli/src/registry/captionLastGroup.chromium.test.ts › "clears a 0.04 s word's highlight once the word is over". Only the body changes, so I'll approve once it's there.
Scope
- Red/green reproduced locally (chrome-headless-shell 157): with
caption-highlight.htmlreverted, the new test failsexpected 1 to be +0; at head, 2/2 pass. CI's Test (cli) skips*.chromium.test.ts(noPUPPETEER_EXECUTABLE_PATH), so this local run is the only red/green evidence. - Sibling audit:
hl-bg-appears only in the component, the demo, and the two catalog outputs, and all four are updated. The other caption components with an entrance tween plus aw.endexit either hide the element withvisibility: hiddenatw.end + 0.1(kinetic-slam, texture), so a late entrance write stays invisible, or have an entrance that always ends before the exit (particle-burst, neon-glow, clip-wipe). - Catalog: re-running
generate-catalog-payloads --only caption-highlight+generate-catalog-pagesproduces no diff in either caption-highlight file. - Words from 0.05 to 0.15 s (the demo's "a", "you", "and") now reach full opacity right at the word's end instead of ~0.89. This is intended and has no correctness impact.
— Genesis
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 resolved, 0 open, 1 new · 69851602 (unchanged head)
The fails without the fix: line is fixed. New blocker: CI's Catalog payloads job is red in both runs at this head (check-catalog-source-pr.mjs): "Catalog PRs commit item sources only… Restore these generated files: docs/catalog/components/caption-highlight.mdx, docs/public/catalog/components/caption-highlight.json". Drop those two files from the PR, since publish automation regenerates them, and drop the catalog bullet from the body.
— Genesis
There was a problem hiding this comment.
Verdict: APPROVE · 2 resolved, 0 open, 0 new · 69851602 → fc2d22ca
The generated catalog files are dropped and the body has the fails without the fix: line. Component, demo and test are byte-identical to the head I verified red/green. CI is green, including Catalog payloads and Windows render.
— Genesis
What
The
caption-highlightcomponent now clears a short word's highlight when the word ends. Before, a word shorter than 0.05 s could leave its highlight lit until the whole phrase ended.Why
Each word's highlight fades in over 0.15 s from the word's start and fades out over 0.1 s from its end. On a word shorter than 0.05 s (transcripts produce them) the fade-in is still running after the fade-out has finished. When a rendered frame lands in that short tail, the fade-in writes its end value last and the highlight comes back at full opacity for every later frame of the phrase.
hyperframes checkalready reports this asgsap_tween_tail("ends 0.010 s after a later tween"), and agents using the component argued it was a false positive. It is not: in Chromium, seeking the real component frame by frame through a 0.04 s word leaves the highlight at opacity 1 after the word.Related work
None.
How
registry/components/caption-highlight/caption-highlight.htmlanddemo.html: the fade-in lastsMath.min(0.15, w.end - w.start), so it never outlives its word. Words of 0.15 s or longer are unchanged.Test plan
packages/cli/src/registry/captionLastGroup.chromium.test.ts: the demo with one word cut to 0.04 s, seeked frame by frame with one frame inside the tail; the word's highlight must read opacity 0 after the word.caption-highlight short word in Chromium > clears a 0.04 s word's highlight once the word is overinpackages/cli/src/registry/captionLastGroup.chromium.test.tsgoes red with the component change reverted (expected 1 to be +0); with it, 2 passed, 3 runs in a row.oxfmt --checkandoxlinton the test file: clean.