dsh-vscode-mode 0.33.1 → 0.35.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-vscode-mode",
3
- "version": "0.33.1",
3
+ "version": "0.35.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": [
@@ -50,6 +50,29 @@ whenToUse: 用户输入 /html-plan;或 plan 模式下要求给出可逐项作
50
50
  8. 用户在计划页签点「生成 HTML 计划页」时,你会收到一条同样的修复指令:照第 3、4 步做完再重提交。
51
51
  不要回「计划模式不能写文件」——能写,写的是 `plans/` 下的计划交付物。
52
52
 
53
+ ### 2.1 附件(图片与文件)
54
+
55
+ 用户把图片/文件拖进对话输入框、连 `/html-plan <任务>` 一起发时,命令会先把它们复制到
56
+ `plans/<slug>/assets/`,并把固定 slug 与文件清单写进给你的指令:
57
+
58
+ - slug 已由命令定好:页面写到 `plans/<slug>/plan.html`,不要另起目录。
59
+ - 图片先用 `read_image` 看清内容再写主张;文档、日志用 `read` 读原文。
60
+ - 页面里用附件块引用(`src` 相对页面目录):
61
+
62
+ ```html
63
+ <doc-attach label="随附材料" caption="打包后内联,离线也能看">
64
+ <doc-file src="assets/login-mock.png">登录页设计稿</doc-file>
65
+ <doc-file src="assets/api-v3.pdf">接口文档 v3</doc-file>
66
+ </doc-attach>
67
+ ```
68
+
69
+ - `pack.mjs` 把每个 `doc-file` 内联成 data URI,并补 `data-mime` / `data-bytes`;
70
+ 图片出缩略图(点开看原图),文件出卡片(带下载)。单文件 >4 MB 不内联,
71
+ 卡片显示「未内联」;全页附件 >12 MB 会警告——大文件先裁小或改成文字引用。
72
+ - `plan.mjs --check` 会拒绝仍有未内联附件的页面;打包成功后 `plans/<slug>/assets/` 默认删除。
73
+ 要再打包一次(改页、重跑)就先给 `plan.mjs` 加 `--keep-assets` 保留原图。
74
+ - 页面只引用工作区里的文件:pack 只读 `--root` 与页面目录,围栏与密钥过滤对附件同样生效。
75
+
53
76
  ## 3. 主张树(沿用上游)
54
77
 
55
78
  每一层回答一个问题,问题决定配什么图示。
@@ -49,6 +49,20 @@ Put it in the `<header>`, after the `h1`. It shows “Proposed · 10 files · +5
49
49
  - **A behaviour whose output is text** (a CLI, a log, a generated file) is a `frame="terminal"` mock, or a `doc-code` of the output.
50
50
  - `doc-shot src="before.png"` is the same for a screenshot. Use screenshots for UI that exists and mocks for UI that does not.
51
51
 
52
+ ## `doc-attach` — files and images that came with the request
53
+
54
+ ```html
55
+ <doc-attach label="随附材料" caption="打包后内联,离线也能看">
56
+ <doc-file src="assets/login-mock.png">登录页设计稿</doc-file>
57
+ <doc-file src="assets/api-v3.pdf">接口文档 v3</doc-file>
58
+ </doc-attach>
59
+ ```
60
+
61
+ - One `<doc-file>` per attachment; its text is the display name (`name=""` overrides it). `src` is relative to the page, so the file must sit beside it — `/html-plan` puts uploads in `assets/<name>`.
62
+ - Images render as a thumbnail that opens full size; every other type renders as a card that downloads.
63
+ - `pack.mjs` inlines each source as a data URI and stamps `data-mime` / `data-bytes`. A file over 4 MB stays a dashed "未内联" card, and more than ~12 MB of attachments gets a warning.
64
+ - `plan.mjs` deletes `plans/<slug>/assets/` after a successful pack; pass `--keep-assets` when a repack still needs the originals. `plan.mjs --check` refuses a packed page that still points at a local attachment.
65
+
52
66
  ## `doc-machine` — a lifecycle, with the screen for each state
53
67
 
54
68
  ```html
@@ -362,6 +362,26 @@ doc-mock > template { display: none; }
362
362
  .mk-frame.none { background: transparent; border: 1px dashed var(--line); box-shadow: none; color: var(--ink); }
363
363
  .mk-cap { font-size: 13px; color: var(--ink-2); margin-top: 7px; }
364
364
 
365
+ /* ── doc-attach ──────────────────────────────────── */
366
+ doc-attach { display: block; }
367
+ .at-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; align-items: start; }
368
+ .at-item { display: flex; flex-direction: column; align-items: stretch; overflow: hidden; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); color: inherit; font: inherit; text-align: left; text-decoration: none; }
369
+ button.at-item { cursor: pointer; }
370
+ button.at-item:disabled { cursor: default; }
371
+ a.at-item { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
372
+ .at-item:hover { border-color: var(--ink-3); }
373
+ .at-thumb { display: block; width: 100%; height: 120px; object-fit: cover; background: var(--sunk); }
374
+ .at-thumb.at-missing { display: grid; place-items: center; font: 12px var(--mono); color: var(--ink-3); border-bottom: 1px dashed var(--line); }
375
+ .at-name { display: block; padding: 7px 10px 0; font: 550 12.5px/1.35 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
376
+ .at-file .at-name { padding: 0; font-weight: 600; }
377
+ .at-meta { display: block; padding: 1px 10px 9px; font: 11px var(--mono); color: var(--ink-3); }
378
+ .at-file .at-meta { padding: 2px 0 0; }
379
+ .at-info { min-width: 0; flex: 1; }
380
+ .at-ext { flex: 0 0 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 10px var(--mono); }
381
+ .at-raw { border-style: dashed; opacity: .85; }
382
+ .at-cap { font-size: 13px; color: var(--ink-2); margin-top: 7px; }
383
+ .pl-body > doc-attach { display: block; margin-bottom: 10px; }
384
+
365
385
  /* ── doc-ask ──────────────────────────────────────── */
366
386
  doc-ask { display: block; margin: 20px 0 24px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); position: relative; }
367
387
  doc-ask::before { content: "Decision"; display: block; font: 550 12px/1 var(--sans); color: var(--ink-3); margin: 0 0 8px; }
@@ -1183,6 +1183,41 @@ define('doc-shot', (el) => {
1183
1183
  img.addEventListener('load', fitS); new ResizeObserver(fitS).observe(stage); fitS();
1184
1184
  });
1185
1185
 
1186
+ /* ── doc-attach (files and images that came with the request) ────────────── */
1187
+ /* One container, one <doc-file> child per attachment. pack.mjs turns each src into a data URI and
1188
+ stamps data-mime / data-bytes; an unpacked page still renders, marked as not inlined. */
1189
+ const fmtBytes = (n) => { const v = +n || 0; if (!v) return ''; if (v >= 1048576) return (v / 1048576).toFixed(1) + ' MB'; if (v >= 1024) return Math.round(v / 1024) + ' KB'; return v + ' B'; };
1190
+ const extOfName = (s) => { const m = String(s || '').match(/\.([a-z0-9]{1,6})(?:$|[?#])/i); return m ? m[1].toUpperCase() : ''; };
1191
+ const MIME_LABEL = { 'text/plain': 'TXT', 'text/markdown': 'MD', 'text/csv': 'CSV', 'application/json': 'JSON', 'application/pdf': 'PDF', 'application/zip': 'ZIP' };
1192
+ const mimeLabel = (mime) => { const base = String(mime || '').split(';')[0].trim(); if (MIME_LABEL[base]) return MIME_LABEL[base]; const sub = base.split('/')[1] || ''; return sub.replace(/^(x-|vnd\.)/i, '').slice(0, 4).toUpperCase(); };
1193
+ const looksImage = (src, mime) => /^image\//i.test(mime || '') || (!mime && /\.(png|jpe?g|gif|webp|svg|avif|bmp|tiff?)$/i.test(String(src || '')));
1194
+ /** One attachment card: an image thumbnail that opens full size, or a file row that downloads. */
1195
+ function attachItem(f) {
1196
+ const src = f.getAttribute('src') || ''; const mime = f.getAttribute('data-mime') || '';
1197
+ const name = (f.textContent || '').trim() || f.getAttribute('name') || String(src).split(/[\\/]/).pop() || 'attachment';
1198
+ const bytes = +(f.getAttribute('data-bytes') || 0); const packed = /^(data:|https?:)/i.test(src);
1199
+ const meta = [fmtBytes(bytes), packed ? '' : '未内联'].filter(Boolean).join(' · ');
1200
+ if (looksImage(src, mime)) {
1201
+ const thumb = packed ? h('img', { class: 'at-thumb', src, alt: name, loading: 'lazy' }) : h('div', { class: 'at-thumb at-missing' }, '未内联');
1202
+ const card = h('button', { type: 'button', class: 'at-item at-image', title: name }, thumb, h('span', { class: 'at-name' }, name), h('span', { class: 'at-meta' }, meta));
1203
+ if (packed) card.addEventListener('click', () => openSheet(name, h('img', { src, alt: name, style: 'max-width:100%;height:auto;display:block' })));
1204
+ else card.disabled = true;
1205
+ return card;
1206
+ }
1207
+ const badge = h('span', { class: 'at-ext' }, (extOfName(name) || mimeLabel(mime) || 'FILE').slice(0, 4).toUpperCase());
1208
+ const info = h('span', { class: 'at-info' }, h('span', { class: 'at-name' }, name), h('span', { class: 'at-meta' }, [fmtBytes(bytes), packed ? '下载' : '未内联'].filter(Boolean).join(' · ')));
1209
+ if (packed) return h('a', { class: 'at-item at-file', href: src, download: name, target: '_blank', rel: 'noopener', title: name }, badge, info);
1210
+ return h('span', { class: 'at-item at-file at-raw', title: src || name }, badge, info);
1211
+ }
1212
+ define('doc-attach', (el) => {
1213
+ const files = $$(':scope > doc-file', el);
1214
+ if (!files.length) { errBox(el, ['no <doc-file> inside'], 'doc-attach'); return; }
1215
+ const grid = h('div', { class: 'at-grid' });
1216
+ files.forEach((f) => { grid.append(attachItem(f)); f.remove(); });
1217
+ const label = el.getAttribute('label'); const caption = el.getAttribute('caption');
1218
+ el.replaceChildren(...[label ? h('div', { class: 'mk-label' }, label) : null, grid, caption ? h('div', { class: 'at-cap', html: capHtml(caption) }) : null].filter(Boolean));
1219
+ });
1220
+
1186
1221
  /* ── doc-plan / doc-claim (a tree of claims; each claim shows the one exhibit that proves it) ── */
1187
1222
  const claimKids = (c) => $$(':scope > doc-claim, :scope > .pl-body > doc-claim', c);
1188
1223
  /** Runs before the TOC is built: level, number, id and plain text of every claim. */
@@ -1286,7 +1321,7 @@ define('doc-ask', (el) => {
1286
1321
  });
1287
1322
 
1288
1323
  /* ── generic: [data-ref] outside mocks, tables ── */
1289
- function upgradeWithin(root) { $$('doc-code, doc-flow, doc-seq, doc-schema, doc-tree, doc-calls, doc-mock, doc-shot, doc-quote', root).forEach((el) => { const d = defs.find(([t]) => t === el.tagName.toLowerCase()); if (d && !el._nw) { el._nw = true; d[1](el); } }); }
1324
+ function upgradeWithin(root) { $$('doc-code, doc-flow, doc-seq, doc-schema, doc-tree, doc-calls, doc-mock, doc-shot, doc-attach, doc-quote', root).forEach((el) => { const d = defs.find(([t]) => t === el.tagName.toLowerCase()); if (d && !el._nw) { el._nw = true; d[1](el); } }); }
1290
1325
 
1291
1326
  /* ───────────────────────── boot ───────────────────────── */
1292
1327
  function boot() {
@@ -66,7 +66,7 @@ if (!/<h1[\s>]/i.test(html)) warn('no <h1> — the response header uses it');
66
66
  if (!/<meta[^>]+charset/i.test(html)) warn('missing <meta charset="utf-8">');
67
67
  if (!/htmlplan\.css/.test(html) && !/<style[^>]*data-htmlplan/.test(html)) err('htmlplan.css is not linked — add <link rel="stylesheet" href="…/htmlplan.css">');
68
68
  if (!/htmlplan\.js/.test(html) && !/<script[^>]*data-htmlplan/.test(html)) err('htmlplan.js is not included — add <script src="…/htmlplan.js" defer></script>');
69
- const KNOWN = new Set(['doc-code', 'doc-pin', 'doc-flow', 'doc-seq', 'doc-schema', 'doc-tree', 'doc-calls', 'doc-machine', 'doc-mock', 'doc-shot', 'doc-quote', 'doc-ask', 'doc-note', 'doc-draft', 'doc-plan', 'doc-claim', 'doc-changes']);
69
+ const KNOWN = new Set(['doc-code', 'doc-pin', 'doc-flow', 'doc-seq', 'doc-schema', 'doc-tree', 'doc-calls', 'doc-machine', 'doc-mock', 'doc-shot', 'doc-attach', 'doc-file', 'doc-quote', 'doc-ask', 'doc-note', 'doc-draft', 'doc-plan', 'doc-claim', 'doc-changes']);
70
70
  for (const m of html.matchAll(/<(doc-[a-z]+)\b/g)) if (!KNOWN.has(m[1])) err(`line ${lineOf(m.index)}: unknown element <${m[1]}> — known: ${[...KNOWN].join(' ')}`);
71
71
  const ids = {}; for (const m of html.matchAll(/\sid=["']([^"']+)["']/g)) { if (ids[m[1]]) err(`duplicate id="${m[1]}" (lines ${ids[m[1]]} and ${lineOf(m.index)})`); ids[m[1]] = lineOf(m.index); }
72
72
  for (const m of html.matchAll(/href=["']#([^"']+)["']/g)) if (!ids[m[1]] && !/^s\d+/.test(m[1])) warn(`line ${lineOf(m.index)}: href="#${m[1]}" points at no id`);
@@ -174,6 +174,19 @@ html = html.replace(/<(doc-(?!plan\b|claim\b)[a-z]+)\b([^>]*)>([\s\S]*?)<\/\1>/g
174
174
  else if (w >= 800 && !('thumbnail' in a)) warn(`${at}: ${a.frame || 'browser'} mock w=${w} renders at ~${Math.round(350 / w * 100)}% on a phone — fine as an overview (add thumbnail to say so), but pair it with a narrow crop (w≤480 frame=none) of the part that matters${inCols ? '; and it is inside .cols, which halves it again on desktop' : ''}`);
175
175
  else if (inCols && w > 600) warn(`${at}: w=${w} mock inside .cols — .cols is for mocks ≤600 wide; stack them or use .storyboard`); }
176
176
  else if (tag === 'doc-shot') { if (!a.src) err(`${at}: needs src=""`); else if (!/^(data:|https?:)/.test(a.src) && !findFile(a.src)) err(`${at}: src="${a.src}" not found`); }
177
+ else if (tag === 'doc-attach') {
178
+ const files = [...inner.matchAll(/<doc-file\b([^>]*)>([\s\S]*?)<\/doc-file>/gi)];
179
+ if (!files.length) err(`${at}: no <doc-file> inside — one child per attachment`);
180
+ if (files.length > 6) warn(`${at}: ${files.length} attachments — past ~6 the row wraps; split by kind or link the rest`);
181
+ for (const item of files) {
182
+ const fa = attrs(item[1]); const label = stripTags(item[2]).replace(/\s+/g, ' ').trim();
183
+ if (!fa.src) err(`${at}: <doc-file> needs src="assets/…"`);
184
+ else if (!/^(data:|https?:)/.test(fa.src) && !findFile(fa.src)) err(`${at}: src="${fa.src}" not found — keep attachments under plans/<slug>/assets/ and cite them as assets/<name>`);
185
+ if (!label && !fa.name) warn(`${at}: <doc-file src="${fa.src || '…'}"> has no display name — put it as the element text`);
186
+ if (fa.src && !/^(data:|https?:)/.test(fa.src) && /\.(html?|svg)$/i.test(fa.src)) warn(`${at}: ${fa.src} is markup — a browser may run it when opened; prefer a screenshot or a non-executable format`);
187
+ }
188
+ if (!a.caption) warn(`${at}: no caption="" — say what these attachments are for`);
189
+ }
177
190
  else if (tag === 'doc-draft') { if (!blockSrc(inner).trim()) err(`${at}: empty — put the editable text inside <script type="text/plain">`); if (!a.id) warn(`${at}: give it an id so edits survive a reload`); }
178
191
  else if (tag === 'doc-quote') { if (!a.via) warn(`${at}: add via="prompt|slack|github|transcript|doc|tools|…"`); if (!inner.trim()) err(`${at}: empty quote`); if (/[{}]/.test(a.from || '')) warn(`${at}: from="${a.from}" contains braces — from= is the literal name/handle the source shows; put role/agent context in where=`);
179
192
  if (a.via === 'slack' && a.href && /\/archives\/[A-Z0-9]+\/?$/.test(a.href)) warn(`${at}: href links the channel, not the message — use the permalink (…/p<ts>)`);
@@ -200,12 +213,13 @@ html = html.replace(/<(doc-(?!plan\b|claim\b)[a-z]+)\b([^>]*)>([\s\S]*?)<\/\1>/g
200
213
  });
201
214
  for (const m of html.matchAll(/data-if=["']([^"']+)["']/g)) m[1].split(/\s*&&\s*/).forEach((c) => { const n = c.replace(/^!/, '').split(/[=!~]/)[0].trim(); if (!names.has(n)) err(`line ${lineOf(m.index)}: data-if="${m[1]}" — no control named "${n}"`); });
202
215
  if (/<doc-pin\b/.test(html.replace(/<doc-(code|mock|shot|schema)\b[\s\S]*?<\/doc-\1>/g, ''))) err('a <doc-pin> sits outside any doc-code / doc-mock / doc-shot');
216
+ if (/<doc-file\b/.test(html.replace(/<doc-attach\b[\s\S]*?<\/doc-attach>/gi, ''))) err('a <doc-file> sits outside any doc-attach');
203
217
 
204
218
  /* ── doc-plan: the shape of the tree ── */
205
219
  if (/<doc-plan\b/.test(html)) {
206
220
  const flat = html.replace(/<!--[\s\S]*?-->/g, '').replace(/<(script|template|style)\b[\s\S]*?<\/\1>/gi, '').replace(/(<doc-(machine|ask|calls|mock|note)\b[^>]*>)[\s\S]*?(<\/doc-\2>)/gi, '$1$3');
207
221
  const root = { no: '', kids: [], ex: [], l: 0 }; const stack = [root]; let inPlan = 0;
208
- for (const t of flat.matchAll(/<(\/?)(doc-plan|doc-claim)\b([^>]*)>|<(doc-(?:mock|shot|machine|calls|schema|code|flow|seq|tree|quote))\b|<(doc-ask)\b|<p\b[^>]*>([\s\S]*?)<\/p>/g)) {
222
+ for (const t of flat.matchAll(/<(\/?)(doc-plan|doc-claim)\b([^>]*)>|<(doc-(?:mock|shot|attach|machine|calls|schema|code|flow|seq|tree|quote))\b|<(doc-ask)\b|<p\b[^>]*>([\s\S]*?)<\/p>/g)) {
209
223
  const top = stack[stack.length - 1];
210
224
  if (t[2] === 'doc-plan') { inPlan += t[1] ? -1 : 1; continue; }
211
225
  if (t[2] === 'doc-claim') { if (t[1]) { if (stack.length > 1) stack.pop(); else err('a </doc-claim> closes nothing'); continue; }
@@ -241,8 +255,8 @@ if (/<doc-plan\b/.test(html)) { // a plan starts with a title, not a label lin
241
255
 
242
256
  /* ── words: the blocks are the document; prose only joins them ── */
243
257
  { const main = (html.match(/<main[\s\S]*<\/main>/i) || [html])[0];
244
- const blocks = (main.match(/<doc-(code|flow|seq|schema|tree|calls|machine|mock|shot|ask|draft)\b/g) || []).length;
245
- const bare = main.replace(/<(script|style|template)\b[\s\S]*?<\/\1>/gi, ' ').replace(/<(doc-(?:code|flow|seq|schema|tree|calls|machine|mock|shot|ask|draft|quote))\b[\s\S]*?<\/\1>/gi, ' ');
258
+ const blocks = (main.match(/<doc-(code|flow|seq|schema|tree|calls|machine|mock|shot|attach|ask|draft)\b/g) || []).length;
259
+ const bare = main.replace(/<(script|style|template)\b[\s\S]*?<\/\1>/gi, ' ').replace(/<(doc-(?:code|flow|seq|schema|tree|calls|machine|mock|shot|attach|ask|draft|quote))\b[\s\S]*?<\/\1>/gi, ' ');
246
260
  let total = 0, long = 0, longest = 0, slow = 0;
247
261
  for (const m of bare.matchAll(/<(p|li|dd|doc-note)\b[^>]*>([\s\S]*?)<\/\1>/gi)) { const t = stripTags(m[2]).replace(/\s+/g, ' ').trim(); const n = wc(t); total += n; if (n > 40) { long++; longest = Math.max(longest, n); } t.split(/(?<=[.!?])\s+/).forEach((sn) => { if (wc(sn) > 25) slow++; }); }
248
262
  if (long) warn(`${long} paragraph${long > 1 ? 's' : ''} over 40 words (longest ${longest}) — two short sentences, then a block; move the rest into a caption, a pin or a table`);
@@ -274,6 +288,23 @@ if (!lintOnly) {
274
288
  const size = statSync(f).size; if (size > 6e6) { warn(`${src} is ${(size / 1e6).toFixed(1)} MB — not inlining; the packed file will need it alongside`); return m; }
275
289
  inlined++; return `${pre}data:${MIME[extname(f).toLowerCase()] || 'application/octet-stream'};base64,${readFileSync(f).toString('base64')}${post}`;
276
290
  });
291
+ // Attachments: a <doc-file> is one downloadable file (or image) that came with the request. Each is
292
+ // inlined under a stricter per-file cap than figures, so a plan page never silently ships a dead link.
293
+ const ATTACH_MIME = { ...MIME, '.pdf': 'application/pdf', '.txt': 'text/plain;charset=utf-8', '.log': 'text/plain;charset=utf-8', '.md': 'text/markdown;charset=utf-8', '.csv': 'text/csv;charset=utf-8', '.json': 'application/json', '.zip': 'application/zip', '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', '.pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation' };
294
+ let attachTotal = 0;
295
+ packed = packed.replace(/<doc-file\b([^>]*)>/gi, (m, rawAttrs) => {
296
+ const a = attrs(rawAttrs); const src = a.src || '';
297
+ if (!src || /^(data:|https?:|#)/.test(src)) return m;
298
+ const f = findFile(src); if (!f) { warn(`attachment ${src} not found — left as-is`); return m; }
299
+ const size = statSync(f).size; const mime = ATTACH_MIME[extname(f).toLowerCase()] || 'application/octet-stream';
300
+ if (size > 4e6) { warn(`${src} is ${(size / 1e6).toFixed(1)} MB — over the 4 MB attachment cap; the card will say it is not packed`); return m; }
301
+ attachTotal += size; inlined++;
302
+ const uri = `data:${mime};base64,${readFileSync(f).toString('base64')}`;
303
+ const next = rawAttrs.replace(/(\ssrc\s*=\s*["'])([^"']*)(["'])/i, (whole, pre, _old, post) => `${pre}${uri}${post}`);
304
+ const extra = ('data-mime' in a ? '' : ` data-mime="${mime}"`) + ('data-bytes' in a ? '' : ` data-bytes="${size}"`);
305
+ return `<doc-file${next}${extra}>`;
306
+ });
307
+ if (attachTotal > 12e6) warn(`attachments total ${(attachTotal / 1e6).toFixed(1)} MB — pages over ~12 MB open slowly; link the big ones instead`);
277
308
  if (!/data-htmlplan-packed/.test(packed)) packed = packed.replace(/<html\b/i, '<html data-htmlplan-packed');
278
309
  }
279
310
 
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  // plan.mjs — one command to turn plans/<slug>/plan.html into plan.packed.html.
3
- // node plan.mjs <slug> [--root <dir>] [--check] [--keep]
4
- // Copies the runtime next to the page, runs pack.mjs, then removes runtime/ and the
5
- // unpacked plan.html so only the single packed page stays in the repo.
3
+ // node plan.mjs <slug> [--root <dir>] [--check] [--keep] [--keep-assets]
4
+ // Copies the runtime next to the page, runs pack.mjs, then removes runtime/, the unpacked
5
+ // plan.html and (by default) the attachments folder so only the packed page stays in the repo.
6
6
  // @author ddj 2026年11月23号
7
- import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, statSync } from 'node:fs'
7
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync } from 'node:fs'
8
8
  import { execFileSync } from 'node:child_process'
9
9
  import { dirname, join, resolve } from 'node:path'
10
10
  import { fileURLToPath } from 'node:url'
@@ -22,7 +22,7 @@ function die(message) {
22
22
  process.exit(1)
23
23
  }
24
24
 
25
- if (!slug || !/^[a-z0-9][a-z0-9-]*$/i.test(slug)) die('用法:node plan.mjs <slug> [--root <dir>] [--check] [--keep]\n slug 用小写 kebab-case,例如 html-plan-own-answer')
25
+ if (!slug || !/^[a-z0-9][a-z0-9-]*$/i.test(slug)) die('用法:node plan.mjs <slug> [--root <dir>] [--check] [--keep] [--keep-assets]\n slug 用小写 kebab-case,例如 html-plan-own-answer')
26
26
 
27
27
  const dir = join(root, 'plans', slug)
28
28
  const pagePath = join(dir, 'plan.html')
@@ -35,6 +35,7 @@ if (flag('--check')) {
35
35
  const text = readFileSync(packedPath, 'utf8')
36
36
  if (/<(?:link|script)\b[^>]*?\s(?:href|src)\s*=\s*["'][^"']*htmlplan\.(?:css|js)/i.test(text)) die(`plan.packed.html 仍引用运行时文件,没打包干净:${packedPath}`)
37
37
  if (!/<style[^>]*data-htmlplan/i.test(text) || !/<script[^>]*data-htmlplan/i.test(text)) die(`plan.packed.html 里没有内联样式/脚本,可能不是 pack.mjs 的产物:${packedPath}`)
38
+ if (/<doc-file\b[^>]*\ssrc\s*=\s*["'](?!data:|https?:|#)[^"']+["']/i.test(text)) die(`plan.packed.html 里还有没内联的附件(<doc-file src="…">):重跑 plan.mjs ${slug};单个超过 4 MB 的附件要换小文件或改成文字引用`)
38
39
  console.log(`✓ ${packedPath} ${(statSync(packedPath).size / 1024).toFixed(0)} KB`)
39
40
  process.exit(0)
40
41
  }
@@ -59,12 +60,22 @@ try {
59
60
  }
60
61
  if (!packed || !existsSync(packedPath)) process.exit(1)
61
62
 
62
- // 3) 清理:只留打包好的单文件
63
+ // 3) 清理:只留打包好的单文件(附件目录默认也删掉——页面已内联,仓库不留原图;--keep-assets 才留)
63
64
  if (!flag('--keep')) {
64
65
  rmSync(runtimeDir, { recursive: true, force: true })
65
66
  rmSync(pagePath, { force: true })
66
67
  } else {
67
68
  console.log('· --keep:保留 runtime/ 与 plan.html')
68
69
  }
70
+ const assetsDir = join(dir, 'assets')
71
+ if (existsSync(assetsDir)) {
72
+ const count = readdirSync(assetsDir).length
73
+ if (flag('--keep-assets')) {
74
+ console.log(`· --keep-assets:保留 ${count} 个附件:plans/${slug}/assets/`)
75
+ } else {
76
+ rmSync(assetsDir, { recursive: true, force: true })
77
+ console.log(`· 已删除 plans/${slug}/assets/(${count} 项);要重打包先加 --keep-assets`)
78
+ }
79
+ }
69
80
  console.log(`✓ ${packedPath} ${(statSync(packedPath).size / 1024).toFixed(0)} KB`)
70
81
  console.log(`下一步:计划正文单独一行写「HTML 计划页:plans/${slug}/plan.packed.html」,再调 exit_plan_mode`)
@@ -0,0 +1,64 @@
1
+ /**
2
+ * dsh-vscode-mode client — 对话输入条崩溃态探测与恢复。
3
+ *
4
+ * 背景:DSH 的槽渲染器在某个 slot 条目渲染抛错时,会把该槽替换成空的
5
+ * `<div data-slot-error="…">`,并且不会自愈——所有会话的输入条都会一直是空的,
6
+ * 用户只能手动刷新页面。已定位的触发源是第三方皮肤插件改写官方占位符节点的
7
+ * textContent,导致 React 卸载时 removeChild 抛 NotFoundError。
8
+ * @author ddj 2026年11月23号
9
+ */
10
+
11
+ /** 官方对话输入条槽名(崩溃占位挂在同一个名字上)。 */
12
+ export const COMPOSER_BAR_SLOT = 'conversation.composer.bar'
13
+
14
+ /** 崩溃占位元素选择器。 */
15
+ const CRASH_SELECTOR = '[data-slot-error="' + COMPOSER_BAR_SLOT + '"]'
16
+
17
+ /** 恢复入口:复用插件已有的受保护页面刷新命令。 */
18
+ const RELOAD_EVENT = 'edrv.command.reloadWindow'
19
+
20
+ /**
21
+ * 判断输入条是否已经进入崩溃占位态。
22
+ * @public @author ddj 2026年11月23号
23
+ * @param doc 目标文档,缺省取当前页面
24
+ * @returns 崩溃占位存在时为 true
25
+ */
26
+ export function composerCrashed(doc: Document | undefined = typeof document === 'undefined' ? undefined : document): boolean {
27
+ if (!doc) return false
28
+ return doc.querySelector(CRASH_SELECTOR) !== null
29
+ }
30
+
31
+ /**
32
+ * 监听输入条崩溃态变化(槽被替换、会话切换都会触发)。
33
+ * @public @author ddj 2026年11月23号
34
+ * @param doc 目标文档
35
+ * @param onChange 状态变化回调;仅在布尔值真的翻转时调用
36
+ * @returns 解绑函数;无 MutationObserver 时返回空操作
37
+ */
38
+ export function watchComposer(doc: Document | undefined, onChange: (crashed: boolean) => void): () => void {
39
+ if (!doc || typeof MutationObserver === 'undefined') return () => {}
40
+
41
+ let last = composerCrashed(doc)
42
+ const observer = new MutationObserver(() => {
43
+ const next = composerCrashed(doc)
44
+ if (next === last) return
45
+
46
+ last = next
47
+ onChange(next)
48
+ })
49
+
50
+ observer.observe(doc.body, { childList: true, subtree: true })
51
+ onChange(last)
52
+ return () => { observer.disconnect() }
53
+ }
54
+
55
+ /**
56
+ * 触发一次受保护的页面刷新,把崩溃的输入条恢复到可用状态。
57
+ * @public @author ddj 2026年11月23号
58
+ * @returns 无
59
+ * @sideEffects 派发插件既有的刷新命令(会先保存界面状态再 reload)
60
+ */
61
+ export function recoverComposer(): void {
62
+ if (typeof window === 'undefined') return
63
+ window.dispatchEvent(new CustomEvent(RELOAD_EVENT))
64
+ }
@@ -12,6 +12,7 @@ import {
12
12
  buildPlanSrcDoc,
13
13
  derivePlanUiState,
14
14
  isMissingPage,
15
+ planAttachInfoOf,
15
16
  planPagePathOf,
16
17
  planRepairInstruction,
17
18
  resolvePlanPagePath,
@@ -161,6 +162,7 @@ export function HtmlPlanPanel(props: HtmlPlanPanelProps) {
161
162
  React.useEffect(() => { postPlanState() }, [review])
162
163
 
163
164
  const state = derivePlanUiState(projection, review !== null, acted)
165
+ const attachments = html === null ? { total: 0, pending: 0 } : planAttachInfoOf(html)
164
166
 
165
167
  /**
166
168
  * 把页面答复直接发给 agent:成功清空并回传成功,失败回传原因且保留文本。
@@ -348,9 +350,12 @@ export function HtmlPlanPanel(props: HtmlPlanPanelProps) {
348
350
  } else if (html === null) {
349
351
  stage = React.createElement('div', { className: 'edrv-empty' }, '读取计划页…')
350
352
  } else {
351
- const warn = staleRefs.length
353
+ const warnLines: string[] = []
354
+ if (staleRefs.length) warnLines.push('页面未打包:仍引用 ' + staleRefs.join('、') + '。样式/脚本可能缺失,先重新打包再提交。')
355
+ if (attachments.pending) warnLines.push(String(attachments.pending) + ' 个附件没内联:点开是空链接,重新打包后再提交。')
356
+ const warn = warnLines.length
352
357
  ? React.createElement('div', { className: 'edrv-htmlplan-warn' },
353
- '页面未打包:仍引用 ' + staleRefs.join('、') + '。样式/脚本可能缺失,先重新打包再提交。',
358
+ warnLines.join(' '),
354
359
  React.createElement('button', {
355
360
  className: 'edrv-pill edrv-pill-accent', style: { marginLeft: 8 },
356
361
  disabled: repairing || !sessionId,
@@ -364,7 +369,7 @@ export function HtmlPlanPanel(props: HtmlPlanPanelProps) {
364
369
  ref: frameRef,
365
370
  className: 'edrv-htmlplan-frame',
366
371
  title,
367
- sandbox: 'allow-scripts allow-forms allow-popups',
372
+ sandbox: 'allow-scripts allow-forms allow-popups allow-downloads',
368
373
  srcDoc: buildPlanSrcDoc(html),
369
374
  }))
370
375
  }
@@ -209,6 +209,34 @@ export function isMissingPage(result: unknown): boolean {
209
209
  return /文件不存在|no such file|ENOENT/i.test(typeof row.error === 'string' ? row.error : '')
210
210
  }
211
211
 
212
+ /** 打包页里的附件统计。 */
213
+ export interface PlanAttachmentInfo {
214
+ /** `<doc-file>` 总数。 */
215
+ total: number
216
+ /** src 仍是本地路径(没被 pack 内联)的数量。 */
217
+ pending: number
218
+ }
219
+
220
+ /**
221
+ * 统计打包页里的附件:`data:` / `http(s):` 之外都算没内联。
222
+ * 打包后的页面内附件必须是 data URI——iframe 用 srcdoc 渲染,相对路径打不开。
223
+ * @author ddj 2026年11月24号
224
+ * @param html 页面文本
225
+ * @returns 总数与未内联数
226
+ */
227
+ export function planAttachInfoOf(html: unknown): PlanAttachmentInfo {
228
+ const text = typeof html === 'string' ? html : ''
229
+ let total = 0
230
+ let pending = 0
231
+ for (const match of text.matchAll(/<doc-file\b([^>]*)>/gi)) {
232
+ total += 1
233
+ const found = /\bsrc\s*=\s*["']([^"']*)["']/i.exec(match[1] ?? '')
234
+ const src = found ? found[1] : ''
235
+ if (src && !/^(?:data:|https?:|#)/i.test(src)) pending += 1
236
+ }
237
+ return { total, pending }
238
+ }
239
+
212
240
  /**
213
241
  * 从计划正文声明的页面路径里取 slug(plans/<slug>/… 的第二段)。
214
242
  * @author ddj 2026年11月23号
@@ -235,7 +263,9 @@ export function planRepairInstruction(declared: unknown): string {
235
263
  '请按 dsh-vscodemode-html-plan 技能生成并打包 HTML 计划页,然后重新提交计划:',
236
264
  '1. 计划模式里允许写 plans/ 下的计划交付物:直接在计划模式里写页面,不要让我退出计划模式。',
237
265
  `2. 先写 plans/${slug}/plan.html,再运行该技能的 runtime/plan.mjs ${slug}(自带复制运行时、pack、清理)。`,
238
- `3. 确认 plans/${slug}/plan.packed.html 存在后,再调用 exit_plan_mode:正文第一行「# 计划:<标题>」,并单独一行「HTML 计划页:plans/${slug}/plan.packed.html」。`,
266
+ `3. 页面若引用附件(<doc-file src="assets/…">),确认文件在 plans/${slug}/assets/,并由 pack 内联成 data URI。`,
267
+ ' 打包成功后该目录会被删除;文件已不在时让我重新附一次附件,不要凭空造图。',
268
+ `4. 确认 plans/${slug}/plan.packed.html 存在后,再调用 exit_plan_mode:正文第一行「# 计划:<标题>」,并单独一行「HTML 计划页:plans/${slug}/plan.packed.html」。`,
239
269
  '不要只写路径不生成文件;页面确实生成失败就说清原因,并交付纯 Markdown 计划。',
240
270
  ].join('\n')
241
271
  }
@@ -11,7 +11,7 @@
11
11
  * 作者 ddj 2026-08-26 / 2026-08-27 / 2026-08-31 / 2026-09-10 / 2026-09-16 / 2026-10-09
12
12
  */
13
13
  import React from 'react'
14
- import { IconFolderClose16, IconFolderOpen16, IconRefreshOutline16, fileIconEl } from '../../ui/icons.js'
14
+ import { IconRefreshOutline16, dirIconEl, fileIconEl } from '../../ui/icons.js'
15
15
  import { rpc } from '../../rpc.js'
16
16
  import { isSessionMissingError, sessionMissingDetail, sessionMissingTitle } from '../../sessionError.js'
17
17
  import { ContextMenu } from '../../ui/ContextMenu.js'
@@ -41,19 +41,8 @@ const MISSING_DIR_PREFIX = '目录不存在'
41
41
 
42
42
  // --region 行图标(官方原语:目录文件夹图标 + 文件类型图标;缺失时回落纯文本)
43
43
 
44
- /**
45
- * 目录图标元素(官方 IconFolderOpen16/Close16)。
46
- * @author ddj 2026年09月10号
47
- * @param isOpen 目录是否展开
48
- * @returns 图标元素;原语缺失返回 null
49
- */
50
- function dirIconEl(isOpen) {
51
- const Icon = isOpen ? IconFolderOpen16 : IconFolderClose16
52
- if (typeof Icon !== 'function') return null
53
- return React.createElement(Icon, { size: 16, className: 'edrv-tree-icon' })
54
- }
55
-
56
- // 文件图标元素(fileIconEl)已上移 icons.ts 共享(SVN 变更行同用),此处直接引用。
44
+ // 目录图标(dirIconEl)与文件图标(fileIconEl)都在 icons.ts 共享:文件树、SVN 变更行、
45
+ // 提交/更新窗口用同一套原语,避免三处各留一份副本后漂移。
57
46
 
58
47
  /**
59
48
  * 行图标分派:目录 → 文件夹图标,文件 → 官方类型图标。
@@ -13,7 +13,9 @@
13
13
  * 作者 ddj 2026年09月16号
14
14
  */
15
15
  import React from 'react'
16
- import { IconRefreshOutline16, fileIconEl } from '../../ui/icons.js'
16
+ import { IconRefreshOutline16, entryIconEl } from '../../ui/icons.js'
17
+ import { isDirOf } from '../../ui/svnIcons.js'
18
+ import { useSvnEntryKinds } from '../../ui/useSvnEntryKinds.js'
17
19
  import {
18
20
  BATCH_PATHS_CAP,
19
21
  FILE_SIZES_CAP,
@@ -281,10 +283,12 @@ export function groupByChangelist(entries) {
281
283
  * @param props.onMenu 行右键菜单(分区管理入口;参数为条目与视口坐标)
282
284
  * @param props.onOpen 单击跳转(编辑区打开/聚焦该文件)
283
285
  * @param props.pairNote 疑似改名标记文案(W2-5;空 = 无配对)
286
+ * @param props.dirs 子项关系确定的目录集合(行图标判型)
287
+ * @param props.kinds host 返回的类型表(行图标判型)
284
288
  * @returns 行元素
285
289
  */
286
290
  const SvnRow = React.memo(function SvnRow(props) {
287
- const { entry, busy, onDiff, onAdd, onRevert, onConflict, onMenu, onOpen, pairNote } = props
291
+ const { entry, busy, onDiff, onAdd, onRevert, onConflict, onMenu, onOpen, pairNote, dirs, kinds } = props
288
292
  const diffable = isSvnDiffable(entry.path, entry.status)
289
293
  const act = (label, title, danger, run) => React.createElement('button', {
290
294
  className: 'edrv-svn-act' + (danger ? ' edrv-svn-act-danger' : ''),
@@ -303,7 +307,7 @@ const SvnRow = React.memo(function SvnRow(props) {
303
307
  onMenu(entry, event.clientX, event.clientY)
304
308
  },
305
309
  },
306
- fileIconEl(String(entry.path ?? '').split(/[\\/]/).pop() || ''),
310
+ entryIconEl(entry.path, isDirOf(entry.path, dirs, kinds)),
307
311
  statusLetterEl(entry),
308
312
  React.createElement('span', { className: 'edrv-svn-path' }, entry.path),
309
313
  (pairNote ? React.createElement('span', { className: 'edrv-svn-pair-mark', title: pairNote }, '⇄') : null),
@@ -944,6 +948,9 @@ export function SvnPanel(props) {
944
948
  const onAdd = React.useCallback((paths) => runBatch('add', paths), [runBatch])
945
949
  const onRevert = React.useCallback((paths) => runBatch('revert', paths), [runBatch])
946
950
  const showMore = React.useCallback(() => setRenderLimit((old) => old + RENDER_STEP), [])
951
+ // 行图标判型:条目集合变化才重算子项关系(面板会随编辑区刷新重渲,别每帧 O(n))
952
+ const kindPaths = React.useMemo(() => shown.map((entry) => entry.path), [shown])
953
+ const entryKinds = useSvnEntryKinds(kindPaths, sessionId)
947
954
  const handlers = {
948
955
  busy,
949
956
  onDiff: openSvnDiff,
@@ -955,6 +962,8 @@ export function SvnPanel(props) {
955
962
  onMenu: openRowMenu,
956
963
  onGroupClRemove: removeGroupCl,
957
964
  onOpen: openFileAt,
965
+ dirs: entryKinds.dirs,
966
+ kinds: entryKinds.kinds,
958
967
  }
959
968
 
960
969
  /**
@@ -229,6 +229,39 @@
229
229
  box-shadow: none;
230
230
  overflow: hidden;
231
231
  }
232
+ /* 输入条崩溃兜底:官方槽被替换成空占位时,dock 位给出可点的恢复入口 */
233
+ [data-edrv-diff-dock-shell] .edrv-composer-crash {
234
+ display: flex;
235
+ align-items: center;
236
+ gap: 8px;
237
+ min-height: 36px;
238
+ padding: 6px 12px;
239
+ }
240
+ [data-edrv-diff-dock-shell] .edrv-composer-crash-text {
241
+ min-width: 0;
242
+ flex: 1;
243
+ color: var(--dsw-alias-state-warning-primary, #a86a1f);
244
+ font-size: 12px;
245
+ line-height: 18px;
246
+ overflow-wrap: anywhere;
247
+ }
248
+ [data-edrv-diff-dock-shell] .edrv-composer-crash-fix {
249
+ flex: none;
250
+ height: 28px;
251
+ padding: 0 12px;
252
+ border: 1px solid var(--dsw-alias-border-l1, #e0e6e8);
253
+ border-radius: 8px;
254
+ background: transparent;
255
+ color: var(--dsw-alias-label-primary);
256
+ font-size: 12px;
257
+ font-weight: 600;
258
+ cursor: pointer;
259
+ white-space: nowrap;
260
+ }
261
+ [data-edrv-diff-dock-shell] .edrv-composer-crash-fix:hover {
262
+ background: var(--dsw-alias-interactive-bg-hover);
263
+ }
264
+
232
265
  [data-edrv-diff-dock-shell] .edrv-diffbar-dock {
233
266
  box-sizing: border-box;
234
267
  position: relative;
@@ -740,7 +773,7 @@
740
773
  [data-edrv-view] .edrv-update-close:disabled { opacity: .35; cursor: default; }
741
774
  [data-edrv-view] .edrv-update-close:not(:disabled):hover { background: var(--dsw-alias-interactive-bg-hover, #e7edf0); }
742
775
  [data-edrv-view] .edrv-update-table { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 12px 14px 0; border: 1px solid var(--dsw-alias-border-l1, #d9e0e4); border-radius: 5px; overflow: hidden; background: var(--dsw-alias-bg-layer-1, #fff); }
743
- [data-edrv-view] .edrv-update-cols, [data-edrv-view] .edrv-update-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 160px; align-items: center; }
776
+ [data-edrv-view] .edrv-update-cols, [data-edrv-view] .edrv-update-row { display: grid; grid-template-columns: 110px 22px minmax(0, 1fr) 160px; align-items: center; }
744
777
  [data-edrv-view] .edrv-update-sort { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
745
778
  [data-edrv-view] .edrv-update-sort:hover { color: var(--dsw-alias-brand-primary, #2869b4); }
746
779
  [data-edrv-view] .edrv-update-sort:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary, #2869b4); outline-offset: 2px; }
@@ -759,6 +792,9 @@
759
792
  [data-edrv-view] .edrv-update-action.tone-deleted, [data-edrv-view] .edrv-update-action.tone-conflict { color: var(--dsw-alias-state-error-primary, #b93b43); }
760
793
  [data-edrv-view] .edrv-update-action.tone-merged { color: var(--dsw-alias-state-warn-primary, #a05d22); }
761
794
  [data-edrv-view] .edrv-update-action.tone-updated { color: var(--dsw-alias-state-info-primary, #2869b4); }
795
+ /* 图标列:独立窄列,不带单元格内边距与分隔线 @author ddj 2026年11月23号 */
796
+ [data-edrv-view] .edrv-update-icon { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
797
+ [data-edrv-view] .edrv-update-cols > span + .edrv-update-icon, [data-edrv-view] .edrv-update-row > span + .edrv-update-icon { padding: 0; border-left: 0; }
762
798
  [data-edrv-view] .edrv-update-path { font-family: var(--ds-font-family-code, ui-monospace, monospace); }
763
799
  [data-edrv-view] .edrv-update-type { color: var(--dsw-alias-label-tertiary, #65737c); }
764
800
  [data-edrv-view] .edrv-update-empty { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; font-size: 12px; color: var(--dsw-alias-label-tertiary, #65737c); pointer-events: none; }
@@ -777,8 +813,8 @@
777
813
  @media (max-width: 620px) {
778
814
  [data-edrv-view] .edrv-update-head { gap: 6px; padding: 0 10px; }
779
815
  [data-edrv-view] .edrv-update-table { margin: 8px 8px 0; }
780
- [data-edrv-view] .edrv-update-cols, [data-edrv-view] .edrv-update-row { grid-template-columns: 76px minmax(0, 1fr); }
781
- [data-edrv-view] .edrv-update-cols > span:nth-child(3), [data-edrv-view] .edrv-update-row > span:nth-child(3) { display: none; }
816
+ [data-edrv-view] .edrv-update-cols, [data-edrv-view] .edrv-update-row { grid-template-columns: 76px 18px minmax(0, 1fr); }
817
+ [data-edrv-view] .edrv-update-cols > span:nth-child(4), [data-edrv-view] .edrv-update-row > span:nth-child(4) { display: none; }
782
818
  [data-edrv-view] .edrv-update-path { white-space: normal !important; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
783
819
  [data-edrv-view] .edrv-update-foot { flex-wrap: wrap; padding: 8px; }
784
820
  [data-edrv-view] .edrv-update-counts { flex-basis: 100%; }
@@ -795,7 +831,7 @@
795
831
  [data-edrv-view] .edrv-svncommit-bar .edrv-svn-check { flex: none; gap: 4px; font-size: 11px; color: var(--dsw-alias-label-secondary, #485762); }
796
832
  [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; }
797
833
  [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); }
798
- [data-edrv-view] .edrv-svncommit-cols, [data-edrv-view] .edrv-svncommit-row { display: grid; grid-template-columns: 34px 24px minmax(0, 1fr); align-items: center; }
834
+ [data-edrv-view] .edrv-svncommit-cols, [data-edrv-view] .edrv-svncommit-row { display: grid; grid-template-columns: 34px 24px 22px minmax(0, 1fr); align-items: center; }
799
835
  [data-edrv-view] .edrv-svncommit-cols { flex: none; height: 28px; padding: 0 10px; background: var(--dsw-alias-bg-layer-2, #f1f4f5); border-bottom: 1px solid var(--dsw-alias-border-l1, #d9e0e4); color: var(--dsw-alias-label-secondary, #485762); font-size: 11px; font-weight: 600; }
800
836
  [data-edrv-view] .edrv-svncommit-cols > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
801
837
  [data-edrv-view] .edrv-svncommit-list { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
@@ -810,6 +846,8 @@
810
846
  [data-edrv-view] .edrv-svncommit-emptyrow { padding: 3px 10px 5px 44px; font-size: 11px; color: var(--dsw-alias-label-tertiary, #8a949b); }
811
847
  [data-edrv-view] .edrv-svncommit-row:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary, #2869b4); outline-offset: -2px; }
812
848
  [data-edrv-view] .edrv-svncommit-pick { display: flex; align-items: center; }
849
+ /* 图标列:独立窄列,与文件树同款图标 @author ddj 2026年11月23号 */
850
+ [data-edrv-view] .edrv-svncommit-icon { display: inline-flex; align-items: center; justify-content: center; }
813
851
  [data-edrv-view] .edrv-svncommit-path { min-width: 0; padding-right: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--ds-font-family-code, ui-monospace, monospace); font-size: 11px; }
814
852
  [data-edrv-view] .edrv-svncommit-empty { display: grid; place-items: center; flex: 1; padding: 24px; color: var(--dsw-alias-label-tertiary, #65737c); font-size: 12px; }
815
853
  [data-edrv-view] .edrv-svncommit-cb { position: relative; flex: none; box-sizing: border-box; width: 13px; height: 13px; margin: 0; border: 1px solid var(--dsw-alias-border-l2, #cdd6da); border-radius: 3px; background: var(--dsw-alias-bg-layer-1, #fff); cursor: pointer; appearance: none; -webkit-appearance: none; }
@@ -843,7 +881,7 @@
843
881
  [data-edrv-view] .edrv-svncommit-bar { padding: 6px 8px; }
844
882
  [data-edrv-view] .edrv-svncommit-badge { margin-left: 0; }
845
883
  [data-edrv-view] .edrv-svncommit-table { margin: 8px 8px 0; }
846
- [data-edrv-view] .edrv-svncommit-cols, [data-edrv-view] .edrv-svncommit-row { grid-template-columns: 26px 24px minmax(0, 1fr); }
884
+ [data-edrv-view] .edrv-svncommit-cols, [data-edrv-view] .edrv-svncommit-row { grid-template-columns: 24px 20px 18px minmax(0, 1fr); }
847
885
  [data-edrv-view] .edrv-svncommit-row { height: auto; min-height: 34px; padding: 3px 8px; }
848
886
  [data-edrv-view] .edrv-svncommit-path { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
849
887
  [data-edrv-view] .edrv-svncommit-compose { padding: 8px 8px 0; }