Skip to content

improve(ui): rebuild toasts on one component with variants and a hover dismiss - #192013

Merged
roboclaw-bot merged 2 commits into
mainfrom
brzezowski/toast-component
Nov 4, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
brzezowski/toast-component

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Toasts in the Control UI had no shared anatomy: errors tinted the whole card red, success and warning icons were blue, a long action label wrapped inside a 35% column, and the dismiss X sat in the row taking space from the message.

User Impact

Every toast now uses one component:

  • A leading slot (status icon or agent avatar), a title, an optional muted description, an action, and a dismiss X that appears on the top-right corner only on hover or focus.
  • Variants: neutral (no icon), success, info, warning, error and progress. The only signal is the icon color; the card stays neutral. Errors announce with role="alert".
  • One button: a 28 px pill. Primary (terracotta fill) is opt-in through actionPrimary.
  • One line is a pill; two or more lines use a 28 px corner. Width hugs the content between 240 and 360 px. Themes with square corners keep them.
  • The action stays beside the text only while the text fits one line next to it; otherwise it moves to its own row, right aligned.

Existing callers keep working; the three that passed an icon now pass the matching severity.

Why This Change Was Made

This is the approved toast design, split into four stacked PRs. This one is the component; placement and stacking follow in the next PR.

Evidence

Mock Control UI, Absolutely light, 1440 and 390, reached through real clicks (archive from the sidebar, an oversized upload, a background session finishing).

Before and After, Session archived:

Before: Session archived After: Session archived as a pill

Hover shows the dismiss X on the corner:

After: hover with the dismiss X

Before and After, an error: the red card becomes a neutral card with a red icon:

Before: red error card After: neutral card with an error icon

Before and After, a background session with an avatar; the action moves to its own row when the title does not fit beside it:

Before: background session toast After: background session toast

After, 390:

After: error toast at 390

Checks run locally: oxfmt, oxlint, stylelint, pnpm tsgo:ui, toast.test.ts, toast-host.loading.test.ts and toast.browser.test.ts (all pass). The attachment e2e helper that asserted the red card now asserts the icon color; e2e was not run.

Landing order: this PR first, then the stack (#192014), center callers (#192015) and arrivals (#192016).

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR redesigns Control UI toasts with severity icons, optional descriptions, wrapping actions, and a dismiss button revealed by hover or focus.

Example: Uploading an oversized file in the Control UI.

  • Before: “File too large. Try a smaller file.” appears on a red-tinted card.
  • After: The same message appears on a neutral card with a red error icon.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Good visual proof and a focused use of existing owners, with two concrete repairs required.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The linked before/after screenshots exercise the changed Solid toast renderer through archive, oversized-upload, and background-session flows in the mock Control UI at desktop and phone widths, visibly showing the new anatomy and hover dismissal.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Toast styling and action layout vary, and long actions compete with notification text.
Reason: The maintainer-authored PR supplies the direction decision and keeps this stage focused on toast anatomy; placement and stacking are explicitly owned by subsequent PRs.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this PR open: the maintainer-approved redesign has useful visual proof, but oversized-message scrolling and the CSS budget need repair before merge.

Priority: P2
Reviewed head: 8c5b9cf3eb9eb27f1526e60882dedbf42f24f5ef

Before merge

  • [P2] Keep the beginning of oversized toast messages reachable (P2) - At a 320×400 viewport, the existing long-message case ("Lost. ".repeat(1000)) exceeds the body's 160px height cap. The message is now a flex child with its content-based minimum height, while justify-content: center distributes the overflow above and below the scroll container. The opening text can therefore sit above the reachable scroll origin. Previously the message itself scrolled without this centering. Use start alignment or overflow-safe centering and extend the existing browser case to verify both ends remain reachable; MDN documents the safe alignment behavior.
  • [P2] Fit the toast styles within the existing CSS budget (P2) - The added toast styling makes the exact-head performance check fail its raw and compressed CSS limits. The annotations report 1617.3 KiB raw against 1616.3 KiB and 313.6 KiB gzip against 313.3 KiB; the same check compares the base and permits only 64 bytes of variance when the base already exceeds its cap. Reduce or consolidate these styles so the existing performance gate passes without raising its budget.

Findings

  • [P2] [P2] Keep the beginning of oversized toast messages reachable — ui/src/styles/components.css:843-847
  • [P2] [P2] Fit the toast styles within the existing CSS budget — ui/src/styles/components.css:669-674

Tests

  • Missing end-to-end proof: The supplied screenshots do not exercise oversized scrolling, and the browser test checks scrolling toward the end without proving that the opening text remains reachable.
Agent review details

How this fits together

Control UI callers send notification options to the existing toast owner, which manages timing and placement while a lazy Solid view renders messages and actions.

flowchart LR
  A[Control UI actions] --> B[Toast options]
  B --> C[Toast owner]
  C --> D[Toast host]
  D --> E[Lazy Solid view]
  E --> F[Message and action controls]
  F --> C
Loading

Technical review

Best possible solution:

Keep the existing toast owners and approved presentation, make oversized content align safely, and reduce the stylesheet enough to satisfy the existing asset budget.

Do we have a high-confidence way to reproduce the issue?

The original appearance is visible in the before screenshots and current-main source; the oversized-text regression is source-reproducible from the new flex layout, but was not executed during this read-only review.

Is this the best way to solve the issue?

Extending the existing renderer and migrating its icon callers is appropriately scoped; overflow-safe alignment preserves recovery readability without adding another component or state owner.

Full review comments:

  • [P2] [P2] Keep the beginning of oversized toast messages reachable — ui/src/styles/components.css:843-847
    At a 320×400 viewport, the existing long-message case ("Lost. ".repeat(1000)) exceeds the body's 160px height cap. The message is now a flex child with its content-based minimum height, while justify-content: center distributes the overflow above and below the scroll container. The opening text can therefore sit above the reachable scroll origin. Previously the message itself scrolled without this centering. Use start alignment or overflow-safe centering and extend the existing browser case to verify both ends remain reachable; MDN documents the safe alignment behavior.
    Confidence: 0.91
  • [P2] [P2] Fit the toast styles within the existing CSS budget — ui/src/styles/components.css:669-674
    The added toast styling makes the exact-head performance check fail its raw and compressed CSS limits. The annotations report 1617.3 KiB raw against 1616.3 KiB and 313.6 KiB gzip against 313.3 KiB; the same check compares the base and permits only 64 bytes of variance when the base already exceeds its cap. Reduce or consolidate these styles so the existing performance gate passes without raising its budget.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a4d32afaaa32.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/lib/toast.test.ts src/lib/toast-host.loading.test.ts src/lib/toast.browser.test.ts
  • pnpm test:ui:e2e ui/src/e2e/chat-attachment-errors.e2e.test.ts
  • pnpm tsgo:ui
  • pnpm lint:ui:styles
  • Verify the control-ui-performance check passes on the repaired head.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit d912f0c adds ui/src/lib/toast-view.tsx:24 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d912f0c06e7a; files: ui/src/lib/toast-view.tsx)

PR surface

Source +179, Tests +46. Total +225 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 311 132 +179
Tests 3 85 39 +46
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 396 171 +225

Labels

Label changes:

  • add P2: This is a useful notification improvement with a bounded recovery-text regression and a concrete asset-budget failure.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a useful notification improvement with a bounded recovery-text regression and a concrete asset-budget failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 3, 2026, 10:42 AM ET / 15:42 UTC.

@roboclaw-bot
roboclaw-bot merged commit 1be3b6d into main Nov 4, 2026
78 of 82 checks passed
@roboclaw-bot
roboclaw-bot deleted the brzezowski/toast-component branch November 4, 2026 00:02
roboclaw-bot added a commit that referenced this pull request Nov 4, 2026
…nes (#192431)

Follow-up to #192013-#192016: unit tests still expected severity-less error toasts, single-line copy, and unwrapped toast markup.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…nes (openclaw#192431)

Follow-up to openclaw#192013-openclaw#192016: unit tests still expected severity-less error toasts, single-line copy, and unwrapped toast markup.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
vincentkoc added a commit that referenced this pull request Nov 4, 2026
* commit 'b4ebd3673fea4932296b92bbc07b7abc4bdc792d':
  fix(ci): allow serial SDK API reports to finish (#192196)
  fix(ci): run PostgreSQL checks when its shard planner changes (#191963)
  fix(ci): model native Linux updater asset entry
  improve(test): speed up config and device binding browser tests (#192404)
  improve(ui): show arrivals top right with a contextual session status (#192016)
  improve(ui): mark error toasts and split two-sentence copy (#192015)
  fix(sandbox): give dependency builders a writable home (#192390)
  fix(worktrees): keep archive manifest checks off the main thread (#192358)
  fix(cron): preserve admitted runs and pacing across unrelated MCP reloads (#192399)
  improve(ui): stack toasts in a center lane and an arrivals lane (#192014)
  fix: reclaim abandoned read-only database snapshots (#192368)
  improve(ui): rebuild the toast on one component with variants and a hover dismiss (#192013)
  docs: consolidate team server and team setup into one Multiplayer page
  fix(ci): reconcile remaining unallocated test lines
  feat: run admitted MCP tools on the worker node that hosts them (#191387)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants