Repository navigation
feat(web): cite a stretch of the transcript, tool calls included - #476
Merged
Merged
Conversation
Dragging a selection across messages cites everything between, including user messages and tool calls. Shift-clicking a tool call picks it, grows a text selection to it, or extends a pick, with a Cite button at the foot of the timeline. Citations carry ordered segments so the chip summarises the excerpt, agents receive it as a short transcript, and going to the source scrolls to and tints the cited items. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Citations could only quote text inside one assistant response, so there was no way to point an agent at a run of the conversation: what it said, the commands it ran, and what it concluded.
This adds transcript citations:
segmentsnaming each item's id. Items hidden in collapsed tool groups or folded turns are included; reasoning is left out.How
AssistantCitationgains an optionalsegmentsarray (message or tool-call ids in timeline order);text/markdownhold the rendered excerpt. Extending the existing type rather than adding a new one means every consumer (composer chips, queue and stash previews, titles, find, mobile, provider expansion, sending to another thread) handles excerpts without changes. Old citation links are byte-identical. A client without this change won't recognise a link carryingsegmentsand will show it as a plain link.Segments are built from the timeline entries, not the DOM, because LegendList recycles rows out of order and unmounts off-screen ones (
transcriptCitation.logic.ts). Only the two ends of a drag are read from the DOM.Screenshots
Dragging from one response to the next, across "Ran 4 commands":
Before, a cross-row selection offers no Cite button. After, the commands in the range are tinted (reasoning rows are not) and Cite appears.
Shift-clicking a command and then the response below it picks whole items, with the action above the composer:
The chip and its comment panel, then the chip's hover preview:
Verification
segmentslink format, and a browser test for drag, shift-click and Escape. Temporarily removing the shift-click interception makes the browser test fail.check:changedis clean for this change. Its remaining failures exist without it: knip's unused exports, a server typecheck error inProviderInstanceRegistry.test.ts, and two "opens a nested diff" tests inMessagesTimeline.browser.test.tsx.docs/user/composer.mdand a new section indocs/fork-differences.md.Not covered: mobile only renders excerpts as text (it doesn't create citations, as before), and I didn't test the desktop app separately from web.
Claude Opus 5.5 in T3 Code (Claude Code harness).
🤖 Generated with Claude Code