fix(free-layout): refresh lines after JSON layout - #1157
Conversation
|
Friendly ping on this one — the CLA is signed and local validation is green. GitHub Actions are currently awaiting maintainer approval for this fork PR. This fixes free-layout lines not refreshing after a JSON-driven layout. Could a maintainer help approve the workflows and take a look / assign a reviewer when convenient? Happy to rebase or adjust if needed. Thanks! |
|
Correction to my previous note: the remote status currently contains only the successful CLA check, and there are no GitHub check runs for this head. The implementation evidence is local validation on the PR head (88 Vitest tests, ESLint, tsc --noEmit, and git diff --check), not upstream CI. The PR remains ready for maintainer review; no action is needed on the branch unless requested. |
Summary
Refresh free-layout edges after
fromJSON()has rendered and browser layout has settled.Ports may not have final DOM measurements during the initial render. Updating lines immediately can therefore leave edges at stale positions until another interaction triggers a refresh.
This change schedules a line refresh on the next animation frame and manages that deferred callback safely:
fromJSON()callsfireRender=falseValidation
vitest runinfree-layout-core— 11 files, 88 tests passedtsc --noEmitgit diff --checkRegression tests cover deferred refresh, default layout configuration, disabled rendering, repeated loads, and cancellation of stale callbacks.
AI assistance
This change was developed with AI assistance. I reviewed the animation-frame lifecycle and ran the package-level checks above.