Skip to content

fix(ui): surface sidebar clipboard failures across reconnects - #118632

Merged
steipete merged 2 commits into
mainfrom
codex/qa0803-ui-sidebar-copy-feedback
Aug 3, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa0803-ui-sidebar-copy-feedback

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Make the default chat file sidebar show visible, localized, accessible feedback when copying either a file path or file contents fails.
  • Give each action independent latest-attempt and feedback-timer ownership.
  • Correctly invalidate old clipboard attempts and feedback across sidebar disconnection, reconnection, and file changes.

Actual user-visible owner behavior

The real sidebar custom element and actual clipboard helper previously ignored failures from both navigator.clipboard and document.execCommand. Both Copy path and Copy file contents silently remained at their idle icon/accessible label.

The repaired owner displays a localized visible role=alert failure and matching accessible button feedback for both actions, preserves successful copies, and restores the correct idle labels independently.

A fresh security/lifecycle review additionally identified that detaching and reconnecting the same custom element could preserve obsolete success/failure feedback or allow a pre-detach clipboard promise to publish into a new connection. Four actual custom-element regressions reproduced those failures before the owner fix. Connection-scoped monotonic action generations now invalidate every obsolete completion without resetting counters or triggering reactive updates from disconnected lifecycle cleanup.

The tests run the real custom element, real clipboard helper, real user-visible DOM and accessibility attributes; only the unrelated browser-only CodeMirror editor initialization is replaced on the individual test instance because it cannot run in jsdom.

Verification

  • Initial red-before-green default-path proof: path-copy and contents-copy failures reproduced.
  • Four additional detach/reconnect stale-feedback and stale-completion regressions reproduced before repair.
  • Complete existing sidebar owner suite: 26 passed.
  • Coverage includes denied Clipboard API and legacy fallback, visible alerts, accessible labels, successful copy, out-of-order completions, independent per-action timers, changed file selection, disconnect, and same-instance reconnect.
  • Focused formatting/lint/diff checks passed.
  • Fresh independent structured security/lifecycle review: clean, confidence 0.98.
  • Production-code delta: +34 lines for canonical visible user outcomes, independent async ownership, and safe lifecycle invalidation.

Exact-head actual Chromium after-fix proof

Reviewed head: bfc701c. A real headless Chromium browser loaded the actual reviewed Control UI through the actual Vite source server and a local mock Gateway. Both changed file-sidebar buttons were clicked, both real browser clipboard mechanisms were denied, visible alert and accessible feedback were observed, each action reset, and the exact same custom element was disconnected/reconnected while an older promise completed. No provider calls or external traffic.

{"result":"PASS","head":"bfc701cbd42bbf6f6ad63c5f250ea00a3fb49818","browser":"chromium","actualBrowser":true,"actualViteSourceUi":true,"mockGateway":"local","actions":[{"action":"path","modernClipboardDenied":true,"legacyCopyDenied":true,"visibleAlert":"Copy failed","failedAriaLabel":"Copy failed","idleAriaLabel":"Copy path","resetAlertCleared":true},{"action":"contents","modernClipboardDenied":true,"legacyCopyDenied":true,"visibleAlert":"Copy failed","failedAriaLabel":"Copy failed","idleAriaLabel":"Copy file contents","resetAlertCleared":true}],"reconnect":{"sameElement":true,"connected":true,"staleCompletionIgnored":true,"idleAriaLabel":"Copy file contents","alertAbsent":true},"fileRequests":1,"providerCalls":0,"screenshots":["sidebar-path-denied.png","sidebar-contents-denied.png","sidebar-reconnect-stale-completion.png"]}

Browser and Vite server shut down cleanly; both reviewed source overlays were restored. Actual browser run exited zero in 8.81 seconds. All four exact-head hosted Chromium shards and the required CI gate also passed.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 7:16 AM ET / 11:16 UTC.

ClawSweeper review

What this changes

The PR makes file-sidebar path and contents copy failures visible and accessible, while preventing stale success or failure feedback after a sidebar reconnect or file change.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Keep open. Current main silently discards failed clipboard outcomes in the file sidebar; this patch gives the owning custom element per-action feedback and invalidates stale completions across file changes and reconnects. I found no concrete patch defect, but the PR body supplies jsdom-based regression claims rather than after-fix browser/runtime evidence, so real behavior proof remains required before merge.

Priority: P2
Reviewed head: bfc701cbd42bbf6f6ad63c5f250ea00a3fb49818

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and its component coverage is strong, but the missing real browser/runtime evidence caps merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body describes jsdom custom-element tests and CI, but no redacted after-fix browser or live Control UI artifact demonstrates the clipboard-denial and reconnect behavior; add real runtime proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body describes jsdom custom-element tests and CI, but no redacted after-fix browser or live Control UI artifact demonstrates the clipboard-denial and reconnect behavior; add real runtime proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main silent failure path: The path button invokes the shared helper with a discarded promise, and the existing contents-copy owner returns immediately when the helper reports false; neither path produces visible failure feedback.
Clipboard contract: The shared helper deliberately returns false when the Clipboard API and legacy execCommand fallback both fail, so the sidebar has an owned failure outcome to surface rather than an exception to catch.
Patch preserves async ownership: The proposed owner tracks attempts independently by action, rejects completions for a newer attempt, changed file, or disconnected element, and resets each action with its own timer.
Findings None None.
Security None None.

How this fits together

The Control UI file sidebar receives a selected workspace file and offers copy-path and copy-contents actions. Those actions call the shared browser clipboard helper, and the sidebar must turn its boolean outcome into independent button feedback and a visible alert without letting old asynchronous results affect a new view.

flowchart LR
  A[Selected workspace file] --> B[File sidebar custom element]
  B --> C[Copy path or contents action]
  C --> D[Clipboard helper]
  D --> E[Browser Clipboard API or legacy fallback]
  E --> F{Copy outcome current?}
  F -->|yes| G[Accessible button feedback]
  F -->|yes on failure| H[Visible failure alert]
  F -->|stale| I[Ignore obsolete completion]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body describes jsdom custom-element tests and CI, but no redacted after-fix browser or live Control UI artifact demonstrates the clipboard-denial and reconnect behavior; add real runtime proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR body reports focused jsdom coverage but includes no redacted after-fix browser or live Control UI artifact showing denied clipboard feedback and a reconnect; CI and component tests do not replace that merge-gate evidence.
  • Complete next step (P2) - The patch has no discrete repair finding, but an external PR needs contributor-supplied real runtime proof before a human merge decision; the protected maintainer label also keeps this out of automatic cleanup.
Agent review details

Security

None.

PR surface

Source +34, Tests +277. Total +311 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 83 49 +34
Tests 1 278 1 +277
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 361 50 +311

Review metrics

Metric Value Why it matters
Production versus regression delta production +34, tests +277 The production growth is tied to the canonical visible outcome and asynchronous lifecycle owner; the much larger test delta covers the newly explicit failure and stale-completion invariants.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the per-action sidebar-owned state machine and land it after a redacted real-browser Control UI run demonstrates a denied copy, visible alert, recovery to the idle label, and no stale feedback after reconnect.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the per-action sidebar-owned state machine and land it after a redacted real-browser Control UI run demonstrates a denied copy, visible alert, recovery to the idle label, and no stale feedback after reconnect.

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

Yes, from source: make either shared clipboard route return false while using the current file sidebar; current main leaves the action at its idle label with no alert. I did not execute contributor code locally because this is an external PR and the checkout is read-only.

Is this the best way to solve the issue?

Yes. Moving the result handling into the file-sidebar owner is the narrowest maintainable repair: the shared helper remains a generic boolean provider, while the UI owner controls visible feedback, timers, and lifecycle invalidation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e87fb689b533.

Labels

Label changes:

  • add P2: This is a bounded Control UI default-path usability defect: failed copy actions currently produce no visible outcome, but it has limited blast radius and a focused repair.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes jsdom custom-element tests and CI, but no redacted after-fix browser or live Control UI artifact demonstrates the clipboard-denial and reconnect behavior; add real runtime proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded Control UI default-path usability defect: failed copy actions currently produce no visible outcome, but it has limited blast radius and a focused repair.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body describes jsdom custom-element tests and CI, but no redacted after-fix browser or live Control UI artifact demonstrates the clipboard-denial and reconnect behavior; add real runtime proof before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main silent failure path: The path button invokes the shared helper with a discarded promise, and the existing contents-copy owner returns immediately when the helper reports false; neither path produces visible failure feedback. (ui/src/pages/chat/components/chat-sidebar.ts:294, e87fb689b533)
  • Clipboard contract: The shared helper deliberately returns false when the Clipboard API and legacy execCommand fallback both fail, so the sidebar has an owned failure outcome to surface rather than an exception to catch. (ui/src/lib/clipboard.ts:8, e87fb689b533)
  • Patch preserves async ownership: The proposed owner tracks attempts independently by action, rejects completions for a newer attempt, changed file, or disconnected element, and resets each action with its own timer. (ui/src/pages/chat/components/chat-sidebar.ts:1000, bfc701cbd42b)
  • Regression coverage: The PR exercises both actions through the real custom element and verifies failed labels, role=alert output, independent timers, changed-file invalidation, disconnect, and same-instance reconnect behavior. (ui/src/pages/chat/components/chat-sidebar.test.ts:298, bfc701cbd42b)
  • Feature history and routing: The sidebar implementation was introduced in commit bd23864 and has recent accessibility/lifecycle work from the same area in commit 79f3474; the current PR head is not an ancestor of current main, so the requested behavior is not already implemented there. (ui/src/pages/chat/components/chat-sidebar.ts:680, bd23864508c6)

Likely related people:

  • steipete: Peter Steinberger introduced the current sidebar implementation and authored recent accessibility/lifecycle work in the same component; the proposed branch also follows that established owner boundary. (role: file-sidebar introducer and recent area contributor; confidence: high; commits: bd23864508c6, 79f3474836be, 926aaf20ca70; files: ui/src/pages/chat/components/chat-sidebar.ts, ui/src/pages/chat/components/chat-sidebar.test.ts)
  • vincentkoc: Vincent Koc recently maintained Control UI localization in this sidebar area, relevant because the patch reuses accessible translated feedback strings. (role: adjacent localization contributor; confidence: medium; commits: 755eea5e9756; files: ui/src/pages/chat/components/chat-sidebar.ts, ui/src/i18n/locales/en.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted after-fix Control UI browser recording, terminal output, or runtime log showing a denied copy produces the alert and then resets.
  • Include a same-element reconnect in that proof so an old copy completion is visibly ignored.

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 757d220 into main Aug 3, 2026
113 of 117 checks passed
@steipete
steipete deleted the codex/qa0803-ui-sidebar-copy-feedback branch August 3, 2026 11:36
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
…aw#118632)

* fix(ui): surface sidebar clipboard failures across reconnects

* test(ui): type sidebar clipboard lifecycle fixtures correctly
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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant