Skip to content

Review tab counts untracked files, so a restored file leaves it and a new file shows #597

Closed

Description

@a-team-app

Context

The Review tab lists only what git's index knows about, so a file the branch deleted in a commit stays listed as deleted after you restore and save it, and a new file you haven't git added never shows. This makes the review match what's on disk: untracked files that git doesn't ignore are compared with the merge base like any other file. Pitch: #593. No other repo involved.

Acceptance criteria

  • On a branch that committed a file's deletion, restoring it from the Review tab (Enter, Ctrl+R) and pressing Ctrl+S takes it off the Review tab's tree after a refresh (Ctrl+Shift+R), and the N files count in the header drops by one.
  • Restoring a deletion that wasn't committed still takes the file off the list, as it does today.
  • A new file created on disk but not added shows in the Review tab's tree as A with its +N line count, under its folder, and the header count includes it.
  • Enter on that new file opens it against an empty left side, as an added file does today.
  • An untracked file whose content differs from the base's version of the same path shows as M with its line counts; one identical to the base isn't listed.
  • A file matched by .gitignore never shows.
  • Next/previous change (Alt+Down / Alt+Up) steps into untracked files like any other.
  • The same holds when the Review tab compares against the PR's base rather than the branch's merge base.
  • Nothing TuiCode does here stages a file: git status shows the new and restored files as untracked afterwards.
  • AGENTS.md's Review tab section says untracked, not-ignored files count.

Tests

  • Changed-file listing against a real temp repo: committed deletion then restored file (left out), committed deletion still absent (D), untracked new file (A with line count), untracked file differing from base (M), untracked identical to base (left out), ignored file (left out), binary untracked file.
  • Line counts for untracked files match what git diff --numstat would give once added.
  • The user's index is unchanged after a refresh (no intent-to-add, no staging); any index used for diffing is a throwaway.
  • Paths with spaces and non-ASCII names in untracked files.

Out of scope

  • Staging, intent-to-add, or any other write to the user's index.
  • A setting to hide untracked files.
  • Rename detection between a deleted tracked file and a new untracked one: they show as D and A.
  • Any change to how restore works (Bring back a file your branch deleted, without leaving the diff #247): it still opens an unsaved tab and Ctrl+S writes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-team:devClaimed by the a-team Dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions