@michengai/dsh-codex-ui 1.1.46 → 1.1.48

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.48 (2026-10-24)
4
+
5
+ - Support DeepSeek Harness `0.2.1-rc.3` while retaining all existing supported versions.
6
+
7
+ ## 1.1.47 (2026-10-22)
8
+
9
+ - Prevent interaction lockup during sidebar collapse by removing blocking `pointer-events: none` and settling state on `transitionend` with a timeout fallback (#57).
10
+ - Support async `startSession` return handling and add a pending state guard to prevent silent no-ops when host RPC is busy during streaming (#57).
11
+ - Optimize streaming performance: lazily mount and subscribe search store snapshots only when the search modal is open, wrap `SessionRow` and `GroupHead` in `React.memo` to isolate tree item re-renders, and throttle tool menu DOM geometry syncs into animation frames (#57).
12
+
3
13
  ## 1.1.46 (2026-10-21)
4
14
 
5
15
  - Restore window dragging on the Settings page in the Windows desktop app: the full-screen Settings overlay now reserves the native caption band and declares it as a drag region again (#56).
@@ -1,5 +1,15 @@
1
1
  # 更新日志
2
2
 
3
+ ## 1.1.48 (2026-10-24)
4
+
5
+ - 支持 DeepSeek Harness `0.2.1-rc.3`,继续兼容此前已支持的宿主版本。
6
+
7
+ ## 1.1.47 (2026-10-22)
8
+
9
+ - 修复侧栏折叠动画窗口期交互锁死:移除展开壳上的 `pointer-events: none` 阻断,改由 `transitionend` 驱动收敛并配合超时兜底,避免主线程流式长任务排队导致整栏无法点击(#57)。
10
+ - 增强「新建任务」健壮性:适配 `startSession` 异步返回值与异常捕获,增加 pending 状态守卫,避免宿主并发繁忙或挂起时静默失效(#57)。
11
+ - 优化流式输出期间渲染性能:搜索弹窗改为按需挂载,未打开时不订阅 store 快照,切断高频全量搜索索引重建;会话行与分组头使用 `React.memo` 隔离局部重绘;工具菜单 DOM 几何测量合并到 `requestAnimationFrame`(#57)。
12
+
3
13
  ## 1.1.46 (2026-10-21)
4
14
 
5
15
  - 修复 Windows 桌面端设置页无法拖动窗口:全屏设置浮层重新预留原生标题栏区域,并把该区域声明为窗口拖动区(#56)。
package/README.md CHANGED
@@ -24,7 +24,7 @@ Working across several projects and conversations in DSH Web? DSH Codex UI helps
24
24
 
25
25
  ## Host compatibility
26
26
 
27
- Version `1.1.42` explicitly declares support for DSH `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, and `0.2.1-rc.2` (dropping obsolete pre-0.2.0 hosts to align with in-house plugin standards). Development dependencies are pinned to `0.2.1-rc.2`. Compatibility declarations do not imply that every supported host received a fresh live test in this release.
27
+ Version `1.1.42` explicitly declares support for DSH `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, `0.2.1-rc.2`, and `0.2.1-rc.3` (dropping obsolete pre-0.2.0 hosts to align with in-house plugin standards). Development dependencies are pinned to `0.2.1-rc.2`. Compatibility declarations do not imply that every supported host received a fresh live test in this release.
28
28
 
29
29
  **Do not enable Codex UI and `ds-bot` together.** Both redesign the sidebar and conversation interface, so their slot ownership and layout styles overlap. Disable or uninstall one before using the other.
30
30
 
package/README.zh-CN.md CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  ## 宿主兼容性
26
26
 
27
- `1.1.42` 已对齐自研插件规范,彻底移除 `0.2.0` 以前的历史宿主支持,显式声明支持 DSH `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1` 和 `0.2.1-rc.2`。开发依赖钉在 `0.2.1-rc.2`。兼容范围声明不代表本次发布重新完成了所有宿主版本的实机测试。
27
+ `1.1.42` 已对齐自研插件规范,彻底移除 `0.2.0` 以前的历史宿主支持,显式声明支持 DSH `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`、`0.2.1-rc.2` 和 `0.2.1-rc.3`。开发依赖钉在 `0.2.1-rc.2`。兼容范围声明不代表本次发布重新完成了所有宿主版本的实机测试。
28
28
 
29
29
  **不要同时启用 Codex UI 与 `ds-bot`。** 两者都重绘侧栏与会话界面,插槽归属和布局样式高度重叠。使用其中一个前,请先停用或卸载另一个。
30
30
 
package/lib/client.js CHANGED
@@ -1949,7 +1949,7 @@ window.__ModuleLoader__.load({
1949
1949
  })
1950
1950
  });
1951
1951
  }
1952
- function SessionRow({ id, title, selected, menuOpen, unread, running, pendingInteraction, t, menuItems, onOpen, onMenuChange, onSelectAction, onArchive, onHover, onLeave, onContextMenu, menuPoint, subtitle, flat, draggable, dropActive, onDragStart, onDragEnd, onDragOver, onDrop, time }) {
1952
+ const SessionRow = (0, react.memo)(function SessionRow({ id, title, selected, menuOpen, unread, running, pendingInteraction, t, menuItems, onOpen, onMenuChange, onSelectAction, onArchive, onHover, onLeave, onContextMenu, menuPoint, subtitle, flat, draggable, dropActive, onDragStart, onDragEnd, onDragOver, onDrop, time }) {
1953
1953
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1954
1954
  "data-dcu-session": id,
1955
1955
  className: `dcu-wb-session${selected ? " dcu-wb-selected" : ""}${menuOpen ? " dcu-wb-menu-open" : ""}${dropActive === true ? " dcu-wb-drop" : ""}${flat === true ? " dcu-wb-session-flat" : ""}`,
@@ -2018,8 +2018,8 @@ window.__ModuleLoader__.load({
2018
2018
  })
2019
2019
  ]
2020
2020
  });
2021
- }
2022
- function GroupHead({ expanded, title, icon, onToggle, actions, menuOpen }) {
2021
+ });
2022
+ const GroupHead = (0, react.memo)(function GroupHead({ expanded, title, icon, onToggle, actions, menuOpen }) {
2023
2023
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2024
2024
  className: `dcu-wb-project-head${menuOpen === true ? " dcu-wb-menu-open" : ""}`,
2025
2025
  role: "treeitem",
@@ -2047,7 +2047,7 @@ window.__ModuleLoader__.load({
2047
2047
  })
2048
2048
  ]
2049
2049
  });
2050
- }
2050
+ });
2051
2051
  //#endregion
2052
2052
  //#region src/client/session-pending.ts
2053
2053
  const EMPTY_PENDING_INTERACTIONS = /* @__PURE__ */ new Map();
@@ -7167,7 +7167,9 @@ body[data-ds-dark-theme] [data-conversation-scroll] [data-trigger-menu]{backgrou
7167
7167
  ]) menu.style.removeProperty(property);
7168
7168
  });
7169
7169
  }
7170
- function sync() {
7170
+ let syncFrame;
7171
+ function syncNow() {
7172
+ syncFrame = void 0;
7171
7173
  for (const [menu, dispose] of mounted) if (!menu.isConnected) {
7172
7174
  dispose();
7173
7175
  mounted.delete(menu);
@@ -7182,7 +7184,18 @@ body[data-ds-dark-theme] [data-conversation-scroll] [data-trigger-menu]{backgrou
7182
7184
  break;
7183
7185
  }
7184
7186
  }
7185
- const observer = new MutationObserver(sync);
7187
+ function scheduleSync() {
7188
+ if (anchor === void 0 || now() > pendingUntil) {
7189
+ for (const [menu, dispose] of mounted) if (!menu.isConnected) {
7190
+ dispose();
7191
+ mounted.delete(menu);
7192
+ }
7193
+ return;
7194
+ }
7195
+ if (syncFrame !== void 0) return;
7196
+ syncFrame = window.requestAnimationFrame(syncNow);
7197
+ }
7198
+ const observer = new MutationObserver(scheduleSync);
7186
7199
  observer.observe(document.body, {
7187
7200
  childList: true,
7188
7201
  subtree: true
@@ -7197,6 +7210,7 @@ body[data-ds-dark-theme] [data-conversation-scroll] [data-trigger-menu]{backgrou
7197
7210
  ].includes(event.key)) capture(event);
7198
7211
  }
7199
7212
  return () => {
7213
+ if (syncFrame !== void 0) window.cancelAnimationFrame(syncFrame);
7200
7214
  observer.disconnect();
7201
7215
  document.removeEventListener("pointerdown", capture, true);
7202
7216
  document.removeEventListener("keydown", captureKey, true);
@@ -7245,11 +7259,10 @@ html[data-windows-titlebar][data-fullscreen] .dcu-desktop-navigation{display:non
7245
7259
  }
7246
7260
  //#endregion
7247
7261
  //#region src/client/sidebar-session.ts
7248
- /** 先切回任务页签再创建,避免新建后仍停在频道或日程。 */
7262
+ /** 先切回任务页签再创建,避免新建后仍停在频道或日程。支持同步与异步返回值。 */
7249
7263
  function beginSidebarSession(setTab, startSession, workspaceId) {
7250
7264
  setTab("tasks");
7251
- if (workspaceId === void 0) startSession();
7252
- else startSession(workspaceId);
7265
+ return workspaceId === void 0 ? startSession() : startSession(workspaceId);
7253
7266
  }
7254
7267
  //#endregion
7255
7268
  //#region src/client/WorkspaceShortcutBridge.tsx
@@ -7542,7 +7555,7 @@ html[data-windows-titlebar][data-fullscreen] .dcu-desktop-navigation{display:non
7542
7555
  /* 滤镜只作用于背景,避免为设置和搜索等 fixed 后代创建侧栏包含块。 */
7543
7556
  body[data-we-sidebar-glass] .dcu-root{position:relative;background:transparent}body[data-we-sidebar-glass] .dcu-root::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;background-color:color-mix(in srgb,var(--we-sidebar-color,#fff) calc(var(--we-sidebar-alpha,.15)*.66*100%),transparent);background-image:linear-gradient(180deg,rgba(255,255,255,calc(var(--we-sidebar-sheen,1)*.14)),rgba(255,255,255,calc(var(--we-sidebar-sheen,1)*.04)) 38%,rgba(255,255,255,calc(var(--we-sidebar-sheen,1)*.01)));-webkit-backdrop-filter:blur(var(--we-sidebar-blur,16px)) saturate(var(--we-sidebar-saturate,1.8)) brightness(var(--we-glass-brightness,1.04)) contrast(1.01);backdrop-filter:blur(var(--we-sidebar-blur,16px)) saturate(var(--we-sidebar-saturate,1.8)) brightness(var(--we-glass-brightness,1.04)) contrast(1.01);box-shadow:inset 0 1px 0 rgba(255,255,255,calc(var(--we-sidebar-sheen,1)*.32)),inset 0 -1px 0 rgba(255,255,255,calc(var(--we-sidebar-sheen,1)*.08)),inset 0 0 0 .5px rgba(255,255,255,calc(var(--we-sidebar-sheen,1)*.06))}body[data-ds-dark-theme][data-we-sidebar-glass] .dcu-root::before{background-color:color-mix(in srgb,var(--we-sidebar-color,#fff) calc(var(--we-sidebar-alpha,.15)*.33*100%),transparent)}body[data-we-appwindow][data-we-sidebar-glass] .dcu-root::before{-webkit-backdrop-filter:none;backdrop-filter:none}@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){body[data-we-sidebar-glass] .dcu-root{background:#eef7f5}body[data-ds-dark-theme][data-we-sidebar-glass] .dcu-root{background:#1d2120}body[data-we-sidebar-glass] .dcu-root::before{display:none}}
7544
7557
  body[data-we-sidebar-glass] .dcu-expanded-shell,body[data-we-sidebar-glass] .dcu-compact-shell,body[data-we-sidebar-glass] .dcu-foot{position:relative}
7545
- .dcu-expanded-shell{display:flex;width:100%;min-height:0;flex:1 1 0;overflow:hidden;flex-direction:column;transform-origin:left center;transition:opacity 500ms cubic-bezier(.16,1,.3,1),transform 500ms cubic-bezier(.16,1,.3,1);animation:dcu-sidebar-expanded-in 500ms cubic-bezier(.16,1,.3,1)}.dcu-compact-shell{display:none;width:56px}.dcu-root.dcu-collapsing .dcu-expanded-shell{opacity:0;transform:translateX(-6px);pointer-events:none}.dcu-root.dcu-compact .dcu-expanded-shell{display:none}.dcu-root.dcu-compact .dcu-compact-shell{display:flex;min-height:0;flex:1;flex-direction:column;align-items:center;animation:dcu-sidebar-compact-in 140ms ease-out}@keyframes dcu-sidebar-expanded-in{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:none}}@keyframes dcu-sidebar-compact-in{from{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:none}}
7558
+ .dcu-expanded-shell{display:flex;width:100%;min-height:0;flex:1 1 0;overflow:hidden;flex-direction:column;transform-origin:left center;transition:opacity 500ms cubic-bezier(.16,1,.3,1),transform 500ms cubic-bezier(.16,1,.3,1);animation:dcu-sidebar-expanded-in 500ms cubic-bezier(.16,1,.3,1)}.dcu-compact-shell{display:none;width:56px}.dcu-root.dcu-collapsing .dcu-expanded-shell{opacity:0;transform:translateX(-6px)}.dcu-root.dcu-compact .dcu-expanded-shell{display:none}.dcu-root.dcu-compact .dcu-compact-shell{display:flex;min-height:0;flex:1;flex-direction:column;align-items:center;animation:dcu-sidebar-compact-in 140ms ease-out}@keyframes dcu-sidebar-expanded-in{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:none}}@keyframes dcu-sidebar-compact-in{from{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:none}}
7546
7559
  .dcu-root *{box-sizing:border-box}.dcu-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;flex:none;height:var(--dcu-header-height,34px);padding:calc((var(--dcu-header-height,34px) - 28px)/2) 8px calc((var(--dcu-header-height,34px) - 28px)/2) 12px}.dcu-brand{border:0;background:transparent;color:inherit;padding:0;display:flex;align-items:center;min-width:0;overflow:hidden}.dcu-brand svg{display:block;width:auto;max-width:100%;height:24px;min-width:0}.dcu-head-actions{display:grid;grid-auto-flow:column;grid-auto-columns:28px;align-items:center;column-gap:8px;height:28px}
7547
7560
  .dcu-icon,.dcu-menu button,.dcu-footer-link{appearance:none;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}.dcu-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:8px;color:var(--dcu-sidebar-icon)}.dcu-head .dcu-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:0;padding:0;border-radius:50%;line-height:0}.dcu-head .dcu-icon svg{display:block;width:16px;height:16px}
7548
7561
  .dcu-icon:hover,.dcu-menu button:hover:not(:disabled),.dcu-footer-link:hover{background:var(--dcu-sidebar-hover);color:var(--dcu-sidebar-primary)}
@@ -7639,22 +7652,12 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7639
7652
  })
7640
7653
  });
7641
7654
  }
7642
- /** 搜索状态与大侧栏隔离:输入、悬停和开关弹窗都不能让工作区树跟着重渲染。 */
7643
- const SidebarSearch = (0, react.forwardRef)(function SidebarSearch({ imSettingsAvailable, openPlugins, openSession, startSession, t, useSessions, useWorkspaces, settingsSeat }, ref) {
7644
- const [open, setOpen] = (0, react.useState)(false);
7655
+ function SidebarSearchModal({ imSettingsAvailable, openPlugins, openSession, startSession, t, useSessions, useWorkspaces, settingsSeat, onClose }) {
7645
7656
  const [query, setQuery] = (0, react.useState)("");
7646
7657
  const [activeIndex, setActiveIndex] = (0, react.useState)(0);
7647
7658
  const deferredQuery = (0, react.useDeferredValue)(query);
7648
7659
  const sessions = useSessions((state) => state);
7649
7660
  const workspaces = useWorkspaces((state) => state);
7650
- const close = (0, react.useCallback)(() => {
7651
- setOpen(false);
7652
- setQuery("");
7653
- setActiveIndex(0);
7654
- }, []);
7655
- (0, react.useImperativeHandle)(ref, () => ({ open: () => {
7656
- setOpen(true);
7657
- } }), []);
7658
7661
  const selectSection = (0, react.useCallback)((label) => {
7659
7662
  openSettingsSection(settingsSeat.current, label);
7660
7663
  }, [settingsSeat]);
@@ -7692,7 +7695,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7692
7695
  keywords: `${session.cwd ?? ""} ${session.id}`,
7693
7696
  detail: workspaceTitles.get(String(session.id)) ?? session.cwd,
7694
7697
  run: () => {
7695
- close();
7698
+ onClose();
7696
7699
  openSession(session.id);
7697
7700
  }
7698
7701
  }));
@@ -7703,7 +7706,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7703
7706
  label: t("search.settings"),
7704
7707
  keywords: t("search.settings"),
7705
7708
  run: () => {
7706
- close();
7709
+ onClose();
7707
7710
  openSettings();
7708
7711
  }
7709
7712
  },
@@ -7713,7 +7716,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7713
7716
  label: t("sidebar.experts"),
7714
7717
  keywords: t("search.settings"),
7715
7718
  run: () => {
7716
- close();
7719
+ onClose();
7717
7720
  selectExternalSection(t("sidebar.experts"));
7718
7721
  }
7719
7722
  },
@@ -7723,7 +7726,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7723
7726
  label: t("sidebar.skills"),
7724
7727
  keywords: t("search.settings"),
7725
7728
  run: () => {
7726
- close();
7729
+ onClose();
7727
7730
  selectExternalSection(t("sidebar.skills"));
7728
7731
  }
7729
7732
  },
@@ -7733,7 +7736,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7733
7736
  label: t("sidebar.plugins"),
7734
7737
  keywords: t("search.settings"),
7735
7738
  run: () => {
7736
- close();
7739
+ onClose();
7737
7740
  openPlugins();
7738
7741
  }
7739
7742
  },
@@ -7743,7 +7746,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7743
7746
  label: t("settings.pluginConfig"),
7744
7747
  keywords: t("search.settings"),
7745
7748
  run: () => {
7746
- close();
7749
+ onClose();
7747
7750
  openSettingsSection(settingsSeat.current, t("settings.pluginConfig"));
7748
7751
  }
7749
7752
  },
@@ -7753,7 +7756,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7753
7756
  label: t("sidebar.connectors"),
7754
7757
  keywords: t("search.settings"),
7755
7758
  run: () => {
7756
- close();
7759
+ onClose();
7757
7760
  selectSection(t("sidebar.connectors"));
7758
7761
  }
7759
7762
  },
@@ -7763,7 +7766,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7763
7766
  label: t("sidebar.schedule"),
7764
7767
  keywords: t("search.settings"),
7765
7768
  run: () => {
7766
- close();
7769
+ onClose();
7767
7770
  selectExternalSection(t("sidebar.schedule"));
7768
7771
  }
7769
7772
  },
@@ -7773,7 +7776,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7773
7776
  label: t("sidebar.assistant"),
7774
7777
  keywords: t("search.settings"),
7775
7778
  run: () => {
7776
- close();
7779
+ onClose();
7777
7780
  openImSettings();
7778
7781
  }
7779
7782
  },
@@ -7783,7 +7786,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7783
7786
  label: t("about.nav"),
7784
7787
  keywords: t("search.settings"),
7785
7788
  run: () => {
7786
- close();
7789
+ onClose();
7787
7790
  selectSection(t("about.nav"));
7788
7791
  }
7789
7792
  }
@@ -7797,13 +7800,14 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7797
7800
  label: t("sidebar.newTask"),
7798
7801
  keywords: t("search.actions"),
7799
7802
  run: () => {
7800
- close();
7803
+ onClose();
7801
7804
  startSession();
7802
7805
  }
7803
7806
  }
7804
7807
  ];
7805
7808
  }, [
7806
- close,
7809
+ imSettingsAvailable,
7810
+ onClose,
7807
7811
  openImSettings,
7808
7812
  openPlugins,
7809
7813
  openSession,
@@ -7820,13 +7824,12 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7820
7824
  const results = (0, react.useMemo)(() => filterSidebarSearchItems(entries, deferredQuery).slice(0, 12), [deferredQuery, entries]);
7821
7825
  (0, react.useEffect)(() => {
7822
7826
  setActiveIndex(0);
7823
- }, [query, open]);
7827
+ }, [query]);
7824
7828
  (0, react.useEffect)(() => {
7825
- if (!open) return;
7826
7829
  const onKeyDown = (event) => {
7827
7830
  if (event.key === "Escape") {
7828
7831
  event.preventDefault();
7829
- close();
7832
+ onClose();
7830
7833
  return;
7831
7834
  }
7832
7835
  if (event.key === "ArrowDown") {
@@ -7853,15 +7856,13 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7853
7856
  };
7854
7857
  }, [
7855
7858
  activeIndex,
7856
- close,
7857
- open,
7859
+ onClose,
7858
7860
  results
7859
7861
  ]);
7860
- if (!open) return null;
7861
7862
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7862
7863
  className: "dcu-search-scrim",
7863
7864
  onMouseDown: (event) => {
7864
- if (event.target === event.currentTarget) close();
7865
+ if (event.target === event.currentTarget) onClose();
7865
7866
  },
7866
7867
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
7867
7868
  className: "dcu-search-dialog",
@@ -7917,6 +7918,21 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7917
7918
  })]
7918
7919
  })
7919
7920
  });
7921
+ }
7922
+ /** 搜索状态与大侧栏隔离:未打开时不订阅 store 快照,避免后台流式高频引发无谓的搜索索引重构。 */
7923
+ const SidebarSearch = (0, react.forwardRef)(function SidebarSearch(props, ref) {
7924
+ const [open, setOpen] = (0, react.useState)(false);
7925
+ const close = (0, react.useCallback)(() => {
7926
+ setOpen(false);
7927
+ }, []);
7928
+ (0, react.useImperativeHandle)(ref, () => ({ open: () => {
7929
+ setOpen(true);
7930
+ } }), []);
7931
+ if (!open) return null;
7932
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarSearchModal, {
7933
+ ...props,
7934
+ onClose: close
7935
+ });
7920
7936
  });
7921
7937
  /** Codex 风格的 DSH 侧栏,只替换导航外观,项目浏览和设置仍由 DSH 官方组件提供。 */
7922
7938
  function CodexSidebar({ workspaceShortcuts, navigationHistory, globalPanels, footerActions, selectPanel, usePanelInfo = useLegacyPanelInfo, collapsed, width, openSession, startSession, toggleSidebar, archiveSession, canDeleteSession, deleteSession, forkSession, moveSession, renameSession, openPath, companionSlots, renderSlot, t, useSessions, useSessionPendingInteraction, useSessionStatus, useWorkspaces, prefillNewConversation, newConversationDraft }) {
@@ -7940,9 +7956,18 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
7940
7956
  }, []);
7941
7957
  const [extensionsOpen, setExtensionsOpen] = (0, react.useState)(readExtensionsOpen);
7942
7958
  const [imTab, setImTab] = (0, react.useState)("tasks");
7943
- const beginSession = (0, react.useCallback)((workspaceId) => {
7944
- beginSidebarSession(setImTab, startSession, workspaceId);
7945
- }, [startSession]);
7959
+ const [startingSession, setStartingSession] = (0, react.useState)(false);
7960
+ const beginSession = (0, react.useCallback)(async (workspaceId) => {
7961
+ if (startingSession) return;
7962
+ setStartingSession(true);
7963
+ try {
7964
+ await Promise.resolve(beginSidebarSession(setImTab, startSession, workspaceId));
7965
+ } catch (error) {
7966
+ console.warn("新建任务失败:", error);
7967
+ } finally {
7968
+ setStartingSession(false);
7969
+ }
7970
+ }, [startSession, startingSession]);
7946
7971
  const companionTabs = (0, react.useSyncExternalStore)(companionSlots?.subscribe ?? subscribeEmptyCompanionTabs, companionSlots?.getSnapshot ?? getEmptyCompanionTabs, companionSlots?.getSnapshot ?? getEmptyCompanionTabs);
7947
7972
  const showChannels = companionTabs.channels;
7948
7973
  const showSchedule = companionTabs.schedule;
@@ -8128,11 +8153,16 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
8128
8153
  return;
8129
8154
  }
8130
8155
  setCollapsing(true);
8131
- const timer = window.setTimeout(() => {
8156
+ let done = false;
8157
+ const finish = () => {
8158
+ if (done) return;
8159
+ done = true;
8132
8160
  setVisualCompact(true);
8133
8161
  setCollapsing(false);
8134
- }, SIDEBAR_COLLAPSE_SETTLE_MS);
8162
+ };
8163
+ const timer = window.setTimeout(finish, SIDEBAR_COLLAPSE_SETTLE_MS);
8135
8164
  return () => {
8165
+ done = true;
8136
8166
  window.clearTimeout(timer);
8137
8167
  };
8138
8168
  }, [compact, visualCompact]);
@@ -8193,6 +8223,12 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
8193
8223
  }),
8194
8224
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8195
8225
  className: "dcu-expanded-shell",
8226
+ onTransitionEnd: (event) => {
8227
+ if (event.target === event.currentTarget && (event.propertyName === "opacity" || event.propertyName === "transform")) {
8228
+ setVisualCompact(true);
8229
+ setCollapsing(false);
8230
+ }
8231
+ },
8196
8232
  children: [
8197
8233
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
8198
8234
  className: "dcu-head",
@@ -9990,9 +10026,25 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
9990
10026
  archive: "<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" fill=\"currentColor\" d=\"M15.8659 2.05975C17.2603 2.05995 18.3913 3.19096 18.3914 4.58527V5.4874C18.3914 6.02747 18.2192 6.52672 17.9303 6.93735C17.9336 6.96524 17.9388 6.99318 17.9388 7.02195V12.8884C17.9388 13.6345 17.9395 14.2379 17.8996 14.7254C17.8642 15.1593 17.7936 15.5499 17.6373 15.9141L17.5654 16.0685C17.278 16.6328 16.8405 17.1046 16.3038 17.434L16.0679 17.5661C15.66 17.7739 15.2196 17.8598 14.7237 17.9003C14.2362 17.9401 13.6327 17.9405 12.8867 17.9405H7.11122C6.36511 17.9405 5.76171 17.9401 5.27418 17.9003C4.84051 17.8649 4.44949 17.7952 4.08545 17.6391L3.93104 17.5661C3.36673 17.2785 2.89392 16.8414 2.56465 16.3044L2.43245 16.0685C2.22473 15.6608 2.13878 15.2211 2.09825 14.7254C2.05841 14.2379 2.05912 13.6345 2.05912 12.8884V7.02195C2.05912 6.99284 2.06422 6.96449 2.06758 6.93629C1.77931 6.52592 1.60858 6.02687 1.60858 5.4874V4.58527C1.60876 3.19084 2.73962 2.05975 4.1341 2.05975H15.8659ZM16.4984 7.92936C16.296 7.98169 16.0847 8.01288 15.8659 8.01291H4.1341C3.91478 8.01291 3.70246 7.98194 3.49955 7.92936V12.8884C3.49955 13.6582 3.50053 14.1927 3.53445 14.608C3.56769 15.0146 3.62923 15.244 3.71635 15.415L3.7925 15.5514C3.98339 15.8627 4.25749 16.1165 4.58464 16.2833L4.72529 16.3435C4.88095 16.3993 5.08638 16.4402 5.39158 16.4651C5.80685 16.4991 6.34138 16.5001 7.11122 16.5001H12.8867C13.6564 16.5001 14.1911 16.499 14.6063 16.4651C15.0128 16.432 15.2423 16.3703 15.4133 16.2833L15.5508 16.2061C15.8618 16.0152 16.116 15.7419 16.2827 15.415L16.3429 15.2732C16.3985 15.1177 16.4396 14.9128 16.4645 14.608C16.4985 14.1927 16.4984 13.6583 16.4984 12.8884V7.92936ZM4.1341 3.50019C3.53511 3.50019 3.0492 3.98631 3.04902 4.58527V5.4874C3.04902 6.08649 3.535 6.57248 4.1341 6.57248H15.8659C16.4648 6.57228 16.951 6.08638 16.951 5.4874V4.58527C16.9509 3.98644 16.4647 3.50038 15.8659 3.50019H4.1341Z\"/><path fill=\"currentColor\" d=\"M12.7962 12.5661V11.0832H7.20548V12.5661L12.7962 12.5661Z\"/>",
9991
10027
  about: "<path fill=\"currentColor\" d=\"M12.5757 7.00012C12.5757 3.92085 10.0794 1.42463 7.00012 1.42456C3.9208 1.42456 1.42456 3.9208 1.42456 7.00012C1.42463 10.0794 3.92085 12.5757 7.00012 12.5757C10.0793 12.5756 12.5756 10.0793 12.5757 7.00012ZM13.8002 7.00012C13.8001 10.7559 10.7559 13.8001 7.00012 13.8002C3.2443 13.8002 0.199291 10.7559 0.199219 7.00012C0.199219 3.24426 3.24426 0.199219 7.00012 0.199219C10.7559 0.199291 13.8002 3.2443 13.8002 7.00012Z\"/><path fill=\"currentColor\" d=\"M6.18042 8.68184C6.18043 8.09153 6.32893 7.34655 6.92127 6.8481C7.28566 6.54148 7.76104 6.27318 8.0022 6.10811C8.28964 5.91137 8.42234 5.76562 8.48328 5.58944C8.57774 5.31609 8.53121 5.00904 8.34912 4.76741C8.17409 4.53522 7.83879 4.32222 7.28186 4.32222C5.99668 4.32225 5.46969 5.11832 5.46949 5.78939H4.24414C4.24436 4.39942 5.36327 3.09691 7.28186 3.09688C8.17773 3.09688 8.89489 3.45606 9.32752 4.02999C9.75287 4.59438 9.86938 5.32775 9.64026 5.99019C9.44847 6.5444 9.04722 6.87743 8.69434 7.11898C8.29506 7.39226 8.02318 7.52192 7.70996 7.78548C7.51943 7.94582 7.40577 8.24899 7.40577 8.68184V8.75533H6.18042V8.68184Z\"/><path fill=\"currentColor\" d=\"M7.39455 9.44026V10.8109H6.16921V9.44026H7.39455Z\"/>"
9992
10028
  };
9993
- const NAV_ICON_CLASS = "dcu-settings-nav-icon";
9994
10029
  const NAV_ICON_STYLE_ID = "dcu-settings-nav-icon-style";
9995
- const NAV_ICON_CSS = `[data-dcu-nav-icon]>svg{display:none!important}.${NAV_ICON_CLASS}{display:inline-block;flex:none;width:16px;height:16px;background:currentColor;-webkit-mask:var(--dcu-settings-nav-icon-mask) center/contain no-repeat;mask:var(--dcu-settings-nav-icon-mask) center/contain no-repeat}`;
10030
+ const NAV_ICON_CSS = [
10031
+ "[data-dcu-nav-icon] > svg { display: none !important; }",
10032
+ "[data-dcu-nav-icon]::before {",
10033
+ " content: '';",
10034
+ " flex: none;",
10035
+ " width: 16px;",
10036
+ " height: 16px;",
10037
+ " background-color: currentColor;",
10038
+ " -webkit-mask: var(--dcu-settings-nav-icon-mask) center / contain no-repeat;",
10039
+ " mask: var(--dcu-settings-nav-icon-mask) center / contain no-repeat;",
10040
+ " -webkit-mask-repeat: no-repeat;",
10041
+ " mask-repeat: no-repeat;",
10042
+ " -webkit-mask-position: center;",
10043
+ " mask-position: center;",
10044
+ " -webkit-mask-size: 16px 16px;",
10045
+ " mask-size: 16px 16px;",
10046
+ "}"
10047
+ ].join("\n");
9996
10048
  /** mask 只取 alpha 通道,因此把 currentColor 固定为黑色即可 */
9997
10049
  function iconMask(id) {
9998
10050
  const viewBox = id === "archive" ? "0 0 20 20" : id === "about" ? "0 0 14 14" : "0 0 16 16";
@@ -10032,7 +10084,14 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
10032
10084
  }
10033
10085
  function applySettingsNavIcon(button) {
10034
10086
  const id = settingsNavIconId(button.textContent ?? "");
10035
- if (id === void 0) return false;
10087
+ if (id === void 0) {
10088
+ if (button.hasAttribute("data-dcu-nav-icon")) {
10089
+ button.removeAttribute("data-dcu-nav-icon");
10090
+ button.style.removeProperty("--dcu-settings-nav-icon-mask");
10091
+ return true;
10092
+ }
10093
+ return false;
10094
+ }
10036
10095
  let changed = false;
10037
10096
  if (id === "about") {
10038
10097
  if (!button.hasAttribute("data-dcu-settings-about-last")) {
@@ -10045,19 +10104,12 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
10045
10104
  }
10046
10105
  }
10047
10106
  if (button.querySelector(":scope > svg") === null) return changed;
10048
- if (button.getAttribute("data-dcu-nav-icon") === id && button.querySelector(`.${NAV_ICON_CLASS}`) !== null) return changed;
10107
+ if (button.getAttribute("data-dcu-nav-icon") === id) return changed;
10049
10108
  const doc = button.ownerDocument;
10050
10109
  if (doc === null) return changed;
10051
10110
  ensureNavIconStyle(doc);
10052
10111
  button.setAttribute("data-dcu-nav-icon", id);
10053
- let icon = button.querySelector(`.${NAV_ICON_CLASS}`);
10054
- if (icon === null) {
10055
- icon = doc.createElement("span");
10056
- icon.className = NAV_ICON_CLASS;
10057
- icon.setAttribute("aria-hidden", "true");
10058
- button.prepend(icon);
10059
- }
10060
- icon.style.setProperty("--dcu-settings-nav-icon-mask", iconMask(id));
10112
+ button.style.setProperty("--dcu-settings-nav-icon-mask", iconMask(id));
10061
10113
  return true;
10062
10114
  }
10063
10115
  function applySettingsNavIcons(root) {
@@ -10111,7 +10163,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
10111
10163
  if (frame !== void 0) window.cancelAnimationFrame(frame);
10112
10164
  for (const button of document.querySelectorAll("[data-dcu-nav-icon]")) {
10113
10165
  button.removeAttribute("data-dcu-nav-icon");
10114
- button.querySelector(`.${NAV_ICON_CLASS}`)?.remove();
10166
+ button.style.removeProperty("--dcu-settings-nav-icon-mask");
10115
10167
  }
10116
10168
  if (document.querySelector("[data-dcu-nav-icon]") === null) document.getElementById(NAV_ICON_STYLE_ID)?.remove();
10117
10169
  };
@@ -11918,17 +11970,23 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
11918
11970
  }
11919
11971
  }
11920
11972
  /** Archive Manager replaces the official ui-workspace row with this optional service. */
11921
- function startWorkspaceSession(ctx, workspaceId) {
11973
+ async function startWorkspaceSession(ctx, workspaceId) {
11922
11974
  const uiWorkspace = probeService(ctx, "uiWorkspace");
11923
- if (hasStartSession(uiWorkspace)) {
11924
- uiWorkspace.startSession(workspaceId);
11925
- return;
11926
- }
11927
- if (hasStartSession(ctx.workspaces)) {
11928
- ctx.workspaces.startSession(workspaceId);
11929
- return;
11975
+ try {
11976
+ if (hasStartSession(uiWorkspace)) {
11977
+ await Promise.resolve(uiWorkspace.startSession(workspaceId));
11978
+ return true;
11979
+ }
11980
+ if (hasStartSession(ctx.workspaces)) {
11981
+ await Promise.resolve(ctx.workspaces.startSession(workspaceId));
11982
+ return true;
11983
+ }
11984
+ console.warn("DSH 工作空间服务尚未就绪,无法新建会话。");
11985
+ return false;
11986
+ } catch (error) {
11987
+ console.warn("新建会话失败:", error);
11988
+ return false;
11930
11989
  }
11931
- console.warn("DSH 工作空间服务尚未就绪,无法新建会话。");
11932
11990
  }
11933
11991
  /** 替换 DSH 的官方 sidebar 插槽,不修改 DSH 源码或会话数据。 */
11934
11992
  function apply(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-codex-ui",
3
- "version": "1.1.46",
3
+ "version": "1.1.48",
4
4
  "description": "DSH Codex UI — 为 DeepSeek Harness Web 提供 Codex 风格侧栏、工作区会话树、全局搜索和轮次导航 · A Codex-style sidebar, workspace session tree, global search, and turn navigation for DSH Web",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -78,17 +78,17 @@
78
78
  },
79
79
  "peerDependencies": {
80
80
  "@deepseek-ai/cordis": ">=4.0.2 <5.0.0",
81
- "@deepseek-ai/dsh-client-connection": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
82
- "@deepseek-ai/dsh-client-locale": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
83
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
84
- "@deepseek-ai/dsh-client-ui-input-trigger": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
85
- "@deepseek-ai/dsh-client-ui-layout": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
86
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
87
- "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
88
- "@deepseek-ai/dsh-client-ui-settings-general": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
89
- "@deepseek-ai/dsh-client-ui-sidebar": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
90
- "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
91
- "@deepseek-ai/dsh-client-ui-workspace": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2",
81
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
82
+ "@deepseek-ai/dsh-client-locale": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
83
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
84
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
85
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
86
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
87
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
88
+ "@deepseek-ai/dsh-client-ui-settings-general": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
89
+ "@deepseek-ai/dsh-client-ui-sidebar": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
90
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
91
+ "@deepseek-ai/dsh-client-ui-workspace": "0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1-rc.3",
92
92
  "react": "^18.2.0",
93
93
  "react-dom": "^18.2.0"
94
94
  },