dsh-vscode-mode 0.36.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -4
- package/lib/client.js +68 -65
- package/lib/client.js.map +1 -1
- package/lib/index.js +1961 -222
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/dsh-vscodemode-html-plan/SKILL.md +1 -1
- package/src/archivePurge.ts +411 -0
- package/src/client/addToConversation.ts +77 -18
- package/src/client/htmlPlan/HtmlPlanPanel.ts +9 -13
- package/src/client/htmlPlan/planActions.ts +97 -23
- package/src/client/htmlPlan/planPage.ts +2 -2
- package/src/client/reviewBatch.ts +48 -1
- package/src/client/state/diffSummary.ts +2 -1
- package/src/client/styles/editor.css +3 -1
- package/src/client/ui/EditorView.ts +8 -9
- package/src/client/ui/SvnCommitDialog.ts +256 -31
- package/src/client/ui/svnCommitModel.ts +63 -0
- package/src/index.ts +13 -0
- package/src/pending/capture.ts +201 -34
- package/src/pending/decide.ts +33 -1
- package/src/pending/externalCapture.ts +171 -8
- package/src/pending/kernel.ts +13 -2
- package/src/pending/noteTool.ts +96 -0
- package/src/pending/notes.ts +83 -0
- package/src/pending/persist.ts +301 -51
- package/src/pending/provenance.ts +45 -11
- package/src/pending/receipt.ts +177 -0
- package/src/pending/store.ts +161 -69
- package/src/pending/vcs.ts +25 -7
- package/src/pending/verdict.ts +170 -0
- package/src/pendingCompat.ts +14 -1
- package/src/pendingRpc.ts +19 -1
- package/src/reviewDb.ts +63 -2
- package/src/reviewRpc.ts +47 -1
- package/src/rpc.ts +36 -4
- package/src/shared/pendingReview.ts +20 -2
- package/src/shared/review.ts +17 -0
- package/src/shared/reviewRegions.ts +48 -3
- package/src/shared/rpc.ts +7 -1
- package/src/slowLog.ts +74 -0
- package/src/textEncoding.probe.ts +1 -0
|
@@ -25,6 +25,7 @@ let host: {
|
|
|
25
25
|
ctx: PlanActionCtx
|
|
26
26
|
appendText: (sessionId: string | undefined, text: string) => Promise<string>
|
|
27
27
|
sendTask: (sessionId: string | undefined, text: string) => Promise<PlanActionResult>
|
|
28
|
+
steerTask: (sessionId: string | undefined, text: string) => Promise<PlanActionResult>
|
|
28
29
|
} | null = null
|
|
29
30
|
/** 取异常的展示文案。 */
|
|
30
31
|
function messageOf(error: unknown): string {
|
|
@@ -211,15 +212,15 @@ function unwrap(result: unknown): PlanActionResult {
|
|
|
211
212
|
}
|
|
212
213
|
|
|
213
214
|
/**
|
|
214
|
-
*
|
|
215
|
+
* 安装选项(appendText / sendTask / steerTask 可注入,便于单测;生产缺省用会话输入门面)。
|
|
215
216
|
* @author ddj 2026年11月21号
|
|
216
|
-
* @
|
|
217
|
-
* @returns 幂等卸载器
|
|
217
|
+
* @author ddj 2026年11月24号(新增 steerTask)
|
|
218
218
|
*/
|
|
219
|
-
/** 安装选项(appendText / sendTask 可注入,便于单测;生产缺省用会话输入门面)。 */
|
|
220
219
|
export interface HtmlPlanActionOptions {
|
|
221
220
|
appendText?: (sessionId: string | undefined, text: string) => Promise<string>
|
|
222
221
|
sendTask?: (sessionId: string | undefined, text: string) => Promise<unknown>
|
|
222
|
+
/** 送进 agent 当前回合(steer):答复先到、审批后结算,两者才落在同一次请求里。 */
|
|
223
|
+
steerTask?: (sessionId: string | undefined, text: string) => Promise<unknown>
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
/**
|
|
@@ -244,28 +245,81 @@ function sendResultOf(raw: unknown): PlanActionResult {
|
|
|
244
245
|
return fail('发送结果未知' + detail)
|
|
245
246
|
}
|
|
246
247
|
|
|
248
|
+
/**
|
|
249
|
+
* 安装动作宿主(index.ts 装配一次)。
|
|
250
|
+
* @author ddj 2026年11月21号
|
|
251
|
+
* @param ctx 客户端上下文
|
|
252
|
+
* @returns 幂等卸载器
|
|
253
|
+
*/
|
|
247
254
|
export function installHtmlPlanActions(ctx: PlanActionCtx, options: HtmlPlanActionOptions = {}): () => void {
|
|
248
255
|
const injectedAppend = options.appendText
|
|
249
256
|
const injectedSend = options.sendTask
|
|
257
|
+
const injectedSteer = options.steerTask
|
|
250
258
|
const addToConversation = injectedAppend && injectedSend ? null : createAddToConversation(ctx as never)
|
|
251
259
|
const sendInjected = injectedSend
|
|
260
|
+
const steerInjected = injectedSteer
|
|
252
261
|
const conversations = addToConversation
|
|
262
|
+
|
|
263
|
+
/** 走会话投递门面的详细回执(sendTaskResult 缺失时给可读失败)。 */
|
|
264
|
+
const sendViaResults = async (
|
|
265
|
+
sessionId: string | undefined,
|
|
266
|
+
text: string,
|
|
267
|
+
mode: 'queue' | 'steer',
|
|
268
|
+
): Promise<PlanActionResult> => {
|
|
269
|
+
const send = conversations?.sendTaskResult
|
|
270
|
+
if (typeof send !== 'function') return fail('当前 DSH 不支持直接发送,请用「填入对话输入框」')
|
|
271
|
+
return sendResultOf(await send.call(conversations, sessionId, text, mode))
|
|
272
|
+
}
|
|
273
|
+
|
|
253
274
|
host = {
|
|
254
275
|
ctx,
|
|
255
276
|
appendText: injectedAppend ?? ((sessionId, text) => conversations!.appendText(sessionId, text)),
|
|
256
277
|
sendTask: typeof sendInjected === 'function'
|
|
257
278
|
? async (sessionId, text) => sendResultOf(await sendInjected(sessionId, text))
|
|
258
|
-
:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
},
|
|
279
|
+
: (sessionId, text) => sendViaResults(sessionId, text, 'queue'),
|
|
280
|
+
steerTask: typeof steerInjected === 'function'
|
|
281
|
+
? async (sessionId, text) => sendResultOf(await steerInjected(sessionId, text))
|
|
282
|
+
: (sessionId, text) => sendViaResults(sessionId, text, 'steer'),
|
|
263
283
|
}
|
|
264
284
|
return () => {
|
|
265
285
|
host = null
|
|
266
286
|
}
|
|
267
287
|
}
|
|
268
288
|
|
|
289
|
+
/**
|
|
290
|
+
* 已送进当前回合、但审批结算还没成功的答复:同一 callId 与同一正文不重复送。
|
|
291
|
+
*
|
|
292
|
+
* 批准这一步可能失败(网络、审批已被别处结算),用户会再点一次;没有这张表,
|
|
293
|
+
* 同一份答复会被送两遍给模型。
|
|
294
|
+
*/
|
|
295
|
+
const steeredReplies = new Map<string, { callId: string; text: string }>()
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* 把一段正文送进 agent 当前回合(steer),让它和审批结果落在同一次模型请求里。
|
|
299
|
+
*
|
|
300
|
+
* 顺序只能是「先 steer 正文,再结算审批」。反过来时,审批一结算宿主立刻把工具结果
|
|
301
|
+
* 交给模型并开始下一步,而排队投递(queue)的消息属于下一回合,于是表现为
|
|
302
|
+
* 「agent 直接开始执行,我填的答复等这一轮跑完才送到」。
|
|
303
|
+
* @author ddj 2026年11月24号
|
|
304
|
+
* @param sessionId 会话 id
|
|
305
|
+
* @param callId 待审批调用的 id(同一份答复的去重键)
|
|
306
|
+
* @param body 正文
|
|
307
|
+
* @returns 动作结果
|
|
308
|
+
*/
|
|
309
|
+
async function steerIntoRun(sessionId: string, callId: string, body: string): Promise<PlanActionResult> {
|
|
310
|
+
const previous = steeredReplies.get(sessionId)
|
|
311
|
+
if (previous && previous.callId === callId && previous.text === body) return ok()
|
|
312
|
+
if (!host) return fail('计划动作桥未就绪')
|
|
313
|
+
let result: PlanActionResult
|
|
314
|
+
try {
|
|
315
|
+
result = await host.steerTask(sessionId, body)
|
|
316
|
+
} catch (error) {
|
|
317
|
+
return fail('送进当前回合失败:' + messageOf(error))
|
|
318
|
+
}
|
|
319
|
+
if (result.ok) steeredReplies.set(sessionId, { callId, text: body })
|
|
320
|
+
return result
|
|
321
|
+
}
|
|
322
|
+
|
|
269
323
|
/**
|
|
270
324
|
* 回答官方 plan-review:批准 = 选批准标签;不批准 = 选继续规划标签(若官方提供)。
|
|
271
325
|
* @author ddj 2026年11月21号
|
|
@@ -282,6 +336,7 @@ export async function answerPlanReview(sessionId: string, approve: boolean): Pro
|
|
|
282
336
|
if (!label) return fail(approve ? '该审批没有可用的批准选项' : '官方审批没有「继续规划」选项,请在对话中要求修改')
|
|
283
337
|
try {
|
|
284
338
|
await live.pending.answer({ answers: [{ id: live.labels.questionId, selected: [label] }] })
|
|
339
|
+
steeredReplies.delete(sessionId)
|
|
285
340
|
return ok()
|
|
286
341
|
} catch (error) {
|
|
287
342
|
return fail('提交审批失败:' + messageOf(error))
|
|
@@ -296,7 +351,9 @@ export async function answerPlanReview(sessionId: string, approve: boolean): Pro
|
|
|
296
351
|
return fail('当前 DSH 不支持在插件内作答,请在对话审批卡片中操作')
|
|
297
352
|
}
|
|
298
353
|
try {
|
|
299
|
-
|
|
354
|
+
const result = unwrap(await questions.answer(sessionId, review.callId, answer))
|
|
355
|
+
if (result.ok) steeredReplies.delete(sessionId)
|
|
356
|
+
return result
|
|
300
357
|
} catch (error) {
|
|
301
358
|
return fail('提交审批失败:' + messageOf(error))
|
|
302
359
|
}
|
|
@@ -323,27 +380,44 @@ export async function exitPlanMode(sessionId: string): Promise<PlanActionResult>
|
|
|
323
380
|
}
|
|
324
381
|
|
|
325
382
|
/**
|
|
326
|
-
*
|
|
383
|
+
* 把手填正文交给 agent,并同时结算官方审批(页面「回复」/「回复并执行」)。
|
|
384
|
+
*
|
|
385
|
+
* 有待审批卡片时:先把正文 steer 进当前回合,再结算审批(approve=true 选批准标签,
|
|
386
|
+
* false 选「继续规划」)。宿主在审批一结算就把工具结果交给模型并开始下一步,
|
|
387
|
+
* 所以顺序不能反——反过来时答复只能排到下一回合,表现为「agent 先执行,答复晚一步才送到」。
|
|
388
|
+
* steer 失败就不动审批(保持可重试),避免出现「批了但答复没送到」的半截状态。
|
|
327
389
|
* @author ddj 2026年11月21号
|
|
390
|
+
* @author ddj 2026年11月24号(批准前先把正文送进当前回合;新增 approve 参数)
|
|
328
391
|
* @param sessionId 会话 id
|
|
329
|
-
* @param text 答复 markdown
|
|
330
|
-
* @
|
|
392
|
+
* @param text 答复 / 指令 markdown
|
|
393
|
+
* @param approve true 结算为「同意执行」,false 结算为「继续规划」;没有待审批时只发消息
|
|
394
|
+
* @returns 动作结果(失败带原因,正文不丢)
|
|
331
395
|
*/
|
|
332
|
-
export async function submitPlanResponse(sessionId: string, text: string): Promise<PlanActionResult> {
|
|
396
|
+
export async function submitPlanResponse(sessionId: string, text: string, approve = true): Promise<PlanActionResult> {
|
|
333
397
|
if (!host) return fail('计划动作桥未就绪')
|
|
334
398
|
if (!sessionId) return fail('当前没有活动会话')
|
|
335
399
|
const body = String(text ?? '').trim()
|
|
336
|
-
if (!body) return fail('答复为空:先在页面里作答再点「回复」')
|
|
337
|
-
|
|
338
|
-
if (
|
|
339
|
-
|
|
340
|
-
|
|
400
|
+
if (!body) return fail(approve ? '答复为空:先在页面里作答再点「回复」' : '指令为空')
|
|
401
|
+
const review = readPendingReview(sessionId)
|
|
402
|
+
if (!review) {
|
|
403
|
+
try {
|
|
404
|
+
return await host.sendTask(sessionId, body)
|
|
405
|
+
} catch (error) {
|
|
406
|
+
return fail('发送失败:' + messageOf(error))
|
|
407
|
+
}
|
|
341
408
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return fail('
|
|
409
|
+
const bodyLabel = approve ? '答复' : '指令'
|
|
410
|
+
const steered = await steerIntoRun(sessionId, review.callId, body)
|
|
411
|
+
if (!steered.ok) {
|
|
412
|
+
return fail(bodyLabel + '没送进当前回合,审批保持待处理:' + String(steered.error ?? '') + '。可点「填入对话输入框」手动发送')
|
|
346
413
|
}
|
|
414
|
+
const settled = await answerPlanReview(sessionId, approve)
|
|
415
|
+
if (!settled.ok) {
|
|
416
|
+
const settleLabel = approve ? '批准' : '「继续规划」'
|
|
417
|
+
return fail(bodyLabel + '已送进当前回合,但' + settleLabel + '失败:' + String(settled.error ?? '')
|
|
418
|
+
+ '。点页签的「' + (approve ? '同意执行' : '继续规划') + '」重试即可,' + bodyLabel + '不会重复发送')
|
|
419
|
+
}
|
|
420
|
+
return ok()
|
|
347
421
|
}
|
|
348
422
|
|
|
349
423
|
/**
|
|
@@ -95,7 +95,7 @@ const BRIDGE_SCRIPT = [
|
|
|
95
95
|
' const copy = Array.from(footer.querySelectorAll("button")).find((btn) => /copy response|复制答复/i.test(btn.textContent || ""))',
|
|
96
96
|
' footer.insertBefore(reply, copy || footer.firstChild)',
|
|
97
97
|
' const hint = sheet.querySelector("p.hint")',
|
|
98
|
-
' if (hint) hint.textContent = reviewPending ? "点「回复并执行」=
|
|
98
|
+
' if (hint) hint.textContent = reviewPending ? "点「回复并执行」= 把答复和批准一起交给 agent(同一步读到);要改计划请先点页签「继续规划」。" : "点「回复」直接发送给 agent;也可以复制后手动粘贴。"',
|
|
99
99
|
' }',
|
|
100
100
|
' }',
|
|
101
101
|
' try { new MutationObserver(() => { try { hookSheet() } catch (error) { /* 忽略 */ } }).observe(document.body || document.documentElement, { childList: true, subtree: true }) } catch (error) { /* 无 MutationObserver */ }',
|
|
@@ -109,7 +109,7 @@ const BRIDGE_SCRIPT = [
|
|
|
109
109
|
' const reply = Array.from(sheet.querySelectorAll("footer button")).find((btn) => /回复|发送中|已发送|发送失败/.test(btn.textContent || ""))',
|
|
110
110
|
' if (reply && !reply.disabled) reply.textContent = reviewPending ? "回复并执行" : "回复"',
|
|
111
111
|
' const hint = sheet.querySelector("p.hint")',
|
|
112
|
-
' if (hint && !/发送失败/.test(hint.textContent || "")) hint.textContent = reviewPending ? "点「回复并执行」=
|
|
112
|
+
' if (hint && !/发送失败/.test(hint.textContent || "")) hint.textContent = reviewPending ? "点「回复并执行」= 把答复和批准一起交给 agent(同一步读到);要改计划请先点页签「继续规划」。" : "点「回复」直接发送给 agent;也可以复制后手动粘贴。"',
|
|
113
113
|
' }',
|
|
114
114
|
' return',
|
|
115
115
|
' }',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Official bulk decisions use persisted metadata, never the visible history page. @author ddj 2026年10月27号 */
|
|
2
|
-
import type { ReviewDetail, ReviewItem, ReviewPage, ReviewResult } from '../shared/review.js'
|
|
2
|
+
import type { ReviewDetail, ReviewItem, ReviewPage, ReviewResult, UndoAllItem, UndoAllResult } from '../shared/review.js'
|
|
3
3
|
import { PENDING_PREFIX } from '../shared/pendingReview.js'
|
|
4
4
|
|
|
5
5
|
export interface BatchPort {
|
|
@@ -13,6 +13,53 @@ export interface BatchPort {
|
|
|
13
13
|
}
|
|
14
14
|
export interface BatchResult { completed: number; total: number; paths: string[]; error: string }
|
|
15
15
|
|
|
16
|
+
/** 批量 Undo 的宿主通道:一次往返搞定整批,不再逐条取详情再逐条判定。 */
|
|
17
|
+
export interface UndoAllPort {
|
|
18
|
+
snapshot: () => Promise<ReviewPage>
|
|
19
|
+
undoAll: (items: UndoAllItem[], batchId: string, confirmed: boolean) => Promise<ReviewResult<{ result: UndoAllResult }>>
|
|
20
|
+
/** 需要显式确认时的整批确认;返回 false 视为取消。 */
|
|
21
|
+
confirmExternal: (count: number) => boolean
|
|
22
|
+
guard: () => void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
* @author ddj 2026年11月25号
|
|
28
|
+
* @description: Undo All 走宿主批量通道:一次 RPC、一次事务,遇冲突即停。
|
|
29
|
+
* 非本会话工具写入的来源先要一次确认,确认后带 confirmed 重试同一批。
|
|
30
|
+
* @param port 已鉴权的 RPC 适配器
|
|
31
|
+
* @returns 与逐条口径一致的批量结果
|
|
32
|
+
*/
|
|
33
|
+
export async function runUndoAll(port: UndoAllPort): Promise<BatchResult> {
|
|
34
|
+
const result: BatchResult = { completed: 0, total: 0, paths: [], error: '' }
|
|
35
|
+
try {
|
|
36
|
+
port.guard()
|
|
37
|
+
const items = await loadPending(port)
|
|
38
|
+
// 待审条目走单条判定;批量通道只处理官方审查记录
|
|
39
|
+
const official = items.filter((item) => !item.id.startsWith(PENDING_PREFIX))
|
|
40
|
+
if (!official.length) throw new Error('没有可撤销的官方审查记录')
|
|
41
|
+
result.total = official.length
|
|
42
|
+
|
|
43
|
+
const targets: UndoAllItem[] = official.map((item) => ({
|
|
44
|
+
id: item.id, display: item.display, seq: item.seq, revision: item.revision, operationId: crypto.randomUUID(),
|
|
45
|
+
}))
|
|
46
|
+
const batchId = crypto.randomUUID()
|
|
47
|
+
let reply = await port.undoAll(targets, batchId, false)
|
|
48
|
+
if (!reply.ok) throw new Error(reply.error)
|
|
49
|
+
if (reply.result.needsConfirm) {
|
|
50
|
+
if (!port.confirmExternal(reply.result.needsConfirm)) {
|
|
51
|
+
throw new Error('已取消:这批修改里有非本会话工具写入的来源,撤销前需要确认')
|
|
52
|
+
}
|
|
53
|
+
reply = await port.undoAll(targets, batchId, true)
|
|
54
|
+
if (!reply.ok) throw new Error(reply.error)
|
|
55
|
+
}
|
|
56
|
+
result.completed = reply.result.completed
|
|
57
|
+
result.paths = reply.result.paths
|
|
58
|
+
result.error = reply.result.error
|
|
59
|
+
} catch (cause) { result.error = cause instanceof Error ? cause.message : String(cause) }
|
|
60
|
+
return result
|
|
61
|
+
}
|
|
62
|
+
|
|
16
63
|
/**
|
|
17
64
|
* @public
|
|
18
65
|
* @author ddj 2026年10月31号
|
|
@@ -107,7 +107,8 @@ function pendingRowsOf(page: ReviewPage | null): { rows: DiffFile[]; covered: Se
|
|
|
107
107
|
rows.push({
|
|
108
108
|
path,
|
|
109
109
|
// 非 agent 来源才在标签上带徽标:agent 行保持原样,面板不被新增文案刷屏
|
|
110
|
-
|
|
110
|
+
// (agent 行现在还会带证据强度后缀,这里按前缀匹配,不看结尾)。
|
|
111
|
+
label: item.sourceLabel && !/· agent(?: ·|$)/.test(item.sourceLabel) ? `${label} · ${item.sourceLabel}` : label,
|
|
111
112
|
recs: [],
|
|
112
113
|
pending: item.decision === 'pending' ? 1 : 0,
|
|
113
114
|
added: item.added,
|
|
@@ -828,6 +828,8 @@
|
|
|
828
828
|
[data-edrv-view] .edrv-svncommit-close:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary, #2869b4); outline-offset: 1px; }
|
|
829
829
|
[data-edrv-view] .edrv-svncommit-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: none; min-height: 34px; padding: 6px 14px; border-bottom: 1px solid var(--dsw-alias-border-l1, #d9e0e4); background: var(--dsw-alias-bg-layer-1, #fff); }
|
|
830
830
|
[data-edrv-view] .edrv-svncommit-ctl { flex: none; max-width: 160px; height: 24px; padding: 0 8px; font-size: 11px; line-height: 22px; }
|
|
831
|
+
[data-edrv-view] .edrv-svncommit-sels { display: inline-flex; flex: none; gap: 6px; }
|
|
832
|
+
[data-edrv-view] .edrv-svncommit-sels .edrv-svn-act { height: 24px; padding: 0 8px; font-size: 11px; line-height: 22px; }
|
|
831
833
|
[data-edrv-view] .edrv-svncommit-bar .edrv-svn-check { flex: none; gap: 4px; font-size: 11px; color: var(--dsw-alias-label-secondary, #485762); }
|
|
832
834
|
[data-edrv-view] .edrv-svncommit-badge { flex: none; margin-left: auto; padding: 1px 8px; border: 1px solid var(--dsw-alias-border-l1, #d9e0e4); border-radius: 10px; background: var(--dsw-alias-bg-layer-2, #f1f4f5); color: var(--dsw-alias-label-secondary, #485762); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
833
835
|
[data-edrv-view] .edrv-svncommit-table { display: flex; flex-direction: column; flex: 1; min-height: 120px; margin: 10px 14px 0; border: 1px solid var(--dsw-alias-border-l1, #d9e0e4); border-radius: 5px; overflow: hidden; background: var(--dsw-alias-bg-layer-1, #fff); }
|
|
@@ -839,7 +841,7 @@
|
|
|
839
841
|
[data-edrv-view] .edrv-svncommit-gname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
840
842
|
[data-edrv-view] .edrv-svncommit-gnote { flex: none; padding: 0 6px; border-radius: 8px; background: var(--dsw-alias-interactive-bg-hover, #e7edf0); color: var(--dsw-alias-state-warn-primary, #a05d22); font-size: 10px; font-weight: 400; }
|
|
841
843
|
[data-edrv-view] .edrv-svncommit-gcount { flex: none; margin-left: auto; color: var(--dsw-alias-label-tertiary, #65737c); font-size: 10px; font-weight: 400; font-variant-numeric: tabular-nums; }
|
|
842
|
-
[data-edrv-view] .edrv-svncommit-row { height: 26px; padding: 0 10px; font-size: 12px; color: var(--dsw-alias-label-primary, #202932); }
|
|
844
|
+
[data-edrv-view] .edrv-svncommit-row { height: 26px; padding: 0 10px; font-size: 12px; color: var(--dsw-alias-label-primary, #202932); -webkit-user-select: none; user-select: none; }
|
|
843
845
|
[data-edrv-view] .edrv-svncommit-row:hover { background: var(--dsw-alias-interactive-bg-hover, #ecf3f9); }
|
|
844
846
|
[data-edrv-view] .edrv-svncommit-row.is-menu { background: var(--dsw-alias-interactive-bg-hover, #ecf3f9); box-shadow: inset 2px 0 0 var(--dsw-alias-brand-primary, #2869b4); }
|
|
845
847
|
[data-edrv-view] .edrv-svncommit-row.is-selected { background: var(--dsw-alias-interactive-bg-hover, #dceaf9); box-shadow: inset 2px 0 0 var(--dsw-alias-brand-primary, #2869b4); }
|
|
@@ -26,7 +26,7 @@ import { bindPanelCommand } from '../panelCommands.js'
|
|
|
26
26
|
import { dbg, isDebug, rpc } from '../rpc.js'
|
|
27
27
|
import { refreshFeed, subscribeErrors, subscribeRecords } from '../state/recordsFeed.js'
|
|
28
28
|
import { subscribeReview, refreshReview } from '../state/reviewFeed.js'
|
|
29
|
-
import {
|
|
29
|
+
import { runUndoAll } from '../reviewBatch.js'
|
|
30
30
|
import { runKeepAll } from '../reviewKeepAll.js'
|
|
31
31
|
import { toastDom } from '../externalOpen.js'
|
|
32
32
|
import { ReviewAllConfirm } from './ReviewAllConfirm.js'
|
|
@@ -3843,16 +3843,15 @@ export function EditorView(props) {
|
|
|
3843
3843
|
return res.page
|
|
3844
3844
|
}
|
|
3845
3845
|
|
|
3846
|
-
/** @private @author ddj 2026年11月03号 @param token 起批时的会话寿命 @returns
|
|
3846
|
+
/** @private @author ddj 2026年11月03号 / 2026年11月25号 @param token 起批时的会话寿命 @returns 一次往返的批量 Undo(遇冲突即停) */
|
|
3847
3847
|
function undoAllBatch(token) {
|
|
3848
|
-
return
|
|
3848
|
+
return runUndoAll({
|
|
3849
3849
|
snapshot: batchSnapshot,
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
}, true)
|
|
3850
|
+
undoAll: (items, batchId, confirmed) => rpc('edrv.review.undoAll', { sessionId, batchId, items, confirmed }),
|
|
3851
|
+
confirmExternal: (count) => window.confirm(
|
|
3852
|
+
`这批修改里有 ${count} 条不是本会话工具写入的来源(例如编辑器保存、版本库基线或外部脚本)。\n确认整批撤销并写回修改前内容?`),
|
|
3853
|
+
guard: () => guardReviewAll(true, token),
|
|
3854
|
+
})
|
|
3856
3855
|
}
|
|
3857
3856
|
|
|
3858
3857
|
/** @private @author ddj 2026年11月03号 @param token 起批时的会话寿命 @returns 一次 RPC 的批量 Keep 结果(跳过项不算失败) */
|