-
Couldn't load subscription status.
- Fork 2.3k
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
base: main
Are you sure you want to change the base?
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.


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.