Skip to content

fix(ui): keep Undo available while a toast is focused or hovered - #146940

Merged
roboclaw-bot merged 2 commits into
mainfrom
openclaw/ux-toast-20260913
Sep 13, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
openclaw/ux-toast-20260913

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What Problem This Solves

Fixes an issue where users lose the archive Undo toast after six seconds even while hovering over it or focusing its action with the keyboard.

Why This Change Was Made

The shared toast owner now pauses its existing expiry timer instead of making every caller manage interaction timing. Focus transfers between toast controls stay paused; explicit actions/dismissal, replacement, FIFO ordering, and modal relocation remain supported. True disconnection clears queued outcomes and timers. Existing archive Undo is unchanged; no new undo mechanism, persistent notification, stacking redesign, or global setting is introduced.

User Impact

Users can pause to read and activate Undo without losing the action or their focus to an automatic timeout. The toast resumes its remaining lifetime only after both pointer hover and keyboard focus leave. No migration or settings changes.

Related: #128270 is the broader operator-notice presentation work. This PR is limited to the current shared toast’s interaction-aware expiry and its regressions; it does not take over that redesign.

Evidence

  • Baseline: nine existing toast tests passed. Six added interaction/cleanup regressions failed on the unchanged owner (focused Undo expired; hover/focus overlap timed out; replacement ignored retained focus; queued outcome outlived host removal).

  • After: eighteen toast unit tests passed, including remaining-time precision, both hover/focus exit orders, internal focus transfer, FIFO/replacement, explicit action/dismiss, reduced motion, removed action focus, modal relocation, disconnection cleanup, and hover state reset after removal. Independent review caught the latter; a failing-before/passing-after regression now protects it.

  • Chromium real-wall-clock component proof: baseline Undo disappeared around 6.6s while focused; fixed Undo remained focused beyond 6.5s and expired only after focus left plus its remaining lifetime. Actual shared toast and production styles with synthetic archive data; not full-app, mock-Gateway, or live-production E2E. Timestamped captures and assertions supplied with this change.

  • Two existing Chromium toast layout tests passed; 48 archive/annotation caller tests passed.

  • Changed-check guards, i18n, core-test typecheck, UI typecheck, and dead-export scans passed. The run found four missing test-only braces; those were corrected mechanically, then scoped oxlint (0 warnings/errors), stylelint, formatting, and all 18 toast tests passed.

  • Independent autoreview: final P0–P2 scope clean after resolving its stale-hover finding. Full application build/live-Gateway proof was not run for this timer-only change.

Before / after

Actual toast component, synthetic archive action, real elapsed time.

Before: Undo disappears while focused After: Undo stays while focused
Before at 6.6 seconds After at 6.6 seconds

After focus leaves, the remaining lifetime resumes and the toast expires normally:

Normal expiry after interaction

Worked on by: @vincentkoc

Team session

Pause the shared toast expiry budget during pointer hover or focus within, and resume only after both end. Preserve replacement, FIFO, explicit actions, relocation, and cleanup.

Co-authored-by: vincentkoc <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 13, 2026 10:37
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 9:12 AM ET / 13:12 UTC (Revision 2).

ClawSweeper review

What this changes

The shared Control UI toast pauses automatic dismissal during hover or keyboard focus, resumes the remaining time afterward, and clears queued notifications when removed.

Merge readiness

✅ Ready for maintainer review

The prior shadow-root focus finding is resolved, and no blocking defect remains in the reviewed patch. The fix is still needed on current main; the broader notice redesign does not supersede it.

Priority: P2
Reviewed head: 7db84d74cf0790157c3cc1928cc88261265bb890

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level fix with useful browser evidence and regression coverage; the previous blocking finding is addressed.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The inspected Chromium component captures and reported real elapsed-time assertions demonstrate the actual shared toast retaining focused Undo beyond expiry and dismissing after focus leaves. This supports the visible timer behavior; the new shadow-root cases have supplemental regression coverage, not a claimed full-app run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The inspected Chromium component captures and reported real elapsed-time assertions demonstrate the actual shared toast retaining focused Undo beyond expiry and dismissing after focus leaves. This supports the visible timer behavior; the new shadow-root cases have supplemental regression coverage, not a claimed full-app run.
Evidence reviewed 9 items Current main still needs the fix: The complete current-main toast owner starts an unconditional timeout in show() and has no hover or focus pause handlers.
Latest release comparison: The v2026.9.4 toast owner also uses unconditional expiry; this requested behavior is not present in the supplied latest release.
Prior finding addressed: The exact-head commit replaces document-only focus detection with current-root detection and adds shadow-root hover-exit, render-update, and relocation regressions. This satisfies the retained prior finding and rank-up move.
Findings None None.
Security None None.

How this fits together

Control UI actions send messages and optional recovery callbacks to the shared toast host. That host presents notifications across the app, drawers, and modals, and controls when actions such as Undo disappear.

flowchart TD
  A[UI action outcome] --> B[Shared toast host]
  B --> C[App or modal placement]
  C --> D{Hovered or focused?}
  D -->|Yes| E[Pause remaining lifetime]
  D -->|No| F[Resume expiry timer]
  E --> D
  F --> G[Dismiss and advance queue]
  C --> H[Undo or explicit dismiss]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +54, Tests +271. Total +325 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 59 5 +54
Tests 1 271 0 +271
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 330 5 +325

Review metrics

None.

Technical review

Best possible solution:

Keep interaction-aware expiry in the shared toast owner while preserving caller-owned recovery actions and existing dismissal semantics.

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

Yes: current main unconditionally dismisses the toast after six seconds even when Undo holds focus, matching the supplied browser baseline. This review verified the source path without running target code.

Is this the best way to solve the issue?

Yes: extending the existing timer owner avoids caller-specific timers and preserves the existing Undo mechanism; the updated root-aware focus check resolves the prior review concern.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The inspected Chromium component captures and reported real elapsed-time assertions demonstrate the actual shared toast retaining focused Undo beyond expiry and dismissing after focus leaves. This supports the visible timer behavior; the new shadow-root cases have supplemental regression coverage, not a claimed full-app run.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This fixes a bounded accessibility and recovery-action problem where an actively focused Undo control expires.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The inspected Chromium component captures and reported real elapsed-time assertions demonstrate the actual shared toast retaining focused Undo beyond expiry and dismissing after focus leaves. This supports the visible timer behavior; the new shadow-root cases have supplemental regression coverage, not a claimed full-app run.
  • proof: sufficient: Contributor real behavior proof is sufficient. The inspected Chromium component captures and reported real elapsed-time assertions demonstrate the actual shared toast retaining focused Undo beyond expiry and dismissing after focus leaves. This supports the visible timer behavior; the new shadow-root cases have supplemental regression coverage, not a claimed full-app run.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The inspected Chromium component captures and reported real elapsed-time assertions demonstrate the actual shared toast retaining focused Undo beyond expiry and dismissing after focus leaves. This supports the visible timer behavior; the new shadow-root cases have supplemental regression coverage, not a claimed full-app run.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-13T10:44:17.811Z sha 2666d99 :: needs changes before merge. :: [P2] Resolve focus from the toast's current root

Resolve toast focus against its current root during hover exit, render updates, and relocation. Add failing-before shadow-root regressions and retained-focus relocation coverage.

Co-authored-by: vincentkoc <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. labels Sep 13, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

The shadow-root focus finding is repaired in 7db84d74cf0790157c3cc1928cc88261265bb890. The timer resolves focus from the toast’s current Document or ShadowRoot and preserves explicit focus-out overrides. Hover exit, rerender and relocation no longer restart expiry while Undo remains focused.

Verification: 38 targeted tests across two suites, two canonical browser tests, and fresh independent P0–P2 review passed. The interrupted combined check is not claimed as an exit-zero run; its remaining lint, style and three dead-export lanes completed separately.

Inspected real-wall-clock proof uses the actual toast in a synthetic shadow-root host, not a live Gateway:

Before repair: focused Undo expires After repair: focused Undo remains
Before shadow-root focus repair After shadow-root focus repair

Normal expiry after focus leaves

@roboclaw-bot
roboclaw-bot merged commit 1c63692 into main Sep 13, 2026
130 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@roboclaw-bot
roboclaw-bot deleted the openclaw/ux-toast-20260913 branch September 13, 2026 14:57
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…nclaw#146940)

* fix(ui): keep Undo available while a toast is focused or hovered

Pause the shared toast expiry budget during pointer hover or focus within, and resume only after both end. Preserve replacement, FIFO, explicit actions, relocation, and cleanup.

Co-authored-by: vincentkoc <[email protected]>

* fix(ui): preserve focused Undo inside shadow-root modals

Resolve toast focus against its current root during hover exit, render updates, and relocation. Add failing-before shadow-root regressions and retained-focus relocation coverage.

Co-authored-by: vincentkoc <[email protected]>

---------

Co-authored-by: vincentkoc <[email protected]>
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 maintainer Maintainer-authored PR 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant