Skip to content

feat: show git status marks in the Files tree - #7443

Open
yaminyassin wants to merge 16 commits into
pingdotgg:mainfrom
yaminyassin:feat/files-git-status
Open

yaminyassin wants to merge 16 commits into
pingdotgg:mainfrom
yaminyassin:feat/files-git-status

Conversation

@yaminyassin

@yaminyassin yaminyassin commented Aug 18, 2026

Copy link
Copy Markdown

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:

Untracked porcelainStatus files in the git folder

Modified files and their folder get M:

Modified GitVcsDriverCore files in the vcs folder

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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

  • Adds per-file Git working tree status to the file tree on both platforms. Rows display a colored status letter and include it in accessibility labels. Refreshing the file list now also refreshes Git status.
  • Introduces a server-side porcelain v2 status parser in porcelainStatus.ts with C-quoted path decoding, and updates GitVcsDriverCore.ts to force core.quotepath=false and status.relativePaths=true so paths are UTF-8 and relative to the project cwd.
  • Adds a shared workingTreeGitStatusByPath utility in fileTreeGitStatus.ts that maps raw statuses to tree paths, expands untracked directories, and rolls the strongest child status up to ancestors.
  • Extends VcsStatusLocalShape in git.ts with an optional per-file status field, and centralizes PR repository naming via pullRequestRepositoryOf in pullRequest.ts used by server and web.
  • Risk: readStatusDetailsLocal in GitVcsDriverCore.ts now sends core.quotepath=false and status.relativePaths=true on every git status and 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 shared workingTreeGitStatusByPath, and wire Pierre / FlatList so marks update when status changes.

On the server, working-tree files gain an optional status (VcsWorkingTreeFileStatus in contracts). GitVcsDriverCore parses porcelain v2 via new porcelainStatus.ts (C-quoted paths, renames, conflicts), runs git status/diff with core.quotepath=false and relative paths for nested cwds, and attaches status to each file in statusDetails. Older clients/servers still decode when status is absent.

Pull-request links in chat and navigation now resolve repositories through shared pullRequestRepositoryOf (notably Azure DevOps short repo names), aligned with PullRequestService.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.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 29086515-5abf-494e-89d2-0d9f8f27a033

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 18, 2026
Comment thread apps/server/src/git/porcelainStatus.ts Outdated
Comment thread apps/server/src/vcs/GitVcsDriverCore.ts
Comment thread apps/server/src/git/porcelainStatus.ts Outdated
Comment thread apps/server/src/git/porcelainStatus.ts Outdated
Comment thread apps/server/src/git/porcelainStatus.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/files/FileBrowserPanel.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/files/FileBrowserPanel.tsx
@yaminyassin
yaminyassin force-pushed the feat/files-git-status branch from 920a13f to fd00ee1 Compare August 31, 2026 11:01
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Aug 31, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/files/FileBrowserPanel.tsx Outdated
Comment thread packages/shared/src/fileTreeGitStatus.ts Outdated
Comment thread packages/contracts/src/pullRequest.ts Outdated
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>
Comment thread packages/shared/src/fileTreeGitStatus.ts Outdated
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>

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/ChatView.tsx
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>
@yaminyassin
yaminyassin marked this pull request as ready for review August 31, 2026 11:33
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>
@macroscopeapp

macroscopeapp Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant