fix(chat): preserve path:line refs through file open - #810
ZxlDragonDoctor wants to merge 1 commit into
Conversation
Chat tokens like src/a.ts:42 previously lost the line in parseFileRef
before any opener ran. Keep the position on ChatPreviewTarget, thread it
through useOpenChatFileRef, encode plugin locations as path#L{line}, and
scroll the host file viewer when the bundled file-manager view is absent.
|
Thanks — keeping the parse position is the right direction, but I checked this branch against current CI on the head is failing (landing blocker)
The #681 path itself is not threaded
Possible regression on the bundled file-view path — please confirm What would make this landable: rebase onto |
Problem
Chat tokens such as
src/a.ts:42open the file but lose the line. On currentmain,parseFileRefrecognizes:line[:column]thenstripLineRefdrops the position before any opener runs;useOpenChatFileRefonly forwards a path into file-manager / work panel.Confirmed on the issue: reporter symptom matches code path; maintainer review on #681 notes the stripLineRef gap is real and no mergeable PR existed.
Solution
ChatPreviewTarget.useOpenChatFileRef/ work-panel open path.path#L{n}viafileLocationWithPosition.FilesTabscrolls to the line when the bundled plugin view is absent.Addresses maintainer confirmation on #681 (stripLineRef gap; no competing mergeable PR).
Testing
node --test apps/desktop/test/chat-links.test.mjsparseFileRefPosition keeps the line the transcript named (#681)fileLocationWithPosition encodes #L for plugin open locations (#681)Agent dimension
tool-retrieval (chat path:line refs ? file open + line scroll)
Core value
[path:line]chips in chat keep the line through open instead of only landing on the file.Issue alignment
Fixes #681