[PR #7216] [MERGED] test(e2e): measure phone tool overlap after the menu settles #7627

Closed
opened 2026-10-24 04:05:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7216
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: test/phone-tools-settle-7200


📝 Commits (1)

  • 15c6991 test(e2e): measure phone tool overlap after the menu settles

📊 Changes

1 file changed (+42 additions, -17 deletions)

View changed files

📝 e2e/phone-bubbles.e2e.ts (+42 -17)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7200

Why this change

  • e2e/phone-bubbles.e2e.ts › "large themed tools scroll inside a short phone viewport without covering their trigger" failed on mobile-webkit about once in three runs, including on untouched main and staging. The report was [null], so it did not say what covered the message box.
  • What the null element was: a row of the Chat tools menu, control:session (menu rows are .mari-window-bubble without data-window).
  • Why it only happened sometimes: in a game chat, the message box can mount about 150 ms after the test opens the menu. Before it exists, the phone bounds reach the bottom of the screen, so the menu opens below its button. When the box appears, the bounds shrink, the menu no longer fits below and moves beside the button (left 4 → 124, top 263 → 59). Framer Motion's Reorder.Item layout animation then glides each row from its old spot to the new one over about 300 ms, using inline transform. This is not a Web Animation, so document.getAnimations() is empty. Under CPU load the overlap check landed inside that glide. The row's getBoundingClientRect() (translate3d(-118px, 201px)) crossed the message box.
  • The failure is a test problem. The flagged row is clipped by the menu's scroll list, which ends above the message box (list bottom 428.5, message box top 436.5). Hit tests at the overlapping points always land on the message box, never on the row. Once the glide ends (about 0.3–0.5 s), the row sits inside the list and the box is clear, so the app code is unchanged.
  • A separate, brief app race (not fixed here): for about 2 frames (~40–60 ms) after the message box mounts, before the bounds update, the menu still sits in its old spot below its button and does cover the new message box. The test never tripped on that: the flagged element was always a clipped, gliding row, and the new 3-still-frame wait outlasts those 2 frames.

What changed

  • expectComposerClearAndNoSideScroll (used by 11 phone tests) now waits until every .mari-window-bubble and the message box hold the same boxes for 3 animation frames, with a 3 s limit. It then measures as before. The assertion is not weaker: it is still a strict unclipped-box overlap check, and it now also fails (settled: false) if the bubbles never stop moving, so it cannot pass by measuring at a lucky moment.
  • Unnamed bubbles in the overlap report now get a stable name: menu:<tool id> for menu rows, menu:lock for the lock, and an outerHTML prefix for anything else.
  • Test-only change: no app code, docs or CHANGELOG entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run evidence (local macOS, Playwright WebKit iPhone 15 Pro; boxes above left for the human reviewer):

  • Reproduced on staging 05843b89b only under CPU load (12 yes processes on 10 cores): 1/12, 3/16, 4/12 and 1/8 failures. Unloaded it passed 6/6 and 20/20. Diagnostics captured the row name, its in-flight translate3d, the menu moving from below to beside the button, and the late message-box mount. Hit tests at the overlap points returned the message box.
  • With the fix, under the same load: pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --workers=1 -g "large themed tools scroll" --repeat-each=16 → 16 passed.
  • Unloaded, the requested proof: same command with --repeat-each=10 → 10 passed, 0 failed.
  • Whole spec on both phone projects: pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --project=mobile-chromium → 27 passed, 5 skipped (the spec's existing project skips).
  • Negative check 1 (temporary local change, reverted): moved the open menu 80 px down so it really sits on the message box. The test fails with overlap: ["menu:control:volume"], settled: true.
  • Negative check 2 (temporary local change, reverted): added an endless 6 px CSS jiggle to the Chat tools button. The test fails with settled: false, so a bubble that never settles is not measured at a lucky moment.
  • pnpm check passed on the commit.
  • Local CodeRabbit (coderabbit review --agent --committed, CLI 0.7.6) on the commit: review completed, 0 findings.

Independent verification (second agent, same machine, branch head 15c699193):

  • Deterministic replay of the late mount: hid the game message box, opened Chat tools, then showed the box again, sampling every frame. For 2 frames the menu was still below its button and control:volume really covered the box (all hit-test samples landed on it). From then until ~340 ms, control:session and control:volume glided from translate3d(-120px, 204px) to none with unclipped boxes over the message box, but 0 hit-test samples were visible (clipped by the list). A screenshot taken mid-glide shows only the lock button in the menu column.
  • Same replay, 15 times per run: staging's measurement failed 15/15 on control:session (WebKit and Chromium, and 45/45 under CPU load). The new helper failed 0/15 per run (0/45 unloaded and 0/45 under load on WebKit, 0/15 on Chromium).
  • Natural reproduction: staging's spec under CPU load (12 yes processes) failed 1/12 with the original [null]. Its trace shows every Chat tools row (LI[data-chat-tools-menu-item]) carrying translate3d(-120px, 204px) during the steps just before the check. The branch under the same load passed 16/16.
  • The assertion can still fail: a temporary app mutation that sizes the menu against the whole screen instead of the phone bounds fails the test on WebKit and Chromium with { settled: true, overlap: ["menu:control:volume"] }. An endless CSS jiggle on the launcher fails with settled: false on both engines.
  • pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --workers=1 -g "large themed tools scroll" --repeat-each=10 → 10 passed.
  • Whole spec, mobile-webkit + mobile-chromium → 27 passed, 5 skipped, both on the branch and on a local merge with current staging (241ee8f2d; not pushed, since the PR has no conflicts).
  • pnpm check → exit 0.
  • All probes and mutations were temporary and reverted; the branch is unchanged.

Manual verification notes

  • Manually verify in CI that the mobile-webkit e2e shard passes phone-bubbles.e2e.ts › "large themed tools scroll inside a short phone viewport without covering their trigger".
  • Manually verify locally: pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --workers=1 -g "large themed tools scroll" --repeat-each=10 reports 10 passed. For a harder run, repeat it while the CPU is busy (for example, other test suites running).
  • GitHub CodeRabbit was rate limited on this PR and has not reviewed it yet; the e2e browser jobs show as skipped here, so they are not a pass.
  • Optional: manually verify on a phone that if you open Chat tools in a game chat while it is still loading, the tool buttons slide in beside the button inside the menu. Expect at most a brief flash (about 2 frames) of the menu over the message box before it moves, as described above.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Agent note: test-only change. No docs, CHANGELOG or translation impact.

UI evidence (if applicable)

Not a UI change.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7216 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `test/phone-tools-settle-7200` --- ### 📝 Commits (1) - [`15c6991`](https://github.com/Pasta-Devs/Marinara-Engine/commit/15c699193eb289a7cd0507eb454904ffb6913d96) test(e2e): measure phone tool overlap after the menu settles ### 📊 Changes **1 file changed** (+42 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `e2e/phone-bubbles.e2e.ts` (+42 -17) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7200 ## Why this change - `e2e/phone-bubbles.e2e.ts` › "large themed tools scroll inside a short phone viewport without covering their trigger" failed on mobile-webkit about once in three runs, including on untouched `main` and `staging`. The report was `[null]`, so it did not say what covered the message box. - **What the `null` element was:** a row of the Chat tools menu, `control:session` (menu rows are `.mari-window-bubble` without `data-window`). - **Why it only happened sometimes:** in a game chat, the message box can mount about 150 ms after the test opens the menu. Before it exists, the phone bounds reach the bottom of the screen, so the menu opens below its button. When the box appears, the bounds shrink, the menu no longer fits below and moves beside the button (`left 4 → 124`, `top 263 → 59`). Framer Motion's `Reorder.Item` layout animation then glides each row from its old spot to the new one over about 300 ms, using inline `transform`. This is not a Web Animation, so `document.getAnimations()` is empty. Under CPU load the overlap check landed inside that glide. The row's `getBoundingClientRect()` (`translate3d(-118px, 201px)`) crossed the message box. - **The failure is a test problem.** The flagged row is clipped by the menu's scroll list, which ends above the message box (list bottom 428.5, message box top 436.5). Hit tests at the overlapping points always land on the message box, never on the row. Once the glide ends (about 0.3–0.5 s), the row sits inside the list and the box is clear, so the app code is unchanged. - **A separate, brief app race (not fixed here):** for about 2 frames (~40–60 ms) after the message box mounts, before the bounds update, the menu still sits in its old spot below its button and does cover the new message box. The test never tripped on that: the flagged element was always a clipped, gliding row, and the new 3-still-frame wait outlasts those 2 frames. ## What changed - `expectComposerClearAndNoSideScroll` (used by 11 phone tests) now waits until every `.mari-window-bubble` and the message box hold the same boxes for 3 animation frames, with a 3 s limit. It then measures as before. The assertion is not weaker: it is still a strict unclipped-box overlap check, and it now also fails (`settled: false`) if the bubbles never stop moving, so it cannot pass by measuring at a lucky moment. - Unnamed bubbles in the overlap report now get a stable name: `menu:<tool id>` for menu rows, `menu:lock` for the lock, and an `outerHTML` prefix for anything else. - Test-only change: no app code, docs or CHANGELOG entry. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run evidence (local macOS, Playwright WebKit iPhone 15 Pro; boxes above left for the human reviewer): - Reproduced on `staging` 05843b89b only under CPU load (12 `yes` processes on 10 cores): 1/12, 3/16, 4/12 and 1/8 failures. Unloaded it passed 6/6 and 20/20. Diagnostics captured the row name, its in-flight `translate3d`, the menu moving from below to beside the button, and the late message-box mount. Hit tests at the overlap points returned the message box. - With the fix, under the same load: `pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --workers=1 -g "large themed tools scroll" --repeat-each=16` → 16 passed. - Unloaded, the requested proof: same command with `--repeat-each=10` → 10 passed, 0 failed. - Whole spec on both phone projects: `pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --project=mobile-chromium` → 27 passed, 5 skipped (the spec's existing project skips). - Negative check 1 (temporary local change, reverted): moved the open menu 80 px down so it really sits on the message box. The test fails with `overlap: ["menu:control:volume"], settled: true`. - Negative check 2 (temporary local change, reverted): added an endless 6 px CSS jiggle to the Chat tools button. The test fails with `settled: false`, so a bubble that never settles is not measured at a lucky moment. - `pnpm check` passed on the commit. - Local CodeRabbit (`coderabbit review --agent --committed`, CLI 0.7.6) on the commit: review completed, 0 findings. Independent verification (second agent, same machine, branch head `15c699193`): - Deterministic replay of the late mount: hid the game message box, opened Chat tools, then showed the box again, sampling every frame. For 2 frames the menu was still below its button and `control:volume` really covered the box (all hit-test samples landed on it). From then until ~340 ms, `control:session` and `control:volume` glided from `translate3d(-120px, 204px)` to none with unclipped boxes over the message box, but 0 hit-test samples were visible (clipped by the list). A screenshot taken mid-glide shows only the lock button in the menu column. - Same replay, 15 times per run: staging's measurement failed 15/15 on `control:session` (WebKit and Chromium, and 45/45 under CPU load). The new helper failed 0/15 per run (0/45 unloaded and 0/45 under load on WebKit, 0/15 on Chromium). - Natural reproduction: staging's spec under CPU load (12 `yes` processes) failed 1/12 with the original `[null]`. Its trace shows every Chat tools row (`LI[data-chat-tools-menu-item]`) carrying `translate3d(-120px, 204px)` during the steps just before the check. The branch under the same load passed 16/16. - The assertion can still fail: a temporary app mutation that sizes the menu against the whole screen instead of the phone bounds fails the test on WebKit and Chromium with `{ settled: true, overlap: ["menu:control:volume"] }`. An endless CSS jiggle on the launcher fails with `settled: false` on both engines. - `pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --workers=1 -g "large themed tools scroll" --repeat-each=10` → 10 passed. - Whole spec, mobile-webkit + mobile-chromium → 27 passed, 5 skipped, both on the branch and on a local merge with current `staging` (241ee8f2d; not pushed, since the PR has no conflicts). - `pnpm check` → exit 0. - All probes and mutations were temporary and reverted; the branch is unchanged. ### Manual verification notes - Manually verify in CI that the `mobile-webkit` e2e shard passes `phone-bubbles.e2e.ts` › "large themed tools scroll inside a short phone viewport without covering their trigger". - Manually verify locally: `pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --workers=1 -g "large themed tools scroll" --repeat-each=10` reports 10 passed. For a harder run, repeat it while the CPU is busy (for example, other test suites running). - GitHub CodeRabbit was rate limited on this PR and has not reviewed it yet; the e2e browser jobs show as skipped here, so they are not a pass. - Optional: manually verify on a phone that if you open Chat tools in a game chat while it is still loading, the tool buttons slide in beside the button inside the menu. Expect at most a brief flash (about 2 frames) of the menu over the message box before it moves, as described above. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Agent note: test-only change. No docs, CHANGELOG or translation impact. ## UI evidence (if applicable) Not a UI change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:05:59 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7627
No description provided.