功能: changeset 文件支持右键查看版本与下钻历史,目录对比 localOnly 项可加入版本控制

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
fenghp
2026-06-10 19:56:38 +08:00
co-authored by Cursor
parent de2a6793f4
commit a913b4718e
9 changed files with 297 additions and 68 deletions
+19
View File
@@ -212,6 +212,25 @@ export function useFileActions({
await runFileOperation(target, action)
setActionBusy(false)
break
case "add": {
// pend add 需要本地路径(localOnly 项服务端尚不存在)。
if (!target.localPath) {
return
}
setActionBusy(true)
setNotice({ kind: "info", text: "正在加入版本控制…" })
const result = await api.addFiles({ paths: [target.localPath], recursive: target.folder })
refreshLogs()
setActionBusy(false)
if (!result.ok || !result.data) {
setNotice({ kind: "error", text: result.errorMessage ?? "加入版本控制失败" })
return
}
setNotice({ kind: "info", text: `已加入版本控制 ${result.data.result.affected} 项` })
await refreshPendingChanges()
refreshItems()
break
}
case "map":
setDialog({ kind: "mapping", serverPath: target.serverPath })
break