Repository navigation
feat(chat): quote selected chat text into the composer - #593
Merged
Merged
Conversation
Text selected in a chat's message text (assistant replies, tool-timeline text, user bubbles) now becomes the composer's selection chip, like a note selection does. It is held back while selecting, since chat text is mostly selected to copy, and pins when the composer is pressed or focused (capture phase, before the press collapses the selection). The model sees it as a quote, not a file: "[Quoted from earlier in this conversation]" for the same thread, or the source chat's title and path for another one. Whether it is the same thread is fixed on the ref at capture, because the block is rebuilt to strip it and a thread's path changes when it is auto-titled. Closes #591 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryAdds chat-message quotes to the composer.
All four earlier, unnumbered findings are addressed: quotes exclude intervening tool output, destination labels are set at send time, popout documents receive selection listeners, and saved quote paths follow chat renames. No new actionable issues were found. Reviews (6) · Last reviewed commit: "fix(chat): keep the highlight on a pinne..." · Reviewed by Greptile |
- A selection spanning several messages keeps only their text: the UI between them (an expanded tool card's output, footers) is cut out, one clamped range per message element. - Whether a quote comes from the same thread is decided at send time, not when it was pinned, so a quote that outlives the composer switching threads is no longer sent as "this conversation". - selectionchange is listened on every window document (popouts too), and the pinned highlight is registered on the window that owns it. Co-Authored-By: Claude <noreply@anthropic.com>
A chat auto-titles itself after its first turn. A quote pinned from it kept the old path, so at send time it no longer matched the composer's thread and went out labelled as coming from another chat. Co-Authored-By: Claude <noreply@anthropic.com>
A chat selection now shows its chip live, like a note selection. The composer still pins it; a selection that collapses before that (copied, then clicked away) drops the chip. Co-Authored-By: Claude <noreply@anthropic.com>
A selection is a quote wherever it came from; the icon also sets its chip apart from the file chips of visible notes. The icon is no longer stored on the SelectionRef; an icon on older persisted refs is ignored. Co-Authored-By: Claude <noreply@anthropic.com>
The highlight went to the active Markdown view, but a note selection is pinned on active-leaf-change, when the active view is already the chat, so no editor ever got it. Find the editor that owns the selection by path. Co-Authored-By: Claude <noreply@anthropic.com>
Leo310
added a commit
that referenced
this pull request
Nov 26, 2026
Google Gemini (#584), Mistral (#585) and LM Studio (#583) as providers, a directory of OpenAI-compatible services under More providers (#589), and a per-agent reasoning effort (#582). Quoting chat text into the input (#593), chats that open where the last one was (#592), model details read from each provider instead of models.dev (#586), and mobile fixes for the sidebar drawer, the Cupertino theme, the formatting toolbar and the empty-chat greeting (#594, #595, #596). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Text selected in a chat's messages can now be attached to the composer, as a note selection already can. Closes #591
pointerdown/focusinon the input card runs before the press collapses the selection, and the chip adopted on the last refresh covers the case where it already has. A selection that goes away before that (copied, then clicked elsewhere) drops its chip, and leaving the chat for a note does not pin it. Clicking back into message text dismisses a pinned quote, mirroring the note behaviour..s2b-message-text, which includes tool-timeline text) and user bubbles (new.s2b-user-bubble-textmarker). Tool cards, bars, the tray and the composer are ignored.[Quoted from earlier in this conversation]for the same thread,[Quoted from the chat "<title>" (<path>)]for another chat.sameThreadis decided at send time and stored on theSelectionRef, becausestripAugmentedSuffixrebuilds the block from the ref and a thread's path changes when it is auto-titled.getMostRecentLeaf().How I tested it
New unit suite
test/hooks/chatSelection.test.ts(shown live, dropped when the selection goes away unengaged, pinned after the press already collapsed the selection, non-message text ignored, cross-chat labelling, dismissal on a click into message text, and the three context-block formats). Fullcheck/format/lint/testpass. I built into the slot vault and the plugin loads with no errors. I have not clicked through it live on desktop or mobile; that's for the maintainer's live test. On mobile, a long press on a user bubble opens its menu, so in practice only assistant text is quotable there.AI assistance: Claude Code wrote the change and tests from the maintainer's brief on #591 (live chip pinned on composer engagement, quote framing, message-text-only scope); live testing is still pending from the maintainer.
Checklist
bun run check,bun run format,bun run lint, andbun run testpass locallymanifest.json: I noted that the docs site needs updating (see "Documentation" in CONTRIBUTING.md)