Skip to content

Agentic UI: Fix crash when a toast is replaced in place with a different shape - #4443

Merged
shaunandrews merged 2 commits into
trunkfrom
fix-toast-replace-in-place-crash
Aug 6, 2026
Merged

Agentic UI: Fix crash when a toast is replaced in place with a different shape#4443
shaunandrews merged 2 commits into
trunkfrom
fix-toast-replace-in-place-crash

Conversation

@shaunandrews

Copy link
Copy Markdown
Contributor

Related issues

  • None (split out of the stu-2162-site-header-actions exploration)

How AI was used in this PR

Claude Code cherry-picked this fix out of a larger exploration branch and verified it (the regression test, lint, typecheck) in isolation.

Proposed Changes

Fixes a crash that occurred when an app toast was updated in place and its content shape changed — for example, a running-sync toast transitioning into its success or failure result, where the result gains or loses a description. Previously React tried to update the existing Notice across that shape change and crashed; now the Notice re-mounts cleanly instead, so the toast transitions smoothly with no crash.

Testing Instructions

  1. Run the included regression test: npm test -- apps/ui/src/components/app-toasts/index.test.tsx — it exercises the toast-shape transition directly and must pass.
  2. Manual repro (optional): trigger a toast that starts in a running state with a description (e.g. a sync in progress), then let it transition to a result state without a description (e.g. success/failure), and confirm the toast updates cleanly with no crash.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shaunandrews shaunandrews changed the title Fix crash when a toast is replaced in place with a different shape Agentic UI: Fix crash when a toast is replaced in place with a different shape Aug 4, 2026
@shaunandrews
shaunandrews requested review from a team and bcotrim August 4, 2026 19:17
@shaunandrews
shaunandrews marked this pull request as ready for review August 4, 2026 19:17

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

I did not manage to reproduce this manually on my end but it looks good based on the regression test so approving this 👍

@shaunandrews
shaunandrews enabled auto-merge (squash) August 6, 2026 18:57
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 69be746 vs trunk

app-size

Metric trunk 69be746 Diff Change
App Size (Mac) 1402.95 MB 1402.95 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 69be746 Diff Change
load 1075 ms 1059 ms 16 ms ⚪ 0.0%

site-startup

Metric trunk 69be746 Diff Change
siteCreation 7526 ms 7537 ms +11 ms ⚪ 0.0%
siteStartup 2869 ms 2875 ms +6 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@shaunandrews
shaunandrews merged commit 784acb3 into trunk Aug 6, 2026
13 checks passed
@shaunandrews
shaunandrews deleted the fix-toast-replace-in-place-crash branch August 6, 2026 19:29
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.

3 participants