Skip to content

Compare-to-commit: native multi-diff file experience + commit-graph menu fixes#5

Merged
MelbourneDeveloper merged 6 commits into
mainfrom
comparetocommit
May 30, 2026
Merged

Compare-to-commit: native multi-diff file experience + commit-graph menu fixes#5
MelbourneDeveloper merged 6 commits into
mainfrom
comparetocommit

Conversation

@MelbourneDeveloper
Copy link
Copy Markdown
Collaborator

What

Replaces the file-picker QuickPick with VSCode's native multi-diff editor (vscode.changes) and fixes every commit-graph compare context-menu action.

The multi-diff file experience

  • One persistent multi-diff tab lists every changed file (full path + inline diff); click any row to jump to that file's diff.
  • Uses the built-in vscode.changes command — no custom view, sidebar, tree provider, or webview.
  • Zero UI duplication: FilePicker.ts, format/fileItem.ts, showStayOpenPick, and the dead numstat/parseNumstat/DiffStat/TAB chain were deleted.

Commit-graph menu fix

  • Real SCM history-item invocations pass the SourceControl provider (id "git") first, then the history item. The old handlers read the first arg's id and fed the literal "git" to git (fatal: ambiguous argument 'git'). historyItemShaFromArgs now scans args for the real history item (the one with parentIds).

Titles

  • Diff titles are human-scannable: a1b2c3 ↔ Working Copy (multi-diff) and a1b2c3 ↔ Working Copy — a.txt (single file). VSCode appends its own (N files) count to the multi-diff title.

Tests

  • 130 unit + 41 E2E passing, 0 failing.
  • E2E drives every compare command end-to-end through real VSCode UI, including the real commit-graph provider-first argument shape, asserting title + left/right URIs per row.
  • Coverage 95.18% (threshold 95).

Verification

make ci green locally (lint + test + build); release stamp dry-run passes.

🤖 Generated with Claude Code

MelbourneDeveloper and others added 6 commits May 30, 2026 18:40
…itor

The multi-diff editor populates its `textDiffs` array asynchronously after
the tab opens and does not always emit onDidChangeTabs, so waitForMultiDiffTab
now polls until a multi-diff tab's entries are populated instead of settling
for the first empty one.

VSCode's multi-diff editor also appends its own " (N files)" count to the
title we pass. The title assertion now verifies the label starts with our
human-scannable comparison title AND ends with the changed-file count, which
is strictly stronger than the previous exact-match and reflects exactly what
the user sees.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
src/git/parsers.ts was committed un-formatted (its import line exceeded
prettier's print width), so CI's `make fmt CHECK=1`
(`prettier --check "src/**/*.ts" "*.json" "*.md"`) failed before tests
ran. Apply prettier --write. No behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add pure unit tests (no vscode) for the two git subprocess modules using a
recording GitRunner stand-in and a logger stub:

- GitRepo.test.ts drives log/nameStatus/show/refs/revParse/currentBranch,
  asserting the exact argv handed to the runner (buildLogArgs ref + limit,
  buildNameStatusArgs commit/workingCopy/index shapes, showSpec sha:path vs
  :path), the empty-output → parseError path, the detached-HEAD → undefined
  path, and error passthrough. GitRepo.ts: 97.7/81.8 → 100/100.
- GitRunner.test.ts covers the zero-exit ok path, the non-zero-exit error
  (stderr + exit code) and the spawn-failure branch. GitRunner.ts:
  97.6/75 → 100/100.

Total line coverage 95.18 → 95.39; ratchet the threshold 95 → 95.3.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI lint (typed @typescript-eslint/no-unnecessary-condition) rejected the
optional chains on array index reads in the new git unit tests. Rewrite
GitRepo.test.ts to guard the single recorded call via `.at(0)` + assert,
and assert whole-result equality; GitRunner.test.ts drops the unused
log-event field. No coverage change (still 153 unit + 41 E2E, threshold 95.3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MelbourneDeveloper MelbourneDeveloper merged commit 3cfbb09 into main May 30, 2026
1 check passed
@MelbourneDeveloper MelbourneDeveloper deleted the comparetocommit branch May 30, 2026 12:05
MelbourneDeveloper added a commit that referenced this pull request May 30, 2026
…enu fixes (#5)

## What

Replaces the file-picker QuickPick with VSCode's native multi-diff
editor (`vscode.changes`) and fixes every commit-graph compare
context-menu action.

### The multi-diff file experience
- One persistent multi-diff tab lists **every changed file** (full path
+ inline diff); click any row to jump to that file's diff.
- Uses the built-in `vscode.changes` command — **no custom view,
sidebar, tree provider, or webview**.
- **Zero UI duplication**: `FilePicker.ts`, `format/fileItem.ts`,
`showStayOpenPick`, and the dead
`numstat`/`parseNumstat`/`DiffStat`/`TAB` chain were deleted.

### Commit-graph menu fix
- Real SCM history-item invocations pass the SourceControl provider (id
`"git"`) **first**, then the history item. The old handlers read the
first arg's `id` and fed the literal `"git"` to git (`fatal: ambiguous
argument 'git'`). `historyItemShaFromArgs` now scans args for the real
history item (the one with `parentIds`).

### Titles
- Diff titles are human-scannable: `a1b2c3 ↔ Working Copy` (multi-diff)
and `a1b2c3 ↔ Working Copy — a.txt` (single file). VSCode appends its
own ` (N files)` count to the multi-diff title.

## Tests
- **130 unit + 41 E2E passing, 0 failing.**
- E2E drives every compare command end-to-end through real VSCode UI,
including the real commit-graph provider-first argument shape, asserting
title + left/right URIs per row.
- Coverage **95.18%** (threshold 95).

## Verification
`make ci` green locally (lint + test + build); release stamp dry-run
passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant