Skip to content

fix(ui): prevent chat crashes after copying a message - #153281

Closed
roboclaw-bot wants to merge 2 commits into
mainfrom
openclaw/fix-chat-contextmenu-containment-e34a980f
Closed

roboclaw-bot wants to merge 2 commits into
mainfrom
openclaw/fix-chat-contextmenu-containment-e34a980f

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: Chromium can crash the chat renderer when a user copies a message and then right-clicks that message. This also blocks the toolbar fix in #153241.

Landing status: While this revision was in CI, #153260 merged at 00:54:21 UTC on September 20, 2026 (03328bcdb525d61eca0f3a32e61c0a343a57964b). That change removes the same focus-driven row-containment switch and moves tool-summary focus rings inside their controls. This PR now conflicts with that landed repair. Preparation and merge are paused rather than reintroducing the removed containment rule.

User Impact

Copy and message context menus work together without crashing. Keyboard focus rings remain visible, and unrelated offscreen rows keep their layout-skipping optimization. No settings, dependency, or test-expectation changes.

Why This Change Was Made

The focus-ring repair in #149002 switches a virtual row from visible content back to automatic containment when mouse focus leaves its Copy button. Keeping the row visible while its message bubble is hovered avoids changing containment during the same native mouse operation, while preserving the original focus-ring repair. Metadata-only hover retains automatic containment and the existing top-layer tooltip path; the separate focus selector also remains active on touch devices.

Evidence

  • Reproduced the unchanged desktop message-actions test on unmodified main 741d65bcf703fff8834442f5fccc30f22c96f83a, with the exact CI Chrome for Testing 153.0.8010.12 and Node 24.19.0. It crashes during trusted right-mousedown, before the custom context-menu event.

  • The same original test invocation passes with this source fix, with screenshot capture disabled.

  • All 16 existing cases pass across chat-message-actions, chat-content-copy, chat-transcript-focus, and chat-collapsed-reply-reveal. This covers desktop/mobile actions, clipboard behavior, and focus retention with fewer than 30 mounted rows from a 200-message transcript.

  • Fresh scoped autoreview found no actionable findings. Targeted oxfmt, stylelint, and git diff --check pass. No tests are skipped or weakened, and the browser version is unchanged.

  • Blacksmith Testbox hosting run. The test commands completed successfully before the lease was stopped; the hosting workflow cancellation is cleanup, not the test verdict.

  • Exact-head CI on the initial revision caught the existing metadata-tooltip containment contract. The source selector was narrowed to hovered message bubbles rather than changing that assertion. The unchanged tooltip test now passes, together with all 25 E2E cases across message actions, content copy, focused-row retention, collapsed replies, and history prepend, plus all seven end-follow browser cases. Fresh scoped autoreview, oxfmt, stylelint, and diff checks pass.

  • Refinement proof hosting run: commands passed before explicit lease cleanup; its cancellation is not a CI verdict. The earlier end-follow and one-frame prepend CI failures did not reproduce in focused baseline or refined-source runs. No assertion, retry count, timeout, dependency, or browser version was changed; the new exact-head required CI remains the landing gate.

Before

Actual bundled UI with synthetic Gateway data, replaying only the previous containment declarations. The screenshot shows Copy completed; the following right-click reproduces the renderer crash.

Before: copied message before the reproducible right-click crash

After

The same bundled UI and interaction with the source fix: the context menu opens normally.

After: the message context menu opens after Copy

Worked on by

Work sessions


View the OpenClaw team session

Keep hovered virtual rows uncontained through native mouse focus, preserving keyboard focus rings and offscreen layout skipping. The unchanged desktop Copy/right-click E2E fails on main and passes with this repair.

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

clawsweeper Bot commented Sep 20, 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: XS maintainer Maintainer-authored PR labels Sep 20, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 20, 2026 00:18
roboclaw-bot added a commit that referenced this pull request Sep 20, 2026
Consume the canonical repair in #153281; retain append-only publication history. Land the prerequisite before this image-gallery PR.

Co-authored-by: vyctorbrzezowski <[email protected]>
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 8:54 PM ET / September 20, 2026, 00:54 UTC (Revision 2).

ClawSweeper review

What this changes

The PR keeps hovered chat message bubbles fully rendered to prevent the reported Chromium crash when right-clicking a message after copying it.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still lacks this targeted repair, and the refined selector preserves the existing focus and metadata-tooltip contracts. No actionable patch defect was found.

Priority: P2
Reviewed head: 0b418af9fbf34d85e46180da93c966bed4a9ee69

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with no identified correctness defect, useful visual evidence, and existing coverage for the affected interactions.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary contributor-proof gate does not apply to this bot-authored PR. Inspected bundled-UI screenshots show Copy feedback and the resulting context menu; the captured body reports pinned-Chromium before/after execution and refined-selector coverage with synthetic Gateway data, while raw execution logs were unavailable to this reviewer.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor-proof gate does not apply to this bot-authored PR. Inspected bundled-UI screenshots show Copy feedback and the resulting context menu; the captured body reports pinned-Chromium before/after execution and refined-selector coverage with synthetic Gateway data, while raw execution logs were unavailable to this reviewer.
Evidence reviewed 8 items Verified introduced change: The merge-base-to-head diff changes only the row containment selector and its explanatory comment. It retains focus-within and adds hovered message bubbles; git diff --check passed.
Current main still needs the repair: Fetched main retains content-visibility:auto and only the focus-within exception; it has no bubble-hover exception. The latest release's stylesheet also lacks the proposed repair and lacks the later focus-within rule.
Release source check: The v2026.9.5 stylesheet contains automatic row containment and the measuring-rows exception, without either the later focus exception or this hover repair; this review makes no shipped-fix claim.
Findings None None.
Security None None.

How this fits together

The Control UI renders conversation history in virtualized rows that skip offscreen layout work. This CSS controls when an interacting row remains fully rendered so message actions and keyboard focus can work reliably.

flowchart TD
  A[Conversation history] --> B[Virtualized chat rows]
  B --> C{Focus or bubble hover?}
  C -->|Yes| D[Keep row fully rendered]
  C -->|No| E[Allow offscreen layout skipping]
  D --> F[Copy and context menu interaction]
  E --> G[Contained metadata with top-layer tooltip]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 5 4 +1
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 5 4 +1

Review metrics

None.

Root-cause cluster

Relationship: canonical
Canonical: #153281
Summary: This is the standalone containment-crash repair; related UI work treats it as a prerequisite rather than a replacement.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the repair in the existing row-layout CSS, preserving keyboard focus, contained metadata tooltips, and offscreen rendering optimization.

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

A precise reproduction path is documented: Copy a message, then right-click its bubble in Chrome for Testing 153.0.8010.12. Source inspection confirms the interaction and containment transition, but this read-only review did not independently reproduce the browser crash.

Is this the best way to solve the issue?

Yes: the narrow CSS exception addresses the reported containment transition without replacing the context-menu owner, removing keyboard focus support, or disabling virtualization globally.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes a specific Chromium Copy-to-context-menu crash with a bounded CSS change.
  • 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 ordinary contributor-proof gate does not apply to this bot-authored PR. Inspected bundled-UI screenshots show Copy feedback and the resulting context menu; the captured body reports pinned-Chromium before/after execution and refined-selector coverage with synthetic Gateway data, while raw execution logs were unavailable to this reviewer.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The ordinary contributor-proof gate does not apply to this bot-authored PR. Inspected bundled-UI screenshots show Copy feedback and the resulting context menu; the captured body reports pinned-Chromium before/after execution and refined-selector coverage with synthetic Gateway data, while raw execution logs were unavailable to this reviewer.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff changes only the row containment selector and its explanatory comment. It retains focus-within and adds hovered message bubbles; git diff --check passed. (ui/src/styles/chat/layout.css:654, 0b418af9fbf3)
  • Current main still needs the repair: Fetched main retains content-visibility:auto and only the focus-within exception; it has no bubble-hover exception. The latest release's stylesheet also lacks the proposed repair and lacks the later focus-within rule. (ui/src/styles/chat/layout.css:642, e0a092d59e13)
  • Release source check: The v2026.9.5 stylesheet contains automatic row containment and the measuring-rows exception, without either the later focus exception or this hover repair; this review makes no shipped-fix claim. (ui/src/styles/chat/layout.css:642, ec9c1a13db89)
  • Touch focus remains independent: The production hover guard separates comma-delimited hover selectors into a hover-capable media query and leaves non-hover selectors outside it. Consequently, the retained focus-within selector remains effective on touch devices. (ui/config/control-ui-hover-guard.ts:22, 0b418af9fbf3)
  • Existing interaction and containment coverage: The unchanged message-actions scenario clicks Copy, verifies clipboard text, right-clicks the bubble, and waits for the menu. The metadata browser test independently requires automatic row containment with a painted top-layer tooltip; focused-row coverage checks retention and fewer than 30 mounted rows in a 200-message transcript. These tests were inspected, not executed during this review. (ui/src/e2e/chat-message-actions.e2e.test.ts:233, 0b418af9fbf3)
  • Re-review refinement: The prior completed review published no findings or rank-up moves. GitHub's exact-head commit patch confirms the refinement replaces whole-row hover with bubble-only hover and restores focus-within as a separate selector, addressing the metadata containment contract without changing tests. (ui/src/styles/chat/layout.css:654, 0b418af9fbf3)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-20T00:24:46.201Z sha 2b8696c :: needs maintainer review before merge. :: none

Limit mouse uncontainment to hovered message bubbles so metadata retains its top-layer containment contract. Keep focus-within as a separate selector for touch keyboard focus through the existing hover guard. All 25 unchanged related E2E cases, seven end-follow browser tests, and the metadata context test pass.

Co-authored-by: steipete <[email protected]>
roboclaw-bot added a commit that referenced this pull request Sep 20, 2026
Consume the canonical reviewed repair in #153281; its own landing remains a prerequisite.

Co-authored-by: vyctorbrzezowski <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Superseded by #153260, merged as 03328bc. I verified that main now removes the focus-driven containment transition and keeps tool-summary focus rings inside their controls. Keeping this alternative would reintroduce the retired mechanism. Closing the duplicate and continuing #153241 against the landed repair; the proof and discussion remain available here.

@RomneyDa
RomneyDa deleted the openclaw/fix-chat-contextmenu-containment-e34a980f branch October 22, 2026 00:23
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. 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