支持文件和变更区域的根目录快捷操作

This commit is contained in:
xintaofei
2026-03-13 21:50:15 +08:00
parent bf14a99168
commit 3376974d0f
4 changed files with 252 additions and 59 deletions

View File

@@ -440,10 +440,14 @@ export function WorkspaceProvider({ children }: WorkspaceProviderProps) {
const mode = options?.mode ?? "auto"
if (mode === "overview") {
const isRoot = path === "."
const displayPath = isRoot ? folderPath : path
const encodedPath = encodeURIComponent(path)
const tabId = `diff:working-overview:${encodedPath}`
const title = t("diffTitleFile", { name: fileName(path) })
const description = path
const title = t("diffTitleFile", {
name: fileName(displayPath ?? path),
})
const description = displayPath ?? path
upsertLoadingTab(
loadingTab(tabId, "diff", title, description, path, "diff")
)