From b0751497d4fa7f5174ae2a1f2645858d4f552feb Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 07:53:04 +0300 Subject: [PATCH] test(moon): judge the editor after the mode transition; fresh screenshot fingerprint (#718) Validate on the conveyor's rebase 98d98e83 was red twice over: - smoke_moon_static ac5_noMoonInTheEditor sampled the plan editor two frames after `setMode('plan')`, while the View -> editor transition (#101) was still running and the sky layer was legitimately fading out. Locally 2 of 3 runs red on 98d98e83. The check now waits for the transition to end (no `_modeTransitionBusy`, no `mode-transition` class) and turns red if it never does; 5 of 5 runs green. - the branch changes visual sources, so the screenshot check is strict on it, and #725 moved the sources under the fingerprint. `docs:accept --identical`: all 11 frames pixel-identical, only the fingerprint moves. Issue: #718 User-Visible: no Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018qZfe7YS4rqEMKoVeS3GKd --- demo/smoke_moon_static.mjs | 6 +++++- docs/images/screenshots.json | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/demo/smoke_moon_static.mjs b/demo/smoke_moon_static.mjs index ebd74b64..402d07e1 100644 --- a/demo/smoke_moon_static.mjs +++ b/demo/smoke_moon_static.mjs @@ -245,6 +245,10 @@ const sameBox = (a, b) => !!a && !!b && a.every((value, index) => Math.abs(value const stopSampling = () => page.evaluate(() => { window.__hpSkyStop = true; return window.__hpSkySamples; }); await sample(); await page.evaluate(() => window.__hpTest.setMode('plan')); + // The View → editor transition (#101) runs for frames after `setMode`: judge + // the editor once it has ended, not two frames in (#718 r1: red under load). + const editorSettled = await until(page, () => !window.__card._modeTransitionBusy + && !window.__card.renderRoot.querySelector('.stage')?.classList.contains('mode-transition')); await settle(page); const toEditor = await stopSampling(); const inEditor = await moonState(page); @@ -258,7 +262,7 @@ const sameBox = (a, b) => !!a && !!b && a.every((value, index) => Math.abs(value report.ac5 = { between: between.length, toEditor: toEditor.length, inEditor, firstBack, backInView }; checks.ac5_skyFollowsTheViewWeight = between.length > 0 && toEditor.every((frame) => frame.sky === null || Math.abs(frame.sky - frame.weight) <= 0.02); - checks.ac5_noMoonInTheEditor = inEditor.count === 0 && inEditor.sky === 0; + checks.ac5_noMoonInTheEditor = editorSettled && inEditor.count === 0 && inEditor.sky === 0; checks.ac5_backInViewAtOnce = !!firstBack && firstBack.moon.on && firstBack.moon.opacity === 1 && backInView.on && backInView.opacity === 1 && backInView.parent === 'hp-moon-sky'; await browser.close(); diff --git a/docs/images/screenshots.json b/docs/images/screenshots.json index ac4a6269..05faa2da 100644 --- a/docs/images/screenshots.json +++ b/docs/images/screenshots.json @@ -3,7 +3,7 @@ "fixture": "synthetic-only", "chromium": "151.0.7922.34", "oxipng": null, - "sourceFingerprint": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceFingerprint": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "captureScriptSha256": "e2d14d89de793011615662af7c83c433768d4761f6cec7f0b3860c797494299e", "command": "npm run build && node demo/docs/capture.mjs", "scenarios": { @@ -15,7 +15,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "de1ee062cfffa375f66ff74509ad9ddbf6aabc5c5440733fe1ff0ea5a40e96c7" }, "view-touch": { @@ -26,7 +26,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "f9dd5b54f86b814c00bc84149af84485f052b103cdcc9263b5c50bf5d32c69d6" }, "space-create": { @@ -37,7 +37,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "aab4811bba3afa6cc849cb9d3989d126b8c327b69a2f8f853e55fc077e0e9a1b" }, "room-contour-close": { @@ -48,7 +48,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "96a7e691ad8167103199a58b48b31ae2fc4f03e9616b65a5096dc8d0b9b51da0" }, "plan-context-tray": { @@ -59,7 +59,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "ebb89bacfecd16178534e1f02fed8bb7540072a691ec4d4b14407c0b8ec4455e" }, "device-editor": { @@ -70,7 +70,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "b40f843d7bcab902a6f697cc76735e6d3351a95443fe11ba761f0e39613120bc" }, "device-display-preview": { @@ -81,7 +81,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "835e9f1b9446072a2caa2421b06a669eac9e5c0e3e6cf94106dd6cc2dd0d8e2b" }, "background-editor": { @@ -92,7 +92,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "98a8c735165912b49b4254d2f975a61891e5737b0a9c16c627f08d60853fa8a7" }, "room-card": { @@ -103,7 +103,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "d47988b03e6a078508b27b5612b6eafe8ecc33c891b589ddda1cc7c71f43b7c8" }, "device-info": { @@ -114,7 +114,7 @@ }, "theme": "dark", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "a10e6044376b087ba6800a31a229e4166a6797820104860f85a4659d89ee8045" }, "pdf-export": { @@ -125,7 +125,7 @@ }, "theme": "light", "language": "en", - "sourceSha256": "2c4b16527004611d48a6cf52debd9ccd04c0eef6ab9a02f2484a02cf3d0a055a", + "sourceSha256": "82729cc9b1a6ae03478bfd96f7c101e549599d944b3be4b924c36b1139cf70dd", "imageSha256": "788a1ff32d6ceb51c9fb47ea37922ab15aeddf3fdcf3686bfcb0709634c41f0e" } },