Navigate to paths outside the project from the Files panel (../, ~/, absolute) #14489
josephv123
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What I'm trying to do
I want to reach files outside the current project from the Files panel by typing their path. One common case: some of my projects are subfolders of a larger repo, for example
~/work/monorepo/sub-a, with~/work/monorepoadded as its own project too. While working insub-aI often need to glance at a file one level up or in a sibling folder, like../README.mdor../sub-b/notes.md, without switching projects.What happens today
The Files panel's search box only fuzzy-matches paths inside the project. Typing
../,../sub-b/notes.md,~/work/...or an absolute path matches nothing, and the tree stays on the project's own files. The only way to see a sibling file is to switch to the parent project, which moves me out of the thread I'm in.From the code (main @ bd89c13):
apps/web/src/components/files/FileBrowserPanel.tsx:118-120: the input feedsuseProjectPathSearch({ cwd, query }).apps/server/src/workspace/WorkspaceEntries.ts:235-243:searchqueries the workspace search index for that root only.apps/server/src/workspace/WorkspaceEntries.ts:283-303:listrejects any directory that resolves outside the root ("Directory must be inside the workspace and outside .git.").apps/server/src/workspace/WorkspaceFileSystem.ts:5-8: file reads already accept absolute host paths "so clients can show files an agent left outside the workspace", so read-only viewing outside the root is already supported on the server.What I'd like
When the Files input looks like a path (starts with
/,~/or../), treat it as path navigation instead of fuzzy search:../sub-b/ notes).This should work for any path on the machine, not just the project's own repo: I also want to peek at files in unrelated folders (another repo, a downloads folder, a config file in
~) without adding each one as a project. Writes stay confined to the workspace root, as they are now. If maintainers want a guard, a setting to turn off out-of-project browsing would be fine, but the default should allow it, since the agent in the thread can already read those paths.Related
All reactions