Skip to content

feat: right-click and keyboard Reply affordance in Dashboard webchat#86679

Closed
mvanhorn wants to merge 1 commit into
openclaw:mainfrom
mvanhorn:fix/16896-openclaw-dashboard-right-click-reply
Closed

feat: right-click and keyboard Reply affordance in Dashboard webchat#86679
mvanhorn wants to merge 1 commit into
openclaw:mainfrom
mvanhorn:fix/16896-openclaw-dashboard-right-click-reply

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Right-clicking a Dashboard webchat bubble now shows a small Reply action, and pressing r on the focused bubble selects it as the reply target. The reply target threads into the input area as a preview that prepends a quoted block when the message is submitted.

Why this matters

Filed in #16896: the Dashboard webchat had no Reply UX. Right-click opened the browser context menu and r did nothing. The issue includes screenshots from competitor chat UIs (Discord, Slack, iMessage) showing Reply as a first-class affordance on the bubble itself. This brings parity without changing the surrounding chat semantics.

Changes

  • ui/src/ui/views/chat.ts: adds the right-click contextmenu handler, the r keyboard handler, the reply preview band above the input (with an X to cancel), and threads selectedReplyTarget / onReply props through. Submits via prependReplyQuote() which clears the target afterward.
  • ui/src/ui/controllers/chat.ts: adds setSelectedReplyTarget() and prependReplyQuote(). Reply state lives on the controller so both keyboard and right-click sources converge on the same target.
  • ui/src/ui/types/chat-types.ts: new ChatReplyTarget type with the message id, author role, and quote text.
  • ui/src/ui/chat/grouped-render.ts: extracts the quote-prepend helper from the inline render so it's testable from outside.
  • ui/src/styles/chat/grouped.css: small inline-menu and reply-preview styles. ARIA roles on the menu and the preview.
  • ui/src/ui/views/chat.test.ts: covers right-click selection, r keyboard selection, cancel-clears, submit-clears, and the focus-restoration after submit.
  • ui/src/ui/chat/grouped-render.test.ts (new): isolated tests for the quote-prepend helper.

Testing

Vitest in chat.test.ts and grouped-render.test.ts. Existing chat tests still pass (rendering unchanged when selectedReplyTarget is null).

Fixes #16896

AI was used for assistance.

The Dashboard webchat had no Reply UX. Right-clicking a chat bubble
opened the browser context menu and the keyboard shortcut (r) did
nothing. Filed in openclaw#16896 with screenshots of competitor chat UIs that
expose Reply directly on the bubble.

Adds a Reply affordance reachable two ways:
  - right-click (contextmenu event) on a chat bubble opens a small
    inline action with one option: Reply
  - pressing 'r' on the currently-focused bubble selects it as the
    reply target

Reply target threads through chat controller state into the input area
as a preview ("Replying to user / assistant"), with X to cancel.
Submitting prepends the quoted text via prependReplyQuote and clears
the target. New types in chat-types.ts (ChatReplyTarget). CSS for the
preview/menu lives in styles/chat/grouped.css. Tests cover the right-
click, keyboard, cancel, and submit-clears-target paths plus the new
grouped-render quote-prepend helper.

Fixes openclaw#16896
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 25, 2026, 8:05 PM ET / 00:05 UTC.

Summary
The PR adds Dashboard webchat reply selection through a message context menu, per-message Reply button, composer preview, quoted send text, CSS, and Vitest coverage.

PR surface: Source +318, Tests +246. Total +564 across 7 files.

Reproducibility: not applicable. as a bug reproduction because this PR adds a new Dashboard webchat affordance. Source inspection of current main confirms the outbound reply-selection workflow is absent.

Review metrics: 1 noteworthy metric.

  • Branch divergence: 1 ahead, 26,532 behind; mergeable_state dirty. The PR touches heavily changed Control UI chat files, so maintainers need a current-main rebase before relying on the diff or validation.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦪 silver shellfish
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rebase the branch onto current main and resolve Control UI chat conflicts.
  • Implement and test the advertised r shortcut, or narrow the title/body to the click and context-menu affordances.
  • Add redacted real browser proof showing right-click Reply, cancel, preview, and quoted send behavior.

Proof guidance:
Needs real behavior proof before merge: The PR body reports Vitest coverage only and does not include after-fix real Dashboard proof; the contributor should add redacted screenshots, recording, terminal/browser output, or logs, then update the PR body or ask for @clawsweeper re-review.

Mantis proof suggestion
A browser recording would materially help because the change is a visible Dashboard webchat interaction. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify Dashboard webchat right-click Reply menu, Reply button, composer preview, cancel, and quoted send.

Risk before merge

  • The branch is dirty and far behind current main, so reviewers need a rebase before trusting the final Control UI chat diff or validation.
  • The PR changes a visible Dashboard interaction but provides only test claims, not after-fix real browser proof.

Maintainer options:

  1. Decide the mitigation before merge
    Rebase onto current main, preserve current chat rendering and send behavior, implement or remove the advertised r shortcut, and attach redacted real Dashboard browser proof for the reply flow.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
The remaining blockers are contributor or maintainer follow-up for rebase, real behavior proof, and a scope decision on the advertised keyboard shortcut.

Security
Cleared: No concrete security or supply-chain issue found; the diff is limited to Control UI TypeScript, CSS, and tests without dependency, workflow, lockfile, secret, or install-script changes.

Review findings

  • [P2] Implement the advertised r shortcut — ui/src/ui/chat/grouped-render.ts:825-833
Review details

Best possible solution:

Rebase onto current main, preserve current chat rendering and send behavior, implement or remove the advertised r shortcut, and attach redacted real Dashboard browser proof for the reply flow.

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

Not applicable as a bug reproduction because this PR adds a new Dashboard webchat affordance. Source inspection of current main confirms the outbound reply-selection workflow is absent.

Is this the best way to solve the issue?

No, not yet. The UI-only quoted Markdown direction is plausible, but the branch still advertises an r keyboard shortcut that is not implemented and lacks real browser proof.

Full review comments:

  • [P2] Implement the advertised r shortcut — ui/src/ui/chat/grouped-render.ts:825-833
    The PR body and commit message say pressing r on the focused bubble selects it for reply, but the patch only wires @contextmenu plus button clicks. The only added keydown handler is Escape for the menu, and bubbles are not made focusable for an r shortcut path.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.84

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against c59635ae970c.

Label changes

Label justifications:

  • P3: This is a low-priority Dashboard webchat ergonomics feature with no outage, data-loss, security, or delivery-regression signal.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • 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 reports Vitest coverage only and does not include after-fix real Dashboard proof; the contributor should add redacted screenshots, recording, terminal/browser output, or logs, then update the PR body or ask for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +318, Tests +246. Total +564 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 439 121 +318
Tests 2 248 2 +246
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 687 123 +564

What I checked:

  • Repository policy read: Read the full root AGENTS.md and scoped UI guide; the real-behavior-proof rule and UI-specific scope guidance apply to this Control UI PR. (AGENTS.md:1, c59635ae970c)
  • Scoped UI policy read: ui/AGENTS.md contains only Control UI i18n/scope guidance and no conflicting rule for the touched chat files. (ui/AGENTS.md:1, c59635ae970c)
  • No matching maintainer note: The only maintainer note found is Telegram-specific, so there was no Control UI note changing this review. (.agents/maintainer-notes/telegram.md:1, c59635ae970c)
  • Current main lacks outbound reply selection: Current main has no selectedReplyTarget, prependReplyQuote, Reply button, reply context menu, or r shortcut hit in the Dashboard chat view/render/controller/style files, so this PR is not obsolete on main. (c59635ae970c)
  • Adjacent current-main behavior is inbound-only: Current main renders normalized inbound reply pills, which is adjacent display behavior but not the requested user action for selecting a webchat message as a reply target. (ui/src/ui/chat/grouped-render.ts:849, c59635ae970c)
  • Advertised keyboard shortcut is missing from the patch: The head file wires a contextmenu handler and Reply button, but the changed bubble markup has no focusable bubble or r key handler despite the PR body and commit message advertising that shortcut. (ui/src/ui/chat/grouped-render.ts:825, 34046671b3df)

Likely related people:

  • Michael Zelbel: Current checkout history and blame show this author on the present versions of the central chat view, renderer, and controller files touched by the PR. (role: recent area contributor; confidence: medium; commits: 1cc0a96df1a1; files: ui/src/ui/views/chat.ts, ui/src/ui/chat/grouped-render.ts, ui/src/ui/controllers/chat.ts)
  • steipete: Blame shows Peter Steinberger as committer for the current chat-file versions, and current main also includes a recent commit authored by this handle adjacent to session/chat state. (role: recent area committer and current-main contributor; confidence: medium; commits: 1cc0a96df1a1, c59635ae970c; files: ui/src/ui/views/chat.ts, ui/src/ui/chat/grouped-render.ts, ui/src/ui/controllers/chat.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Closing this one - the branch is in CONFLICTING merge state and the canvas:a2ui build step isn't cooperating in my fork's workspace, so I can't produce the Real behavior proof the way I did for #86674 and #86676. Will resubmit cleanly from a fresh clone once I can get the dogfooding loop working. Apologies for the noise.

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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add right-click reply in Dashboard webchat

1 participant