FE-1651: Keep a notification without detail a single compact line - #9631
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
PR SummaryLow Risk Overview Toasts that need a way out keep the action column: anything with detail gets copy + close, and error toasts always get close (even without detail) because they stay until dismissed. The toast root sets Adds a provider test that asserts button/ Reviewed by Cursor Bugbot for commit 7a7ab75. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
The new detail/dismissible/data-detail logic is inconsistent when detail is an empty string, producing a “detail” layout/state without rendering the description/copy button.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adjusts Petrinaut’s toast notification rendering so “plain” messages (no detail) return to a compact, single-line appearance with no action buttons, while detailed and error notifications retain the expanded layout and affordances.
Changes:
- Center-align toast content by default, switching to top alignment only when the toast carries detail (via a
data-detailattribute). - Show close/copy actions only for notifications that are errors or that include detail.
- Add a unit test asserting button/attribute presence for plain vs detailed error notifications.
File summaries
| File | Description |
|---|---|
| libs/@hashintel/petrinaut/src/react/notifications/toaster.tsx | Updates toast layout/alignment and conditionally renders action buttons based on presence of detail or error type. |
| libs/@hashintel/petrinaut/src/react/notifications/provider.test.tsx | Adds coverage for “no detail => no buttons/attribute” and “error with detail => buttons + attribute”. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Before this PR, every notification carried the chrome a long error needs. #9564 gave the toaster a description column, a copy button and a close button so an AI assistant failure could be read and copied from the toast, and applied that shape to all of them. A three-second message with no detail, "Simulation complete" among them, rendered as a tall pill: title top-aligned in a column, close button beside it.
A notification without detail is a single centred line again, with no buttons, the form it had before. One that carries detail keeps the column, the copy button and the close button, and so does an error, which never dismisses itself.
Links
Changes
Test coverage
provider.test.tsx:How to test