Repository navigation
feat(desktop): quote selected timeline text into the composer - #55664
Conversation
There was a problem hiding this comment.
Looks good. I ran the 8 new quote e2e cases in headless Chromium and all pass. The composer and session unit tests pass (176), and typecheck passes in app, session-ui and ui. In a quick before/after run (screenshots below), the Quote toolbar appears under a selected reply, and Alt-click adds the quote chip with its comment editor open. The base shows no toolbar.
Public API is unchanged. The new quote context item and comment type are internal app/session-ui types, and allowEmpty is an optional prop on LineCommentEditor. The SDK, server API, plugins, config and CLI are untouched.
No blocking concerns.
|
Registering a real-user signal for review: I use the Desktop app daily for long agent sessions, and quoting a specific sentence of a previous answer to comment on it is the interaction I reach for most. Today it costs six steps (drag-select, copy, focus composer, paste, hand-wrap in The edge cases in the description are the ones that actually matter in practice: selections crossing message and diff boundaries, excluding buttons and timestamps, and refusing silently-truncated quotes over the length limit. Follow-up, explicitly not a request to expand this PR: the same surface would be worth exposing to plugins eventually, because the three missing pieces are also what several neighbouring requests need (#54002 markdown copy, #55195 pinning a selection):
None of that needs to land here. I'm only noting it so the selection plumbing this PR builds is not accidentally shaped in a way that closes the door on it later. Separately: my #56836 is the same request and can be closed as the duplicate it is — sorry for the noise, I should have searched harder before filing. |
e241915 to
a3f571c
Compare



Issue for this PR
Closes #48664
Related: #53189, #54581 (quoting covers part of each)
Type of change
What does this PR do?
Lets you select text anywhere in the session timeline and quote it into the composer, with an optional comment per quote.
quotecomposer context item, shown as chips. Hovering a chip shows "Add comment" (or "Edit comment"), and clicking opens the same comment editor used for file comments, anchored to the chip. Alt/⌥-click on Quote adds the quote and opens its comment box focused. Enter with an empty comment keeps the quote with no comment.>prefixed lines, followed by the comment if there is one. Quotes are stored in message metadata, so sent messages show them as cards and revert/fork restores them.How did you verify your code works?
bun typecheckin app, session-ui and ui.bun run lint:changedpasses.request.test.tscase for how quotes are sent.timeline-stream.spec.ts: quoting across messages, tables and diffs; toolbar placement (down/up drags, triple-click, select all, resize, touch vs narrow mouse); keyboard (Tab/Escape); the length limit; clearing on outside click; chip comments; and Alt-click. The timeline-stream and session-queue suites pass (83).timeline-stream.spec.tsfile passes fully parallel.Screenshots / recordings
Selection toolbar:
Tooltip with the Alt-click shortcut:
Alt-click opens the quote's comment in the composer:
Quote chips, with the hover hint on a quote without a comment:
Sent message:
Touch screens dock the action to the bottom:
Checklist
Added by the opencode bot (AI-generated).
Fixes #48664
Related: #53189, #54581