dsh-vscode-mode 0.37.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 +16 -0
- package/lib/client.js +68 -65
- package/lib/client.js.map +1 -1
- package/lib/index.js +1481 -239
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/archivePurge.ts +120 -28
- 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 +9 -0
- package/src/pending/capture.ts +201 -34
- package/src/pending/decide.ts +33 -1
- package/src/pending/externalCapture.ts +73 -6
- 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 +214 -51
- package/src/pending/provenance.ts +45 -11
- package/src/pending/receipt.ts +177 -0
- package/src/pending/store.ts +126 -69
- package/src/pending/verdict.ts +170 -0
- package/src/pendingCompat.ts +14 -1
- package/src/reviewDb.ts +63 -2
- package/src/reviewRpc.ts +47 -1
- package/src/rpc.ts +16 -7
- 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 +4 -2
- package/src/slowLog.ts +74 -0
- package/src/textEncoding.probe.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-vscode-mode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "DSH 上的类 VSCode 编码体验:Monaco 编辑器(文件页签/QuickOpen/状态栏,可驻 DSH 0.1.5+ 官方右侧 Sidebar 与对话同屏)+ 命令栏(Ctrl+Shift+P)与可扩展指令系统 + VS Code 兼容代码片段(.code-snippets 全局/项目,IntelliSense 展开)+ Agent 编辑差异审查(整文件差异/采纳/拒绝/归档/回滚)+ SVN 集成(侧栏变更面板/日志弹窗/并排差异)+ 语言服务器(LSP)智能(跳转定义/引用/hover/大纲 + VSIX 扩展市场安装),状态持久化到工作区旁车,界面状态(页签/光标/侧栏/编辑 Tab/导航历史)镜像到 DSH home 跨重启恢复",
|
|
5
5
|
"icon": "assets/icon.svg",
|
|
6
6
|
"keywords": [
|
package/src/archivePurge.ts
CHANGED
|
@@ -10,19 +10,18 @@
|
|
|
10
10
|
* - 真删之前先留一份同名备份(`<db>.before-purge.bak`,覆盖写),每个工作区只占一份。
|
|
11
11
|
* 作者 ddj 2026-11-24
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { spawn } from 'node:child_process'
|
|
14
|
+
import { existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from 'node:fs'
|
|
15
|
+
import { dirname, join } from 'node:path'
|
|
15
16
|
import { DatabaseSync } from 'node:sqlite'
|
|
16
17
|
import { archiveDbFile, dshHome, PLUGIN_ID } from './paths.js'
|
|
17
|
-
import { dbFor, activeReady } from './archiveDb.js'
|
|
18
|
+
import { dbFor, activeReady, closeArchiveDbs } from './archiveDb.js'
|
|
18
19
|
import { log } from './log.js'
|
|
19
20
|
|
|
20
21
|
/** 已判定历史默认保留天数。 */
|
|
21
22
|
export const RETENTION_DAYS = 30
|
|
22
23
|
/** 同一路径默认保留多少个归档批次。 */
|
|
23
24
|
export const KEEP_BATCHES = 20
|
|
24
|
-
/** 同一待审条目默认保留多少步撤销栈。 */
|
|
25
|
-
export const KEEP_HISTORY = 10
|
|
26
25
|
/** 幂等操作表默认保留多少条(该表无时间列,按 rowid 保留最近的)。 */
|
|
27
26
|
export const KEEP_OPS = 500
|
|
28
27
|
/** 真删前备份文件名后缀。 */
|
|
@@ -34,8 +33,8 @@ export interface ArchivePurgeOptions {
|
|
|
34
33
|
retentionDays?: number
|
|
35
34
|
/** 每路径保留批次数(缺省 {@link KEEP_BATCHES})。 */
|
|
36
35
|
keepBatches?: number
|
|
37
|
-
/**
|
|
38
|
-
|
|
36
|
+
/** 幂等表保留条数(缺省 {@link KEEP_OPS})。 */
|
|
37
|
+
keepOps?: number
|
|
39
38
|
/** true 只报数不删。 */
|
|
40
39
|
dryRun?: boolean
|
|
41
40
|
/** 删除后 VACUUM(缺省 true)。 */
|
|
@@ -103,20 +102,16 @@ function pickCandidates(db: ReturnType<typeof dbFor>, options: ArchivePurgeOptio
|
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
/**
|
|
106
|
-
* @author ddj 2026
|
|
107
|
-
* @description:
|
|
105
|
+
* @author ddj 2026年11月25号
|
|
106
|
+
* @description: 截断幂等表:撤销栈已改成「一条路径一行」,不再按步裁剪。
|
|
108
107
|
* @param db 工作区归档库连接
|
|
109
|
-
* @param
|
|
110
|
-
* @returns
|
|
108
|
+
* @param keepOps 幂等表保留条数
|
|
109
|
+
* @returns 删除的历史行数(恒为 0,保留字段只为回执口径不变)
|
|
111
110
|
*/
|
|
112
|
-
function trimPendingTables(db: ReturnType<typeof dbFor>,
|
|
113
|
-
const trimmed = db.prepare(`DELETE FROM pending_history WHERE id NOT IN (
|
|
114
|
-
SELECT id FROM (
|
|
115
|
-
SELECT id, ROW_NUMBER() OVER (PARTITION BY entry_id ORDER BY id DESC) AS rn FROM pending_history
|
|
116
|
-
) WHERE rn <= ?)`).run(keepHistory)
|
|
111
|
+
function trimPendingTables(db: ReturnType<typeof dbFor>, keepOps: number): number {
|
|
117
112
|
db.prepare(`DELETE FROM pending_ops WHERE rowid NOT IN (
|
|
118
|
-
SELECT rowid FROM pending_ops ORDER BY rowid DESC LIMIT ?)`).run(
|
|
119
|
-
return
|
|
113
|
+
SELECT rowid FROM pending_ops ORDER BY rowid DESC LIMIT ?)`).run(keepOps)
|
|
114
|
+
return 0
|
|
120
115
|
}
|
|
121
116
|
|
|
122
117
|
/**
|
|
@@ -161,14 +156,14 @@ export function purgeArchiveDb(cwd: string, options: ArchivePurgeOptions = {}):
|
|
|
161
156
|
const db = dbFor(cwd)
|
|
162
157
|
const { ids, expired, overCap, keptPending } = pickCandidates(db, options)
|
|
163
158
|
const dryRun = options.dryRun !== false
|
|
164
|
-
const
|
|
159
|
+
const keepOps = options.keepOps ?? KEEP_OPS
|
|
165
160
|
if (dryRun) {
|
|
166
161
|
return { expired, overCap, keptPending, removed: { records: 0, batches: 0, history: 0 } }
|
|
167
162
|
}
|
|
168
163
|
// 没有要删的批次就不备份、不动库:每日扫描绝大多数时候是空跑
|
|
169
164
|
if (ids.length) backupBeforePurge(db, cwd)
|
|
170
165
|
const removedBatches = removeBatches(db, ids)
|
|
171
|
-
const history = activeReady(cwd) ? trimPendingTables(db,
|
|
166
|
+
const history = activeReady(cwd) ? trimPendingTables(db, keepOps) : 0
|
|
172
167
|
const outcome: ArchivePurgeOutcome = {
|
|
173
168
|
expired, overCap, keptPending,
|
|
174
169
|
removed: { ...removedBatches, history },
|
|
@@ -231,6 +226,16 @@ export interface ArchiveSweepOptions {
|
|
|
231
226
|
run?: (cwd: string, options: ArchivePurgeOptions) => ArchivePurgeOutcome
|
|
232
227
|
/** 覆盖 DSH home(测试注入)。 */
|
|
233
228
|
home?: string
|
|
229
|
+
/** 覆盖「重写库文件」的执行体(测试注入;缺省起子进程做 VACUUM)。 */
|
|
230
|
+
rewrite?: (jobs: RewriteJob[]) => void
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** 交给子进程的重写任务:备份 + 回收页,两件都是整库 IO,必须离开宿主事件循环。 */
|
|
234
|
+
export interface RewriteJob {
|
|
235
|
+
/** 库文件绝对路径。 */
|
|
236
|
+
file: string
|
|
237
|
+
/** 清理前备份路径;空串表示不备份。 */
|
|
238
|
+
backup: string
|
|
234
239
|
}
|
|
235
240
|
|
|
236
241
|
/**
|
|
@@ -267,27 +272,113 @@ export function listArchiveWorkspaces(home = dshHome()): string[] {
|
|
|
267
272
|
|
|
268
273
|
/**
|
|
269
274
|
* @public
|
|
270
|
-
* @author ddj 2026-11-24
|
|
271
|
-
* @description:
|
|
275
|
+
* @author ddj 2026-11-24 / 2026年11月25号
|
|
276
|
+
* @description: 对所有工作区归档库跑一遍清理;删除在进程内做完(快),整库重写交给子进程。
|
|
277
|
+
* 单个库失败只记日志,不影响其他库。
|
|
272
278
|
* @param options 扫描选项
|
|
273
279
|
* @returns 扫描到的库数与删除的行数合计
|
|
274
280
|
*/
|
|
275
|
-
export function sweepArchives(options: ArchiveSweepOptions = {}): { workspaces: number; removed: number } {
|
|
281
|
+
export function sweepArchives(options: ArchiveSweepOptions = {}): { workspaces: number; removed: number; rewrites: number } {
|
|
276
282
|
const run = options.run ?? purgeArchiveDb
|
|
277
283
|
const workspaces = listArchiveWorkspaces(options.home)
|
|
284
|
+
const jobs: RewriteJob[] = []
|
|
278
285
|
let removed = 0
|
|
279
286
|
for (const cwd of workspaces) {
|
|
280
287
|
try {
|
|
281
|
-
|
|
288
|
+
// vacuum:false 先在进程内删行;备份与 VACUUM 一律留到最后统一交给子进程
|
|
289
|
+
const outcome = run(cwd, { dryRun: false, vacuum: false })
|
|
282
290
|
removed += outcome.removed.batches + outcome.removed.history
|
|
283
|
-
if (outcome.removed.batches
|
|
284
|
-
|
|
285
|
-
}
|
|
291
|
+
if (!outcome.removed.batches && !outcome.removed.history) continue
|
|
292
|
+
jobs.push({ file: archiveDbFile(cwd, options.home), backup: archiveDbFile(cwd, options.home) + BACKUP_SUFFIX })
|
|
293
|
+
log.debug(`归档库清理:${cwd} 批次 ${outcome.removed.batches},历史 ${outcome.removed.history}`)
|
|
286
294
|
} catch (error) {
|
|
287
295
|
log.debug('归档库清理跳过:' + cwd + ' ' + String(error))
|
|
288
296
|
}
|
|
289
297
|
}
|
|
290
|
-
|
|
298
|
+
if (jobs.length) {
|
|
299
|
+
const rewrite = options.rewrite ?? rewriteInChild
|
|
300
|
+
try { rewrite(jobs) } catch (error) { log.warn('归档库重写调度失败(库已删行,未回收空间):' + String(error)) }
|
|
301
|
+
}
|
|
302
|
+
return { workspaces: workspaces.length, removed, rewrites: jobs.length }
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @private
|
|
307
|
+
* @author ddj 2026年11月25号
|
|
308
|
+
* @description: 起一个独立 Node 子进程做备份与 VACUUM。这两步是整库读写,留在宿主里会把
|
|
309
|
+
* 事件循环堵住十几秒,所有 RPC(含文件读取、差异渲染)都会一起卡住。
|
|
310
|
+
* 子进程只认「文件 + 备份路径」,不含任何业务规则,规则仍只有 {@link purgeArchiveDb} 一份。
|
|
311
|
+
* @param jobs 重写任务
|
|
312
|
+
* @returns 无(不等待完成)
|
|
313
|
+
*/
|
|
314
|
+
function rewriteInChild(jobs: RewriteJob[]): void {
|
|
315
|
+
// 子进程要独占写库:先把本进程缓存的连接关掉,否则它会在 busy_timeout 里空转
|
|
316
|
+
try { closeArchiveDbs() } catch { /* 关闭失败仍交给子进程重试 */ }
|
|
317
|
+
const script = [
|
|
318
|
+
"const { DatabaseSync } = require('node:sqlite')",
|
|
319
|
+
"const { rmSync } = require('node:fs')",
|
|
320
|
+
'const jobs = JSON.parse(process.argv[1])',
|
|
321
|
+
'for (const job of jobs) {',
|
|
322
|
+
' let db',
|
|
323
|
+
' try {',
|
|
324
|
+
' db = new DatabaseSync(job.file, { timeout: 15000 })',
|
|
325
|
+
" db.exec('PRAGMA busy_timeout=15000')",
|
|
326
|
+
' if (job.backup) {',
|
|
327
|
+
' try { rmSync(job.backup, { force: true }) } catch (e) { /* 备份覆盖失败不阻断 */ }',
|
|
328
|
+
" db.exec(\"VACUUM INTO '\" + job.backup.replace(/'/g, \"''\") + \"'\")",
|
|
329
|
+
' }',
|
|
330
|
+
" db.exec('VACUUM')",
|
|
331
|
+
' } catch (error) {',
|
|
332
|
+
' console.error(String(error))',
|
|
333
|
+
' process.exitCode = 1',
|
|
334
|
+
' } finally {',
|
|
335
|
+
' try { db && db.close() } catch (e) { /* 已关闭 */ }',
|
|
336
|
+
' }',
|
|
337
|
+
'}',
|
|
338
|
+
].join('\n')
|
|
339
|
+
const child = spawn(process.execPath, ['-e', script, JSON.stringify(jobs)], { stdio: ['ignore', 'ignore', 'pipe'], windowsHide: true })
|
|
340
|
+
let stderr = ''
|
|
341
|
+
child.stderr?.on('data', (chunk) => { stderr += String(chunk) })
|
|
342
|
+
child.on('error', (error) => log.warn('归档库重写子进程启动失败:' + String(error)))
|
|
343
|
+
child.on('exit', (code) => {
|
|
344
|
+
if (code === 0) log.debug('归档库重写完成:' + jobs.length + ' 个库')
|
|
345
|
+
else log.warn('归档库重写子进程退出码 ' + String(code) + ':' + stderr.slice(0, 300))
|
|
346
|
+
})
|
|
347
|
+
if (typeof child.unref === 'function') child.unref()
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @public
|
|
352
|
+
* @author ddj 2026年11月25号
|
|
353
|
+
* @description: 单个工作区库的备份与回收页交给子进程;RPC 层删完行后调它,不再原地 VACUUM。
|
|
354
|
+
* @param cwd 工作区
|
|
355
|
+
* @param home DSH home(测试可注入)
|
|
356
|
+
* @returns 无
|
|
357
|
+
*/
|
|
358
|
+
export function scheduleArchiveRewrite(cwd: string, home = dshHome()): void {
|
|
359
|
+
const file = archiveDbFile(cwd, home)
|
|
360
|
+
try { rewriteInChild([{ file, backup: file + BACKUP_SUFFIX }]) } catch (error) {
|
|
361
|
+
log.warn('归档库重写调度失败(库已删行,未回收空间):' + String(error))
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @private
|
|
367
|
+
* @author ddj 2026年11月25号
|
|
368
|
+
* @description: 今日是否已经扫过:两个宿主(桌面端与 Web 端)共用同一份 home,避免一天扫两遍。
|
|
369
|
+
* @param home DSH home
|
|
370
|
+
* @returns 已扫过返回 true
|
|
371
|
+
*/
|
|
372
|
+
function sweptToday(home: string): boolean {
|
|
373
|
+
const stamp = join(home, PLUGIN_ID, 'data', 'archive', '.sweep-' + new Date().toISOString().slice(0, 10))
|
|
374
|
+
try {
|
|
375
|
+
if (existsSync(stamp)) return true
|
|
376
|
+
mkdirSync(dirname(stamp), { recursive: true })
|
|
377
|
+
writeFileSync(stamp, new Date().toISOString(), 'utf8')
|
|
378
|
+
return false
|
|
379
|
+
} catch {
|
|
380
|
+
return false
|
|
381
|
+
}
|
|
291
382
|
}
|
|
292
383
|
|
|
293
384
|
/**
|
|
@@ -301,6 +392,7 @@ export function startArchiveSweep(options: ArchiveSweepOptions = {}): { dispose(
|
|
|
301
392
|
let stopped = false
|
|
302
393
|
const run = (): void => {
|
|
303
394
|
if (stopped) return
|
|
395
|
+
if (sweptToday(options.home ?? dshHome())) return
|
|
304
396
|
try { sweepArchives(options) } catch (error) { log.warn('归档库每日清理失败:' + String(error)) }
|
|
305
397
|
}
|
|
306
398
|
const first = setTimeout(run, options.delayMs ?? SWEEP_FIRST_DELAY_MS)
|
|
@@ -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 结果(跳过项不算失败) */
|