feat(web): attach selected response text - #5224
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (attaching selected response text to messages) with new UI components, new state management, and new interaction flows. New features with this scope warrant human review. You can customize Macroscope's approvability policy. Learn more. |
9d445cd to
2d7789d
Compare
6907e9a to
869feb2
Compare
869feb2 to
1f9c8a8
Compare
4983c1e to
0275673
Compare
0275673 to
4108b83
Compare
4108b83 to
760517f
Compare
760517f to
6982ab0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6982ab0. Configure here.
6982ab0 to
6163c32
Compare

What Changed
Adds response-text annotations to web and desktop chat.
Users can select text from an assistant response, choose Add to chat, and include an optional comment. Pending selections are grouped in a composer chip where they can be reviewed or removed before sending.
Selections are sent as structured prompt context and displayed as a compact annotation summary instead of exposing the serialized markup in the conversation.
Why
Referencing part of an assistant response currently requires manually copying and pasting it into the composer. This makes the excerpt and the user’s instruction harder to distinguish.
Attaching the exact selection keeps that context explicit while leaving the composer and conversation readable.
UI Changes
Before
Selecting text in an assistant response did not provide an action for attaching it to the next message.
After
Selecting response text opens an Add to chat action.
An optional comment can be added to explain why the text is relevant.
Multiple selections are grouped and can be reviewed or removed individually.
Sent messages display a compact annotation summary without showing the underlying prompt markup.
Interaction video
Screen.Recording.2026-08-02.at.1.00.54.PM.mov
Checklist
Model: OpenAI Codex · Harness: Codex desktop
Note
Add selected response text attachment to the chat composer
appendChatSelectionAnnotationsToPrompt; the composer shows a summary chip (ComposerPendingChatSelectionAnnotations) to review or remove pending annotations before sending.resolvePlanFollowUpSubmissionnow stays in plan mode when chat selection annotations are present even if draft text is empty.Macroscope summarized 6163c32.
Note
Medium Risk
Touches composer send/rollback, draft persistence, and prompt serialization for outbound messages, but changes are localized to chat UI with tests for round-trip and markup edge cases.
Overview
Adds response-text annotations so users can quote assistant output in the next message without copy-paste.
Selecting text in an assistant markdown response opens an Add to chat popover (optional comment). Pending selections live in the composer as reviewable chips, persist in the draft store (storage version bump), and count toward sendable content and plan follow-up mode.
On send, annotations are appended as structured
chat_selectionXML blocks markeddata-t3code-appended; only app-generated blocks are parsed as annotations—user-authored similar markup stays plain text. The timeline shows a compact N annotation(s) summary instead of raw markup; annotation-only messages skip an empty user bubble. Failed sends and plan follow-ups restore cleared drafts when the composer was not edited mid-flight.Reviewed by Cursor Bugbot for commit 6163c32. Bugbot is set up for automated code reviews on this repo. Configure here.