Skip to content

fix: connector_detached now skips fully dash-hidden connector shafts - #3912

Open
miga-heygen wants to merge 1 commit into
mainfrom
fix/connector-detached-dash-hidden
Open

fix: connector_detached now skips fully dash-hidden connector shafts#3912
miga-heygen wants to merge 1 commit into
mainfrom
fix/connector-detached-dash-hidden

Conversation

@miga-heygen

Copy link
Copy Markdown
Contributor

Summary

connector_detached (the layout-audit finding for SVG connector paths whose rendered endpoints don't attach to any anchor) evaluated a path's geometry unconditionally — it had no gate for stroke-dashoffset/stroke-dasharray draw-on visibility. A connector fully hidden behind an un-advanced "draw the line in" dash animation still fired the finding as if it were rendered and visible. The sibling check, connector_orphan, already skips fully dash-hidden shafts via a shaftDashHidden(path) helper — this adds the same gate to connectorDetachmentIssues, in the same position.

Deliberately did not also add the shaftIsPainted check that connector_orphan uses (which additionally covers opacity/display:none/visibility:hidden) — that's a real, separate gap but out of scope for this fix; noted below as a follow-up candidate.

Test plan

  • Added a regression test: a connector fully hidden via strokeDasharray/strokeDashoffset no longer fires connector_detached, using the exact fixture (now shared via extracted foreignFrameDom/foreignFrameRects/foreignFrameStyles consts, mirroring this file's existing orphanDom convention) as the adjacent positive-control test that proves the same fixture does fire when not dash-hidden — isolating the single variable.
  • Verified via a real-Chromium (puppeteer) revert-and-restore harness against the actual browser script (this file has no build step and can't run under this sandbox's happy-dom test runner): confirmed pre-fix, a dash-hidden connector fired the identical finding as a fully-visible control; confirmed post-fix, the dash-hidden connector reports zero findings while the control still fires.
  • bunx tsc --noEmit -p packages/cli, oxlint, oxfmt --check clean on both touched files.
  • Full packages/cli test suite: 3040 passed, 3 skipped; the only 2 failures are in files unrelated to this change and fail identically on an unmodified checkout (happy-dom collection error, pre-existing sandbox limitation — this PR's own regression test lives in one of the files affected by that same pre-existing limitation and could not be executed locally, only via the real-Chromium harness above).
  • Adversarial review also flagged: shaftDashHidden and pathUserEndpoints each independently call path.getTotalLength(), a redundant SVG geometry query — but this exact double-call pattern already exists today in the sibling connector_orphan check this PR intentionally mirrors, so it's not a new inefficiency.

connector_detached fired on SVG connector paths that were 100% hidden
via stroke-dashoffset/stroke-dasharray draw-on entrances, evaluating
rendered/user-space geometry unconditionally. The sibling
connector_orphan check already gates on shaftDashHidden(path); add the
same gate here, in the same position.

Co-Authored-By: Miguel Angel <miguel.sierra@heygen.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