Repository navigation
fix(lint): every selector in a comma list counts as hidden by authored CSS - #7252
Conversation
Edit accuracy: accurate 267 (base branch 267), smooth 93 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
There was a problem hiding this comment.
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.
|
Took the follow-up at c686d4f: |
…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>
What
gsap_timeline_set_initial_hideno 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_conflictread 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, asdigitIdsTargetedBySelectorsinrules/core.tsalready does, and takes the subject of every selector inrule.selectors. What counts as hidden is unchanged: a declaration matching the sameopacity: 0pattern, and a selector's trailing#idor.class, as the regex took before. A block postcss cannot parse is skipped, ascss_parse_errorreports it.Test plan
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 withtl.set(..., 0); no finding. With the oldgsap.tsit reports one, for#stroke-a.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#herogivesgsap_css_transform_conflictfor#hero. With main'sgsap.tsit gives none.gsap.test.ts(238) passes three runs in a row;tscon lint: no errors.lint --jsonreportsgsap_timeline_set_initial_hideonce; the branch's built lint package (lintProject) reports none.css_parse_errorreports 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.