feat: show git status marks in the Files tree - #7443
yaminyassin wants to merge 16 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:
Warning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
There was a problem hiding this comment.
One consistency finding in the in-scope web file (apps/web/src/components/files/FileBrowserPanel.tsx): the panel's refresh control does not refresh the git status the new decorations depend on, unlike the mobile counterpart added in the same PR. The Tailwind/token side of the change (--trees-git-*-color-override mapped to --success/--warning/--destructive, alongside the existing --trees-fg-override) follows the existing tree-theming ownership and needs no change.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding: the web Files panel subscribes to git status but its Refresh control does not refresh it, unlike the mobile pull-to-refresh added in this same PR.
Posted via Macroscope — UI Consistency
920a13f to
fd00ee1
Compare
There was a problem hiding this comment.
One finding in web scope: FileBrowserPanel now declares handleRefresh twice, so the git-status refresh added for the Refresh button never runs (and the file does not compile).
Posted via Macroscope — UI Consistency
Collapse the duplicate web refresh callbacks so tree refresh also refreshes git marks, reuse the pre-indexed tree paths for untracked directories, and keep Azure repos named `_git`. Co-authored-by: Cursor <cursoragent@cursor.com>
A deleted file path and a Pierre directory path share a normalized key after trailing slashes are stripped. Skip directory identities when applying deleted status so an untracked replacement directory keeps U. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
One finding: the new shared pullRequestRepositoryOf contract is applied to the project-derived repository here, but the thread-linking writer in ChatMarkdown.tsx still builds the same field from repositoryIdentity.displayName, so linkedPullRequest.repository keeps the old shape and this file's fallback chain mixes the two conventions.
Posted via Macroscope — UI Consistency
Files tree git status does not need the shared Azure repository selector extraction. Reverting it keeps this PR focused and removes the ChatView/ChatMarkdown spelling mismatch the half-migration introduced. Co-authored-by: Cursor <cursoragent@cursor.com>
Move Azure-aware repository selection into contracts so server, ChatView, ChatMarkdown, and open-link flows use one spelling. Drop committed PR screenshots in favor of GitHub user-attachments. Co-authored-by: Cursor <cursoragent@cursor.com>
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds default-on Git status decorations across the web and mobile Files trees, backed by new server parsing, shared path mapping, and refresh behavior. Its cross-platform scope and changes to existing VCS and pull-request paths make it broader than a small isolated UI enhancement. You can add or adjust custom eligibility rules. Learn more. |
After a turn, the Files tree looked the same whether the agent had added files, left untracked ones, or edited tracked ones. You had to open Diff or the commit list to see it.
Files now marks those rows with U, A, M, D, and R. Folders pick up a mark when something inside them changed. A deleted file drops out of the tree. Its parent folder keeps the mark. Marks go away when you commit or discard.
This uses the existing git status list. The server adds an optional status on each working-tree file, so older environments still decode and just show no marks. Web, desktop, and mobile all show them.
Why
I open Files to see what the agent changed to the tree. Diff shows hunks. I want names and folders.
Pitched in #7444.
UI Changes
Untracked files and their folder get U:
Modified files and their folder get M:
Checklist
Tests: porcelain parse, nested-cwd path match, file-tree status mapping.
Implemented with Grok 4.6 through Grok CLI.
Note
Show Git status marks (A/D/M/R/U) in the Files tree across mobile and web
core.quotepath=falseandstatus.relativePaths=trueso paths are UTF-8 and relative to the project cwd.workingTreeGitStatusByPathutility in fileTreeGitStatus.ts that maps raw statuses to tree paths, expands untracked directories, and rolls the strongest child status up to ancestors.VcsStatusLocalShapein git.ts with an optional per-filestatusfield, and centralizes PR repository naming viapullRequestRepositoryOfin pullRequest.ts used by server and web.readStatusDetailsLocalin GitVcsDriverCore.ts now sendscore.quotepath=falseandstatus.relativePaths=trueon everygit statusand numstat invocation; out-of-tree consumers expecting quoted paths or absolute paths will see decoded, relative paths instead.Macroscope summarized c29f696.
Note
Medium Risk
Touches git status parsing and path normalization in
GitVcsDriverCore, which can affect any consumer of working-tree file lists; optional contract fields limit breakage, but incorrect paths or status mapping would show wrong decorations or break nested-project views.Overview
The Files panel on web and mobile now shows U / A / M / D / R decorations from the existing VCS status API, with folder roll-up and pull-to-refresh also reloading git status. Clients take
cwd+environmentId, map server paths through sharedworkingTreeGitStatusByPath, and wire Pierre /FlatListso marks update when status changes.On the server, working-tree files gain an optional
status(VcsWorkingTreeFileStatusin contracts).GitVcsDriverCoreparses porcelain v2 via newporcelainStatus.ts(C-quoted paths, renames, conflicts), runsgit status/diffwithcore.quotepath=falseand relative paths for nested cwds, and attaches status to each file instatusDetails. Older clients/servers still decode whenstatusis absent.Pull-request links in chat and navigation now resolve repositories through shared
pullRequestRepositoryOf(notably Azure DevOps short repo names), aligned withPullRequestService.repositoryIdentityOf. User docs describe the new file-tree letters.Reviewed by Cursor Bugbot for commit c29f696. Bugbot is set up for automated code reviews on this repo. Configure here.