Skip to content

Preserve update notice clicks through refresh - #3555

Merged
kazemek21 merged 2 commits into
mainfrom
kylez_plugin_update_notice_action
Nov 20, 2026
Merged

kazemek21 merged 2 commits into
mainfrom
kylez_plugin_update_notice_action

Conversation

@kazemek21

@kazemek21 kazemek21 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Use one pending action for the notice and Profile → Plugins. Disable competing Update items while preserving Manage plugins.
  • Show Preparing update… while a check or another review holds the request. Later or Dismiss cancels it, including menu requests after Later hid the notice.
  • Keep the pending button keyboard-focusable and return menu reviews to the surviving Profile button. Ignore late results after cancellation or unmount.
  • Preserve the review lease, freshness and access checks, explicit confirmation, notification-body navigation, and signed-managed automatic-update notices. The button never installs an update by itself.

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.

  1. Choose Later, then Profile → Plugins → Update Notes while the slot is held. Keyboard access uses ArrowDown, ArrowRight, then Enter.
  2. Expect Preparing update…. Reopen Profile → Plugins: competing Update items are disabled; Manage plugins remains available.
  3. Close the menus, choose Later or Dismiss on the notice, then release the fixture hold. No review or installation follows.
  4. Retry Profile → Plugins → Update Notes. Exactly one explicit review opens; Close returns focus to Profile. Nothing installs before confirmation.

This scenario does not record human or native verification. The repository readiness checklist still applies.

Synthetic interaction captures

notification-before
notification-refresh
notification-review

Related work

  • #2963 adds runtime plugin-origin permissions; its changes do not alter this update-notice action.
  • #2762 adds shared Markdown and panel workspaces; its changes do not alter this update-notice action.
  • #2983 adds the controlled document editor and browser coverage in the shared import spec; this PR keeps the notification-action journey separate.
  • #2621 shares plugin update discovery and results between notifications and Settings; this PR leaves that shared reconciliation path untouched.

Generated with Codex (gpt-6.1-sol) on behalf of kylez.

Co-authored-by: Codex (gpt-6.1-sol) <noreply@openai.com>
Signed-off-by: Kyle Zemek <kylez@squareup.com>
@kazemek21
kazemek21 force-pushed the kylez_plugin_update_notice_action branch from 6c3399a to 1dacf66 Compare November 20, 2026 01:37
matt2e added a commit that referenced this pull request Nov 20, 2026
)

## 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>
@kazemek21
kazemek21 marked this pull request as ready for review November 20, 2026 15:15
@kazemek21
kazemek21 requested a review from a team as a code owner November 20, 2026 15:15

@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 — 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.

Comment thread src/app/PluginUpdates.tsx Resolved
Comment thread src/app/PluginUpdates.tsx Resolved
Comment thread src/app/PluginUpdates.tsx Resolved

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 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.

Comment thread src/app/PluginUpdates.tsx Resolved

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 The Profile focus tests do not detect the focus-ownership regression; please strengthen the fixture and queued-review coverage.

Comment thread src/app/PluginUpdates.test.tsx Resolved
- 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>
@kazemek21

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback from reviews 5995109867, 5995154599, and 5995239764 in 455ee6a:

  • Pending notice cancellation during multi-repo checks (src/app/PluginUpdates.tsx): kept the captured pending update notice mounted with Later and Dismiss until it settles or is cancelled, even if its candidate disappears or errors while another repository check is still running.
  • Synchronous Dismiss cancellation (src/shared/design-system/ui/Toast.tsx): ToastNotice now invokes its single-shot onDismiss handler synchronously on X button activation so an in-flight refresh or review lease cannot race past dismissal.
  • Request-owned Profile focus & fixture hardening (src/app/PluginUpdates.tsx, src/app/PluginUpdates.test.tsx): stored returnFocus on PendingNotificationAction, updated the test fixture's Profile trigger to return a stable element ref, and added preceding-queue focus coverage.
  • Newer candidate during stale refresh (src/app/PluginUpdates.test.tsx): pinned that a newer candidate discovered during refresh opens an explicit confirmation dialog for the refreshed candidate without auto-installing.

All 71 tests in src/app/PluginUpdates.test.tsx, 18 tests in src/shared/design-system/ui/Toast.test.tsx, 211 design-system tests, typecheck, design:typecheck, design:check, and all pre-commit/pre-push hooks passed locally.

— Posted by Antigravity (Gemini 4 Neon) on behalf of kylez

@gilgtm gilgtm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 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)]

@kazemek21
kazemek21 merged commit 70ad400 into main Nov 20, 2026
84 checks passed
@kazemek21
kazemek21 deleted the kylez_plugin_update_notice_action branch November 20, 2026 16:26
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>
LordMelkor added a commit to LordMelkor/buzz-app that referenced this pull request Nov 20, 2026
* 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
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.

5 participants