✨ feat(vscode): 「未提交的更改」分暂存区两组、单文件暂存、隐藏测试文件

- 照源代码管理视图分「暂存的更改」「更改」两组(空的不摆,分组行写文件数),部分暂存的文件两组都有
- 「更改」组的文件行上加「暂存」按钮,走 git 扩展的 repository.add
- 标题栏「隐藏测试文件 / 显示测试文件」开关,按工作区记住,藏了几个写在标题后面;测试文件的判断集中在 isTestFile
- 以上只在「未提交的更改」里有:普通文件树、审查模式的行和菜单不变
This commit is contained in:
cruldra committed 2026-09-30 06:30:54 +08:00
1 parent a3b04a443b
commit 87d4360704
14 files changed
+528 -129

No files matched your search

+3 -3
View File
@@ -2,7 +2,7 @@ import type { Disposable, ExtensionContext, QuickPickItem, TreeView, WorkspaceFo
import type { PrFileDto } from '../../gitea/api'
import type { RepoContext } from '../../gitea/repoContext'
import type { Issue } from '../../gitea/types'
import type { FileNode, FileTreeProvider } from '../explorer/fileTree'
import type { FileTreeProvider, TreeNode } from '../explorer/fileTree'
import type { TreeFilter, TreeFilters } from '../explorer/treeFilters'
import type { FileCount } from './pickList'
import * as path from 'node:path'
@@ -59,7 +59,7 @@ export class ReviewMode implements TreeFilter, Disposable {
constructor(
private readonly context: ExtensionContext,
private readonly viewId: string,
private readonly view: TreeView<FileNode>,
private readonly view: TreeView<TreeNode>,
private readonly files: FileTreeProvider,
private readonly filters: TreeFilters,
) {
@@ -251,7 +251,7 @@ export class ReviewMode implements TreeFilter, Disposable {
const changes = files.map(file => ({ path: file.path, change: changeOf(file.status) }))
const entering = this.filters.enter(this, 'review')
this.reviewing = issue.number
this.files.showChanges([{ folder, tree: buildChangedTree(changes) }])
this.files.showChanges([{ roots: [{ folder, tree: buildChangedTree(changes) }] }])
this.decorations.show(changes.map(file => ({ uri: Uri.joinPath(root, file.path), change: file.change })))
this.view.description = reviewDescription(issue.number)
this.view.message = reviewMessage(issue, pr, files.length)