Repository navigation
feat(native-chat): quote a selection from an agent reply into the composer - #26018
Conversation
📝 WalkthroughWalkthroughNative chat can offer a quote action for selected text in eligible message content. The selection reader validates and formats the text, and the composer API can append the formatted quote after the current draft. The context-menu hook mounts the offer and receives the required composer ref. Translations and tests were added or updated. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to If the composer becomes unavailable after a quote offer appears, clicking can dismiss the offer without adding the text; users can retry by selecting text again. This is a limited, recoverable issue, and a focused draft-and-caret test would improve confidence before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 47.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 18 files. (6 skipped: 6 unsupported.) Full details: Description checkExplanation The description is detailed and covers the user experience, implementation, rationale, visual proof, testing, platform considerations, and checklist. However, it omits the required Linked Issue section and does not provide a
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2f384254-9eb7-45a7-a0ea-2afcf2307849
📒 Files selected for processing (23)
src/renderer/src/components/native-chat/NativeChatMessageList.reader-navigation.test.tsxsrc/renderer/src/components/native-chat/NativeChatMessageRow.test.tsxsrc/renderer/src/components/native-chat/NativeChatMessageRow.tsxsrc/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsxsrc/renderer/src/components/native-chat/NativeChatResolvedView.tsxsrc/renderer/src/components/native-chat/NativeChatSelectionQuote.test.tsxsrc/renderer/src/components/native-chat/NativeChatSelectionQuote.tsxsrc/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsxsrc/renderer/src/components/native-chat/native-chat-composer-reveal-focus.test.tsxsrc/renderer/src/components/native-chat/native-chat-composer-types.tssrc/renderer/src/components/native-chat/native-chat-paste-routing.test.tsxsrc/renderer/src/components/native-chat/native-chat-quote-selection.tssrc/renderer/src/components/native-chat/use-native-chat-composer-handle.tssrc/renderer/src/components/native-chat/use-native-chat-context-menu.test.tsxsrc/renderer/src/components/native-chat/use-native-chat-context-menu.tsxsrc/renderer/src/components/native-chat/use-native-chat-typed-insertion.tssrc/renderer/src/components/native-chat/use-structured-native-chat-pane-commands.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
…6018-merge # Conflicts: # src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx
…6018-merge # Conflicts: # src/renderer/src/components/native-chat/NativeChatMessageRow.tsx # src/renderer/src/components/native-chat/use-native-chat-composer-handle.ts # src/renderer/src/components/native-chat/use-native-chat-context-menu.test.tsx # src/renderer/src/components/native-chat/use-native-chat-context-menu.tsx # src/renderer/src/components/native-chat/use-native-chat-typed-insertion.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/native-chat/NativeChatSelectionQuote.test.tsx (1)
76-86: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the real composer append path.
NativeChatSelectionQuote.test.tsx:76-86injects avi.fnforappendText, so the test stops beforeuseNativeChatTypedInsertion.appendText. Add a fixture with an existing draft and assert the combined draft and final caret after clicking Add to chat. The current test can pass if either behavior regresses.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
20e70371-e6d5-4f0f-bddc-c68b8ab6201e
📒 Files selected for processing (8)
src/renderer/src/components/native-chat/NativeChatSelectionQuote.test.tsxsrc/renderer/src/components/native-chat/NativeChatSelectionQuote.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (6)
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/components/native-chat/NativeChatSelectionQuote.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
|
Changed the button wording from "Quote" to "Add to chat" in ee947a1, since that's the common label for this action. The icon is now the message-plus icon. I also updated the translations (es/fr/ja/ko/zh), the tests, and the PR description. What the button does hasn't changed: it still adds the selected text to the message box as a |
ELI5
When you select text in an agent's reply, a small "Add to chat" button appears next to it. Clicking it puts that text into the message box as a quote, so you can reply to that exact part.
What Changed
Before: selecting text in a reply offered nothing except Copy in the right-click menu. To refer to part of a reply you had to copy it, click into the message box, paste, and add the
>yourself.After: selecting text inside an agent's reply (with the mouse or the keyboard) shows an "Add to chat" button beside the selection. Clicking it adds the text to the message box as a markdown quote, below anything already typed, and puts the cursor on a new line under it.
How it works: the prose of an agent reply is marked in the transcript. On mouse or key release the chat checks whether the whole selection sits inside one marked reply; if so it opens a small popover anchored to the selected text. The message box gained one operation, "append this text after the draft", built on the same rule Stop and a queued message's Edit already use to hand text back to the draft.
Why
Replying to one sentence of a long answer is common, and the manual copy-and-paste route is slow enough that people skip it and write vaguer follow-ups.
Alternatives considered:
Visual Proof
Before:
CleanShot.2026-10-07.at.12.42.37.AM.mp4
After:
https://github.com/user-attachments/assets/4b38ebe1-b606-4890-be1e-670baa135004
Testing
Steps to try it:
> …lines with the cursor on a blank line below.New tests cover: quoting as a blockquote, nothing offered outside a reply, a triple-click whose range runs into the next block or over unselectable text, a press that leaves the selection unchanged, keyboard selection, a message box that cannot take text, the offer going away when the selection does, and which message rows are quotable.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
NativeChatResolvedView.tsxwas at the 400-line limit, so one local was shortened there to make room for the new argument.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)