dsh-vscode-mode 0.27.1 → 0.28.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 CHANGED
@@ -211,6 +211,12 @@ Host 优先采集官方 `workspaceChanges` 的轮次净差异;旧版逐工具
211
211
  `before:null` 不作为新建依据;部分成功只记录实际观测到的变化,unknown/畸形结果提供诊断。
212
212
  缺少 raw byte 能力、二进制、无可信基线或超限时不伪造可撤记录。UTF-8 BOM 和行尾按字节保留。
213
213
  可另外从版本库导入基线改动(git / svn / Perforce)。
214
+ dsh-ops 写工具同样环绕采集:`ops_edit_file` / `ops_write_file` / `ops_remove` 按 `arguments.path` 取证,
215
+ `ops_copy` / `ops_move` 追加 `arguments.to`(源删除 + 目标新增各一条);`ops_replace` 目标执行前未知,
216
+ 先按字面量 `pattern` 在替换作用域(`path`,glob 相对该作用域)内预读候选,最多 16 个文件,
217
+ 执行后用回执 `items` 对齐——回执完成却没预读到的路径只记采集诊断,绝不伪造基线;
218
+ `dryRun` 预览不预读也不出条目。`ops_bash` 等非声明式写盘不在实时采集范围(git 工作区仍由官方每轮
219
+ 快照展示;非 git 工作区可手动从版本库导入基线)。
214
220
  - **采集诊断**:进程内按工作区最多 50 条、全局最多 500 条;会话/插件释放后清理,Host 重启不保留。
215
221
  它不替代官方持久化采集完整性记录,也不绕过写回内容和 provider 原子版本守卫。
216
222
  - **采集作用域**:写前冻结当前 `workingDirectory`、provider 与目标;写后读回完成才释放
@@ -587,13 +593,13 @@ profile 请替换为实际目标,不要把示例目录当成当前运行 profi
587
593
 
588
594
  ```bash
589
595
  # ① Git 安装(clone + prepare 构建;推荐打固定 tag)
590
- dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.27.1
596
+ dsh plugin --profile web add github:Lenonss/DSH_VsCodeMode#v0.28.0
591
597
 
592
598
  # ② npm 注册表(发布到 npm 后)
593
- dsh plugin --profile web add dsh-vscode-mode@0.27.1
599
+ dsh plugin --profile web add dsh-vscode-mode@0.28.0
594
600
 
595
601
  # ③ GitHub Release tgz 直装(Release asset 可用后)
596
- dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.27.1/dsh-vscode-mode-0.27.1.tgz
602
+ dsh plugin --profile web add https://github.com/Lenonss/DSH_VsCodeMode/releases/download/v0.28.0/dsh-vscode-mode-0.28.0.tgz
597
603
  ```
598
604
 
599
605
  > **DSH 版本政策(0.17.0 起)**:六项 DSH peer 仍统一声明为 `*`,另以
@@ -973,6 +979,8 @@ Keep All / Undo All 却是亮的。修复:单文件 Keep / Undo 覆盖冲突
973
979
 
974
980
  | 版本 | 要点 |
975
981
  | --- | --- |
982
+ | v0.28.0 | dsh-ops 写工具纳入待审差异采集:ops_edit_file / ops_write_file / ops_remove / ops_copy / ops_move 可查看差异、Keep、Undo;ops_replace 按候选预读 + 回执对齐尽力采集 |
983
+ | v0.27.2 | 当前编辑文件 Tab 自动滚入可见区域;分组独立定位,适配宽度变化,不抢编辑焦点 |
976
984
  | v0.27.1 | 修复仅 LF/CRLF 或 BOM 差异造成的空待审与差异栏残留;统一累计待审路径路由并过滤已归档历史记录 |
977
985
  | v0.27.0 | DSH alpha.3 官方菜单/Forge 导航/设置图标与能力诊断;多目标 patch 字节采集;回滚版本与会话策略守卫;工作区共享差异基线;隐藏轮询门控与导航隔离 |
978
986
  | v0.26.0 | Keep All 改为单次批量(不再因单条过期/冷端条目整批中止,2N+1 次往返降到 2 次);差异审查旧通道遗留清理:待审接管的旧记录自动结案、守卫改会话作用域、失败原因不再被通用文案吞掉 |
@@ -987,7 +995,10 @@ Keep All / Undo All 却是亮的。修复:单文件 Keep / Undo 覆盖冲突
987
995
  | v0.23.0 | 快捷菜单:可拖动悬浮按钮 + 自定义菜单树 |
988
996
 
989
997
  <details>
990
- <summary>完整版本记录(v0.27.1 → v0.1.5x,点击展开)</summary>
998
+ <summary>完整版本记录(v0.28.0 → v0.1.5x,点击展开)</summary>
999
+
1000
+ - **v0.28.0**:把 dsh-ops 的写工具接进累计待审通道——`ops_edit_file` / `ops_write_file` / `ops_remove` / `ops_copy` / `ops_move` 执行前冻结写前基线、执行后读回真实内容,面板可查看差异、Keep 与 Undo;`ops_replace` 以替换作用域为搜索根按字面量预读候选(最多 16 个文件)、执行后用回执对齐,未预读到的文件只记缺口不伪造基线;`dryRun` 预览不采集。候选搜索直接走 `searchRipgrepContent`,不抢占用户的同根搜索。`ops_bash` 内的写盘、PTC 内联工具与非 git 工作区仍未覆盖:git 侧由官方快照列出但无字节证据,非 git 侧可走版本库导入 RPC 兜底。类型检查 0 error;全量 301 文件 3835 通过 / 22 跳过 + `node --test` 9/9;构建双面通过。Host 改动需重启 DSH 才生效,本次未安装、未重启,真实面板 Keep/Undo 冒烟缺口经维护者接受。参见 [0.28.0 发布说明](docs/release-0.28.0.md)。
1001
+ - **v0.27.2**:活动文件与计划预览 Tab 按编辑分组独立保持可见;打开、切换、关闭页签及编辑区尺寸变化后做最小横向定位,已可见时不滚动,不抢键盘焦点、不带动正文。保留手动横滚,超宽 Tab 显示名称起始部分。当前 GUI 未加载新 bundle,真实交互验收缺口已由用户接受;发布不自动安装或重启。参见 [0.27.2 发布说明](docs/release-0.27.2.md)。
991
1002
 
992
1003
  - **v0.27.1**:净零判定复用差异生成器的逻辑行口径,消除仅 LF/CRLF 或 BOM 不同造成的「无差异块但仍计入待审」;保留真实文本与末尾换行增删,不改原始快照和磁盘文件。累计待审详情与工具栏统一身份解析,避免误走历史改动栏;汇总与批量列表排除已归档记录。客户端空文本差异收敛保留现有能力、脏缓冲和忙状态守卫。Web Host 重启后实测三个空待审归零、差异栏消失,三个游戏文件 SHA256 不变。参见 [0.27.1 发布说明](docs/release-0.27.1.md)。
993
1004
 
package/lib/client.js CHANGED
@@ -380,11 +380,105 @@ window.__ModuleLoader__.load({
380
380
  };
381
381
  }
382
382
  //#endregion
383
+ //#region src/client/ui/tabReveal.ts
384
+ /** Group-local active tab visibility. @author ddj 2026年11月05号 */
385
+ /**
386
+ * Reveal the selected tab without moving the page or keyboard focus.
387
+ * @public @author ddj 2026年11月05号
388
+ * @param host Tab strip belonging to one editor group.
389
+ * @sideEffects Updates only the strip's horizontal scroll position.
390
+ */
391
+ function revealTab(host) {
392
+ const tab = host.querySelector(".edrv-tab-active");
393
+ if (!tab || host.clientWidth <= 0) return;
394
+ const stripRect = host.getBoundingClientRect();
395
+ const tabRect = tab.getBoundingClientRect();
396
+ const left = stripRect.left + host.clientLeft;
397
+ const right = left + host.clientWidth;
398
+ let delta = 0;
399
+ if (tabRect.width > host.clientWidth || tabRect.left < left) delta = tabRect.left - left;
400
+ else if (tabRect.right > right) delta = tabRect.right - right;
401
+ if (Math.abs(delta) < .5) return;
402
+ const maximum = Math.max(0, host.scrollWidth - host.clientWidth);
403
+ const next = Math.max(0, Math.min(maximum, host.scrollLeft + delta));
404
+ if (next !== host.scrollLeft) host.scrollLeft = next;
405
+ }
406
+ /**
407
+ * Observe geometry changes, not scrolling, so manual tab browsing remains possible.
408
+ * @public @author ddj 2026年11月05号
409
+ * @param host Group tab strip after its DOM commit.
410
+ * @returns Cleanup cancelling pending work and disconnecting geometry observation.
411
+ */
412
+ function watchTabReveal(host) {
413
+ const view = host.ownerDocument.defaultView;
414
+ let frame;
415
+ let disposed = false;
416
+ /** @private @author ddj 2026年11月05号 Reveal the latest selected tab after layout. */
417
+ function measure() {
418
+ frame = void 0;
419
+ if (!disposed) revealTab(host);
420
+ }
421
+ /** @private @author ddj 2026年11月05号 Coalesce resize notifications into one layout read. */
422
+ function schedule() {
423
+ if (disposed || frame !== void 0 || !view) return;
424
+ frame = view.requestAnimationFrame(measure);
425
+ }
426
+ revealTab(host);
427
+ schedule();
428
+ const observer = typeof ResizeObserver === "function" ? new ResizeObserver(schedule) : void 0;
429
+ observer?.observe(host);
430
+ const tab = host.querySelector(".edrv-tab-active");
431
+ if (tab) observer?.observe(tab);
432
+ /** @private @author ddj 2026年11月05号 Cancel work owned by the previous selection or pane. */
433
+ function dispose() {
434
+ disposed = true;
435
+ observer?.disconnect();
436
+ if (frame !== void 0) view?.cancelAnimationFrame(frame);
437
+ frame = void 0;
438
+ }
439
+ return dispose;
440
+ }
441
+ //#endregion
383
442
  //#region src/client/ui/EditorPane.ts
384
443
  /** Independent group views; workbench owns documents, saves and commands. @author ddj 2026年10月14号 */
444
+ /**
445
+ * Keep each group's selected tab visible while preserving the workbench wheel ref.
446
+ * @private @author ddj 2026年11月05号
447
+ * @param props Group selection and shared strip reference.
448
+ * @returns Stable callback ref for this pane's strip.
449
+ */
450
+ function useTabReveal(props) {
451
+ const hostRef = react$1.default.useRef(null);
452
+ /** @private @author ddj 2026年11月05号 @param node Committed strip, or null on detach. Synchronize both owners. */
453
+ function bindStrip(node) {
454
+ hostRef.current = node;
455
+ if (typeof props.tabsRef === "function") props.tabsRef(node);
456
+ else if (props.tabsRef) props.tabsRef.current = node;
457
+ }
458
+ const stripRef = react$1.default.useCallback(bindStrip, [props.tabsRef]);
459
+ const tabShape = JSON.stringify(props.group.tabs.map((tab) => [
460
+ tab.path,
461
+ tab.pinned,
462
+ props.dirty[tab.path]
463
+ ]));
464
+ /** @private @author ddj 2026年11月05号 @returns Geometry observer cleanup for this committed selection. */
465
+ function observeStrip() {
466
+ if (hostRef.current) return watchTabReveal(hostRef.current);
467
+ }
468
+ react$1.default.useLayoutEffect(observeStrip, [
469
+ props.group.active,
470
+ props.focused,
471
+ props.suppressActive,
472
+ props.previewActive,
473
+ tabShape,
474
+ props.tabsRef
475
+ ]);
476
+ return stripRef;
477
+ }
385
478
  /** @public @author ddj 2026年10月14号 @param props Group callbacks and file view. @returns Accessible tab strip and drop target. */
386
479
  function EditorPane(props) {
387
480
  const { group } = props;
481
+ const stripRef = useTabReveal(props);
388
482
  const suppressActive = props.suppressActive === true;
389
483
  /** @private @author ddj 2026年10月20号 @param tab File record. @returns Draggable tab with isolated close control. */
390
484
  function renderTab(tab) {
@@ -465,7 +559,7 @@ window.__ModuleLoader__.load({
465
559
  className: "edrv-tabs",
466
560
  role: "tablist",
467
561
  "data-edrv-group-tabs": group.id,
468
- ref: props.tabsRef
562
+ ref: stripRef
469
563
  }, group.tabs.map(renderTab), props.extras), props.tools), react$1.default.createElement("div", {
470
564
  className: "edrv-group-body",
471
565
  role: "tabpanel"
@@ -396586,22 +396680,6 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
396586
396680
  for (const [eventName] of handlers) window.removeEventListener(eventName, onCommand);
396587
396681
  };
396588
396682
  }, [sessionId]);
396589
- react$1.default.useEffect(() => {
396590
- const host = tabsHostRef.current;
396591
- if (!host) return;
396592
- const el = host.querySelector?.(".edrv-tab-active");
396593
- if (!el) return;
396594
- const left = el.offsetLeft;
396595
- const right = left + el.offsetWidth;
396596
- if (left < host.scrollLeft) host.scrollLeft = left;
396597
- else if (right > host.scrollLeft + host.clientWidth) host.scrollLeft = right - host.clientWidth;
396598
- }, [
396599
- active,
396600
- planActive,
396601
- planTabs.length,
396602
- tabs.length,
396603
- rowOwner
396604
- ]);
396605
396683
  react$1.default.useEffect(() => attachHorizontalWheel(tabsHostRef.current), [rowOwner]);
396606
396684
  react$1.default.useEffect(() => {
396607
396685
  const onPointer = (e) => {
@@ -399528,6 +399606,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
399528
399606
  focused,
399529
399607
  dirty: dirtyMap,
399530
399608
  suppressActive: hideDiskActive,
399609
+ previewActive: chrome ? planActive : void 0,
399531
399610
  tabsRef: chrome ? tabsHostRef : void 0,
399532
399611
  extras: chrome ? planTabExtras : void 0,
399533
399612
  tools: chrome ? rowTools : void 0,
package/lib/client.js.map CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/lib/client.js.map
3
- size: 35796301 bytes
4
- sha256: 2982d27d96e985ee9a5893d3b7ec831282dbff4552db9d6cafea17ad3186e806
3
+ size: 35801402 bytes
4
+ sha256: 91105e05ed90baaf23e1c0d55a8001446938926165eb9229feac384c3290c79b