Repository navigation
Open tool-call files in the files panel, and in the default editor - #164
Open
katulevskiy wants to merge 4 commits into
Open
katulevskiy wants to merge 4 commits into
katulevskiy wants to merge 4 commits into
Conversation
Clicking the file badge on a Read/Write/Edit/Patch tool row now opens that file in the right-hand files panel, instead of only expanding the row to show its path. The badge goes through the transcript's existing workspace-link handler, the same route Markdown file links take, so it resolves against the same roots (the chat's checkout, its parent's, and this device's projects) and opens outside absolute paths read-only. The badge stops propagation, so clicking it does not also toggle the row's accordion; the rest of the header still expands the output or diff. Paths the link handler cannot open keep an inert badge rather than looking clickable and doing nothing.
Add an "Open in default editor" button to the file viewer's breadcrumb toolbar, next to "Reveal file in tree". It hands the file to the platform's default application (xdg-open, open, ShellExecute) via gpui's open_with_system. The button only appears for workspaces on this device: a remote space's files live on another machine, where the local default app cannot reach them.
Source: zeronsh#522 Source revision: 6ca536b
Contribution Managerneeds triage · medium risk · untriaged Open review workspace · Revision Next actions:
This summary is maintained by the review app. Decisions and test evidence are recorded in the workspace; the app does not merge 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.
Upstream mirror
Source: zeronsh#522
Original author: @katulevskiy
Original revision:
6ca536b04f5f0ed47c768c54ca350e9941943542This PR is an isolated Contribution Manager pilot mirror. Its reviews, checks and merge state are separate from upstream. An empty
[skip ci]commit suppresses automatic bulk CI; the code tree matches the imported upstream revision.When you expand a tool group, Read/Write/Edit/Patch rows show a file badge, but clicking the row only expands it to reveal the path. The files panel can already open workspace files (Markdown file links use it), so this PR connects the badge to it, and adds a way to hand the open file to your own editor.
Tool-call file badges open the file in the files panel (
transcript.rs)Shell::activate_session_link/open_workspace_file_link. There is no new event or shell plumbing.LinkUi::file_link, so it resolves against the same ordered roots as Markdown links (the chat's checkout, its parent's, this device's projects), and an absolute path outside all of them opens read-only like an outside Markdown link. Paths the handler can't open keep an inert badge instead of looking clickable and doing nothing."Open in default editor" in the file viewer toolbar (
files/preview.rs)ARROW_UP_RIGHTicon) calls gpui'sopen_with_system:xdg-openon Linux,openon macOS,ShellExecuteon Windows.FilesRequestContext::target_device_id.is_none()). A remote space's files live on another machine, where the local default app can't reach them. The path is the chat'scwdjoined with the workspace-relative path, which matches the root the engine'sresolve_targetuses for chat targets.Verified locally:
cargo test --locked -p zeron-ui --lib -- --test-threads=1: 1356 passed, 2 of them new:tool_file_badge_opens_linkable_files_without_toggling_the_chipclicks the badge and checks that the link handler gets the path and the accordion doesn't toggle; clicking elsewhere on the row still toggles it; a path the handler can't open gets no clickable badge. With thestop_propagationline removed, the test fails as expected.default_editor_opens_only_files_on_this_devicechecks that local workspaces get an absolute path and remote or unresolved ones get none.cargo check --locked -p zeronis clean. Clippy adds no new warnings overmain(tool_chipalready had too many arguments), and the diff is rustfmt-clean.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.