-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: Quote selection to reply with icon overlay (#8837) #8838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Use codicon-quote glyph in a rounded tile; keep aria-label for a11y. Wrap selection-scoping helpers in useCallback and add deps to satisfy lint. Ensure message containers carry data-message-ts for selection scoping.
Review CompleteNo issues found. The implementation is clean and well-structured: ✅ Uses |
| {quoteOverlay.visible && ( | ||
| <button | ||
| type="button" | ||
| aria-label="Quote selection" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making the ARIA label for the quote overlay button translatable (e.g. using t('chat:quoteSelection')) instead of the hardcoded "Quote selection" to support i18n.
| aria-label="Quote selection" | |
| aria-label={t('chat:quoteSelection')} |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
| <div className="text-sm whitespace-pre-wrap flex-1 max-h-20 overflow-hidden">{activeQuote}</div> | ||
| <button | ||
| type="button" | ||
| aria-label="Dismiss quote" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, the dismiss button uses a hardcoded ARIA label "Dismiss quote". Please update this to use a translatable string (e.g. t('chat:dismissQuote')).
| aria-label="Dismiss quote" | |
| aria-label={t('chat:dismissQuote')} |
This comment was generated because it violated a code review rule: irule_C0ez7Rji6ANcGkkX.
|
Hey @brunobergher can you take a quick look at this one UI-wise? |
|
I don't understand what problem this is trying to solve. #8837 asks for the functionality without necessarily explaining who is it for or how it's used. From what I'm able to see I don't support this one at all, but I'm curious to understand more. |
Just is a feature port from Cline that allows you to do this. It helps us quote the exact context we want to return to the agent when going back and forth with it. More of a UX feature if anything. Screen.Recording.2025-10-30.at.4.50.46.PM.mov |
|
Ooh, I see now, thanks for explaining. Yeah, this makes sense. I'm not sure I'd port it over directly though. I'd tweak it to:
|


Related GitHub Issue
Closes: #8837
Roo Code Task Context (Optional)
No Roo Code task context for this PR
Description
This PR implements the "Quote selection to reply" feature for the chat UI, enabling users to select text within a message and quote it in their response.
Implementation approach:
data-message-tsattributes on message containers[context]\n> line1\n> line2\n[/context]prepended to outgoing messagesKey design decisions:
useCallbackfor stable selection helpers to satisfy React hook dependenciesFiles changed:
webview-ui/src/components/chat/ChatView.tsx: Core selection logic, overlay, preview, and injectionwebview-ui/src/components/chat/ChatRow.tsx: Addeddata-message-tsattribute for selection scopingTest Procedure
Automated tests:
All existing tests pass (92 test files, 1094 tests passed).
Manual testing:
Lint validation:
All lint checks pass (11 tasks successful).
Pre-Submission Checklist
Screenshots / Videos
Before:
No quote selection feature.
After:
Icon-only quote overlay appears near selection:
Quote preview above composer:
Documentation Updates
Additional Notes
The feature is entirely client-side and integrates cleanly with the existing virtualized message list. Future enhancements could include:
Get in Touch
Discord username not provided
Important
Introduces a "Quote selection to reply" feature in chat, allowing users to quote selected text with an overlay button and keyboard shortcut, implemented in
ChatView.tsxandChatRow.tsx.ChatView.tsxandChatRow.tsx.data-message-tsfor selection scoping inChatRow.tsx.asContextBlock()formats quoted text inChatView.tsx.useCallbackanduseStateinChatView.tsx.codicon-quoteicon.This description was created by
for 6a3c407. You can customize this summary. It will automatically update as commits are pushed.