[FEATURE] File viewer: no way to reach a cited line in a markdown file (links force preview mode, :line is dropped)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Assistant messages cite files as [foo.py:53](foo.py:53). For code files the File viewer opens in source mode and jumps to the line - works great. For markdown the same link is unusable, and there is currently no path to the cited line at all:
- A .md link whose href carries :line fails entirely - nothing opens (dead click; the right-click menu also differs).
- A plain-path .md link always opens in preview mode, which has no line numbers. The mode cannot be pre-selected, so the line is already discarded by the time I can switch to source - switching afterwards lands at the top of the file.
Net effect: for the file type where long documents are most common (our append-only history log is ~5000 lines), a cited line can never be reached by clicking, and no workaround recovers it. Desktop v2.1.237, Windows 11.
Proposed Solution
Let a :line link reach the line in markdown too: (a) a setting to default the File viewer to source mode, or auto-switch to source when the href carries a :line suffix; (b) graceful fallback - when a :line link cannot jump, still open the file at the top instead of doing nothing. A dead click is worse than a lost line number.
Alternative Solutions
Our Stop-hook receipt renderer special-cases markdown (strips :line for .md only) so the links at least open - but that only avoids the dead click; the line is still unreachable. Opening the file from the tree and searching for the section by hand is the only way, which is what the link was supposed to save.
Priority
High - Significant impact on productivity
Feature Category
File operations
Use Case Example
- A Stop hook prints a per-turn receipt: every file changed this turn, with line ranges, as clickable links.
- Code files: I click [hook.py:279] and land on line 279 in source mode. I review the change in two seconds.
- Markdown (our ~5000-line append-only history log): I click [handoff-history.md:5342] and nothing happens at all.
- I strip the :line so it at least opens - it opens in preview at the top, with no line numbers and no way to have asked for source.
- I switch to source: still the top of the file. The line number from the receipt is now useless; I search for the section by hand.
- With this feature the markdown link lands on the section the same way code links do.
Additional Context
Filed alongside two companion requests about the same pane: (1) keeping the line position when toggling between source and preview modes, (2) font size zoom inside the File viewer. This one is the prerequisite: without a way to open markdown in source mode, there is no line position for the toggle to preserve.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗