Description:
When clicking on file links with line number ranges (format like filename.ts:42-50 or filename.ts#L42-L50) in agent chat replies, the file opens in the viewer but doesn't automatically scroll to or highlight the specified lines.
Steps to Reproduce:
- Have an agent generate a reply that includes file links with line numbers
- Click on such a link (e.g.,
[CodeEditor.tsx:924-1028](src/web-ui/src/tools/editor/components/CodeEditor.tsx#L924-L1028))
- Observe the file opens but stays at the top without scrolling/jumping
Expected Behavior:
The file viewer should automatically scroll to and highlight the specified line range when the file is opened via a link.
Technical Details:
- File links are parsed in
Markdown.tsx (lines 434-457) using parseLineRange()
- The line range is passed to
handleFileViewRequest() (line 474)
FileTabManager.ts receives jumpToRange parameter when opening files
CodeEditor.tsx has the jump logic in lines 924-1028, using jumpToRange prop
- The jump effect may be firing before the file content is fully loaded or the editor is ready
Files Involved:
src/web-ui/src/component-library/components/Markdown/Markdown.tsx - link parsing and handling
src/web-ui/src/flow_chat/components/modern/useFlowChatFileActions.ts - file view request handler
src/web-ui/src/shared/services/FileTabManager.ts - tab management with jumpToRange
src/web-ui/src/tools/editor/components/CodeEditor.tsx - jump implementation (lines 924-1028)
Description:
When clicking on file links with line number ranges (format like
filename.ts:42-50orfilename.ts#L42-L50) in agent chat replies, the file opens in the viewer but doesn't automatically scroll to or highlight the specified lines.Steps to Reproduce:
[CodeEditor.tsx:924-1028](src/web-ui/src/tools/editor/components/CodeEditor.tsx#L924-L1028))Expected Behavior:
The file viewer should automatically scroll to and highlight the specified line range when the file is opened via a link.
Technical Details:
Markdown.tsx(lines 434-457) usingparseLineRange()handleFileViewRequest()(line 474)FileTabManager.tsreceivesjumpToRangeparameter when opening filesCodeEditor.tsxhas the jump logic in lines 924-1028, usingjumpToRangepropFiles Involved:
src/web-ui/src/component-library/components/Markdown/Markdown.tsx- link parsing and handlingsrc/web-ui/src/flow_chat/components/modern/useFlowChatFileActions.ts- file view request handlersrc/web-ui/src/shared/services/FileTabManager.ts- tab management with jumpToRangesrc/web-ui/src/tools/editor/components/CodeEditor.tsx- jump implementation (lines 924-1028)