Repository navigation
Wait for the hero scroll frame before checking receded copy - #2006
Conversation
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the homepage E2E timing-race fix.
No open issues 🎉
What changed in this PR
This PR fixes a timing race in the homepage E2E tests by waiting for the hero’s scroll-driven opacity update. Production behavior and rendered output are unchanged.
Changes:
- Extracts shared helpers to read hero-copy opacity and poll until it reaches the existing threshold.
- Replaces the immediate final opacity assertion with polling.
- Adds a desktop regression test that delays animation-frame callbacks to exercise stale scroll progress.
| File | Description |
|---|---|
src/frontend/tests/e2e/homepage.spec.ts |
Adds polling helpers and delayed-frame regression coverage for hero-copy opacity. |
Review effort: Balanced
Project docs review: not applicable (test-only PR)Reviewed Phase A - claims verification: No documentation claims found. Claim catalog: empty; verified / verified-with-nuance / unverifiable / contradicted: 0 / 0 / 0 / 0. No upstream source repository was consulted because there is no applicable documentation claim to verify. Phase B - blind doc-tester assessment: Not applicable: no changed documentation route, section, or user instructions to exercise. Routes exercised: none; no documentation server or sample application started. Critical issues, warnings, passed checks, recommendations, and knowledge gaps: not assessed, rather than represented as passing. Homepage E2E behavior belongs to the subsequent code review, not a fabricated documentation test. Outcome: Both documentation phases were assessed for applicability; no documentation finding. This is a top-level assessment only, not a formal approval. This once-per-PR docs stage is complete; subsequent commits do not automatically rerun it. |
Project code review: no actionable findingsReviewed the complete test-only diff from Synchronization and assertions: Regression and isolation: The new test delays callbacks through 30 native frames, waits for an intermediate fade at scroll 320, then checks the final endpoint at scroll 600. Its init script is installed before reload. The override and pending callback chains stay inside this test's Playwright-owned page/browser context, which fixture teardown disposes; they do not alter another test's browser APIs. No application navigation requiring cancellation fidelity is exercised by this test. Test coverage and evidenceAt the exact reviewed head, CI run 41166311445 completed successfully. I inspected the actual job logs, not just the check badge:
Limits: No local E2E run or independent exact-base timing reproduction: this checkout has neither Bun on PATH nor frontend dependencies. No dependency restore, local production build, live browser/device session, Firefox/WebKit run, or new CI run was performed. CI evidence is Chromium with configured desktop/tablet/mobile emulation, not physical-device coverage. The logs show the new regression passes; I did not establish a deterministic failing mutation/control for reverting only the polling helper. Cleanup: No tracked files edited, PR checkout created, server/browser process started, or fixes pushed. Read-only fetch and source/CI inspection only. No formal approval/change request or merge action. This once-per-PR code stage is complete, including this clean result; subsequent commits do not automatically rerun it. |
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
Approved following the completed Project docs applicability and clean code review at this unchanged head, approval recommendation, and passing CI. Approval and merge authorized by the user.
The bounded hero motion test read the hero copy opacity once right after scrolling to 600px. HomeHero applies scroll progress in a requestAnimationFrame callback, so the read could observe the previous 320px frame (0.59168) and fail the <= 0.12 assertion. Poll the receded opacity with the same threshold and add a slow-frame regression that fails 10/10 with the single read. Co-authored-by: Copilot <[email protected]>
e1419e3 to
3acda9e
Compare
|
Rebased onto David Pine (@IEvangelist) your earlier approval was on the previous head ( 🤖 Posted by AspireAgent (AI Agent) |
Summary
This fixes a race in the homepage E2E test "uses bounded hero motion to advance product proof on large viewports". It failed on desktop in run 41103769995, job 124232348472 with:
Root cause (test-only):
HomeHero.astroapplies--home-hero-progressinside arequestAnimationFramescroll handler, and.home-hero-copyopacity is1 - progress * 0.88. The test polls afterscrollTo(0, 320), but afterscrollTo(0, 600)it read the opacity once. When that read lands before the next frame, it sees the previous 320px frame: progress 0.464, which gives exactly 0.59168. Site behavior is correct; the settled value is always 0.12.Fix:
expect.poll(...).toBeLessThanOrEqual(0.12)through a smallexpectHeroCopyRecededhelper. The threshold is unchanged and there are no new sleeps, retries or timeout changes.requestAnimationFramecallbacks by 30 frames, then checks the same receded-copy contract.No production or rendered output changes, so there are no screenshots.
Third-party links and affiliations
None.
Validation
Measured locally on the
desktop-chromiumproject against a dev server with retries disabled, at basef05f5561:scrollTo(0, 600)returned0.59168; every settled read was0.12. With the slow-frame deferral, 10/10 immediate reads were stale.Received: 0.59168.--repeat-each=15).npx eslint . --max-warnings 0is clean, andnpx vitest runpassed 84 files with 1,120 tests passed and 1 skipped.homepage.spec.tstests, not this one.🤖 Posted by AspireAgent (AI Agent)