Skip to content

feat: show notices as corner toasts that leave or stay by level - #2629

Merged
yansfil merged 3 commits into
mainfrom
feat/notice-toast
Nov 18, 2026
Merged

yansfil merged 3 commits into
mainfrom
feat/notice-toast

Conversation

@yansfil

@yansfil yansfil commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Problem

When something goes wrong, Hide shows a strip across the window under the top row: a refused command, an unsaved close, a failed agent start, draft recovery.
Each strip pushes the whole screen down a line, and every one looks the same whether it only reports what happened or waits for the operator to act.
The operator asked for these to appear as toasts in the lower right corner instead: passing ones leave on their own, serious ones stay and look different.

Before → After

Before After
What the user gets One grey strip under the top row for every notice, until dismissed Toasts in the lower right corner, at two levels; the screen no longer shifts
Screen A full-width strip under the top row Corner notices: info (grey) and important (amber, stays), Light and Dark
Flow Notice appears → screen moves down → operator closes it Info notice appears → bar drains over 10 s, paused while hovered → leaves; important notice appears → stays until dismissed or its cause clears

The After capture is the production Toast part in the System gallery; the second image shows an info notice's countdown bar about 3 seconds in.

An info notice's bar drains over 10 seconds, here about 3 seconds in

  • Info (grey): a page that did not open, a command a disconnected device did not take, a refused View action, a revisit save that did not hold. Leaves after 10 s.
  • Important (amber border and mark): unsaved changes with Don't save, a close whose status is unknown, typed input lost, an agent Reopen that could not restart, agents waiting for room, a failed worktree removal or agent start, draft recovery, a refused agent close.
  • At most three of the shell's own notices; the oldest info one leaves first, and a repeated notice replaces itself.

Decide

  • The connection badge stays a full-width strip under the top row: while it shows, the whole window takes no input. Agreed with the operator in the session; say if it should move too.

Not verified

  • Not seen in a running app window: the captures are the gallery's production part, not a candidate app with a real failure.
  • The Playwright e2e specs that read these notices (s3.spec.ts draft recovery, s7.spec.ts Don't save) were not run locally; their data attributes are unchanged, and CI runs them.
Evidence
  • Verified: web typecheck, web lint, node scripts/check-design-contract.mjs (tokens, contrast, part counts) pass; unit tests ui.test.ts, toast.test.tsx, errorNotice.test.ts, remote.test.ts, RenderBoundary.test.tsx pass (38 tests).
  • Gallery Toast section captured in Light and Dark with headless Chromium; long Korean text wraps at word boundaries (break-keep).
Tests
  • Layer: unit. ui.test.ts holds the corner's cap, replacement and dismissal through useUiStore; toast.test.tsx holds the info countdown, its pause and resume, and that an important notice stays.
  • Catches: dropping the oldest notice regardless of level (planted: splice(0, 1), the cap test failed); a hold that restarts the whole count instead of resuming (the resume test expects it gone 1 s after leaving).
  • Repeat: ui.test.ts, toast.test.tsx, errorNotice.test.ts x 10 local runs, all green.
  • Waits: none; time is driven by vi.useFakeTimers.
Risky files
  • web/src/App.tsx - every window-wide notice moved from the column under the top row into one absolutely placed corner stack; each keeps its own render boundary.
  • web/src/ui.ts - the single notice slot became a capped list; callers that cleared it now dismiss by rule (refreshable, dontSave display, agent_capacity key).
Verification record
  • Base 7f624a962678, head e9d7ef696e6f.
  • Commands: bash scripts/verify-web.sh web typecheck, web lint, web test <5 files>, node scripts/check-design-contract.mjs.
  • sonner and its unused part components/ui/sonner.tsx removed; the gallery's Sonner section became Toast.
  • scripts/ui-parts-baseline.json lowered: DraftRecovery.tsx and WorkspaceDialogs.tsx no longer draw raw buttons.

@yansfil
yansfil added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 956d4a0 Nov 18, 2026
100 of 102 checks passed
@yansfil
yansfil deleted the feat/notice-toast branch November 18, 2026 13:59
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.

1 participant