Two reproduced lifecycle defects in DiagramRenderer.svelte, tracked together because their local UI ownership repair is shared.
- Replace diagram A with diagram B on the same mounted renderer. With disjoint state IDs, the old selected ID remains and B can render unfiltered paint. With overlapping IDs, the old local selection wins over B’s saved selection. Removing the locally selected state or changing stateless/stateful structure similarly leaves stale selection. A paused camera transition can remain held after identity replacement.
- Toggle fit and unmount before the queued animation frame. The fit callback is not cancelled; repeated toggles enqueue multiple scroll writes rather than retaining only the latest frame.
Regression evidence on the preserved mixed frontend worktree at dd8276fe: canonical layered fixtures produced 8 failing unit cases and 1 passing selection-echo guard; two same-instance Chromium cases on an exact-source-matched preview failed at stale selected state (not readiness). A renderer-only candidate now passes the initial 9 unit cases; expanded lifecycle/continuity/browser/static gates are still pending.
Repair constraints: preserve valid local selections on equivalent objects and parent onUpdate echoes; never mutate incoming canonical payloads or emit unsolicited persistence updates; cancel obsolete transition paint and fit work. No routing, typography, frame sizing, footer redesign, or data normalization.
Tests: src/lib/components/diagrams/tests/diagram-lifecycle.test.ts and test/diagram-lifecycle.spec.ts. Local candidate is uncommitted; no PR or shipping claim.
Dedup searched diagram lifecycle/state/fit/replacement, walkthrough stale, and fit requestAnimationFrame. Existing diagram readiness/size/routing reports do not cover these reproduced ownership defects.
Two reproduced lifecycle defects in DiagramRenderer.svelte, tracked together because their local UI ownership repair is shared.
Regression evidence on the preserved mixed frontend worktree at dd8276fe: canonical layered fixtures produced 8 failing unit cases and 1 passing selection-echo guard; two same-instance Chromium cases on an exact-source-matched preview failed at stale selected state (not readiness). A renderer-only candidate now passes the initial 9 unit cases; expanded lifecycle/continuity/browser/static gates are still pending.
Repair constraints: preserve valid local selections on equivalent objects and parent onUpdate echoes; never mutate incoming canonical payloads or emit unsolicited persistence updates; cancel obsolete transition paint and fit work. No routing, typography, frame sizing, footer redesign, or data normalization.
Tests: src/lib/components/diagrams/tests/diagram-lifecycle.test.ts and test/diagram-lifecycle.spec.ts. Local candidate is uncommitted; no PR or shipping claim.
Dedup searched diagram lifecycle/state/fit/replacement, walkthrough stale, and fit requestAnimationFrame. Existing diagram readiness/size/routing reports do not cover these reproduced ownership defects.