feat(web): tag files and directories from anywhere on the filesystem - #5446
feat(web): tag files and directories from anywhere on the filesystem#5446chrisdeeming wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. New feature enabling file tagging for arbitrary filesystem paths, with substantial cross-layer changes. Two unresolved medium-severity bug reports (label key mismatch, pipe encoding) identify potential correctness issues. You can customize Macroscope's approvability policy. Learn more. |
b83cd06 to
daa899b
Compare
The browse RPC only listed directories, which is all the project picker needs. Add optional `kinds` and `limit` inputs and a `kind` on each entry so callers can ask for files too. Both fields are optional: with `kinds` absent the server still returns directories only, so the project picker is unchanged. Entries are sorted directories-first and the limit is applied last, keeping prefix completion deterministic rather than dependent on directory iteration order.
The `@` picker only searched the indexed workspace, so files outside the project could not be tagged. Queries that are unambiguously filesystem paths (`/`, `~/`, `./`, `../`, and Windows absolute paths on Windows) now browse the thread's environment one segment at a time. Ordinary `@foo` queries keep the existing workspace search untouched. Browsing runs through the environment RPC, so remote threads complete against the filesystem where the agent actually runs, and the inserted tag preserves the spelling the user typed rather than a resolved path.
daa899b to
81df608
Compare
81df608 to
d8e09ab
Compare
d8e09ab to
60e71fe
Compare
Rendering used path-shape heuristics to decide what became a file chip, so an out-of-workspace tag could fall back to a plain link, and a `~/` path needed a cwd it could infer a home from. Canonical `[basename](path)` tags now resolve through their own path, keeping the heuristics for bare paths so application routes such as `/chat/settings` still never become chips. A tag that cannot be resolved in the current context renders and copies but is not offered as an open action. Workspace containment now normalizes `..` segments before comparing, so a path such as `/repo/../outside/page.html` is no longer treated as inside the project, and comparison is case-sensitive except on Windows.
60e71fe to
8f5d400
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8f5d400. Configure here.

What Changed
The composer's
@picker can now complete filesystem paths. Type/,~/,./or../and it browses the thread's environment a segment at a time, so you can tag any file or directory. Plain@fooqueries still search the workspace exactly as before.Tags pointing outside the workspace now render as chips instead of plain links.
filesystem.browsegains optionalkindsandlimitinputs and returns akindper entry. Leavekindsoff and it returns directories only, so the project picker is untouched.Why
The picker only knew about workspace files, so there was no way to tag anything outside the project.
Completing one explicit segment keeps it small: no new index, no fuzzy search outside the workspace, no change to plain
@queries. Browsing runs over the environment RPC, so on a remote thread~means the remote home, matching where the agent runs.Bare paths keep the existing heuristics, so routes like
/chat/settingsstill never become chips.Unchanged: the text sent to the agent, and
projects.readFilecontainment. One fix along the way — workspace containment now normalises.., so/repo/../outside/page.htmlno longer counts as inside/repo.Checklist
I included before/after screenshots for any UI changesI included a video for animation/interaction changesNote
Medium Risk
Touches composer path routing, filesystem browse RPC contracts, and markdown link/open behavior; changes are well-tested but span client UI and server browse semantics.
Overview
The composer
@path picker now branches on explicit filesystem queries (/,~/,./,../, Windows drives): those usefilesystem.browseviauseComposerFilesystemBrowseinstead of workspace search, while plain@foobehavior is unchanged.filesystem.browsegains optionalkindsandlimit, returns akindper entry, and applies directories-first ordering with a limit split so files are not hidden behind many directories. Defaultkindsstays directory-only for existing callers.Chat markdown resolves canonical composer file links (label matches basename) into file tag chips, including paths outside the workspace. Unresolved paths (
~, scoped package refs like@scope/package.json) stay display-only viaopenTargetPath: null(no open-in-editor). Workspace containment now normalizes..and uses platform-appropriate casing on Windows paths.Serialized composer links escape more markdown-sensitive label characters and encode
&/|in destinations; Windows drivehrefs are preserved through the URL transform.Reviewed by Cursor Bugbot for commit 8f5d400. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add filesystem path browsing and file tag support for any path in the composer
useComposerFilesystemBrowsehook with debounce and a configurable limit.FilesystemBrowseInput/FilesystemBrowseEntry) to supportkindsfiltering and a boundedlimit; the server-side browse handler returns entries with akindfield, sorted directories-first, with proportional limit splitting between directories and files.ChatMarkdown: formatted labels (e.g. bold/italic filenames) now resolve to file chips, Windows drive path hrefs are preserved rather than rewritten, and links that cannot be opened render as non-clickable chips without an 'Open in editor' menu item.escapeMarkdownLinkLabelnow escapes*,_,|,`,&, and other markdown-sensitive characters;encodeMarkdownLinkDestinationencodes&.kindsarray return no entries; existing clients omittingkindsare unaffected.Macroscope summarized 8f5d400.