Repository navigation
fix(check): name a color-graded video by its own selector in layout findings - #7699
Merged
miguel-heygen merged 1 commit intoNov 14, 2026
Conversation
…indings A color-graded <video> is painted into a canvas the runtime inserts after it, with a runtime-generated id (__hf_color_grading_<video id>). Layout findings on that canvas (e.g. container_overflow for a punch-in inside an overflow:hidden box) named the canvas, so the fix hint "mark intentional overflow with data-layout-allow-overflow" pointed at an element the author never wrote. The audit already reads flags from the authored video (authoredElement); uniqueSelectorFor now names that element too, so the finding's selector, data attributes and source file are the video's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
miguel-heygen
approved these changes
Nov 14, 2026
miguel-heygen
left a comment
Collaborator
There was a problem hiding this comment.
Verified at b95de7c: the bug reproduces on main, and the new tests fail without the fix and pass with it. Required CI is green.
Merged
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When a layout finding lands on a color-graded
<video>,checknow names the video the author wrote (#c1-v) instead of the canvas the runtime paints the grade into (#__hf_color_grading_c1-v). The finding's data attributes and source file come from the video too.Why
A Short had a slight punch-in (
scale: 1.06) on a graded video inside its scene'soverflow: hiddenroot.checkreported:#__hf_color_grading_c1-vdoes not exist in the source. The runtime inserts it next to the video whendata-color-gradingis set. The hint says to putdata-layout-allow-overflowon the element, and an author or agent cannot tell where that goes. The flag does work on the<video>:hasAllowOverflowFlagalready resolves the canvas to its video throughauthoredElement(#5963). Only the name in the finding was wrong. The JSON had the same problem:dataAttributeslisteddata-hf-color-grading-canvasanddata-hf-ignore, and the video's own attributes were missing.Related work
How
packages/cli/src/commands/layout-audit.browser.js:uniqueSelectorForstarts fromauthoredElement(subject). That helper maps a[data-hf-color-grading-canvas]stand-in to the element before it and returns every other element unchanged.uniqueSelectorFornames every layout finding, so all rules now name the authored video, not onlycontainer_overflow. The rect is still the canvas's, which covers the same box as the video.Test plan
Unit (
packages/cli/src/commands/layout-audit.browser.test.ts): the existingcontainer_overflowcase for a graded video inside a clipping wrapper now expects selector#clip(the video), not#art(the canvas). On main (affa03b6) with the fix stashed it fails withexpected [ '#art' ] to deeply equal [ '#clip' ]. With the fix,layout-audit.browser,layout-audit.video-alpha.browser,contrast-occlusion.browserandlayoutAuditpass: 319 tests. The branch is rebased onto49623307(#7680 also touchedlayout-audit.browser.js, and the rebase was clean). After the rebase,layout-audit.browser.test.tspasses 220 tests.Real CLI on the original project (three graded clips with
scalepunch-ins insideoverflow: hiddenscene roots),hyperframes check --no-cache:After adding
data-layout-allow-overflowto<video id="c1-v">, both builds drop thec1finding, so the flag already worked. In--json, main lists the other two as#__hf_color_grading_c2-vwithdataAttributesdata-hf-color-grading-canvas, data-hf-ignore, …. This branch lists them as#c2-vwithdata-color-grading, data-duration, data-has-audio, …, andsourceFileiscompositions/c2.htmlon both.Gates: oxlint and oxfmt are clean.
fallow audit --base origin/mainreports no issues. The comment ratchet passes, and the lefthook typecheck passes.