Skip to content

fix(lint): every selector in a comma list counts as hidden by authored CSS - #7252

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/lint-comma-hidden-selector
Nov 5, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/lint-comma-hidden-selector

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What

gsap_timeline_set_initial_hide no longer warns about an element that a comma-separated CSS rule already hides. With #stroke-a, #stroke-b { opacity: 0; }, both paths now count as hidden by authored CSS, not only #stroke-b. gsap_css_transform_conflict read stylesheets with the same regex, so it missed every selector of a list but the last; it now sees them all.

Why

Two SVG paths were hidden by one comma rule and re-asserted with tl.set(..., 0). The check reported the first path's set as an initial hide that frame 0 would miss, but not the second's. Splitting the rule into two identical rules made the warning go away without changing the picture.

collectCssOpacityZeroSelectors (rules/gsap.ts) read stylesheets with ([#.][a-zA-Z0-9_-]+)\s*\{, which captures only the one selector directly before {. In #stroke-a, #stroke-b { that is #stroke-b; every earlier selector of a list was dropped.

How

Both rules now read stylesheets through one helper, cssRuleSubjects, which parses each <style> with postcss and walks its rules, as digitIdsTargetedBySelectors in rules/core.ts already does, and takes the subject of every selector in rule.selectors. What counts as hidden is unchanged: a declaration matching the same opacity: 0 pattern, and a selector's trailing #id or .class, as the regex took before. A block postcss cannot parse is skipped, as css_parse_error reports it.

Test plan

  • Unit tests added/updated:
    • fails without the fix: gsap.test.ts "gsap_timeline_set_initial_hide: counts every selector of a comma list as hidden by authored CSS": two paths hidden by #stroke-a, #stroke-b { opacity: 0 }, each re-asserted with tl.set(..., 0); no finding. With the old gsap.ts it reports one, for #stroke-a.
    • fails without the fix: gsap.test.ts "warns for every selector of a comma list with a CSS scale transform, not only the last": #hero, #badge { transform: scale(0.8) } and a scale tween on #hero gives gsap_css_transform_conflict for #hero. With main's gsap.ts it gives none.
    • gsap.test.ts (238) passes three runs in a row; tsc on lint: no errors.
  • Manual testing performed: the reported shape as a project. Released 0.9.15 lint --json reports gsap_timeline_set_initial_hide once; the branch's built lint package (lintProject) reports none.
  • Documentation updated (if applicable): none needed.
  • Comments follow CONTRIBUTING.md "Comments": no new comments, so the file's comment share does not rise; a block postcss cannot parse is skipped because css_parse_error reports it.

Size

About 30 lines of source in one file and two tests. One fix: the two rules that read stylesheets by regex read every selector of a list.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 93 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (1)

  • seqplainkeys-none-px-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head bc69088d

The new test fails with main's gsap.ts (1 finding, for #stroke-a) and passes on this head: 237/237 in gsap.test.ts, run locally. Selector-subject extraction behaves the same as before for descendant, compound, :pseudo, @media and keyframe selectors.

CI on this head is red for reasons outside this PR: Test (cli 2/2) and SDK: unit + contract + smoke both failed downloading ffmpeg (curl 504 / "Failed to download ffmpeg"), and Test is the aggregate that fails with them. A re-run should clear them.

Follow-up, not gating

gsap_css_transform_conflict (gsap.ts:1332) still uses the old ([#.][a-zA-Z0-9_-]+)\s*\{ regex, so it misses every selector of a comma list except the last. There the result is a missed warning, not a false one, and it's a different rule.

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Took the follow-up at c686d4f: gsap_css_transform_conflict had the same regex, so both rules now read stylesheets through one cssRuleSubjects helper (postcss, every selector's subject). New test: #hero, #badge { transform: scale(0.8) } with a scale tween on #hero reports the conflict; main's gsap.ts reports none. gsap.test.ts 238/238 three runs in a row, tsc clean. The earlier reds were the ffmpeg download outage; this push reruns CI.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE — 0 open, 0 new · bc69088 → c686d4f. The gsap_css_transform_conflict follow-up is now folded in through the shared cssRuleSubjects helper. Both named tests fail with main's gsap.ts, src/rules passes 1090/1090 locally, and CI is green.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit a664f99 Nov 5, 2026
123 checks passed
@miguel-heygen
miguel-heygen deleted the fix/lint-comma-hidden-selector branch November 5, 2026 16:36
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 6, 2026
…view

Adopts heygen-com#7250 (SVG stroke drawing is not a dead stretch), heygen-com#7248
(contract check reads a timeline registered in a local script), heygen-com#7252
(comma-list selectors hidden by authored CSS), heygen-com#7238 (snapshot and
preview show a clip on the render frame), heygen-com#7237 (stalled cloud upload
retries) and heygen-com#7251 (per-scene SVG id namespacing), with prerequisite
heygen-com#6829. Defers heygen-com#7246 (needs the delivery limiter from heygen-com#6940) and heygen-com#7232
(needs the WebKit decode-first pipeline), with conditions in the
ledger. Watermark advances to b108f85.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant