dsh-vscode-mode 0.30.0 → 0.31.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 +54 -10
- package/lib/client.js +143 -52
- package/lib/client.js.map +1 -1
- package/lib/index.js +3549 -1465
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/dsh-vscodemode-html-plan/LICENSE +202 -0
- package/skills/dsh-vscodemode-html-plan/SKILL.md +147 -0
- package/skills/dsh-vscodemode-html-plan/examples/scheduled-send.html +298 -0
- package/skills/dsh-vscodemode-html-plan/references/blocks.md +227 -0
- package/skills/dsh-vscodemode-html-plan/references/subagent-brief.md +17 -0
- package/skills/dsh-vscodemode-html-plan/references/upstream-SKILL.md +174 -0
- package/skills/dsh-vscodemode-html-plan/runtime/htmlplan.css +564 -0
- package/skills/dsh-vscodemode-html-plan/runtime/htmlplan.js +1299 -0
- package/skills/dsh-vscodemode-html-plan/runtime/pack.mjs +300 -0
- package/src/ai/llmTask.ts +178 -0
- package/src/ai/llmTypes.ts +6 -0
- package/src/ai/svnCommitMsg.ts +107 -0
- package/src/ai/svnTriage.ts +34 -85
- package/src/client/aiCommit.ts +57 -0
- package/src/client/htmlPlan/HtmlPlanPanel.ts +261 -0
- package/src/client/htmlPlan/planActions.ts +347 -0
- package/src/client/htmlPlan/planPage.ts +333 -0
- package/src/client/htmlPreview.ts +218 -0
- package/src/client/index.ts +8 -0
- package/src/client/officialSidebar.ts +11 -3
- package/src/client/planState.ts +8 -2
- package/src/client/sidebar/menuItems.ts +1 -0
- package/src/client/sidebar/panels/SvnPanel.ts +17 -0
- package/src/client/sidebar/types.ts +2 -0
- package/src/client/styles/editor.css +77 -0
- package/src/client/svnActions.ts +7 -0
- package/src/client/svnCommit.ts +109 -0
- package/src/client/svnNotice.ts +1 -1
- package/src/client/svnStatus.ts +5 -2
- package/src/client/ui/EditorView.ts +85 -7
- package/src/client/ui/McpSettings.ts +59 -0
- package/src/client/ui/SvnAiPlanDialog.ts +24 -4
- package/src/client/ui/SvnCommitDialog.ts +458 -0
- package/src/client/ui/commandCatalog.ts +11 -0
- package/src/client/ui/svnCommitModel.ts +204 -0
- package/src/fileOpenSettings.ts +113 -5
- package/src/htmlPlanCommand.ts +176 -0
- package/src/index.ts +4 -0
- package/src/shared/keybindings.ts +11 -0
- package/src/shared/rpc.ts +13 -4
- package/src/shared/svn.ts +191 -10
- package/src/shared/svnActions.ts +16 -0
- package/src/svn.ts +205 -47
- package/src/svnCommit.ts +348 -0
- package/src/svnCore.ts +254 -0
- package/src/svnToolJson.ts +73 -0
- package/src/svnTools.ts +566 -0
|
@@ -40,6 +40,8 @@ import { bindEditActions, runEditAction } from '../monaco/editActions.js'
|
|
|
40
40
|
import { addReloadGuard } from '../pageReload.js'
|
|
41
41
|
import { clampZoom, clearZoomMem, dataUrlOf, isImagePath, isSvgPath, recallZoom, rememberZoom, zoomKeyOf, zoomStepOf } from '../imagePreview.js'
|
|
42
42
|
import { isMarkdownPath } from '../markdownPreview.js'
|
|
43
|
+
import { hasOfficialHtmlPreview, isHtmlPath } from '../htmlPreview.js'
|
|
44
|
+
import { HtmlPlanPanel } from '../htmlPlan/HtmlPlanPanel.js'
|
|
43
45
|
import { isExcelPath } from '../excel/model.js'
|
|
44
46
|
import { isUniverPath, isOfficePath } from '../../shared/univer.js'
|
|
45
47
|
import { routesUniver } from '../univer/routing.js'
|
|
@@ -127,6 +129,7 @@ import { promptName } from './PromptDialog.js'
|
|
|
127
129
|
import { openWithDialog } from '../openWithDialog.js'
|
|
128
130
|
import { copyText as copyClipText } from '../copyText.js'
|
|
129
131
|
import { SvnLogDialog } from './SvnLogDialog.js'
|
|
132
|
+
import { SvnCommitDialog } from './SvnCommitDialog.js'
|
|
130
133
|
import { SvnUpdateDialog } from './SvnUpdateDialog.js'
|
|
131
134
|
import { sameUpdateOwner, updateDone } from './svnUpdateModel.js'
|
|
132
135
|
import { IconRefreshOutline16 } from './icons.js'
|
|
@@ -385,6 +388,7 @@ export function EditorView(props) {
|
|
|
385
388
|
const [svnLogData, setSvnLogData] = React.useState(null) // 日志条目(null=未加载)
|
|
386
389
|
const [svnLogBusy, setSvnLogBusy] = React.useState(false) // 日志在途
|
|
387
390
|
const [svnLogError, setSvnLogError] = React.useState('') // 日志错误文案
|
|
391
|
+
const [commitSeed, setCommitSeed] = React.useState(null) // 提交对话框 { paths?, message? }(null=关闭)
|
|
388
392
|
const [svnLogWcRev, setSvnLogWcRev] = React.useState(null) // P1-9:文件目标的工作副本版号(null = 不加粗)
|
|
389
393
|
const [dlogOpen, setDlogOpen] = React.useState(false) // 诊断日志弹窗(自取数据,null 语义无需状态层)
|
|
390
394
|
const [svnUpdateDialog, setSvnUpdateDialog] = React.useState(null) // {path,sessionId,scope,resumeJobId?};窗口内自取增量
|
|
@@ -677,6 +681,7 @@ export function EditorView(props) {
|
|
|
677
681
|
}, [excelScope, active, isExcelActive])
|
|
678
682
|
// 当前 tab 是否为可预览的 Markdown,以及是否正处于预览态(预览态替换 Monaco host,只读)
|
|
679
683
|
const isMdActive = !!active && isMarkdownPath(active)
|
|
684
|
+
const isHtmlActive = !!active && isHtmlPath(active)
|
|
680
685
|
const mdPreviewing = isMdActive && mdPreviewRef.current.has(active)
|
|
681
686
|
const regions = React.useMemo(() => {
|
|
682
687
|
// #region debug log
|
|
@@ -2082,6 +2087,7 @@ export function EditorView(props) {
|
|
|
2082
2087
|
if (!isMarkdownPath(path)) { setStatus('当前文件不是 Markdown'); return }
|
|
2083
2088
|
toggleMdPreviewRef.current?.(path)
|
|
2084
2089
|
}],
|
|
2090
|
+
['edrv.command.previewHtml', () => { previewHtmlOf(activeRef.current) }],
|
|
2085
2091
|
['edrv.command.navigateBack', () => navBackRef.current?.()],
|
|
2086
2092
|
['edrv.command.navigateForward', () => navForwardRef.current?.()],
|
|
2087
2093
|
['edrv.command.nextTab', () => cycleTabRef.current?.(1)],
|
|
@@ -2121,6 +2127,7 @@ export function EditorView(props) {
|
|
|
2121
2127
|
['edrv.command.svnDiffBase', () => runSvnDiffBase(activeRef.current)],
|
|
2122
2128
|
['edrv.command.svnAdd', () => runSvnAdd(activeRef.current)],
|
|
2123
2129
|
['edrv.command.svnRevertCli', () => runSvnRevertCli(activeRef.current)],
|
|
2130
|
+
['edrv.command.svnCommit', () => openSvnCommit({ paths: activeRef.current ? [activeRef.current] : [] })],
|
|
2124
2131
|
['edrv.command.svnLog', () => openSvnLog(activeRef.current || undefined)],
|
|
2125
2132
|
['edrv.command.svnCreatePatch', () => runSvnAction(SVN_ACTION_BY_ID['create-patch'], {
|
|
2126
2133
|
sessionId,
|
|
@@ -2347,6 +2354,7 @@ export function EditorView(props) {
|
|
|
2347
2354
|
openSvnDiff: (p) => runSvnDiffBase(p),
|
|
2348
2355
|
openSvnLocalPair: runSvnDiffLocalPair,
|
|
2349
2356
|
openSvnLog: (p) => openSvnLog(p ?? relPath),
|
|
2357
|
+
openCommitDialog: (seed) => openSvnCommit(seed),
|
|
2350
2358
|
refreshChanges: () => refreshSvnChanges(sessionId, scope),
|
|
2351
2359
|
})
|
|
2352
2360
|
},
|
|
@@ -3263,6 +3271,24 @@ export function EditorView(props) {
|
|
|
3263
3271
|
}
|
|
3264
3272
|
toggleMdPreviewRef.current = toggleMdPreview
|
|
3265
3273
|
|
|
3274
|
+
/**
|
|
3275
|
+
* 用官方 HTML 渲染器预览当前网页(按钮/快捷键/命令栏同一动作)。
|
|
3276
|
+
*
|
|
3277
|
+
* 先 flushSave:官方预览读的是磁盘内容,防抖窗口内未落盘的改动必须先生效;
|
|
3278
|
+
* 再交给原生打开 handler(session 域 file 地址 → 官方 documentpreviews 的 html body)。
|
|
3279
|
+
* 旧版 DSH 无官方渲染器时只提示,不改动当前文本编辑态。
|
|
3280
|
+
* @author ddj 2026年11月21号
|
|
3281
|
+
* @param path 当前文件路径
|
|
3282
|
+
*/
|
|
3283
|
+
function previewHtmlOf(path) {
|
|
3284
|
+
if (!isHtmlPath(path)) { setStatus('当前文件不是 HTML'); return }
|
|
3285
|
+
if (!hasOfficialHtmlPreview()) { setStatus('当前 DSH 不支持 HTML 渲染预览'); return }
|
|
3286
|
+
|
|
3287
|
+
flushSave()
|
|
3288
|
+
saveViewState(path)
|
|
3289
|
+
if (!tryNativeOpen(path)) { setStatus('打开官方 HTML 预览失败,请在对话中打开该文件'); return }
|
|
3290
|
+
setStatus('已在官方查看器打开网页预览')
|
|
3291
|
+
}
|
|
3266
3292
|
/** 当前图片的会话+路径级缩放记忆键(页签切换回来保留同一缩放)。 */
|
|
3267
3293
|
const imgZoomKey = zoomKeyOf(sessionId, active)
|
|
3268
3294
|
|
|
@@ -4059,6 +4085,15 @@ export function EditorView(props) {
|
|
|
4059
4085
|
* @author ddj 2026年09月16号
|
|
4060
4086
|
* @param relPath 目标相对路径(缺省 = 工作区根)
|
|
4061
4087
|
*/
|
|
4088
|
+
/**
|
|
4089
|
+
* 打开原生提交对话框(种子 = 预选路径/预填信息;来自 AI 逐组提交或动作入口)。
|
|
4090
|
+
* @author ddj 2026年11月15号
|
|
4091
|
+
* @param seed 预填载荷(缺省 = 按面板默认勾选)
|
|
4092
|
+
*/
|
|
4093
|
+
const openSvnCommit = (seed) => {
|
|
4094
|
+
setCommitSeed(seed && typeof seed === 'object' ? seed : {})
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4062
4097
|
const openSvnLog = (relPath) => {
|
|
4063
4098
|
const target = relPath || ''
|
|
4064
4099
|
dshTrace('svnLog.open', { target, scope, hasSession: Boolean(sessionId) })
|
|
@@ -4184,6 +4219,7 @@ export function EditorView(props) {
|
|
|
4184
4219
|
openSvnDiff: (p) => runSvnDiffBase(p),
|
|
4185
4220
|
openSvnLocalPair: runSvnDiffLocalPair,
|
|
4186
4221
|
openSvnLog: (p) => openSvnLog(p ?? path),
|
|
4222
|
+
openCommitDialog: (seed) => openSvnCommit(seed),
|
|
4187
4223
|
refreshChanges: () => refreshSvnChanges(sessionId, scope),
|
|
4188
4224
|
})
|
|
4189
4225
|
}
|
|
@@ -4785,7 +4821,13 @@ export function EditorView(props) {
|
|
|
4785
4821
|
onClick: () => toggleMdPreview(active),
|
|
4786
4822
|
}, mdPreviewing ? '源码' : '预览') : null),
|
|
4787
4823
|
(mdPreviewing ? React.createElement('span', { className: 'edrv-pb-meta' }, '预览') : null),
|
|
4788
|
-
|
|
4824
|
+
// HTML 网页预览:交给官方 HTML 渲染器;按钮在渲染器不可用时禁用并说明原因。
|
|
4825
|
+
(isHtmlActive ? React.createElement('button', {
|
|
4826
|
+
className: 'edrv-pill edrv-pill-ghost edrv-pb-mdbtn',
|
|
4827
|
+
title: (hasOfficialHtmlPreview() ? '用官方渲染器预览网页' : '当前 DSH 不支持 HTML 渲染预览') + '(' + (chordOf('edrv.previewHtml') ?? '未绑定') + ')',
|
|
4828
|
+
disabled: !hasOfficialHtmlPreview(),
|
|
4829
|
+
onClick: () => previewHtmlOf(active),
|
|
4830
|
+
}, '预览网页') : null), (active && !isImageActive && langOf(active) ? React.createElement('span', { className: 'edrv-pb-meta' }, langOf(active)) : null),
|
|
4789
4831
|
(isImageActive && imgSize ? React.createElement('span', { className: 'edrv-pb-meta' }, imgSize.w + '×' + imgSize.h) : null),
|
|
4790
4832
|
(cursor ? React.createElement('span', { className: 'edrv-pb-meta' }, cursor) : null),
|
|
4791
4833
|
(status ? React.createElement('span', { className: 'edrv-pb-meta edrv-pb-status' }, status) : null))
|
|
@@ -4951,17 +4993,36 @@ export function EditorView(props) {
|
|
|
4951
4993
|
React.createElement('button', { className: 'edrv-pill edrv-pill-ghost', onClick: retry }, '重试'),
|
|
4952
4994
|
React.createElement('button', { className: 'edrv-pill edrv-pill-ghost', onClick: close }, '关闭标签页')))
|
|
4953
4995
|
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4996
|
+
/**
|
|
4997
|
+
* 计划页的 Markdown 渲染(HTML 计划页缺失/未声明时的回退)。
|
|
4998
|
+
* @author ddj 2026年11月21号
|
|
4999
|
+
* @param plan 计划文档
|
|
5000
|
+
* @returns 只读 Markdown 元素
|
|
5001
|
+
*/
|
|
5002
|
+
function planMarkdownBody(plan) {
|
|
5003
|
+
const text = plan.markdown
|
|
4958
5004
|
const render = isComponentType(MarkdownText)
|
|
4959
5005
|
? React.createElement(MarkdownDelegateProvider, {
|
|
4960
5006
|
openFile: (path, options) => options?.line != null ? openFileAt(path, options.line) : openFile(path, false),
|
|
4961
|
-
}, React.createElement(MarkdownText, { text, streaming: false, labels, variant: 'body' }))
|
|
5007
|
+
}, React.createElement(MarkdownText, { text, streaming: false, labels: PLAN_MD_LABELS, variant: 'body' }))
|
|
4962
5008
|
: React.createElement('pre', { className: 'edrv-mdview-pre' }, text)
|
|
5009
|
+
return React.createElement('div', { className: 'edrv-mdview-stage' }, React.createElement('div', { className: 'edrv-mdview-doc' }, render))
|
|
5010
|
+
}
|
|
5011
|
+
|
|
5012
|
+
let body
|
|
5013
|
+
if (activePlan) {
|
|
4963
5014
|
body = React.createElement('div', { className: 'edrv-mdview', ref: planHostRef, 'data-plan-address': activePlan.address },
|
|
4964
|
-
|
|
5015
|
+
activePlan.htmlPath
|
|
5016
|
+
? React.createElement(HtmlPlanPanel, {
|
|
5017
|
+
key: activePlan.address,
|
|
5018
|
+
sessionId,
|
|
5019
|
+
cwd,
|
|
5020
|
+
address: activePlan.address,
|
|
5021
|
+
title: activePlan.title,
|
|
5022
|
+
htmlPath: activePlan.htmlPath,
|
|
5023
|
+
markdown: activePlan.markdown,
|
|
5024
|
+
})
|
|
5025
|
+
: planMarkdownBody(activePlan))
|
|
4965
5026
|
} else if (pageChanged === pageIdentity && largeCandidate === pageIdentity) {
|
|
4966
5027
|
body = React.createElement('div', { className: 'edrv-empty', role: 'status' },
|
|
4967
5028
|
React.createElement('div', null, '文件已变化,请重新读取'),
|
|
@@ -5210,6 +5271,7 @@ export function EditorView(props) {
|
|
|
5210
5271
|
openSvnLocalPair: runSvnDiffLocalPair,
|
|
5211
5272
|
refreshSvnChanges: () => refreshSvnChanges(sessionId, scope),
|
|
5212
5273
|
openSvnLog: (p) => openSvnLog(p),
|
|
5274
|
+
openSvnCommit: (seed) => openSvnCommit(seed),
|
|
5213
5275
|
confirm: (message) => (typeof window === 'undefined' ? false : window.confirm(message)),
|
|
5214
5276
|
notify: (message) => setStatus(message),
|
|
5215
5277
|
// 名称输入弹窗(资源管理器右键的新建文件/新建文件夹/重命名)
|
|
@@ -5473,6 +5535,20 @@ export function EditorView(props) {
|
|
|
5473
5535
|
},
|
|
5474
5536
|
})
|
|
5475
5537
|
: null
|
|
5538
|
+
// 原生提交对话框(22-agent-tools-and-commit):portal 到 body,与日志/更新弹窗同一挂载方式
|
|
5539
|
+
const svnCommitEl = commitSeed
|
|
5540
|
+
? React.createElement(SvnCommitDialog, {
|
|
5541
|
+
key: 'edrv-svn-commit',
|
|
5542
|
+
sessionId,
|
|
5543
|
+
seed: commitSeed,
|
|
5544
|
+
notify: (message) => setStatus(message),
|
|
5545
|
+
onClose: () => setCommitSeed(null),
|
|
5546
|
+
onCommitted: (result) => {
|
|
5547
|
+
refreshSvnChanges(sessionId, scope)
|
|
5548
|
+
setStatus(result?.revision !== undefined ? '提交成功:r' + result.revision : '提交完成')
|
|
5549
|
+
},
|
|
5550
|
+
})
|
|
5551
|
+
: null
|
|
5476
5552
|
/**
|
|
5477
5553
|
* 更新终态只刷新一次目录树与变更缓存,切到日志再返回不重复执行。
|
|
5478
5554
|
* @author ddj 2026年09月24号
|
|
@@ -5632,6 +5708,7 @@ export function EditorView(props) {
|
|
|
5632
5708
|
tabMenuEl,
|
|
5633
5709
|
paletteEl,
|
|
5634
5710
|
svnLogEl,
|
|
5711
|
+
svnCommitEl,
|
|
5635
5712
|
svnUpdateEl,
|
|
5636
5713
|
svnDiffEl,
|
|
5637
5714
|
patchDialogEl,
|
|
@@ -5645,6 +5722,7 @@ export function EditorView(props) {
|
|
|
5645
5722
|
tabMenuEl,
|
|
5646
5723
|
paletteEl,
|
|
5647
5724
|
svnLogEl,
|
|
5725
|
+
svnCommitEl,
|
|
5648
5726
|
svnUpdateEl,
|
|
5649
5727
|
svnDiffEl,
|
|
5650
5728
|
patchDialogEl,
|
|
@@ -410,6 +410,11 @@ function SvnSettingsSection() {
|
|
|
410
410
|
const [svnDraft, setSvnDraft] = React.useState(null)
|
|
411
411
|
const [tortoisePath, setTortoisePath] = React.useState('')
|
|
412
412
|
const [tortoiseDraft, setTortoiseDraft] = React.useState(null)
|
|
413
|
+
const [readOnly, setReadOnly] = React.useState(false)
|
|
414
|
+
const [scale, setScale] = React.useState(1)
|
|
415
|
+
const [autoAdd, setAutoAdd] = React.useState(true)
|
|
416
|
+
const [autoDelete, setAutoDelete] = React.useState(true)
|
|
417
|
+
const [commitStyle, setCommitStyle] = React.useState('plain')
|
|
413
418
|
const [svnInfo, setSvnInfo] = React.useState(null)
|
|
414
419
|
const [busy, setBusy] = React.useState(false)
|
|
415
420
|
const [error, setError] = React.useState('')
|
|
@@ -418,6 +423,11 @@ function SvnSettingsSection() {
|
|
|
418
423
|
const snap = settings?.getSnapshot?.()
|
|
419
424
|
setSvnPath(typeof snap?.value?.svnPath === 'string' ? snap.value.svnPath : '')
|
|
420
425
|
setTortoisePath(typeof snap?.value?.tortoisePath === 'string' ? snap.value.tortoisePath : '')
|
|
426
|
+
setReadOnly(snap?.value?.svnReadOnly === true)
|
|
427
|
+
setScale(typeof snap?.value?.svnCommandTimeoutScale === 'number' ? snap.value.svnCommandTimeoutScale : 1)
|
|
428
|
+
setAutoAdd(snap?.value?.svnAutoAddUnversioned !== false)
|
|
429
|
+
setAutoDelete(snap?.value?.svnAutoDeleteMissing !== false)
|
|
430
|
+
setCommitStyle(snap?.value?.aiCommitStyle === 'conventional' ? 'conventional' : 'plain')
|
|
421
431
|
}
|
|
422
432
|
onChange()
|
|
423
433
|
return settings?.subscribe?.(onChange)
|
|
@@ -452,6 +462,12 @@ function SvnSettingsSection() {
|
|
|
452
462
|
setTortoiseDraft(null)
|
|
453
463
|
savePath('tortoisePath', next, () => setTortoisePath(next))
|
|
454
464
|
}
|
|
465
|
+
/** 通用设置写入(布尔/数字/枚举;失败就地报错,不吞)。 */
|
|
466
|
+
const saveValue = (key, value, apply) => {
|
|
467
|
+
setBusy(true); setError('')
|
|
468
|
+
if (!settings?.set) { setError('设置服务不可用'); setBusy(false); return }
|
|
469
|
+
settings.set(key, value).then(() => { apply() }).catch((e) => setError(String(e))).finally(() => setBusy(false))
|
|
470
|
+
}
|
|
455
471
|
const disabled = loading || unavailable || notReady || busy || snapshot?.writable === false
|
|
456
472
|
return React.createElement('section', { className: 'vsm-panel' },
|
|
457
473
|
React.createElement('h3', { className: 'vsm-panel-title' }, 'SVN'),
|
|
@@ -477,6 +493,49 @@ function SvnSettingsSection() {
|
|
|
477
493
|
onBlur: commitTortoise,
|
|
478
494
|
onKeyDown: (event) => { if (event.key === 'Enter') commitTortoise() },
|
|
479
495
|
})),
|
|
496
|
+
React.createElement('label', { className: 'vsm-general-row' },
|
|
497
|
+
React.createElement('span', null, '超时倍数'),
|
|
498
|
+
React.createElement('input', {
|
|
499
|
+
value: String(scale), placeholder: '1', disabled, title: 'SVN 命令超时倍数(0.2–20;仓库慢或工作副本大时调到 2–3)',
|
|
500
|
+
onChange: (event) => {
|
|
501
|
+
const next = Number(event.target.value)
|
|
502
|
+
if (Number.isFinite(next)) setScale(next)
|
|
503
|
+
},
|
|
504
|
+
onBlur: () => saveValue('svnCommandTimeoutScale', Math.min(20, Math.max(0.2, scale)), () => {}),
|
|
505
|
+
})),
|
|
506
|
+
React.createElement('label', { className: 'vsm-general-row' },
|
|
507
|
+
React.createElement('span', null, '只读模式'),
|
|
508
|
+
React.createElement('input', {
|
|
509
|
+
type: 'checkbox', checked: readOnly, disabled,
|
|
510
|
+
title: '开启后拒绝全部写操作(提交/还原/更新/属性写入),只保留查看与比对',
|
|
511
|
+
onChange: () => saveValue('svnReadOnly', !readOnly, () => setReadOnly(!readOnly)),
|
|
512
|
+
})),
|
|
513
|
+
React.createElement('label', { className: 'vsm-general-row' },
|
|
514
|
+
React.createElement('span', null, '提交前自动加入'),
|
|
515
|
+
React.createElement('input', {
|
|
516
|
+
type: 'checkbox', checked: autoAdd, disabled,
|
|
517
|
+
title: '提交时对勾选的未版本控制文件自动 svn add(关闭后这些文件会被跳过并在结果里列出)',
|
|
518
|
+
onChange: () => saveValue('svnAutoAddUnversioned', !autoAdd, () => setAutoAdd(!autoAdd)),
|
|
519
|
+
})),
|
|
520
|
+
React.createElement('label', { className: 'vsm-general-row' },
|
|
521
|
+
React.createElement('span', null, '提交前自动删除'),
|
|
522
|
+
React.createElement('input', {
|
|
523
|
+
type: 'checkbox', checked: autoDelete, disabled,
|
|
524
|
+
title: '提交时对勾选的已删除文件自动 svn delete(关闭后这些文件会被跳过并在结果里列出)',
|
|
525
|
+
onChange: () => saveValue('svnAutoDeleteMissing', !autoDelete, () => setAutoDelete(!autoDelete)),
|
|
526
|
+
})),
|
|
527
|
+
React.createElement('label', { className: 'vsm-general-row' },
|
|
528
|
+
React.createElement('span', null, 'AI 提交信息风格'),
|
|
529
|
+
React.createElement('select', {
|
|
530
|
+
value: commitStyle, disabled,
|
|
531
|
+
title: 'plain = 中文「<模块>:<标题>」;conventional = type(scope): subject',
|
|
532
|
+
onChange: (event) => {
|
|
533
|
+
const next = event.target.value === 'conventional' ? 'conventional' : 'plain'
|
|
534
|
+
saveValue('aiCommitStyle', next, () => setCommitStyle(next))
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
React.createElement('option', { value: 'plain' }, '中文模板'),
|
|
538
|
+
React.createElement('option', { value: 'conventional' }, 'Conventional Commits'))),
|
|
480
539
|
),
|
|
481
540
|
)
|
|
482
541
|
}
|
|
@@ -90,7 +90,7 @@ function sectionHeadEl(title, note, allChecked, onToggleAll, countText) {
|
|
|
90
90
|
* @param toggleOpen 组卡展开切换
|
|
91
91
|
* @returns 预览主体元素
|
|
92
92
|
*/
|
|
93
|
-
function previewBodyEl(sel, setSel, open, toggleOpen) {
|
|
93
|
+
function previewBodyEl(sel, setSel, open, toggleOpen, commitGroups, onCommitGroup) {
|
|
94
94
|
/** 通用段更新(reverts/ignores 共用)。 */
|
|
95
95
|
const patchItems = (key, index, checked) => setSel((old) => ({
|
|
96
96
|
...old,
|
|
@@ -160,7 +160,27 @@ function previewBodyEl(sel, setSel, open, toggleOpen) {
|
|
|
160
160
|
React.createElement('div', { className: 'edrv-svnplan-sec' },
|
|
161
161
|
sectionHeadEl('建议忽略(svn:ignore)', '将写入 svn:ignore 属性,随提交进仓库,默认不勾', ignoresAll,
|
|
162
162
|
() => toggleItemsAll('ignores', !ignoresAll), sel.ignores.length + ' 项'),
|
|
163
|
-
React.createElement('div', { className: 'edrv-svnplan-list' }, itemRowsOf('ignores')))
|
|
163
|
+
React.createElement('div', { className: 'edrv-svnplan-list' }, itemRowsOf('ignores'))),
|
|
164
|
+
(Array.isArray(commitGroups) && commitGroups.length
|
|
165
|
+
? React.createElement('div', { className: 'edrv-svnplan-sec' },
|
|
166
|
+
React.createElement('div', { className: 'edrv-svnplan-sechead' },
|
|
167
|
+
React.createElement('span', { className: 'edrv-svnplan-sectitle' }, '建议拆分提交(逐组预填提交框)'),
|
|
168
|
+
React.createElement('span', { className: 'edrv-svn-count' }, commitGroups.length + ' 组'),
|
|
169
|
+
React.createElement('span', { className: 'edrv-svnplan-note' }, '不自动提交:只预填,仍需在提交框确认')),
|
|
170
|
+
React.createElement('div', { className: 'edrv-svnplan-list' },
|
|
171
|
+
...commitGroups.map((group) => React.createElement('div', { key: 'commit-' + group.name, className: 'edrv-svnplan-card' },
|
|
172
|
+
React.createElement('div', { className: 'edrv-svnplan-row' },
|
|
173
|
+
React.createElement('span', { className: 'edrv-svnplan-groupname' }, group.name),
|
|
174
|
+
React.createElement('span', { className: 'edrv-svn-count' }, group.paths.length + ' 项'),
|
|
175
|
+
React.createElement('span', { style: { flex: 1 } }),
|
|
176
|
+
React.createElement('button', {
|
|
177
|
+
className: 'edrv-svn-act',
|
|
178
|
+
title: '打开提交对话框并预填该组(不会自动提交)',
|
|
179
|
+
onClick: () => onCommitGroup?.(group),
|
|
180
|
+
}, '逐组提交…')),
|
|
181
|
+
React.createElement('div', { className: 'edrv-svnplan-path', title: group.subject }, group.subject),
|
|
182
|
+
(group.body ? React.createElement('div', { className: 'edrv-svnplan-reason' }, group.body) : null)))))
|
|
183
|
+
: null))
|
|
164
184
|
}
|
|
165
185
|
|
|
166
186
|
/**
|
|
@@ -204,7 +224,7 @@ function progressBodyEl(run) {
|
|
|
204
224
|
* @returns 弹窗元素
|
|
205
225
|
*/
|
|
206
226
|
export function SvnAiPlanDialog(props) {
|
|
207
|
-
const { plan, meta, run, onExecute, onPause, onResume, onCancelRest, onClose } = props
|
|
227
|
+
const { plan, meta, run, onExecute, onPause, onResume, onCancelRest, onClose, onCommitGroup } = props
|
|
208
228
|
const [sel, setSel] = React.useState(() => initPlanSel(plan))
|
|
209
229
|
const [open, setOpen] = React.useState(() => new Set())
|
|
210
230
|
const selected = selectedOf(sel)
|
|
@@ -244,7 +264,7 @@ export function SvnAiPlanDialog(props) {
|
|
|
244
264
|
let body = null
|
|
245
265
|
let footer = null
|
|
246
266
|
if (run === null) {
|
|
247
|
-
body = previewBodyEl(sel, setSel, open, toggleOpen)
|
|
267
|
+
body = previewBodyEl(sel, setSel, open, toggleOpen, plan?.commitGroups, onCommitGroup)
|
|
248
268
|
footer = React.createElement('div', { className: 'edrv-svnplan-foot' },
|
|
249
269
|
React.createElement('span', { className: 'edrv-svn-count' }, '已选 ' + count + ' 项'),
|
|
250
270
|
React.createElement('span', { style: { flex: 1 } }),
|