Skip to content

[Brew] Finished toasts no longer keep a Cancel button - #33036

Merged
nhojb merged 1 commit into
raycast:mainfrom
dibas-np:brew/finish-toasts-in-place
Nov 3, 2026
Merged

nhojb merged 1 commit into
raycast:mainfrom
dibas-np:brew/finish-toasts-in-place

Conversation

@dibas-np

@dibas-np dibas-np commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #30201 in the Brew extension. Also done: the "Finish action toasts in place again" item in the extension's TODO.md.

When an install finished, Brew could leave its progress toast on screen ("Installing Tinycast / Operation completed successfully") with a Cancel button that no longer did anything, instead of showing "Installed Tinycast". Brew finished an action toast by replacing it with a new showToast. A progress update sent in the same tick could land on top of the replacement, because Raycast's toast updates act on whichever toast is visible.

Brew now finishes the toast in place, as TODO.md planned and as most Raycast extensions do. settle in src/utils/toast.ts sets the toast's style and title and clears its message and both actions, so Cancel goes away with the progress text. With Close After Action on, nothing changes: the toast is hidden and a HUD is shown.

Other changes:

  • New src/utils/toast.test.ts: a finished success or failure toast is the same toast, with no message and no Cancel, and Close After Action still shows the HUD. The first two cases fail before this change.
  • confirmAndRun.test.ts: the progress-label test now reads the title while the command runs. The toast it read afterwards now holds the final title.
  • AGENTS.md: the toast note now describes the in-place finish and why replacing the toast was dropped. TODO.md: removed the finished item. CHANGELOG.md: new entry.

Testing

  • npm test: 423 tests pass.
  • npm run lint and npm run build pass.
  • By hand in Raycast, with the distribution build from npm run build: installed the sl formula from Search. The toast ended on "Installed sl" with no Cancel button.

Not checked by hand: a cask from a third-party tap (the case that first showed the bug) and the Close After Action path, which the unit test covers. The unit tests check the toast's final state, not Raycast's on-screen timing.

Screencast

Checklist


Written with Claude Opus 5.5 (claude-opus-5-5) in Claude Code.

🤖 Generated with Claude Code

A finished install could stay on its progress toast, "Installing ... /
Operation completed successfully", with a live Cancel button. settle() finished by replacing the toast with showToast, and a progress update sent in the same tick could land on top of the replacement.

settle() now finishes the toast in place: it sets the style and title and clears the message and both actions. Close After Action still hides the toast and shows a HUD.
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: brew Issues related to the brew extension platform: macOS labels Nov 2, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your first contribution! 🎉

🔔 @nhojb @Aayush9029 @mathieudutour @urwrstkn8mare @ashokbaruaakas @MillerApps @pernielsentikaer @jfkisafk @vpukhanov @j3lte @alexander-cato @ViGeng @ridemountainpig @chrismessina @clins1994 @alexibuild you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="brew/finish-toasts-in-place"
FORK_URL="https://github.com/dibas-np/extensions.git"
EXTENSION_NAME="brew"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Brew now finishes action toasts in place instead of replacing them.

  • Brew action toasts finish in place without a leftover Cancel button.

No actionable issues found. Tests and Raycast UI checks were not run during this review.

Known deferral: dibas-np retains “Give progress toasts an owner” in TODO.md. It describes interference between unrelated toasts and remains outside this fix.

Reviews (1) · Last reviewed commit: "[Brew] Finished toasts no longer keep a ..." · Reviewed by Greptile

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

Thanks for the fix 😄

Only thing I noticed was this JS error each time after installing a formula. I don't see this in the published version of brew, but it might just be a local error. I can't see how these changes could trigger the issue 🤔

Image

@dibas-np

dibas-np commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@nhojb I looked into the socket idle timeout. The index.js:44 frame is inside Raycast.app's @raycast/api runtime, which bundles undici and uses it as the global fetch. The error comes from undici's HTTP/2 idle-connection timer.

It's a known undici bug, nodejs/undici#5936. When undici closes an idle connection, Node can pass the error to a stream that undici already released. That stream has no error listener, so the error goes uncaught. The fix, nodejs/undici#5983, merged on Oct 22 but isn't in a release yet.

The crash depends on timing, which would explain why you saw it locally and not in the store build. Brew only reaches this code through the fetch calls in cache.ts, and this PR doesn't touch those.

@nhojb

nhojb commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thanks - all good then. I thought it might be something about my local dev env.

@nhojb
nhojb merged commit cbfc3f6 into raycast:main Nov 3, 2026
12 checks passed
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

Such a great contribution deserves a reward, but unfortunately we couldn't find your Raycast account based on your GitHub username (@dibas-np).

Please link your GitHub account to your Raycast account to receive your credits and soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: brew Issues related to the brew extension extension fix / improvement Label for PRs with extension's fix improvements platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Brew] "Operation completed successfully" but toast still offers "cancel"

3 participants