Repository navigation
fix(lint): read a sub-composition mount's timing through the parser - #8037
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
Approving. Reading the mount's timing through readClipTiming fixes both cases in #8036: an unresolved expression start is now skipped instead of being treated as 0, and a negative start is clamped to 0, the way the renderer measures it. Clips with an unknown duration still cover the tail, as they did before.
fails without the fix: subcomposition_blanks_before_host > stays silent when the mount resolves its start at runtime and > measures a negative start from zero, as the renderer does. With composition.ts reset to main and the new tests kept, 2 tests fail and 321 pass. At this head, all 323 tests in composition.test.ts pass.
Optional nits:
composition.ts:1464builds the attribute reader inline.readTagTiming(tag.raw)(L88) already does this.- A row whose start is a reference (for example
data-start="intro") is dropped, so it can't count as covering the tail. A mount that starts at an earlier clip's id is still flagged as blank, which is a false positive. Main behaves the same way, so this isn't a regression. - #8032 touches the same two files in different hunks. Whichever PR lands second may need a trivial rebase.
Review by Rames
`subcomposition_blanks_before_host` read `data-start` and `data-duration` with a raw `Number()`, so a mount with a reference start (`intro + 0.5`) looked like it started at 0 and was reported as leaving a blank tail that may not exist. A negative start was measured from the raw value, so the reported gap and the `data-duration` fix hint were wrong in the other direction. Read the mount through `readClipTiming`, the same contract parser the renderer uses: a runtime-resolved start is skipped (its end cannot be known statically), and a negative start is measured from zero.
3637380 to
4b3b059
Compare
|
Thanks — applied the nit in On the reference-start row: keeping it skipped is deliberate, because its start (and therefore end) is only known at runtime; counting it as covering the tail would silently suppress a real blank-tail warning, so the rule stays silent for that row. |
jrusso1020
left a comment
There was a problem hiding this comment.
Re-approving at 4b3b059. I compared the patch against the one I approved at 3637380. The only change is the reader: readTagTiming(tag.raw) replaces the inline readClipTiming closure, which was my nit, and the commit is now rebased on current main. composition.test.ts passes 323/323 at this head.
Review by Rames
What
subcomposition_blanks_before_hostnow reads a mount's timing throughreadClipTiming, the same contract parser the renderer uses, instead of re-parsingdata-start/data-durationwithNumber().Why
With a raw parse, a mount whose start resolves at runtime (
data-start="intro + 0.5") looked like it started at 0. The rule then reported a blank tail that may not exist and suggested a wrongdata-duration. A negative start was measured from the raw value, so both the reported gap and the fix hint were wrong (the hint could exceed the host duration).Related work
Fixes #8036.
The rule itself came from #1542 (issue #1540). This keeps its intent — a mount that starts at the host start and is shorter than the host blanks the tail — and only fixes how the mount's timing is read.
How
readClipTimingwith the tag's attribute reader.timing.start === null) is skipped: its end cannot be known statically, so the rule stays silent instead of guessing.Infinity, preserving the existing "covers the tail" behavior.Test plan
main, pass with the change.@hyperframes/lint typecheckpasses.comment-ratchetandoxfmt --checkpass on the changed files.Commands run: