feat(ui): ask follow-up questions about selected answers - #2837
Conversation
|
@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
great idea! looking into it. |
Wait until pointerup before showing the chip so a downward drag does not hit the button, write the label only when it changes, and omit in-bubble chrome such as Copy from quoted text. Co-authored-by: Cursor <cursoragent@cursor.com>
Review findings (fixed in bde18a6)Pushed follow-up commit P1 — Wait for pointerup before showing the quote action P2 — Do not rewrite a live region on every refresh P3 — Exclude in-bubble chrome from quoted text
|
Summary
Ask WebBrain a questionaction when text is selected inside an assistant answer.Motivation
Users currently need to copy part of a long WebBrain answer manually before asking a follow-up. This PR implements the design agreed in #2836 and keeps the reading-to-follow-up flow in the side panel.
Design
The side panel observes selections and accepts only ranges contained in one assistant
.message-textelement. A localized, accessible floating button is positioned near the selection. Clicking it builds a plain-text Markdown quote in the existing textarea, preserves any existing draft after the quote, focuses the composer, and places the caret at the end. The action is coalesced onto one animation frame, rejects detached ranges, and is dismissed on selection changes, outside interaction, scrolling, resizing, send, Escape, tab changes, and conversation clears. No background protocol, persistence format, or model request changes are required.Testing
node test/run.js— 1827 passed; 1 unrelated pre-existing failure: the stale Opera-safe flag license filename assertion expects a 32.1.0 archive while the checked-in archive is 32.0.0.npm run test:toolbar-guard— passed (33 tests).npm run test:security— passed (60/60 checks).node --checkon both sidepanel and selection-quote modules — passed.upstream/main— no blocking findings after fixing stale-range, rAF/layout, localization, and Escape lifecycle issues.Compatibility and risks
This is a local UI-only change. Assistant text is inserted through the textarea value, not HTML, so selected markup remains literal text. The quote action does not auto-submit. Chrome was manually exercised; Firefox parity is covered by mirrored source and focused tests but was not manually exercised.
Scope
Richer quote chips, persistent answer anchors, automatic send, and cross-turn answer navigation are intentionally deferred.
Closes #2836