From a16565af8c92679a32f3888f6bd3d73ab6e8af0f Mon Sep 17 00:00:00 2001 From: holo Date: Mon, 29 Jun 2026 21:20:10 +0800 Subject: [PATCH] fix(graph): root-cause flaky Pixi canvas race; scope Mermaid e2e locators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two documented flaky e2e tests, fixed at the source rather than absorbed by CI retries. graph.spec.ts "renders a nonblank Pixi graph canvas": under React StrictMode's dev double-invoke the graph runs two createPixiGraphEngine() inits concurrently. The canvas was attached via mount.replaceChildren() inside the async factory — outside the effect's `active` guard — so a slower-resolving stale init could clobber the live engine's canvas and then empty the mount when its destroy() fired, leaving data-ready="true" over a canvas-less stage. GraphCanvas now attaches the canvas only inside the active guard (engine exposes a `canvas` getter); the discarded init never touches the DOM. Production rendering is unchanged (no StrictMode there → single attach). The spec also gates on data-render-count >= 1 before reading the canvas contract. wiki.spec.ts + theme.spec.ts Mermaid disclosure clicks: a bare getByText("flowchart") also matched the