feat(chat): double-click a user message to enter edit mode - #7911
feat(chat): double-click a user message to enter edit mode#7911aqiaojoe08 wants to merge 1 commit into
Conversation
b5abd0e to
c8a58bc
Compare
Check dispositionDependency Audit / Audit Production Dependencies — This failure is not introduced by this PR and is out of its scope. The audit trips on four newly-published high-severity advisories against the transitive
Tracked for a maintainer-owned lockfile bump in #7933. The Fork PR note: the four AI reviews (Design, First Principles, GPT 5.6, Opus 4.8, UX) show SKIPPED — this is the documented fork behavior (secrets are withheld from fork-triggered workflows), not a failure. |
c8a58bc to
b22bdf4
Compare
Double-clicking your own sent message in the chat transcript now enters edit mode, mirroring the existing pencil button. Gated behind the same canEdit + onEditResend condition, so it only fires when editing is enabled and never interferes with native word-selection. Adds three UserMessage tests covering the new behavior and its gating.
b22bdf4 to
7a75ffd
Compare
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of Verification complete. The claimed ChatSidebar precedent for the eslint-disable is real ( First-Principles-Verdict: CONCERNS The double-click gesture is grounded in issue #7908 and reuses What this change shipsIntent: let users open edit mode on a sent chat message with a double-click instead of hover-plus-pencil — an ADDITION.
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 7a75ffd |
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Double-click-to-edit hijacks double-click-to-select-word on the one surface where selecting text is an invested-in flow — the description's "never fights native selection" claim is wrong. Watch
Suggestions
[DESIGN-REVIEWED] 7a75ffd |
UX Review (Fable 5, fork) — 🟡 CONCERNSUX-level review of Context is complete: the diff adds a double-click-to-edit gesture on the sent-message bubble, gated identically to the pencil button, plus tests and a focus-outline polish. Sibling precedents (ChatSidebar rename, FollowUpBar) confirm double-click is an established power gesture here — but those targets are single-line labels/chips, not a body of selectable prose. I've weighed the collision with the universal double-click-to-select-word gesture on message text. UX-Verdict: CONCERNS Double-click on message text is the select-a-word gesture; this hijacks it — the selection is destroyed the instant edit mode swaps in the textarea. Watch
[UX-REVIEWED] 7a75ffd |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Open PR relationship auditThis is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion. Relationship findings
No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit. |
Problem / Motivation
Editing a message you already sent in the chat transcript requires hovering the
message to reveal the action row, then clicking the small pencil icon.
Double-click-to-edit is a widely established convention (Slack, Discord, and the
KiroCrew sidebar's own double-click-to-rename on folders), and its absence on
chat messages is a small but repeated friction when iterating on a prompt.
Why it matters
Iterating on a just-sent prompt is one of the most common chat actions. Requiring
a hover-then-aim-at-a-14px-icon gesture for it is slower and less discoverable
than the double-click users already expect, and inconsistent with the rename
affordance the app ships elsewhere.
What changed (motivation → approach → change)
Goal: let users edit a sent message with the gesture they already expect, without
introducing a second edit path to maintain.
Approach: reuse the existing edit entry point rather than build a new one.
Double-click now calls the same
startEdit()the pencil button calls, and isgated behind the exact same condition that renders the pencil
(
canEdit && onEditResend), so it only fires when editing is actually enabled andthere is no divergence between the two triggers.
Change:
website/src/pages/chat/UserMessage.tsxadds anonDoubleClickhandler onthe read-only message bubble, wired only when
canEditResendis true. The handler(
handleDoubleClick) is declared before theeditingearly-return so React's hookorder stays stable across the read-only and editing renders. A double-click that
lands on a text run still selects a word first (default browser behavior) and only
fires the handler afterward, so it never fights native selection. The bubble stays
a presentational element; the keyboard-accessible path remains the aria-labelled
pencil button, so the mouse-only
onDoubleClickcarries a scopedjsx-a11y/no-static-element-interactionsdisable, matching the pattern alreadyused for double-click-to-rename in
ChatSidebar.tsx.Tests
website/src/test/UserMessage.test.tsxadds three cases:original content);
onEditResendis absent;canEditis false.These lock in both the behavior and its gating. Full file: 36/36 pass.
Manual verification
Typecheck (
tsc -b), ESLint on the changed files, and theUserMessagevitestsuite all pass locally under Node 24 (the repo's required version). The before/
after render was captured from a faithful standalone harness using the
component's own bubble/edit classes and theme tokens.
Screenshots / video
Double-click on a sent message enters the same edit mode the pencil button opens
(accent-outlined textarea + Cancel/Send):
Related Issues
Fixes #7908
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)