Skip to content

improve: skip unused toast dismissal work - #147196

Merged
steipete merged 1 commit into
mainfrom
codex/perf-ui-toast-layout-main-7006
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf-ui-toast-layout-main-7006

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Related: #145679

What Problem This Solves

Toast actions, removal, and reduced-motion dismissal perform browser measurements that their immediate completion paths do not use.

Why This Change Was Made

Share the existing connected, positive-width anchor check and evaluate layout and media queries only when dismissal needs them. Animated dismissals still use live geometry and the current motion preference.

User Impact

Toast dismissal avoids unnecessary browser work while preserving placement, Undo callbacks, focus/hover pauses, queued outcomes, and animation completion. No configuration or visual behavior changes.

Evidence

  • All 21 existing toast unit cases and both Chromium placement cases passed without skips. Extended existing cases reproduce the unwanted geometry/media calls and verify that the final implementation avoids them while retaining the outcome assertions.
  • At proof base 5541c3d, the ordinary UI build/comparison measured 355,723 startup gzip bytes versus 355,744 for unchanged source. That local gate failed by 4 bytes against its then-current 355,719-byte limit. The failed result is retained. This PR changes no baseline, allowance, or comparison setting.
  • Local proof uses Node 24.19; hosted CI uses Node 24.20. Same-source hosted builds have also shown compressed-size variation. Main separately repaired the shared budget in #147116. This PR is based on 8baed117 and preserves the same two tested toast files; its first hosted UI gate passed at 355,103 startup gzip bytes against the inherited 356,316-byte limit. This integrated result includes newer main code and is not an isolated toast-size comparison. It does not claim credit for the independent budget repair.
  • Fresh P0-P2 source review found no actionable findings. All seven selected checks passed: exact-file formatting, UI and owning UI test typechecks, targeted lint, UI i18n, stylelint, and diff check. The review ran alongside those checks and did not execute project code; Exact-head hosted CI completed with 88 successful jobs and 13 skipped after one failed-jobs-only recovery for a Matrix dependency download reset during installation. Passed first-attempt jobs were retained. The fresh hosted source review found no actionable findings. Chromium checks cover placement; existing unit cases cover animation completion and fallback behavior.

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

@steipete
steipete marked this pull request as ready for review September 13, 2026 16:49
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. 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, 12:53 PM ET / 16:53 UTC.

ClawSweeper review

What this changes

The PR avoids unused browser measurements during toast dismissal and extends existing tests to preserve callbacks, cleanup, and reduced-motion behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, focused optimization absent from current main. No actionable correctness or security findings were identified, and the maintainer-protected PR is not eligible for cleanup closure.

Priority: P3
Reviewed head: b9925236992f0679ddb3af97b4a1e552e2958b45

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable optimization with meaningful extensions to existing tests and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer identity exempts this internal optimization from the external-contributor proof gate. Reported host tests cover skipped queries and preserved outcomes; Chromium cases cover placement, while inspected sidebar screenshots concern a separate PR.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied maintainer identity exempts this internal optimization from the external-contributor proof gate. Reported host tests cover skipped queries and preserved outcomes; Chromium cases cover placement, while inspected sidebar screenshots concern a separate PR.
Evidence reviewed 7 items Pinned production change: The introduced diff short-circuits action and disconnected exits before media or geometry queries, and reduced-motion exits before geometry queries. Rendering retains the same connected, positive-width anchor predicate; completion and queue handling are unchanged.
Current main still performs the extra work: Current main eagerly evaluates matchMedia and connected-anchor geometry before deciding whether dismissal finishes immediately. The optimization remains necessary.
Latest release comparison: The v2026.9.4 source also eagerly queries motion preference and anchor geometry before the immediate-exit condition; this optimization is not present in the supplied latest release.
Findings None None.
Security None None.

How this fits together

The Control UI’s shared toast host receives notifications and optional actions from UI features. It manages placement, dismissal timing, queued notifications, and completion callbacks.

flowchart TD
  A[UI notifications] --> B[Shared toast host]
  B --> C[Action, removal, or timeout]
  C --> D{Animation needed?}
  D -->|No| E[Complete dismissal]
  D -->|Yes| F[Read motion preference and geometry]
  F --> G[Animate with fallback timer]
  G --> E
  E --> H[Notify caller and advance queue]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +18. Total +19 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 9 +1
Tests 1 24 6 +18
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 34 15 +19

Review metrics

None.

Technical review

Best possible solution:

Keep dismissal decisions in the shared toast host and perform live browser queries only when their results affect animation.

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

Yes, from source: current main queries media and anchor geometry before action or removal dismissal, despite immediately finishing those paths. Runtime reproduction was not executed in this read-only review.

Is this the best way to solve the issue?

Yes. Short-circuiting the existing dismissal decision and sharing its anchor predicate removes unnecessary work without adding state, changing public options, or altering callback semantics.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small internal browser-work optimization with unchanged user-visible toast behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer identity exempts this internal optimization from the external-contributor proof gate. Reported host tests cover skipped queries and preserved outcomes; Chromium cases cover placement, while inspected sidebar screenshots concern a separate PR.

Label justifications:

  • P3: This is a small internal browser-work optimization with unchanged user-visible toast behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer identity exempts this internal optimization from the external-contributor proof gate. Reported host tests cover skipped queries and preserved outcomes; Chromium cases cover placement, while inspected sidebar screenshots concern a separate PR.

Evidence

What I checked:

  • Pinned production change: The introduced diff short-circuits action and disconnected exits before media or geometry queries, and reduced-motion exits before geometry queries. Rendering retains the same connected, positive-width anchor predicate; completion and queue handling are unchanged. (ui/src/lib/toast.ts:169, b9925236992f)
  • Current main still performs the extra work: Current main eagerly evaluates matchMedia and connected-anchor geometry before deciding whether dismissal finishes immediately. The optimization remains necessary. (ui/src/lib/toast.ts:170, b735b686361e)
  • Latest release comparison: The v2026.9.4 source also eagerly queries motion preference and anchor geometry before the immediate-exit condition; this optimization is not present in the supplied latest release. (ui/src/lib/toast.ts, 3a9d69db306c)
  • Regression coverage: Both complete test modules were inspected. The changed cases exercise host removal, focused Undo, and reduced-motion timeout through the toast host while retaining outcome assertions. Existing browser cases cover placement. The PR reports 21 unit cases and two Chromium cases passing; this read-only review did not execute tests. (ui/src/lib/toast.test.ts:293, b9925236992f)
  • Related work and proof scope: Reduce repeated work across Gateway startup, history, and streaming #145679 explicitly tracks this toast experiment within the performance campaign. The merged fix: tighten spacing above sidebar file previews #147116 repairs an independent startup-size baseline and file-preview spacing. Its two downloaded screenshots were inspected and show file-preview spacing, not toast dismissal.
  • Historical routing: Feature-history inspection identified prior toast work by Peter Steinberger and recent focus/hover lifecycle work by RoboClaw. GitHub commit inspection verified the corresponding toast patches and account identities. Full local blame could not complete because historical blobs were unavailable; no original-introduction attribution is claimed. (ui/src/lib/toast.ts, 72adefbca06c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • roboclaw-bot: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@steipete
steipete merged commit 9cf2f76 into main Sep 13, 2026
285 of 287 checks passed
@steipete
steipete deleted the codex/perf-ui-toast-layout-main-7006 branch September 13, 2026 17:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '201f11afefdb19a9c75e9d3542bf7425c80df7a7': (141 commits)
  fix: keep catalog discovery scoped and execution lazy (#147159)
  fix: serialize reclamation worker shutdown with foreground writes (#147178)
  test(sessions): cover abrupt committed transcript recovery (#143984)
  fix: stop transcript storms during context overflow recovery (#147202)
  fix: reduce CPU overhead for small history and usage reads (#147205)
  fix: resume tasks after tools finish and the model times out (#147203)
  refactor(scripts): share SQLite reliability message waits (#146900)
  feat(exec): configure approval reviewer thinking and fastMode (#147192)
  test: remove redundant Bonjour module headers (#146981)
  refactor: share streaming media tail boundary update (#146989)
  refactor(tui): classify resume candidates once (#146983)
  improve: skip unused toast dismissal work (#147196)
  fix(linux): recover saved remote connections without replacing active sessions (#146047)
  fix: doctor stays silent when Windows state dir is under OneDrive (#123720)
  feat: announce successful Daybreak retries (#147146)
  feat(code-mode): reuse results across code cells (#147154)
  refactor(test): reuse CLI plugin fixture writer (#147186)
  test: skip unused compiler setup in routing fixtures (#147194)
  test: reuse LINE webhook runtime fixture (#146710)
  fix(code-mode): check automation and process result types (#147143)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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