Repository navigation
Cite selected text from a rendered Markdown file, like citing an assistant response #32009
robrab2000
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When a Markdown file is open in the file pane's rendered view, there's no way to point the agent at part of it. Selecting text does nothing, unlike assistant responses, where Cite puts a quote chip in the composer.
Today the only way is to switch to "Show markdown source" and add a line-range comment. That works, but you have to leave the readable view, and it behaves differently from citing in the chat. This matters most for documents you read and refine with the agent, such as specs, plans and READMEs, where you want to say "rewrite this paragraph" or "is this claim right?" about a specific passage.
Proposal
Make selecting text in rendered Markdown behave the same as it does in the chat:
The source would be file-shaped rather than message-shaped: the workspace-relative path, the quoted text and surrounding context, and line numbers as a hint where they can be worked out. Relying on the quote with context, not only the line numbers, means the citation can still be found after the agent edits the file, which is the usual case for documents being worked on. Chat citations already locate quotes this way.
As far as I can tell, this could extend the existing citation format with a file source instead of adding a new mechanism. Sending already expands citations into plain quoted text for every provider, so the agent side should need little or no change.
Scope
Would this direction be welcome? I'm happy to prototype it if the scope looks right.
All reactions