Repository navigation
Conversation
Numbers existing paths in the last completed assistant response and opens one with the configured editor. Supports relative, absolute, Windows, UNC, and file:// paths, directories, quoted paths with spaces, and line/column suffixes. Code fences and URLs stay untouched. Adds /paths and <leader>f, with multi-select and a picker bar built from existing theme tokens.
|
Thanks for the detailed write-up and the tests, @spaxe-dev! This is about 1,460 changed lines without tests across several layers (path scanning, the picker UI, editor launching, theme overrides and a storybook story). That's more than we can review well in one pull request, so I'm closing it and asking you to split it into smaller, focused PRs that can each be reviewed on its own. One possible split:
Since the interaction is new and doesn't follow #58242 as filed, you could also check the UX direction with maintainers on an issue first. You're welcome to open those PRs. |
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.
Issue for this PR
Related: #58242, #54816, #55769, #48609
Type of change
What does this PR do?
Agent responses usually end with a list of files. In the TUI those paths are plain text, so getting to one means selecting and copying it. This adds
/paths(and<leader>f): it numbers the paths in the last completed response, tags each one in red, and opens the path you type.It covers the shapes that show up in practice: relative and
.//../, absolute POSIX, Windows drive and UNC,file://URLs with#L12C3, directories, quoted paths with spaces, andpath:lineorpath:line:column. Markdown links and inline code are read through their delimiters. Fenced code, URLs, and commands are left alone.Opening prefers
$VISUAL/$EDITOR, passes line and column in the syntax each editor understands (--goto,file:line:column,+line), and groups files into one process when the editor accepts several targets. Without an editor, files go to the OS handler, directories to the file manager, and executable types are refused with a message instead of being launched.Multi-select is
m, numbers toggle,aselects up to 10, andenteropens the selection. The cap keeps one keypress from starting an unbounded number of processes. If one number is a prefix of another (1and12), the picker waits 600ms before opening so typing12does not open1.Tags are inserted as
~~1~~,~~●1~~, or~~○1~~, which Markdown conceals. While the picker is open, the marked text parts use a derivedSyntaxStylethat mapsmarkup.strikethroughtotext.feedback.error.base; closing the picker restores the shared style. This gives red tags without adding a theme token and without recoloring real strikethrough, links, or inline code.generateSyntaxtakes optional per-scope overrides for this and keeps its current behavior by default.This is keyboard driven, so it does not implement #58242 as filed. It sits next to #55769, which opens Markdown links to local files with the OS handler, and #48609, which asks for clickable file names on tool blocks. Both are complementary; nothing here changes link handling or tool headers. The feature is behind a command and a keybinding, so it does not add work to the normal transcript path until the picker is opened. Happy to adjust the interaction if maintainers want a different shape.
How did you verify your code works?
Automated, from the affected packages:
Full TUI suite: 1565 pass, 21 skip, 7 fail. The only failures are seven Windows
EPERM: operation not permitted, symlinktests in plugin and watcher suites, which reproduce on a clean checkout on this machine.Coverage added:
~, fenced code and URLs ignored, explicit missing paths, Windows drive/UNC/file URLs, POSIX normalization, dedupe, numbering across parts, multi-digit disambiguation, tag spacing~~markersManual check:
EDITORset to an editor. Terminal editors suspend the renderer until exit./paths.m, toggle numbers, pressenter.The storybook story renders the production component with a temp fixture:
Visual
Screenshots / recordings
No recording. The story above shows the tagged transcript and the picker bar with a fixture that includes quoted paths, directories, a
file://URL, a missing path, and generated files.Checklist