新增: Git 能力闭环(Diff 行号解析/分支只读展示/提交详情/写入后自动刷新变更视图)
- Diff 行号修复:解析 @@ -a,b +c,d @@ 头,计算旧/新行号(原恒空字符串) - 提交详情增强:显示父提交哈希/作者/日期/完整消息(git show -s --format=%P\t%an) - 分支只读展示:list_branches IPC + 变更面板顶部下拉查看分支(切换走 AI 工具) - AI 工具写入后自动跳转变更视图:监听 df-data-changed entity=file 切 Tab + 刷新
This commit is contained in:
@@ -152,6 +152,11 @@ export const moduleApi = {
|
||||
},
|
||||
|
||||
/** 分页查询工程 Git 提交历史。返回 { commits, has_more }。 */
|
||||
/** 列出工程本地分支(只读)。返回 { current, branches: [{ name, is_current }] }。 */
|
||||
listBranches(moduleId: string): Promise<{ current: string; branches: { name: string; is_current: boolean }[] }> {
|
||||
return invoke('list_branches', { moduleId })
|
||||
},
|
||||
|
||||
getModuleCommits(moduleId: string, skip?: number, limit?: number): Promise<{
|
||||
commits: { hash: string; subject: string; timestamp: number; author: string }[]
|
||||
has_more: boolean
|
||||
@@ -163,6 +168,10 @@ export const moduleApi = {
|
||||
getCommitDetail(moduleId: string, commitHash: string): Promise<{
|
||||
files: { status: string; path: string }[]
|
||||
diff: string
|
||||
parents: string[]
|
||||
author: string
|
||||
date: string
|
||||
full_message: string
|
||||
}> {
|
||||
return invoke('get_commit_detail', { moduleId, commitHash })
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user