Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

Merge latest dev and preserve motion fixture isolation

tt-a1i6f050834eb1f
diff --cc test/motion-governor-browser.test.mjs
index 127921ec,d7e4d4d5..1ae8716a
--- a/test/motion-governor-browser.test.mjs
+++ b/test/motion-governor-browser.test.mjs
@@@ -59,20 -59,13 +59,26 @@@ test('Motion Governor preserves mode, o
async function load(mode = 'architecture', { theme = 'dark', reduced = false, fixture = '', preserveStorage = false, query = '' } = {}) {
const expectedNavigation = ++navigationId;
if (!preserveStorage) {
+ if (fixtureUrl) {
+ // Reset through the outgoing document's live storage area, then verify
+ // completion before navigating. A CDP clear against a guessed file
+ // storage key did not reliably clear this document's saved intent.
+ assert.equal(await run('motionResetStorage()'), null, 'Outgoing fixture must clear stored intent.');
+ }
fixtureUrl = pathToFileURL(files[mode]).href + `?theme=${theme}&testNavigation=${expectedNavigation}${query}`;
+ // End the old document before resetting this disposable profile. A
+ // backend clear while the old file document still owns its Storage area
+ // is not an isolation boundary for its pending work or unload handlers.
+ // Keep startup/reload reads in the real Viewer, outside injected scripts.
+ const frame = (await send('Page.getFrameTree')).frameTree.frame;
+ if (frame.url !== 'about:blank') {
+ const detached = browser.cdp.waitFor('Page.loadEventFired', session);
+ const navigation = await send('Page.navigate', { url: 'about:blank' });
+ assert.ok(navigation.loaderId, 'Fresh fixture reset must end the prior document.');
+ await detached;
+ assert.equal(await run('location.href'), 'about:blank', 'Storage reset requires the neutral document.');
+ }
+ await send('Storage.clearDataForStorageKey', { storageKey: 'file:///', storageTypes: 'local_storage' });
}
if (startup) await send('Page.removeScriptToEvaluateOnNewDocument', { identifier: startup });
({ identifier: startup } = await send('Page.addScriptToEvaluateOnNewDocument', { source: `(() => {