Skip to content

fix(ui): prevent queued double-clicks from removing the next message - #124150

Merged
steipete merged 1 commit into
mainfrom
fix/autoqa-refill-queue-edit-outcomes-v2
Aug 15, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/autoqa-refill-queue-edit-outcomes-v2

Conversation

@steipete

@steipete steipete commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #121667 (context only; this PR does not close the broader queue UX work)

What Problem This Solves

Fixes an issue where removing a queued Control UI message could wake delivery after the removal had actually failed, while a native Chromium double-click could retarget its second click onto the row that shifted underneath and remove that sibling too.

Why This Change Was Made

The queue removal owner now returns one closed result: removed, absent, or rejected. Only removed releases attachment payloads and resumes the outbox; absent is a harmless stale no-op; rejected retains the durable row and shows the existing browser-storage recovery guidance. The remove button accepts native single clicks plus keyboard/programmatic activation, but ignores Chromium's retargeted click 2 without adding a timer or broad inert state.

The architectural owner remains the existing Control UI queue/session-storage boundary. This does not change delivery, replay, retry, idempotency, protocol, configuration, security, or persistence formats.

Production LOC: +18/-4 (net +14) | Tests: +237/-5 (net +232). The positive production delta is the explicit owner result and gesture-boundary guard; it replaces an ambiguous void outcome without adding a parallel path.

No changelog or docs change: this restores the existing remove/recovery contract and introduces no new user-facing control or configuration surface.

User Impact

Operators can remove queued messages without risking the adjacent row. A storage failure leaves the message recoverable and explains what to do; duplicate stale activation remains silent. Immediate single-click, keyboard, and programmatic removal still work.

Evidence

  • 323 focused Control UI owner/sibling tests passed across four files.
  • 3 real Chromium mocked-Gateway E2Es passed.
  • Rejected durable removal retained the row, showed recovery guidance, and did not drain.
  • Native double-click emitted detail 1 for the intended row and retargeted detail 2 to the shifted sibling; only the intended row was removed.
  • Immediate next-row single click, keyboard activation, and programmatic activation each remained functional.
  • Edit/reorder/remove/reconnect dispatched exactly send last, send first, and edited before send once each, with unique idempotency keys and no removed or duplicate send.
  • Source-blind behavior contract: 4/4 clauses passed; 3/3 anti-cheat probes passed.
  • Changed gate passed via the documented local fallback after no remote ci-fast provider was ready: format, Control UI i18n, changed-file oxlint/stylelint, core-test types, UI types, and repository guards were clean.
  • Both import-cycle checks reported zero cycles; git diff --check passed.
  • Fresh autoreview: no accepted/actionable findings; patch correct, confidence 0.99.
  • Exact-head CI is green, including all Control UI, real-Gateway UI E2E, build, lint, and type lanes: https://github.com/openclaw/openclaw/actions/runs/31879889614

Rejected removal retains the row and shows recovery

Rejected queued-message removal

Duplicate/retargeted click is a no-op for the shifted sibling

Duplicate queued-message removal is harmless

Surviving queue drains exactly once

Exact queued-message drain

Chromium flow recording

queue-removal-outcomes.webm

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Aug 15, 2026
@steipete steipete self-assigned this Aug 15, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 6:41 AM ET / 10:41 UTC.

ClawSweeper review

What this changes

The PR makes queued-message removal return a precise outcome, resumes delivery only after actual removal, and ignores a retargeted second Chromium click on the remove button.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main resumes the outbox after every remove attempt; this head records whether removal succeeded and blocks Chromium’s retargeted second click, with no blocking correctness finding. The maintainer label requires normal landing handling rather than cleanup automation.

Priority: P2
Reviewed head: 554e8119ffe85b2b8c5f2b7be9f621dbf31d0e5c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with strong behavior-oriented regression coverage and no identified correctness defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless supplies three UI screenshots and a Chromium flow recording.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless supplies three UI screenshots and a Chromium flow recording.
Evidence reviewed 6 items Current-main behavior: Current main always resumes stored outboxes after invoking removal, regardless of whether the durable removal succeeded or the row was already absent.
Removal owner boundary: The proposed closed result distinguishes an actual removal from a rejected durable write and an already-absent row; attachment release remains conditional on the actual removed item.
Gesture boundary: The queue renderer allows native single, keyboard, and programmatic activation while refusing a click with detail greater than one; it also stops the retargeted double-click from reaching the row edit handler.
Findings None None.
Security None None.

How this fits together

The Control UI stores queued composer messages in browser session storage and later drains them through the chat outbox. Queue-row controls mutate that stored queue, release attachment payloads when appropriate, and can resume queued delivery.

flowchart LR
  A[Operator queue row] --> B[Remove control]
  B --> C[Queue storage owner]
  C --> D{Removal outcome}
  D -->|removed| E[Release attachments]
  E --> F[Resume outbox]
  D -->|rejected| G[Show recovery guidance]
  D -->|absent| H[No-op]
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by 14 lines for a bug fix; the explicit owner outcome and narrow gesture guard are justified by separate failure modes, but exact-head CI should complete before landing.
  • Complete next step (P2) - This protected maintainer PR needs normal exact-head CI and merge review, not a repair job.
Agent review details

Security

None.

PR surface

Source +14, Tests +232. Total +246 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 18 4 +14
Tests 2 237 5 +232
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 255 9 +246

Review metrics

Metric Value Why it matters
Production vs test LOC production +18/-4 (net +14); tests +237/-5 (net +232) The production increase is limited to the removal outcome and click guard; the larger test change exercises the storage, gesture, and drain boundary.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one removal outcome at the queue-storage boundary and let only a confirmed removal release payloads and restart delivery.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one removal outcome at the queue-storage boundary and let only a confirmed removal release payloads and restart delivery.

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

Yes—at source level. The current handler resumes after an unsuccessful removal, and the added Chromium E2E specifies the storage-failure and retargeted-double-click sequence, although this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. A closed result at the queue owner lets the existing caller distinguish removed, stale, and rejected states without debouncing, adding a timer, or creating a parallel delivery path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: A narrow Control UI queue defect can remove an adjacent queued message after a double-click, with limited blast radius outside that flow.
  • 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: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless supplies three UI screenshots and a Chromium flow recording.

Label justifications:

  • P2: A narrow Control UI queue defect can remove an adjacent queued message after a double-click, with limited blast radius outside that flow.
  • 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: This maintainer-authored PR is exempt from the external-contributor proof gate; its body nevertheless supplies three UI screenshots and a Chromium flow recording.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame assigns the existing removal flow to this contributor, who also has the strongest recent history on the queue owner and submitted this focused repair. (role: recent queue-owner contributor; confidence: high; commits: d1f8c339b141, 554e8119ffe8; files: ui/src/pages/chat/chat-queue.ts, ui/src/pages/chat/chat-state-page.ts, ui/src/pages/chat/components/chat-composer-queue.ts)

Rank-up moves

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

  • Allow the exact-head CI gate to complete before landing.

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 939aa7d into main Aug 15, 2026
188 checks passed
@steipete
steipete deleted the fix/autoqa-refill-queue-edit-outcomes-v2 branch August 15, 2026 10:46
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: 🐚 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