Skip to content

test(browser): dismiss the profile notice before closing Settings - #4039

Merged
matt2e merged 1 commit into
mainfrom
fix/settings-profile-toast-close-flake
Nov 20, 2026
Merged

matt2e merged 1 commit into
mainfrom
fix/settings-profile-toast-close-flake

Conversation

@matt2e

@matt2e matt2e commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Problem

tests/browser/settings.spec.mjs "Settings loads and publishes the selected community profile" sometimes fails in WebKit. The click on Close Settings in closeSettings times out after 10 s, and for the whole time Playwright reports that the "Profile updated" notice (.buzz-toast under #buzz-toast-root) intercepts pointer events.

Seen in run 44642769572, job 135978173806 ("Browser journeys (webkit, 5/18)") on a branch that does not touch Settings, toasts or this spec.

Root cause

This is a race in the test, not a change in app behaviour.

  • Notices are drawn above dialogs (--layer-toast 1050 over --layer-dialog 1001). At the 1440×950 test viewport the settled notice covers x 1012–1432, y ≈ 94–148. Close Settings is at x 1231–1263, y 126–158, so its centre (1247, 142) is under the notice.
  • The test waited only for the notice to be visible. That is already true while it slides in from above the window.
  • Usual, passing order: the click finds the settled notice in the way and retries until the notice expires after its 5 s timeout. The pointer has not moved, so the timer runs. Measured locally: closeSettings took 5.3 s.
  • Failing order: the click starts while the notice is still sliding. Playwright's hit-target check passes, the pointer moves to Close, and the notice settles under the pointer before the press. Sonner holds a notice's expiry while the pointer is over it, so the notice never leaves and every retry is blocked. The CI log matches this: only the first attempt reaches "performing click action", so its check passed before the pointer moved.

Fix

The test now waits for the notice to settle, hovers it and presses its Dismiss notification button, then closes Settings. This is the sequence plugin-import.spec.mjs already uses for a notice. The test no longer depends on the notice's timer and no longer waits about 5 s for it.

No product code changes. No browser cases added or removed.

Verification

Local, macOS, Playwright 1.63.0, --workers=1, on main at 03abdc7:

  • Fail before, forced: with a temporary probe that moved the pointer onto the centre of Close Settings once the notice was visible, the unchanged test failed with the same error as CI (10 s click timeout, notice still present). Without the pointer move it passed after waiting 5.3 s. The probe is not part of this PR.
  • After: the test passed 15/15 in WebKit and 5/5 in Chromium with --repeat-each. It runs in about 7 s, down from about 14.5 s.
  • All of settings.spec.mjs passed in WebKit (16 tests). biome check on the file is clean.

Not verified:

  • The failure was not reproduced by natural timing locally: 5/5 unchanged runs passed. The failing order was forced with the probe.
  • Not run on Linux WebKit, where CI saw it. This PR's hosted checks cover that.

Notes

  • A notice that lands over Close Settings and stays while the pointer rests on it is also what a person sees after saving a profile at this width. Changing that is a design decision about the notice stack and is left out of this fix.
  • Another test, "one notification-button click opens a review after a concurrent update check" in Preserve update notice clicks through refresh #3555, fails at the same closeSettings click. Its cause is different: that test asserts a notice with no expiry is visible and then clicks Close Settings beneath it. It is not changed here.

🤖 Generated with Claude Code

"Settings loads and publishes the selected community profile" could time
out in WebKit clicking Close Settings, with the "Profile updated" notice
reported as intercepting pointer events for the whole 10 s.

The notice is drawn above dialogs and, at the 1440px test viewport, lands
over the centre of Close Settings. The test only waited for the notice to
be visible, which is already true while it slides in. Usually the click
found the settled notice in the way and waited about 5 s for it to expire.
When the click started during the slide, the hit-target check passed, the
pointer moved to Close, and the notice settled under it. A pointer resting
on a notice holds its expiry, so the notice never left and the click timed
out.

The test now waits for the notice to settle, hovers it and presses its
Dismiss button, as plugin-import.spec already does, then closes Settings.
This no longer depends on the notice's timer and removes the 5 s wait.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@matt2e
matt2e requested a review from a team as a code owner November 20, 2026 01:27

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord: Ready for Wes’s approval at 67c73ec. The test dismisses the success notice before clicking Close Settings and preserves the profile publication assertions. Source review only. The hosted WebKit job was in progress at the review snapshot.

@matt2e
matt2e merged commit 3bad1e2 into main Nov 20, 2026
59 checks passed
@matt2e
matt2e deleted the fix/settings-profile-toast-close-flake branch November 20, 2026 02:16
aepifano-square added a commit that referenced this pull request Nov 20, 2026
…ser-balance

* origin/main: (37 commits)
  Preserve update notice clicks through refresh (#3555)
  feat(agents): compose the base prompt with the owner's section choices (#3813)
  feat(codex): send a resumed thread the base sections that changed (#3812)
  feat(search): rerank message results with the Decisions API (#3748)
  fix(messages): inset the settled agent outcome in Compact density (#3925)
  perf(sidebar): select the Solo label mask by class, not [class~=] (#4067)
  test(browser): jump the frozen page clock in the agent-outcomes journey (#4062)
  Preserve the default sidebar order when upgrading (#4041)
  Let macOS Beta opt in to Web Inspector (#4035)
  feat(agents): pick the working location rule from where the conversation works (#3811)
  feat(agents): state one order of precedence in the base prompt (#3810)
  Upgrade Virtua to 0.54.2 and drop patch hunks fixed upstream (#4003)
  test(browser): dismiss the profile notice before closing Settings (#4039)
  Keep Solo sections closed until disclosed (#4004)
  Order notification fixture messages after the read frontier (#4026)
  fix(avatars): paint ready avatar artwork on the first frame (#3990)
  fix(messages): re-adopt decoded images in every display of a source (#4005)
  fix(threads): keep the unread line through a late thread route (#4013)
  fix(threads): resume a thread opened from the timeline (#4001)
  fix(presence): keep unexpired status when member rows remount (#3981)
  ...

Signed-off-by: Alex Epifano <aepifano@squareup.com>
Co-authored-by: github-enterprise-admin <5016e041c0895516b8c714b80ede89b8a4007c6083dd8737dce174359fde12b5@buzz.block.builderlab.xyz>
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.

2 participants