Skip to content

test(shell-live): clicks wait for a still, hittable target (fixes the mascot-sheet flake that turned main red) - #789

Merged
kh0pper merged 1 commit into
mainfrom
fix/shell-live-click-stable
Nov 6, 2026
Merged

kh0pper merged 1 commit into
mainfrom
fix/shell-live-click-stable

Conversation

@kh0pper

@kh0pper kh0pper commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Fixes the flaky tests/shell-live.test.js test "the mascot opens ONE sheet …", which turned main red and so stopped every instance's auto-update. It failed 2 of 3 recent suite runs, timing out at "the talk overlay, the sheet closed".

Cause

The merged mascot sheet refills its notification list with a fetch every time it opens. The sheet is a bottom-anchored dialog, so when the fetch lands after OPEN_SHEET is already true, its rows move. The test's click(sel) measured the target's centre once and clicked there, so under CI load it could hit empty space or a neighbouring element, and the Talk row never received the click.

Fix (test-only)

  • click() and hold() now wait, for up to 3 s, until the target's centre is the same across two frames AND document.elementFromPoint at that point is the target or inside it. If that never happens, they throw an error naming the selector and the last two positions, so a future layout problem fails clearly instead of flaking.
  • On the second opening, the test now waits for the notification list before clicking the Talk row, as it already did on the first opening.

No product code changes.

Tests

tests/shell-live.test.js ran 3 times in the sandboxed runner with headless Chrome: 19 pass, 0 fail, 1 skip each time (the screenshots test, which only runs with SHELL_SHOTS_DIR). The public hygiene check passes.

Implemented by the Pi coding agent from a controller brief and reviewed by the controller (test-only, 25 lines).

https://claude.ai/code/session_01N9fXzvNy8rCEArj1y5p6fp

… pointer, fixing the mascot-sheet flake

The merged sheet refills its notification list from a fetch every time it
opens; when that lands after OPEN_SHEET, the bottom-anchored sheet's rows
move and a click measured once lands on empty space (the "talk overlay"
wait then times out). click()/hold() now wait for the centre to be stable
across two frames and hit by elementFromPoint; the reopen also waits for
the list, as the first open already did. Test-only.

Claude-Session: https://claude.ai/code/session_01N9fXzvNy8rCEArj1y5p6fp
@kh0pper
kh0pper merged commit e861e55 into main Nov 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant