Skip to content

Commit cf76406

Browse files
committed
feat: update
1 parent 3c7f230 commit cf76406

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/views/diff/FileTreeView.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import type { TreeViewNode } from 'reactive-vscode'
2-
import { createSingletonComposable, ref } from 'reactive-vscode'
2+
import { createSingletonComposable } from 'reactive-vscode'
3+
34
import { FileNode } from './entity/FileNode'
45
import { FolderNode } from './entity/FolderNode'
6+
57
import { type CommitFile, useGitService } from '@/git'
68
import { parseGitStatus } from '@/utils'
9+
import { GIT_STATUS } from '@/constant'
710

811
export const useFileTreeView = createSingletonComposable(() => {
912
const git = useGitService()
@@ -111,7 +114,7 @@ export const useFileTreeView = createSingletonComposable(() => {
111114
const [status, ...pathParts] = line.split('\t')
112115
const { type, similarity } = parseGitStatus(status)
113116

114-
if (type === 'R' && pathParts.length === 2) {
117+
if (type === GIT_STATUS.RENAMED && pathParts.length === 2) {
115118
const [oldPath, newPath] = pathParts
116119
return {
117120
status: type,

src/views/diff/entity/FileNode.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ export class FileNode extends TreeItem {
88
public readonly commitHash: string,
99
public readonly oldPath?: string,
1010
) {
11-
const label = path.split('/').pop() || path
12-
super(label, TreeItemCollapsibleState.None)
13-
1411
// 为重命名的文件创建特殊的 URI
1512
const params = new URLSearchParams()
1613
params.set('status', status)
@@ -19,7 +16,7 @@ export class FileNode extends TreeItem {
1916
}
2017

2118
const uri = Uri.parse(`${EXTENSION_SYMBOL}:${path}?${params.toString()}`)
22-
this.resourceUri = uri
19+
super(uri, TreeItemCollapsibleState.None)
2320

2421
this.tooltip = oldPath
2522
? `${status} ${oldPath}${path}`

src/views/history/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ const hasActiveFilter = computed(() => {
347347
348348
.branch-select,
349349
.author-select {
350-
min-width: 120px;
350+
max-width: 180px;
351351
padding: 4px 8px;
352352
border: 1px solid var(--vscode-input-border);
353353
background-color: var(--vscode-input-background);

0 commit comments

Comments
 (0)