feat(diff): add branch scope to context panel diff view

Show every change on the current branch relative to its base in the
Changed/Staged/Last turn dropdown. The base comes from the branch's
reflog record or an explicit per-branch user choice (persisted), never
a main/master guess; when git has no record the user picks a base once
from a searchable branch list.

- server: GET /api/git/branch-base (reflog-derived base),
  GET /api/git/range-files (name-status -z with rename/copy
  destination paths and -C copy detection)
- shared UI: optional getBranchBase/getGitRangeFiles runtime APIs
  with boundary parsing; persisted per-branch overrides keyed by
  runtime+directory+branch
- DiffView: branch scope with confirmed-unavailability coercion of
  persisted tabs (detached HEAD, default-branch checkout, metadata
  settled without a default), range-invalidated diff cache guarded
  against stale completions, bounded branch-metadata retry, read-only
  diff actions in branch scope; hidden in VS Code
- helper module branchDiffScope.ts with tests for coercion,
  availability, race conditions, and retry exhaustion
This commit is contained in:
Bohdan Triapitsyn
2026-08-22 01:10:19 +03:00
parent 9f7d839fc6
commit 0b01f5ae2d
24 changed files with 1582 additions and 38 deletions
+7
View File
@@ -1519,6 +1519,13 @@ export const dict: Record<I18nKey, string> = {
"diffView.scope.changed": "Changed",
"diffView.scope.staged": "Staged",
"diffView.scope.lastTurn": "마지막 턴",
"diffView.scope.branch": "브랜치",
"diffView.branch.resolvingBase": "베이스 브랜치 감지 중...",
"diffView.branch.noBaseTitle": "베이스 브랜치 없음",
"diffView.branch.noBaseDescription": "이 브랜치가 어디서 시작되었는지 Git에 기록이 없습니다. 비교할 베이스 브랜치를 선택하세요.",
"diffView.branch.loadError": "브랜치 변경 사항을 불러오지 못했습니다",
"diffView.branch.loadingFiles": "브랜치 변경 사항 불러오는 중...",
"diffView.branch.empty": "이 브랜치에는 {base}에 대한 변경 사항이 없습니다",
"diffView.scope.selectorAria": "변경 모드 선택",
'diffView.actions.retry': '다시 시도',
'diffView.actions.renderAnyway': '그래도 렌더링',