Repository navigation
Preserve update notice clicks through refresh - #3555
Conversation
bf22dcd to
c5a2774
Compare
Co-authored-by: Codex (gpt-6.1-sol) <noreply@openai.com> Signed-off-by: Kyle Zemek <kylez@squareup.com>
6c3399a to
1dacf66
Compare
) ## 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](https://github.com/block/buzz-app/actions/runs/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 #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](https://claude.com/claude-code) Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord — changes needed at 1dacf66. The pending update can lose its cancel controls, race past a Dismiss click, or lose its Profile focus target. This was a source review, and the PR description still lists human confirmation as outstanding.
joahg
left a comment
There was a problem hiding this comment.
🤖 Logic looks sound: the pending click lives in an in-memory ref (nothing is persisted), is cleared on queue completion, failure, cancel, Later/Dismiss, store replacement and unmount, and the open() guard prevents a second click from double-queueing. After a refresh the click only opens an explicit review, never an install, and the refreshed candidate, enabled state, source and check choice are re-validated first. No FOUNDATION files are touched, and the new tests cover stale refresh, in-flight check, lease contention, cancel after Later/Dismiss, unmount, store loss and capacity. This changes what users see (the Preparing update… state, focusable disabled button, and new redirects to plugin settings), so it needs a design or core-team reviewer before merge.
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 The Profile focus tests do not detect the focus-ownership regression; please strengthen the fixture and queued-review coverage.
- Keep a pending plugin update notice mounted with Later and Dismiss while other repositories finish checking, even if its own candidate disappears. - Invoke ToastNotice onDismiss synchronously on Dismiss button activation so an in-flight refresh or review lease cannot race past X dismissal. - Store the Profile returnFocus getter on each pending notification request so a preceding queued review does not overwrite it. - Pin test coverage for synchronous ToastNotice X dismissal, disappearing multi-repo candidates, preceding-queue Profile focus ownership via a stable trigger ref, and newer candidates appearing during stale refresh. Co-authored-by: Antigravity (Gemini 4 Neon) <noreply@google.com> Signed-off-by: Kyle Zemek <kylez@squareup.com>
|
Addressed the review feedback from reviews 5995109867, 5995154599, and 5995239764 in 455ee6a:
All 71 tests in — Posted by Antigravity (Gemini 4 Neon) on behalf of kylez |
gilgtm
left a comment
There was a problem hiding this comment.
🤖 No P0/P1 findings in the deep-dual source review of this PR at 455ee6a against main@f37bdd33dc322f8c758cad5c11737745a0e1766a. The update action retains explicit confirmation and the existing freshness and access checks. Native and human acceptance remain outstanding as described in the PR.
Posted by duel-review skill [driver: codex(high), mode: deep-dual, review synthesized by codex(high)]
…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>
* origin/main: (110 commits) fix(emoji): paint remounted custom emoji in the first frame (block#4008) feat(messages): draw relayed agent messages as the agent's collapsed line (block#3978) perf: keep composer tools still while typing (block#4084) feat(github): wake PR watches once when approval is lost (block#3623) docs: point community invite at buzz.communities (block#4082) perf(sidebar): re-render for Recent activity only when the order changes (block#4055) Refine desktop toast entrance and dismissal (block#4075) feat(communities): reorder communities in the switcher by dragging (block#4030) test(perf): keep the rich thread's row count independent of a search preview (block#4049) test(relay): hold the signer clock at the thread-follows window edge (block#4038) fix(activity): hide ordinary activity from muted channels (block#3856) Open website links in the browser instead of navigating the Buzz window (block#4063) feat(messages): spring-load sidebar rows and thread summaries for file drags (block#4073) build(dev): optimize secp256k1 in debug builds (block#4080) fix(search): say how much Top results shows, and mark reranks with a sparkle (block#4057) Preserve update notice clicks through refresh (block#3555) feat(agents): compose the base prompt with the owner's section choices (block#3813) feat(codex): send a resumed thread the base sections that changed (block#3812) feat(search): rerank message results with the Decisions API (block#3748) fix(messages): inset the settled agent outcome in Compact density (block#3925) ... Signed-off-by: LordMelkor <kray@squareup.com> # Conflicts: # docs/plugin-authoring-guide.md # src/features/host/service.ts # vite.config.ts
TL;DR
The Update and reload button can lose its click when the candidate is stale or an update check is already running. Carry that click through fresh validation to an explicit update review, or plugin settings when the candidate is no longer usable.
What
Testing
Added one browser journey and removed none. It exercises the real Settings Check again action, a held in-flight check through the native-IPC fixture, layered keyboard dismissal, one notice click, an enabled explicit review, and no install before confirmation. Those app/fixture boundaries supplement the colocated React cases; they do not establish native Tauri behavior.
The complete affected file passed in Chromium and WebKit:
bin/pnpm test:browser tests/browser/plugin-import.spec.mjs --project chromium --project webkit --no-deps --workers=2(68 cases). The captures below show the notice, a narrow dark pending state with enlarged text, and the wide light review. Human confirmation remains outstanding.Profile-menu regression scenario
Fixture-only setup: a synthetic Git-sourced Notes plugin has an available update, and the fixture holds the update-review slot. Holding and releasing that slot are fixture operations; the menu and notice actions below use ordinary app controls.
This scenario does not record human or native verification. The repository readiness checklist still applies.
Synthetic interaction captures
Related work
Generated with Codex (gpt-6.1-sol) on behalf of kylez.