fix(web): add dismiss control for error toasts#897
fix(web): add dismiss control for error toasts#897binbandit wants to merge 2 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟢 Low
Issue on line in apps/web/src/components/KeybindingsToast.browser.tsx:419:
In the catch block at line 421, remounted.cleanup() is never called when an error occurs between lines 408–419. The cleanup only calls mounted.cleanup(), but mounted was already cleaned at line 407, leaving remounted resources leaked. Ensure remounted.cleanup() is called in the catch block before re-throwing.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/components/KeybindingsToast.browser.tsx around line 419:
In the catch block at line 421, `remounted.cleanup()` is never called when an error occurs between lines 408–419. The cleanup only calls `mounted.cleanup()`, but `mounted` was already cleaned at line 407, leaving `remounted` resources leaked. Ensure `remounted.cleanup()` is called in the catch block before re-throwing.
Evidence trail:
apps/web/src/components/KeybindingsToast.browser.tsx lines 400-426 at REVIEWED_COMMIT: Line 407 calls `await mounted.cleanup()`, line 408 creates `const remounted = await mountApp()`, line 420 calls `await remounted.cleanup()` in happy path, but catch block at lines 421-423 only calls `await mounted.cleanup().catch(() => {})` - missing `remounted.cleanup()` for errors between lines 408-419.
There was a problem hiding this comment.
Fixed in c73c714. The catch path now cleans up remounted before rethrowing, and I isolated this browser suite from the diff worker pool so CI no longer fails on unrelated worker initialization during repeated mount/unmount cycles.
Summary
Why
Validation
bun fmtbun lintbun typecheckbun run test:browser src/components/KeybindingsToast.browser.tsx -t "lets users dismiss the follow-up error toast from the keybindings warning action"bun run test:browser src/components/KeybindingsToast.browser.tsxstill reports a pre-existingWorkerPoolManager: workers failed to initializeunhandled rejection from@pierre/diffs/reactNote
Add dismiss button to error toasts in the web UI
ErrorToastDismissButton(anXIconclose control) to bothToastsandAnchoredToastscomponents in toast.tsx whentoast.type === 'error'.ToastCardContentcomponent to centralize toast layout and conditionally render the dismiss button.Macroscope summarized c73c714.