@michengai/dsh-codex-ui 1.1.45 → 1.1.47
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 +14 -0
- package/CHANGELOG.zh-CN.md +14 -0
- package/lib/client.js +124 -64
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.47 (2026-10-22)
|
|
4
|
+
|
|
5
|
+
- Prevent interaction lockup during sidebar collapse by removing blocking `pointer-events: none` and settling state on `transitionend` with a timeout fallback (#57).
|
|
6
|
+
- Support async `startSession` return handling and add a pending state guard to prevent silent no-ops when host RPC is busy during streaming (#57).
|
|
7
|
+
- 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).
|
|
8
|
+
|
|
9
|
+
## 1.1.46 (2026-10-21)
|
|
10
|
+
|
|
11
|
+
- 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).
|
|
12
|
+
- Paint that band with the host's own `--dsw-specific-sidebar-fill` (the token the desktop app uses for the native title bar), so the caption stays one continuous colour across both columns instead of breaking into sidebar/content/native strips.
|
|
13
|
+
- Move the Settings navigation below the native window buttons on Windows, so Back and Search no longer sit in the same band as the minimize/maximize/close controls.
|
|
14
|
+
- Keep the Windows desktop menu (Application/Edit) visible on the Settings page and align it to the left edge while the session navigation arrows remain exclusive to the main workspace. Hide the desktop menu in fullscreen mode to prevent overlap, and include its items in keyboard Tab navigation.
|
|
15
|
+
- Extend the drag-region browser regression to cover the Windows caption, fullscreen, and hosts without a titlebar.
|
|
16
|
+
|
|
3
17
|
## 1.1.45 (2026-10-20)
|
|
4
18
|
|
|
5
19
|
- Restore macOS window-drag regions in the sidebar header and the top safe area of Settings, while keeping buttons and inputs interactive (#46).
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## 1.1.47 (2026-10-22)
|
|
4
|
+
|
|
5
|
+
- 修复侧栏折叠动画窗口期交互锁死:移除展开壳上的 `pointer-events: none` 阻断,改由 `transitionend` 驱动收敛并配合超时兜底,避免主线程流式长任务排队导致整栏无法点击(#57)。
|
|
6
|
+
- 增强「新建任务」健壮性:适配 `startSession` 异步返回值与异常捕获,增加 pending 状态守卫,避免宿主并发繁忙或挂起时静默失效(#57)。
|
|
7
|
+
- 优化流式输出期间渲染性能:搜索弹窗改为按需挂载,未打开时不订阅 store 快照,切断高频全量搜索索引重建;会话行与分组头使用 `React.memo` 隔离局部重绘;工具菜单 DOM 几何测量合并到 `requestAnimationFrame`(#57)。
|
|
8
|
+
|
|
9
|
+
## 1.1.46 (2026-10-21)
|
|
10
|
+
|
|
11
|
+
- 修复 Windows 桌面端设置页无法拖动窗口:全屏设置浮层重新预留原生标题栏区域,并把该区域声明为窗口拖动区(#56)。
|
|
12
|
+
- 标题栏带改用宿主自己的 `--dsw-specific-sidebar-fill`(桌面端原生标题栏用的就是这个 token),整条贯通同色,不再断成侧栏 / 内容 / 原生按钮三块。
|
|
13
|
+
- Windows 下设置导航整体下移到原生窗口按钮之下,「返回应用」和搜索框不再与最小化/最大化/关闭按钮挤在同一条带内。
|
|
14
|
+
- Windows 设置页保留宿主「应用」「编辑」菜单并左对齐,全屏时隐藏菜单防止遮挡内容,并将菜单项纳入键盘 Tab 循环;会话历史前进/后退箭头仅留在主工作区、不进入设置页。
|
|
15
|
+
- 拖动区域浏览器回归扩展到 Windows 标题栏、全屏切换以及没有标题栏的宿主。
|
|
16
|
+
|
|
3
17
|
## 1.1.45 (2026-10-20)
|
|
4
18
|
|
|
5
19
|
- 恢复 macOS 侧栏顶部与设置页顶部安全区的窗口拖动区域,保留按钮点击和输入框交互(#46)。
|
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
|
-
|
|
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
|
-
|
|
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);
|
|
@@ -7213,7 +7227,7 @@ html[data-windows-titlebar] .dcu-desktop-navigation{display:flex;position:fixed;
|
|
|
7213
7227
|
.dcu-desktop-navigation button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
|
|
7214
7228
|
.dcu-desktop-navigation button:disabled{opacity:.35;cursor:default}
|
|
7215
7229
|
.dcu-desktop-navigation button:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}
|
|
7216
|
-
html[data-windows-titlebar]:not([data-fullscreen]):has(.dcu-desktop-navigation){--dsh-windows-menu-start:84px}
|
|
7230
|
+
html[data-windows-titlebar]:not([data-fullscreen]):not(:has(.dcu-settings-page)):has(.dcu-desktop-navigation){--dsh-windows-menu-start:84px}
|
|
7217
7231
|
html[data-windows-titlebar][data-fullscreen] .dcu-desktop-navigation{display:none}
|
|
7218
7232
|
`;
|
|
7219
7233
|
function DesktopNavigationControls({ history, t }) {
|
|
@@ -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
|
-
|
|
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)
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7803
|
+
onClose();
|
|
7801
7804
|
startSession();
|
|
7802
7805
|
}
|
|
7803
7806
|
}
|
|
7804
7807
|
];
|
|
7805
7808
|
}, [
|
|
7806
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
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
|
|
7944
|
-
|
|
7945
|
-
|
|
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
|
-
|
|
8156
|
+
let done = false;
|
|
8157
|
+
const finish = () => {
|
|
8158
|
+
if (done) return;
|
|
8159
|
+
done = true;
|
|
8132
8160
|
setVisualCompact(true);
|
|
8133
8161
|
setCollapsing(false);
|
|
8134
|
-
}
|
|
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",
|
|
@@ -10347,11 +10383,20 @@ body[data-ds-dark-theme] .dcu-settings-page{--sp-bg:#181818;--sp-nav:var(--dcu-s
|
|
|
10347
10383
|
/* 返回、插槽头与搜索框常驻,只有分区列表滚动。 */
|
|
10348
10384
|
.dcu-settings-nav>*{flex:none}
|
|
10349
10385
|
.dcu-settings-nav>.dcu-settings-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sp-border) transparent}
|
|
10350
|
-
/* body 直属浮层被宿主整层标为 no-drag;撤销整层扣除,仅开放顶部安全区。
|
|
10386
|
+
/* body 直属浮层被宿主整层标为 no-drag;撤销整层扣除,仅开放顶部安全区。
|
|
10387
|
+
宿主把窗口拖动条画在 frame 顶部(macOS 是 data-window-drag 行,Windows 是标题栏伪元素),
|
|
10388
|
+
全屏设置页会整层盖住它,所以两个桌面平台都要预留安全区并重新声明拖动区。 */
|
|
10351
10389
|
html[data-platform=darwin] body>.dcu-settings-page:not(#root){-webkit-app-region:initial}
|
|
10352
|
-
html[data-platform=darwin]:not([data-fullscreen]) .dcu-settings-page::after{content:"";position:absolute;inset:0 0 auto;height:var(--dsh-frame-top-clearance,48px);pointer-events:none;-webkit-app-region:drag}
|
|
10353
|
-
/*
|
|
10354
|
-
|
|
10390
|
+
html:is([data-platform=darwin],[data-windows-titlebar]):not([data-fullscreen]) .dcu-settings-page::after{content:"";position:absolute;inset:0 0 auto;height:var(--dsh-frame-top-clearance,48px);pointer-events:none;-webkit-app-region:drag}
|
|
10391
|
+
/* Windows 原生标题栏整条按 --dsw-specific-sidebar-fill 着色(主进程就是用这个 token 设置标题栏),
|
|
10392
|
+
设置浮层必须用同一颜色贯通顶部,否则标题栏带会在左右两栏交界处断成两块色。 */
|
|
10393
|
+
html[data-windows-titlebar]:not([data-fullscreen]) .dcu-settings-page::after{background:var(--dsw-specific-sidebar-fill,var(--sp-nav))}
|
|
10394
|
+
/* 原生窗口按钮覆盖 Web 内容;沿用宿主标题栏安全区,仅抬高设置导航。 */
|
|
10395
|
+
html:is([data-platform=darwin],[data-windows-titlebar]):not([data-fullscreen]) .dcu-settings-nav{padding-top:calc(var(--dsh-frame-top-clearance,48px) + 8px)}
|
|
10396
|
+
/* 设置页不展示会话历史前进/后退箭头,Desktop 菜单左移到 12px 对齐。 */
|
|
10397
|
+
html[data-windows-titlebar]:has(.dcu-settings-page){--dsh-windows-menu-start:12px}
|
|
10398
|
+
/* Windows 全屏时隐藏 Desktop 菜单,避免悬空遮挡设置页内容。 */
|
|
10399
|
+
html[data-windows-titlebar][data-fullscreen] [data-windows-menu]{display:none!important}
|
|
10355
10400
|
body[data-ds-dark-theme] .dcu-settings-nav{--sp-text:var(--dcu-sidebar-navigation,#b9bab9);--sp-muted:var(--dcu-sidebar-secondary,#909191);--sp-hover:var(--dcu-sidebar-hover,#303432);--sp-active:var(--dcu-sidebar-hover,#303432);--sp-border:var(--dcu-sidebar-border,rgba(255,255,255,.08))}
|
|
10356
10401
|
.dcu-settings-back{display:flex;align-items:center;flex-shrink:0;gap:8px;width:100%;height:30px;padding:5px 8px;border:0;border-radius:10px;background:transparent;color:var(--sp-text);text-align:left}
|
|
10357
10402
|
.dcu-settings-back:hover,.dcu-settings-link:hover{background:var(--sp-hover)}
|
|
@@ -10616,6 +10661,7 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10616
10661
|
const guideModals = step === void 0 ? [] : settingsOverlays("[role=\"dialog\"][aria-modal=\"true\"],[role=\"alertdialog\"][aria-modal=\"true\"]");
|
|
10617
10662
|
const isolate = (element) => {
|
|
10618
10663
|
if (element.parentElement === document.body && element.hasAttribute("data-dsh-pet-overlay")) return;
|
|
10664
|
+
if (element.hasAttribute("data-windows-menu")) return;
|
|
10619
10665
|
if (element.parentElement === document.body && element.getAttribute("role") === "alert") return;
|
|
10620
10666
|
if (element === onboardingRoot.current || guideModals.includes(element)) return;
|
|
10621
10667
|
if (guideModals.some((modal) => element.contains(modal))) {
|
|
@@ -10647,20 +10693,28 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10647
10693
|
const keepFocus = (event) => {
|
|
10648
10694
|
const target = event.target;
|
|
10649
10695
|
if (!(target instanceof Node) || page.current === null || !settingsElementAvailable(page.current)) return;
|
|
10650
|
-
if (page.current.contains(target) || onboardingRoot.current?.contains(target) || [...document.querySelectorAll("body > [data-dsh-pet-overlay], body > [role=alert]")].some((root) => root.contains(target)) || settingsOverlays().some((overlay) => overlay.contains(target))) return;
|
|
10696
|
+
if (page.current.contains(target) || onboardingRoot.current?.contains(target) || [...document.querySelectorAll("body > [data-dsh-pet-overlay], body > [role=alert]")].some((root) => root.contains(target)) || [...document.querySelectorAll("[data-windows-menu]")].some((root) => root.contains(target)) || settingsOverlays().some((overlay) => overlay.contains(target))) return;
|
|
10651
10697
|
back.current?.focus();
|
|
10652
10698
|
};
|
|
10653
10699
|
const wrapFocus = (event) => {
|
|
10654
10700
|
if (event.key !== "Tab" || event.defaultPrevented || page.current === null || !settingsElementAvailable(page.current) || settingsOverlays().length > 0) return;
|
|
10655
|
-
const
|
|
10701
|
+
const menuButtons = [...document.querySelectorAll("[data-windows-menu]")].filter(settingsElementAvailable).flatMap((host) => [...host.shadowRoot?.querySelectorAll("button") ?? host.querySelectorAll("button")]).filter((button) => button.tabIndex >= 0 && !button.matches(":disabled") && getComputedStyle(button).display !== "none");
|
|
10702
|
+
const pageItems = [
|
|
10656
10703
|
page.current,
|
|
10657
10704
|
onboardingRoot.current,
|
|
10658
10705
|
...document.querySelectorAll("body > [data-dsh-pet-overlay], body > [role=alert]")
|
|
10659
10706
|
].filter((root) => root !== null).flatMap((root) => [...root.querySelectorAll("button,input,select,textarea,a[href],[tabindex]")]).filter((element) => element.tabIndex >= 0 && !element.matches(":disabled") && settingsElementAvailable(element));
|
|
10660
|
-
const
|
|
10661
|
-
if (
|
|
10707
|
+
const items = [...menuButtons, ...pageItems];
|
|
10708
|
+
if (items.length === 0) return;
|
|
10709
|
+
const active = document.activeElement?.shadowRoot?.activeElement ?? document.activeElement;
|
|
10710
|
+
const isFirst = active === items[0];
|
|
10711
|
+
const isLast = active === items.at(-1);
|
|
10712
|
+
if (event.shiftKey && isFirst) {
|
|
10713
|
+
event.preventDefault();
|
|
10714
|
+
items.at(-1)?.focus();
|
|
10715
|
+
} else if (!event.shiftKey && isLast) {
|
|
10662
10716
|
event.preventDefault();
|
|
10663
|
-
|
|
10717
|
+
items[0]?.focus();
|
|
10664
10718
|
}
|
|
10665
10719
|
};
|
|
10666
10720
|
document.addEventListener("keydown", onKeyDown, true);
|
|
@@ -11900,17 +11954,23 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
11900
11954
|
}
|
|
11901
11955
|
}
|
|
11902
11956
|
/** Archive Manager replaces the official ui-workspace row with this optional service. */
|
|
11903
|
-
function startWorkspaceSession(ctx, workspaceId) {
|
|
11957
|
+
async function startWorkspaceSession(ctx, workspaceId) {
|
|
11904
11958
|
const uiWorkspace = probeService(ctx, "uiWorkspace");
|
|
11905
|
-
|
|
11906
|
-
uiWorkspace
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
ctx.workspaces
|
|
11911
|
-
|
|
11959
|
+
try {
|
|
11960
|
+
if (hasStartSession(uiWorkspace)) {
|
|
11961
|
+
await Promise.resolve(uiWorkspace.startSession(workspaceId));
|
|
11962
|
+
return true;
|
|
11963
|
+
}
|
|
11964
|
+
if (hasStartSession(ctx.workspaces)) {
|
|
11965
|
+
await Promise.resolve(ctx.workspaces.startSession(workspaceId));
|
|
11966
|
+
return true;
|
|
11967
|
+
}
|
|
11968
|
+
console.warn("DSH 工作空间服务尚未就绪,无法新建会话。");
|
|
11969
|
+
return false;
|
|
11970
|
+
} catch (error) {
|
|
11971
|
+
console.warn("新建会话失败:", error);
|
|
11972
|
+
return false;
|
|
11912
11973
|
}
|
|
11913
|
-
console.warn("DSH 工作空间服务尚未就绪,无法新建会话。");
|
|
11914
11974
|
}
|
|
11915
11975
|
/** 替换 DSH 的官方 sidebar 插槽,不修改 DSH 源码或会话数据。 */
|
|
11916
11976
|
function apply(ctx) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.47",
|
|
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": {
|