@michengai/dsh-codex-ui 1.1.28 → 1.1.29
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 +10 -0
- package/CHANGELOG.zh-CN.md +10 -0
- package/README.md +3 -1
- package/README.zh-CN.md +3 -1
- package/cordis.patch.yml +4 -1
- package/lib/client.js +370 -164
- package/locale/en.json +6 -0
- package/locale/session-title/en.json +6 -0
- package/locale/session-title/zh.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@ This changelog records recent releases of DSH Codex UI. Earlier changes remain a
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## 1.1.29 - 2026-10-06
|
|
10
|
+
|
|
11
|
+
- Account-launcher settings navigation reports missing sections immediately, supports late launcher registration, and reads Settings shortcut hints when the shortcuts service becomes ready.
|
|
12
|
+
- Desktop settings shortcuts open the requested section directly while keeping the official account launcher. Closing Settings restores keyboard focus.
|
|
13
|
+
- Installing from GitHub now includes the compiled runtime, so no manual build is required.
|
|
14
|
+
- The installed-plugin list shows “Codex UI” and a localized description instead of only the package name. The session-title component shows “Codex session titles”. Titles and descriptions come from `meta.title` and `meta.description` in `locale/zh.json`, `locale/en.json`, and `locale/session-title/`.
|
|
15
|
+
- Desktop keeps the official avatar and sign-in control at the bottom of the sidebar. Web still uses the plugin settings button when that account launcher is absent.
|
|
16
|
+
- While this plugin is installed, the patch disables official `ui-sidebar` and `ui-settings-general` so Desktop 0.2 does not fail activation on duplicate child slots. Disabling or uninstalling drops those rows with the bundle and restores the official shells. Official `session-title-llm` stays disabled while this plugin is composed, because the host accepts only one title provider. Remove leftover `disabled: true` rows for those ids from the profile `cordis.patch.yml`, then reload.
|
|
17
|
+
- Disabling or uninstalling restores the host sidebar column width. The official sidebar is no longer left at 240px, and the plugin removes its width variables and conversation-header style.
|
|
18
|
+
|
|
9
19
|
## 1.1.28 - 2026-10-05
|
|
10
20
|
|
|
11
21
|
- Restore the official session-search and add-workspace shortcuts when Codex replaces the workspace sidebar (#35). Preserve command IDs and custom key bindings, reuse the host directory picker, and keep both actions available in the collapsed rail.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
## 未发布
|
|
8
8
|
|
|
9
|
+
## 1.1.29 - 2026-10-06
|
|
10
|
+
|
|
11
|
+
- 账号入口下的设置导航立即处理缺失分区,支持账号入口晚注册,并在快捷键服务就绪后显示设置快捷键提示。
|
|
12
|
+
- 桌面端保留官方账号入口时,设置快捷入口可直接打开目标分区;关闭设置后恢复键盘焦点。
|
|
13
|
+
- 从 GitHub 安装时已包含运行文件,不必再手动构建。
|
|
14
|
+
- 已安装插件列表显示「Codex UI」和中文简介,不再只用包名。会话标题子入口显示「Codex 会话标题」。显示名来自 `locale/zh.json`、`locale/en.json` 和 `locale/session-title/` 的 `meta.title`、`meta.description`。
|
|
15
|
+
- 桌面端左下角保留官方头像和登录入口,不再用设置按钮覆盖。网页端没有该入口时仍显示自己的设置按钮。
|
|
16
|
+
- 安装期间补丁会停用官方 `ui-sidebar` 和 `ui-settings-general`,避免桌面端 0.2 因重复声明子插槽而激活失败。禁用或卸载后这些行随安装包失效,官方侧栏和设置壳回来。标题服务仍暂时停用官方 `session-title-llm`,因为宿主同时只接受一个标题提供方。若 profile 的 `cordis.patch.yml` 里仍有这两行 `disabled: true`,需要删掉后重载。
|
|
17
|
+
- 禁用或卸载时恢复宿主侧栏列宽。不再把官方侧栏留在 240px,并撤掉插件写上的宽度变量和顶栏样式。
|
|
18
|
+
|
|
9
19
|
## 1.1.28 - 2026-10-05
|
|
10
20
|
|
|
11
21
|
- 修复 Codex 侧栏接管工作区后,官方搜索会话、添加工作区快捷键无响应的问题(#35)。沿用官方命令及自定义键位,复用宿主目录选择器,折叠窄轨下同样可用。
|
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://r
|
|
|
102
102
|
dsh --profile web --dump-config
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
Restart DSH Web and hard-refresh the browser (usually `Ctrl+Shift+R`). Once the new sidebar appears, you are ready to use it.
|
|
105
|
+
Restart DSH Web and hard-refresh the browser (usually `Ctrl+Shift+R`). Once the new sidebar appears, you are ready to use it. Disabling or uninstalling restores the official sidebar. If the profile `cordis.patch.yml` still has `disabled: true` for `ui-sidebar` or `ui-settings-general`, delete those rows and reload.
|
|
106
106
|
|
|
107
107
|
## Usage
|
|
108
108
|
|
|
@@ -140,6 +140,8 @@ Check that the installation profile matches the one running DSH Web, then restar
|
|
|
140
140
|
|
|
141
141
|
## Development and contributing
|
|
142
142
|
|
|
143
|
+
GitHub and npm both include a ready-to-run `lib`. After changing source, run `pnpm build` before committing.
|
|
144
|
+
|
|
143
145
|
### Install from source
|
|
144
146
|
|
|
145
147
|
Use this for debugging or unpublished changes. The cloned directory becomes the plugin source path:
|
package/README.zh-CN.md
CHANGED
|
@@ -102,7 +102,7 @@ dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://r
|
|
|
102
102
|
dsh --profile web --dump-config
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
安装后重启 DSH Web,并硬刷新浏览器(通常为 `Ctrl+Shift+R
|
|
105
|
+
安装后重启 DSH Web,并硬刷新浏览器(通常为 `Ctrl+Shift+R`)。看到新的侧栏后即可开始使用。禁用或卸载后官方侧栏会回来。若 profile 的 `cordis.patch.yml` 里还有 `ui-sidebar` 或 `ui-settings-general` 的 `disabled: true`,删掉这两行后再重载。
|
|
106
106
|
|
|
107
107
|
## 使用
|
|
108
108
|
|
|
@@ -140,6 +140,8 @@ dsh --profile web --dump-config
|
|
|
140
140
|
|
|
141
141
|
## 开发与贡献
|
|
142
142
|
|
|
143
|
+
GitHub 与 npm 都包含可直接运行的 `lib`。修改源码后,提交前运行 `pnpm build`。
|
|
144
|
+
|
|
143
145
|
### 从源码安装
|
|
144
146
|
|
|
145
147
|
适用于调试或使用未发布改动。克隆后的目录会直接作为插件安装路径:
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 桌面端 0.2 的官方侧栏会声明同一批子插槽。两边同时登记会让本插件激活失败,
|
|
2
|
+
# 界面仍停在官方侧栏。启用时必须停用官方侧栏和设置壳,由本插件接管。
|
|
3
|
+
# 禁用或卸载后这些行随 bundle 一起失效,官方实现回来;列宽在客户端卸载时还原。
|
|
4
|
+
# 标题服务同时只接受一个提供方,所以仍停用官方 session-title-llm。
|
|
2
5
|
- id: ui-sidebar
|
|
3
6
|
disabled: true
|
|
4
7
|
- id: ui-settings-general
|
package/lib/client.js
CHANGED
|
@@ -359,6 +359,36 @@ window.__ModuleLoader__.load({
|
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
361
|
//#endregion
|
|
362
|
+
//#region src/client/official-slot-shadow.ts
|
|
363
|
+
/**
|
|
364
|
+
* 真实插槽核会在同一轮同步启动里继续挂官方插件。
|
|
365
|
+
* 立刻声明官方也要声明的子插槽,官方注册会抛出且不会重试,停用后官方就回不来。
|
|
366
|
+
* 测试夹具没有 spec,保持同步登记。
|
|
367
|
+
*/
|
|
368
|
+
function registerAfterOfficialWave(slots, slot, officialReady, register) {
|
|
369
|
+
const face = slots;
|
|
370
|
+
if (typeof face.spec !== "function") return register();
|
|
371
|
+
let remove = () => {};
|
|
372
|
+
let done = false;
|
|
373
|
+
let off = () => {};
|
|
374
|
+
const finish = () => {
|
|
375
|
+
if (done) return;
|
|
376
|
+
done = true;
|
|
377
|
+
off();
|
|
378
|
+
remove = register();
|
|
379
|
+
};
|
|
380
|
+
if (officialReady()) return register();
|
|
381
|
+
off = face.subscribe?.(slot, () => {
|
|
382
|
+
if (officialReady()) finish();
|
|
383
|
+
}) ?? (() => {});
|
|
384
|
+
queueMicrotask(finish);
|
|
385
|
+
return () => {
|
|
386
|
+
done = true;
|
|
387
|
+
off();
|
|
388
|
+
remove();
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
//#endregion
|
|
362
392
|
//#region node_modules/.pnpm/lucide-react@1.39.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
363
393
|
/**
|
|
364
394
|
* @license lucide-react v1.39.0 - ISC
|
|
@@ -1038,8 +1068,8 @@ window.__ModuleLoader__.load({
|
|
|
1038
1068
|
//#endregion
|
|
1039
1069
|
//#region src/client/settings-navigation.ts
|
|
1040
1070
|
/**
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1071
|
+
* 自有设置壳通过事件直接打开分区,不依赖账号入口的按钮或菜单结构。
|
|
1072
|
+
* 保留的宿主设置壳仍从设置入口触发,再按可访问名称选择页面。
|
|
1043
1073
|
*/
|
|
1044
1074
|
function pickSettingsSectionButton(buttons, labels) {
|
|
1045
1075
|
for (const label of labels) {
|
|
@@ -1063,13 +1093,17 @@ window.__ModuleLoader__.load({
|
|
|
1063
1093
|
const SETTINGS_NAVIGATION_TIMEOUT_MS = 4e3;
|
|
1064
1094
|
const SETTINGS_TRIGGER_SELECTOR = "[data-dcu-settings-trigger],[aria-haspopup=\"dialog\"]";
|
|
1065
1095
|
const SETTINGS_OPEN_SECTION_EVENT = "dcu-settings-open-section";
|
|
1096
|
+
const SETTINGS_OPEN_ROOT_EVENT = "dcu-settings-open-root";
|
|
1097
|
+
const SETTINGS_OWNER_SELECTOR = "[data-dcu-settings-owner]";
|
|
1066
1098
|
/** 根入口与分区跳转使用同一触发器合约,兼容保留的宿主设置壳。 */
|
|
1067
1099
|
function openSettingsRoot(root) {
|
|
1100
|
+
const owner = root?.querySelector(SETTINGS_OWNER_SELECTOR);
|
|
1101
|
+
if (owner && !owner.dispatchEvent(new CustomEvent("dcu-settings-open-root", { cancelable: true }))) return;
|
|
1068
1102
|
root?.querySelector(SETTINGS_TRIGGER_SELECTOR)?.click();
|
|
1069
1103
|
}
|
|
1070
1104
|
function openSettingsSection(root, label, onMissing, onSelected) {
|
|
1071
1105
|
const labels = typeof label === "string" ? [label] : label;
|
|
1072
|
-
const trigger = root?.querySelector(
|
|
1106
|
+
const trigger = root?.querySelector(SETTINGS_OWNER_SELECTOR) ?? root?.querySelector("[data-dcu-settings-trigger],[aria-haspopup=\"dialog\"]");
|
|
1073
1107
|
if (trigger === null || trigger === void 0) {
|
|
1074
1108
|
onMissing?.();
|
|
1075
1109
|
return;
|
|
@@ -1080,6 +1114,17 @@ window.__ModuleLoader__.load({
|
|
|
1080
1114
|
detail: { labels },
|
|
1081
1115
|
cancelable: true
|
|
1082
1116
|
});
|
|
1117
|
+
const detail = { labels };
|
|
1118
|
+
const ownerRequest = new CustomEvent(SETTINGS_OPEN_SECTION_EVENT, {
|
|
1119
|
+
detail,
|
|
1120
|
+
cancelable: true
|
|
1121
|
+
});
|
|
1122
|
+
if (trigger.hasAttribute("data-dcu-settings-owner")) {
|
|
1123
|
+
trigger.dispatchEvent(ownerRequest);
|
|
1124
|
+
if (detail.result === "selected") onSelected?.();
|
|
1125
|
+
else onMissing?.();
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1083
1128
|
if (!trigger.dispatchEvent(request)) {
|
|
1084
1129
|
onSelected?.();
|
|
1085
1130
|
return;
|
|
@@ -2662,6 +2707,8 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
2662
2707
|
observer.disconnect();
|
|
2663
2708
|
stopWatchingTabs?.();
|
|
2664
2709
|
if (frame !== void 0) window.cancelAnimationFrame(frame);
|
|
2710
|
+
doc.getElementById(CONVERSATION_HEADER_STYLE_ID)?.remove();
|
|
2711
|
+
doc.querySelectorAll("[data-dcu-title-folder], [data-dcu-title-more], [data-dcu-tab-slider]").forEach((node) => node.remove());
|
|
2665
2712
|
};
|
|
2666
2713
|
}
|
|
2667
2714
|
//#endregion
|
|
@@ -6604,6 +6651,47 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6604
6651
|
});
|
|
6605
6652
|
}
|
|
6606
6653
|
const visibleSidebarWidths = /* @__PURE__ */ new WeakMap();
|
|
6654
|
+
const hostSidebarSnapshots = /* @__PURE__ */ new WeakMap();
|
|
6655
|
+
/** 记下插件改写前的宿主列宽。已经带初始化标记的列宽是本插件留下的,不能当成宿主原值。 */
|
|
6656
|
+
function rememberHostSidebar(frame) {
|
|
6657
|
+
if (hostSidebarSnapshots.has(frame) || frame.hasAttribute("data-dcu-codex-sidebar-initialized")) return;
|
|
6658
|
+
const handle = frame.querySelector("[data-side=\"sidebar\"]");
|
|
6659
|
+
hostSidebarSnapshots.set(frame, {
|
|
6660
|
+
grid: frame.style.gridTemplateColumns,
|
|
6661
|
+
handleLeft: handle?.style.left ?? "",
|
|
6662
|
+
windowsWidth: frame.style.getPropertyValue("--dsh-windows-sidebar-width")
|
|
6663
|
+
});
|
|
6664
|
+
}
|
|
6665
|
+
/** 停用或卸载时撤回列宽、拖拽柄和初始化标记,让官方侧栏按宿主宽度重排。 */
|
|
6666
|
+
function restoreHostSidebar(frame) {
|
|
6667
|
+
frame.removeAttribute("data-dcu-codex-sidebar-initialized");
|
|
6668
|
+
frame.style.removeProperty("--dcu-sidebar-expanded-width");
|
|
6669
|
+
const html = frame.ownerDocument.documentElement;
|
|
6670
|
+
const tracks = parseSidebarGrid(frame.style.gridTemplateColumns);
|
|
6671
|
+
if (frame.hasAttribute("data-sidebar-collapsed")) {
|
|
6672
|
+
if ((html.hasAttribute("data-windows-titlebar") || html.dataset.platform === "darwin") && tracks?.sidebar === 56) {
|
|
6673
|
+
frame.style.gridTemplateColumns = `0px ${tracks.middle} ${tracks.details}`;
|
|
6674
|
+
if (html.hasAttribute("data-windows-titlebar")) frame.style.setProperty("--dsh-windows-sidebar-width", "0px");
|
|
6675
|
+
}
|
|
6676
|
+
return;
|
|
6677
|
+
}
|
|
6678
|
+
const snapshot = hostSidebarSnapshots.get(frame);
|
|
6679
|
+
const handle = frame.querySelector("[data-side=\"sidebar\"]");
|
|
6680
|
+
if (snapshot !== void 0) {
|
|
6681
|
+
frame.style.gridTemplateColumns = snapshot.grid;
|
|
6682
|
+
if (handle !== null) {
|
|
6683
|
+
if (snapshot.handleLeft === "") handle.style.removeProperty("left");
|
|
6684
|
+
else handle.style.left = snapshot.handleLeft;
|
|
6685
|
+
}
|
|
6686
|
+
if (snapshot.windowsWidth === "") frame.style.removeProperty("--dsh-windows-sidebar-width");
|
|
6687
|
+
else frame.style.setProperty("--dsh-windows-sidebar-width", snapshot.windowsWidth);
|
|
6688
|
+
return;
|
|
6689
|
+
}
|
|
6690
|
+
if (tracks?.sidebar === 240) {
|
|
6691
|
+
frame.style.gridTemplateColumns = `280px ${tracks.middle} ${tracks.details}`;
|
|
6692
|
+
if (handle !== null) handle.style.left = "280px";
|
|
6693
|
+
}
|
|
6694
|
+
}
|
|
6607
6695
|
/** 解析宿主 AppFrame 的 grid-template-columns。 */
|
|
6608
6696
|
function parseSidebarGrid(value) {
|
|
6609
6697
|
const match = /^(\d+(?:\.\d+)?)px\s+(minmax\(\d+(?:px)?,\s*1fr\))\s+(minmax\(0(?:px)?,\s*\d+(?:\.\d+)?px\)|\d+(?:\.\d+)?px)$/.exec(value.trim());
|
|
@@ -6700,6 +6788,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6700
6788
|
try {
|
|
6701
6789
|
if (frame === void 0 || !frame.isConnected) watchFrame(findSidebarFrame(document));
|
|
6702
6790
|
if (frame !== void 0) {
|
|
6791
|
+
rememberHostSidebar(frame);
|
|
6703
6792
|
if (!canApplySlimSidebar(frame)) return;
|
|
6704
6793
|
if (frame.hasAttribute("data-sidebar-collapsed")) {
|
|
6705
6794
|
applySlimSidebar(frame);
|
|
@@ -6735,14 +6824,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6735
6824
|
observer.disconnect();
|
|
6736
6825
|
frameObserver?.disconnect();
|
|
6737
6826
|
if (pending !== void 0) window.cancelAnimationFrame(pending);
|
|
6738
|
-
|
|
6739
|
-
if (frame?.hasAttribute("data-sidebar-collapsed") && (html.hasAttribute("data-windows-titlebar") || html.dataset.platform === "darwin")) {
|
|
6740
|
-
const tracks = parseSidebarGrid(frame.style.gridTemplateColumns);
|
|
6741
|
-
if (tracks?.sidebar === 56) {
|
|
6742
|
-
frame.style.gridTemplateColumns = `0px ${tracks.middle} ${tracks.details}`;
|
|
6743
|
-
if (html.hasAttribute("data-windows-titlebar")) frame.style.setProperty("--dsh-windows-sidebar-width", "0px");
|
|
6744
|
-
}
|
|
6745
|
-
}
|
|
6827
|
+
if (frame !== void 0) restoreHostSidebar(frame);
|
|
6746
6828
|
};
|
|
6747
6829
|
}
|
|
6748
6830
|
//#endregion
|
|
@@ -7332,7 +7414,7 @@ body[data-we-sidebar-glass] .dcu-expanded-shell,body[data-we-sidebar-glass] .dcu
|
|
|
7332
7414
|
.dcu-menu{padding:0 6px 8px;display:grid;gap:2px}.dcu-menu button,.dcu-footer-link{display:grid;grid-template-columns:20px minmax(0,1fr);column-gap:8px;align-items:center;width:100%;min-height:36px;padding:0 4px;border-radius:8px;color:var(--dcu-sidebar-navigation);font-size:14px;line-height:20px;text-align:left;font-weight:400}
|
|
7333
7415
|
.dcu-menu-icon{display:grid;place-items:center start;width:20px;height:20px}.dcu-menu-icon svg,.dcu-footer-link svg{display:block;width:16px;height:16px;color:var(--dcu-sidebar-icon)}.dcu-menu button:disabled{color:var(--dcu-sidebar-secondary);cursor:default;opacity:1}.dcu-menu button:disabled svg{color:var(--dcu-sidebar-secondary)}
|
|
7334
7416
|
.dcu-extensions-group{display:grid}.dcu-extension-leading{position:relative;display:block;width:16px;height:16px}.dcu-extension-leading svg{position:absolute;inset:0;transition:opacity 140ms ease-out,transform 220ms cubic-bezier(.16,1,.3,1)}.dcu-extension-default-icon{opacity:1}.dcu-extension-state-arrow{opacity:0;transform:rotate(0)}.dcu-extensions-group:hover .dcu-extension-default-icon,.dcu-extensions-toggle:focus-visible .dcu-extension-default-icon{opacity:0}.dcu-extensions-group:hover .dcu-extension-state-arrow,.dcu-extensions-toggle:focus-visible .dcu-extension-state-arrow{opacity:1}.dcu-extensions-toggle[aria-expanded=true] .dcu-extension-state-arrow{transform:rotate(90deg)}.dcu-extension-panel{display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows 220ms cubic-bezier(.16,1,.3,1),opacity 160ms ease-out}.dcu-extension-panel[data-open=false]{grid-template-rows:0fr;opacity:0;pointer-events:none}.dcu-extension-panel-inner{position:relative;min-height:0;overflow:hidden}.dcu-extension-items{position:relative;display:grid;gap:1px;margin:1px 0 4px 28px}.dcu-extension-items::before{content:"";position:absolute;left:-16px;top:0;bottom:4px;width:1px;background:var(--dcu-sidebar-border)}.dcu-extension-items button{grid-template-columns:minmax(0,1fr);min-height:32px;color:var(--dcu-sidebar-secondary);font-size:13px;font-weight:400}.dcu-extension-items .dcu-menu-icon{display:none}
|
|
7335
|
-
.dcu-workspaces{display:flex;min-height:0;flex:1;flex-direction:column;margin-top:2px;padding-top:8px;border-top:1px solid var(--dcu-sidebar-border)}.dcu-workspaces.dcu-workspaces-tabs{padding-top:0;border-top:0}.dcu-im-tabs{display:flex;gap:16px;margin:0 8px 12px;padding:0;border-bottom:1px solid var(--dcu-sidebar-border)}.dcu-im-tab{appearance:none;border:0;background:transparent;color:var(--dcu-sidebar-secondary);padding:8px 0 7px;font:14px/22px var(--dsw-font-family);font-weight:500;cursor:pointer}.dcu-im-tab[data-on=true]{color:var(--dcu-sidebar-primary);font-weight:600;box-shadow:inset 0 -2px 0 currentColor}.dcu-native-workspaces{display:flex;min-height:0;flex:1}.dcu-native-workspaces>*{min-width:0;flex:1}.dcu-native-workspaces .ima-tabs,.dcu-native-workspaces [role=tablist]{display:none!important}.dcu-schedule-browser{display:flex;min-height:0;flex:1;flex-direction:column}.dcu-native-workspaces .dcu-schedule-views{display:flex!important;flex:none;min-height:30px;margin:0 8px 8px;padding:2px;border:1px solid var(--dcu-sidebar-border);border-radius:8px;background:rgba(255,255,255,.025)}.dcu-schedule-views button{appearance:none;flex:1;min-width:0;height:24px;border:0;border-radius:6px;background:transparent;color:var(--dcu-sidebar-secondary);font:600 12px/18px var(--dsw-font-family);cursor:pointer}.dcu-schedule-views button[aria-selected=true]{background:var(--dcu-sidebar-hover);color:var(--dcu-sidebar-primary);box-shadow:inset 0 0 0 1px var(--dcu-sidebar-border)}.dcu-schedule-pane{display:flex;min-height:0;flex:1}.dcu-schedule-pane>*{min-width:0;flex:1}.dcu-schedule-pane>[data-slot="sidebar.schedule"]{display:flex!important;width:100%;min-width:0;flex:1}.dcu-schedule-pane>[data-slot="sidebar.schedule"]>.dsh-st-rail{width:100%;min-width:0;padding-right:8px;scrollbar-gutter:auto}.dcu-schedule-pane .dsh-st-overview{padding-right:8px}.dcu-foot{display:grid;width:100%;gap:4px;padding:8px 6px 12px;border-top:1px solid var(--dcu-sidebar-border);transition:opacity 500ms cubic-bezier(.16,1,.3,1),transform 500ms cubic-bezier(.16,1,.3,1)}.dcu-root.dcu-collapsing>.dcu-foot{opacity:0;transform:translateX(-4px);pointer-events:none}.dcu-footer-actions:empty,.dcu-settings-seat:empty{display:none}.dcu-settings-seat>
|
|
7417
|
+
.dcu-workspaces{display:flex;min-height:0;flex:1;flex-direction:column;margin-top:2px;padding-top:8px;border-top:1px solid var(--dcu-sidebar-border)}.dcu-workspaces.dcu-workspaces-tabs{padding-top:0;border-top:0}.dcu-im-tabs{display:flex;gap:16px;margin:0 8px 12px;padding:0;border-bottom:1px solid var(--dcu-sidebar-border)}.dcu-im-tab{appearance:none;border:0;background:transparent;color:var(--dcu-sidebar-secondary);padding:8px 0 7px;font:14px/22px var(--dsw-font-family);font-weight:500;cursor:pointer}.dcu-im-tab[data-on=true]{color:var(--dcu-sidebar-primary);font-weight:600;box-shadow:inset 0 -2px 0 currentColor}.dcu-native-workspaces{display:flex;min-height:0;flex:1}.dcu-native-workspaces>*{min-width:0;flex:1}.dcu-native-workspaces .ima-tabs,.dcu-native-workspaces [role=tablist]{display:none!important}.dcu-schedule-browser{display:flex;min-height:0;flex:1;flex-direction:column}.dcu-native-workspaces .dcu-schedule-views{display:flex!important;flex:none;min-height:30px;margin:0 8px 8px;padding:2px;border:1px solid var(--dcu-sidebar-border);border-radius:8px;background:rgba(255,255,255,.025)}.dcu-schedule-views button{appearance:none;flex:1;min-width:0;height:24px;border:0;border-radius:6px;background:transparent;color:var(--dcu-sidebar-secondary);font:600 12px/18px var(--dsw-font-family);cursor:pointer}.dcu-schedule-views button[aria-selected=true]{background:var(--dcu-sidebar-hover);color:var(--dcu-sidebar-primary);box-shadow:inset 0 0 0 1px var(--dcu-sidebar-border)}.dcu-schedule-pane{display:flex;min-height:0;flex:1}.dcu-schedule-pane>*{min-width:0;flex:1}.dcu-schedule-pane>[data-slot="sidebar.schedule"]{display:flex!important;width:100%;min-width:0;flex:1}.dcu-schedule-pane>[data-slot="sidebar.schedule"]>.dsh-st-rail{width:100%;min-width:0;padding-right:8px;scrollbar-gutter:auto}.dcu-schedule-pane .dsh-st-overview{padding-right:8px}.dcu-foot{display:grid;width:100%;gap:4px;padding:8px 6px 12px;border-top:1px solid var(--dcu-sidebar-border);transition:opacity 500ms cubic-bezier(.16,1,.3,1),transform 500ms cubic-bezier(.16,1,.3,1)}.dcu-root.dcu-collapsing>.dcu-foot{opacity:0;transform:translateX(-4px);pointer-events:none}.dcu-footer-actions:empty,.dcu-settings-seat:empty{display:none}.dcu-settings-seat>[data-dcu-settings-trigger]{width:100%;min-height:36px;padding-left:4px!important;color:var(--dcu-sidebar-navigation);font:14px/20px var(--dsw-font-family);font-weight:400}.dcu-compact{width:100%;align-items:flex-start;overflow:hidden;padding:calc((var(--dcu-header-height,34px) - 28px)/2) 0 8px}.dcu-compact-nav{display:flex;flex:1;min-height:0;flex-direction:column;align-items:center;gap:2px;overflow:auto;padding:6px 0}.dcu-compact .dcu-icon{width:36px;height:36px;flex:none}.dcu-compact .dcu-foot{width:36px;margin-top:auto;margin-left:10px;padding:8px 0;border-top:0}.dcu-compact .dcu-settings-seat{width:36px;overflow:hidden}.dcu-compact .dcu-settings-seat>[data-dcu-settings-trigger]{display:grid;place-items:center;width:36px;min-height:36px;padding:0!important;font-size:0!important;line-height:0}.dcu-compact .dcu-settings-seat>[data-dcu-settings-trigger] svg{width:16px;height:16px}.dcu-compact .dcu-footer-link{display:flex;justify-content:center;width:36px;padding:0;font-size:0}.dcu-compact .dcu-footer-link svg{width:16px;height:16px}
|
|
7336
7418
|
.dcu-settings-seat [data-slot="settings.trigger"]{color:var(--dcu-sidebar-navigation)}
|
|
7337
7419
|
.dcu-settings-seat [data-slot="settings.trigger"]>svg{color:var(--dcu-sidebar-icon)}
|
|
7338
7420
|
/* 宿主列负责缩放,宽态内容保持展开宽度,避免中文竖排与工作区逐帧重排。 */
|
|
@@ -9933,10 +10015,17 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9933
10015
|
return Box;
|
|
9934
10016
|
}
|
|
9935
10017
|
/** 独立设置视图复用原始 section/close 合约,退出时保留底层会话与输入状态。 */
|
|
9936
|
-
|
|
10018
|
+
const noShortcuts = [];
|
|
10019
|
+
const emptyShortcuts$1 = {
|
|
10020
|
+
subscribe: () => () => {},
|
|
10021
|
+
getSnapshot: () => noShortcuts
|
|
10022
|
+
};
|
|
10023
|
+
function CodexSettingsPage({ wide, sections, onboarding, connectionState, reconnect, accountLauncher, shortcuts = emptyShortcuts$1, useSessions, renderSlot, t }) {
|
|
9937
10024
|
const rows = (0, react.useSyncExternalStore)(sections.subscribe, sections.getSnapshot);
|
|
9938
10025
|
const steps = (0, react.useSyncExternalStore)(onboarding.subscribe, onboarding.getSnapshot);
|
|
9939
10026
|
const connection = (0, react.useSyncExternalStore)(connectionState.subscribe, connectionState.getSnapshot);
|
|
10027
|
+
const hostAccountLauncher = (0, react.useSyncExternalStore)(accountLauncher?.subscribe ?? (() => () => {}), accountLauncher?.getSnapshot ?? (() => false));
|
|
10028
|
+
const settingsShortcut = (0, react.useSyncExternalStore)(shortcuts.subscribe, shortcuts.getSnapshot).find((row) => row.id === "settings.open");
|
|
9940
10029
|
const onboardingActive = useSessions((state) => isBlankOnboardingSession(state));
|
|
9941
10030
|
const [completed, setCompleted] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
|
9942
10031
|
const [open, setOpen] = (0, react.useState)(false);
|
|
@@ -9945,6 +10034,8 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9945
10034
|
const [recovered, setRecovered] = (0, react.useState)(false);
|
|
9946
10035
|
const previousConnection = (0, react.useRef)(connection);
|
|
9947
10036
|
const trigger = (0, react.useRef)(null);
|
|
10037
|
+
const launcherRoot = (0, react.useRef)(null);
|
|
10038
|
+
const returnFocus = (0, react.useRef)(null);
|
|
9948
10039
|
const page = (0, react.useRef)(null);
|
|
9949
10040
|
const back = (0, react.useRef)(null);
|
|
9950
10041
|
const onboardingRoot = (0, react.useRef)(null);
|
|
@@ -9974,28 +10065,46 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9974
10065
|
animation.onfinish = finish;
|
|
9975
10066
|
}, []);
|
|
9976
10067
|
const openSection = (0, react.useCallback)((id) => {
|
|
10068
|
+
if (page.current === null) returnFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
9977
10069
|
exitAnimation.current?.cancel();
|
|
9978
10070
|
exitAnimation.current = null;
|
|
9979
10071
|
setActiveId(id);
|
|
9980
10072
|
setOpen(true);
|
|
9981
10073
|
}, []);
|
|
9982
|
-
(0, react.
|
|
9983
|
-
const element = trigger.current;
|
|
10074
|
+
(0, react.useLayoutEffect)(() => {
|
|
10075
|
+
const element = launcherRoot.current ?? trigger.current;
|
|
10076
|
+
const openRoot = (event) => {
|
|
10077
|
+
event.preventDefault();
|
|
10078
|
+
openSection("general");
|
|
10079
|
+
};
|
|
9984
10080
|
const navigate = (event) => {
|
|
9985
|
-
const
|
|
10081
|
+
const detail = event.detail;
|
|
10082
|
+
const labels = detail?.labels;
|
|
9986
10083
|
if (!Array.isArray(labels)) return;
|
|
9987
10084
|
const row = labels.flatMap((label) => rows.filter((item) => (item.id === "general" ? t("settings.general") : item.label) === label))[0];
|
|
9988
|
-
if (!row)
|
|
10085
|
+
if (!row) {
|
|
10086
|
+
if (element === launcherRoot.current) {
|
|
10087
|
+
event.preventDefault();
|
|
10088
|
+
detail.result = "missing";
|
|
10089
|
+
}
|
|
10090
|
+
return;
|
|
10091
|
+
}
|
|
9989
10092
|
event.preventDefault();
|
|
10093
|
+
detail.result = "selected";
|
|
9990
10094
|
setQuery("");
|
|
9991
10095
|
openSection(row.id);
|
|
9992
10096
|
};
|
|
9993
10097
|
element?.addEventListener(SETTINGS_OPEN_SECTION_EVENT, navigate);
|
|
9994
|
-
|
|
10098
|
+
element?.addEventListener(SETTINGS_OPEN_ROOT_EVENT, openRoot);
|
|
10099
|
+
return () => {
|
|
10100
|
+
element?.removeEventListener(SETTINGS_OPEN_SECTION_EVENT, navigate);
|
|
10101
|
+
element?.removeEventListener(SETTINGS_OPEN_ROOT_EVENT, openRoot);
|
|
10102
|
+
};
|
|
9995
10103
|
}, [
|
|
9996
10104
|
rows,
|
|
9997
10105
|
t,
|
|
9998
|
-
openSection
|
|
10106
|
+
openSection,
|
|
10107
|
+
hostAccountLauncher
|
|
9999
10108
|
]);
|
|
10000
10109
|
(0, react.useEffect)(() => () => {
|
|
10001
10110
|
exitAnimation.current?.cancel();
|
|
@@ -10019,7 +10128,10 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10019
10128
|
};
|
|
10020
10129
|
}, [connection]);
|
|
10021
10130
|
(0, react.useEffect)(() => {
|
|
10022
|
-
if (wasOpen.current && !open)
|
|
10131
|
+
if (wasOpen.current && !open) {
|
|
10132
|
+
const previous = returnFocus.current;
|
|
10133
|
+
(hostAccountLauncher ? previous?.isConnected && previous !== document.body ? previous : launcherRoot.current?.querySelector("button,a[href],[tabindex=\"0\"]") : trigger.current)?.focus();
|
|
10134
|
+
}
|
|
10023
10135
|
wasOpen.current = open;
|
|
10024
10136
|
if (!open || page.current === null) return;
|
|
10025
10137
|
if (settingsElementAvailable(page.current) && settingsOverlays().length === 0) back.current?.focus();
|
|
@@ -10090,7 +10202,8 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10090
10202
|
}, [
|
|
10091
10203
|
open,
|
|
10092
10204
|
close,
|
|
10093
|
-
step?.id
|
|
10205
|
+
step?.id,
|
|
10206
|
+
hostAccountLauncher
|
|
10094
10207
|
]);
|
|
10095
10208
|
(0, react.useEffect)(() => {
|
|
10096
10209
|
if (main.current !== null) main.current.scrollTop = 0;
|
|
@@ -10100,7 +10213,25 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10100
10213
|
const connectionIndicator = connection === "disconnected" ? "disconnected" : connection === "connecting" ? "connecting" : recovered ? "recovered" : void 0;
|
|
10101
10214
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
10102
10215
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: settingsPageStyles }),
|
|
10103
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
10216
|
+
hostAccountLauncher ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10217
|
+
ref: launcherRoot,
|
|
10218
|
+
"data-dcu-settings-owner": true,
|
|
10219
|
+
style: { display: "contents" },
|
|
10220
|
+
children: renderSlot("settings.launcher", {
|
|
10221
|
+
wide,
|
|
10222
|
+
settingsOpen: open,
|
|
10223
|
+
...settingsShortcut?.keys.length ? { settingsShortcut: {
|
|
10224
|
+
keys: settingsShortcut.keys,
|
|
10225
|
+
aria: settingsShortcut.aria
|
|
10226
|
+
} } : {},
|
|
10227
|
+
openSettings: () => {
|
|
10228
|
+
openSection("general");
|
|
10229
|
+
},
|
|
10230
|
+
openOnboarding: (id) => {
|
|
10231
|
+
openSection(id);
|
|
10232
|
+
}
|
|
10233
|
+
})
|
|
10234
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10104
10235
|
ref: trigger,
|
|
10105
10236
|
type: "button",
|
|
10106
10237
|
className: "dcu-settings-trigger",
|
|
@@ -10320,27 +10451,62 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10320
10451
|
}
|
|
10321
10452
|
//#endregion
|
|
10322
10453
|
//#region src/client/settings-page-registration.ts
|
|
10323
|
-
/**
|
|
10454
|
+
/** 快捷键服务可能晚于本插件启动。等到它就绪后再读 catalog,避免注册时一次取值把提示永久丢掉。 */
|
|
10455
|
+
const emptyShortcuts = [];
|
|
10456
|
+
function liveShortcutCatalog(ctx) {
|
|
10457
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
10458
|
+
let catalog;
|
|
10459
|
+
const notify = () => {
|
|
10460
|
+
for (const listener of listeners) listener();
|
|
10461
|
+
};
|
|
10462
|
+
ctx.inject(["shortcuts"], (shortcutCtx) => {
|
|
10463
|
+
catalog = shortcutCtx.shortcuts.catalog;
|
|
10464
|
+
const unsubscribe = catalog.subscribe(notify);
|
|
10465
|
+
notify();
|
|
10466
|
+
return () => {
|
|
10467
|
+
unsubscribe();
|
|
10468
|
+
catalog = void 0;
|
|
10469
|
+
notify();
|
|
10470
|
+
};
|
|
10471
|
+
});
|
|
10472
|
+
return {
|
|
10473
|
+
getSnapshot: () => catalog?.getSnapshot() ?? emptyShortcuts,
|
|
10474
|
+
subscribe: (listener) => {
|
|
10475
|
+
listeners.add(listener);
|
|
10476
|
+
return () => {
|
|
10477
|
+
listeners.delete(listener);
|
|
10478
|
+
};
|
|
10479
|
+
}
|
|
10480
|
+
};
|
|
10481
|
+
}
|
|
10482
|
+
function accountLauncherPresence(slots) {
|
|
10483
|
+
const read = () => {
|
|
10484
|
+
try {
|
|
10485
|
+
return slots.entriesOfSlot("settings.launcher").length > 0;
|
|
10486
|
+
} catch {
|
|
10487
|
+
return false;
|
|
10488
|
+
}
|
|
10489
|
+
};
|
|
10490
|
+
return {
|
|
10491
|
+
getSnapshot: read,
|
|
10492
|
+
subscribe: (listener) => {
|
|
10493
|
+
try {
|
|
10494
|
+
return slots.subscribe("settings.launcher", listener);
|
|
10495
|
+
} catch {
|
|
10496
|
+
return () => {};
|
|
10497
|
+
}
|
|
10498
|
+
}
|
|
10499
|
+
};
|
|
10500
|
+
}
|
|
10324
10501
|
function registerSettingsPage(ctx) {
|
|
10325
|
-
const shellSlots = [
|
|
10326
|
-
"settings.launcher",
|
|
10327
|
-
"settings.trigger",
|
|
10328
|
-
"settings.header",
|
|
10329
|
-
"settings.action",
|
|
10330
|
-
"settings.close",
|
|
10331
|
-
"settings.section",
|
|
10332
|
-
"settings.onboarding",
|
|
10333
|
-
"settings.general.item"
|
|
10334
|
-
];
|
|
10335
|
-
const occupied = () => ctx.slots.entriesOfSlot("sidebar.settings").length > 0 || shellSlots.some((name) => ctx.slots.snapshot(name).length > 0);
|
|
10336
|
-
const warn = () => console.warn("[michengai-codex-ui] 已存在设置外壳,保留宿主设置;独立设置页需要 bundle patch 停用 ui-settings-general。");
|
|
10337
|
-
if (occupied()) {
|
|
10338
|
-
warn();
|
|
10339
|
-
return;
|
|
10340
|
-
}
|
|
10341
|
-
let owned = false;
|
|
10342
10502
|
const t = ctx.locale.bind(NS);
|
|
10503
|
+
const declared = (name) => {
|
|
10504
|
+
const spec = ctx.slots.spec;
|
|
10505
|
+
return typeof spec === "function" && spec.call(ctx.slots, name) !== void 0;
|
|
10506
|
+
};
|
|
10507
|
+
const officialSettingsReady = () => declared("settings.launcher") || ctx.slots.entries("sidebar.settings").some((entry) => entry.component !== CodexSettingsPage);
|
|
10343
10508
|
const connection = ctx.get("connection");
|
|
10509
|
+
const shortcuts = liveShortcutCatalog(ctx);
|
|
10344
10510
|
const source = (name) => {
|
|
10345
10511
|
let revision = "";
|
|
10346
10512
|
let cached = [];
|
|
@@ -10370,15 +10536,22 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10370
10536
|
const sections = source("settings.section");
|
|
10371
10537
|
const onboarding = source("settings.onboarding");
|
|
10372
10538
|
const items = source("settings.general.item");
|
|
10373
|
-
ctx.slots.inject("settings.trigger", () =>
|
|
10539
|
+
ctx.slots.inject("settings.trigger", () => ctx.slots.register({
|
|
10374
10540
|
name: "settings.trigger",
|
|
10541
|
+
priority: -1,
|
|
10375
10542
|
locale: NS
|
|
10376
10543
|
}, ({ wide }) => (0, react.createElement)("span", { className: "dcu-settings-trigger-content" }, (0, react.createElement)(Settings, {
|
|
10377
10544
|
size: 16,
|
|
10378
10545
|
strokeWidth: 1.6
|
|
10379
10546
|
}), wide ? (0, react.createElement)("span", null, t("settings.title")) : null)));
|
|
10380
|
-
ctx.slots.inject("settings.
|
|
10547
|
+
ctx.slots.inject("settings.header", () => ctx.slots.register({
|
|
10548
|
+
name: "settings.header",
|
|
10549
|
+
priority: -1,
|
|
10550
|
+
locale: NS
|
|
10551
|
+
}, () => null));
|
|
10552
|
+
ctx.slots.inject("settings.close", () => ctx.slots.register({
|
|
10381
10553
|
name: "settings.close",
|
|
10554
|
+
priority: -1,
|
|
10382
10555
|
locale: NS
|
|
10383
10556
|
}, () => t("settings.back")));
|
|
10384
10557
|
let documentBound = false;
|
|
@@ -10388,9 +10561,10 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10388
10561
|
if (!remote.$host.isLoopback) return;
|
|
10389
10562
|
documentBound = true;
|
|
10390
10563
|
const describe = forms.describe();
|
|
10391
|
-
const remove = settingsCtx.slots.inject("settings.general.footer", () =>
|
|
10564
|
+
const remove = settingsCtx.slots.inject("settings.general.footer", () => settingsCtx.slots.register({
|
|
10392
10565
|
name: "settings.general.footer",
|
|
10393
10566
|
id: "open-document",
|
|
10567
|
+
priority: -1,
|
|
10394
10568
|
locale: NS,
|
|
10395
10569
|
inject: () => ({
|
|
10396
10570
|
describe,
|
|
@@ -10408,75 +10582,79 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10408
10582
|
ctx.inject(["settingsScope", "remote.settings"], (settingsCtx) => {
|
|
10409
10583
|
return bindSettingsDocument(settingsCtx, settingsCtx.settingsScope);
|
|
10410
10584
|
});
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10585
|
+
const shellChildren = {
|
|
10586
|
+
"settings.launcher": {
|
|
10587
|
+
kind: "single",
|
|
10588
|
+
scope: "root"
|
|
10589
|
+
},
|
|
10590
|
+
"settings.trigger": {
|
|
10591
|
+
kind: "single",
|
|
10592
|
+
scope: "root"
|
|
10593
|
+
},
|
|
10594
|
+
"settings.header": {
|
|
10595
|
+
kind: "single",
|
|
10596
|
+
scope: "root"
|
|
10597
|
+
},
|
|
10598
|
+
"settings.action": {
|
|
10599
|
+
kind: "list",
|
|
10600
|
+
scope: "root"
|
|
10601
|
+
},
|
|
10602
|
+
"settings.close": {
|
|
10603
|
+
kind: "single",
|
|
10604
|
+
scope: "root"
|
|
10605
|
+
},
|
|
10606
|
+
"settings.section": {
|
|
10607
|
+
kind: "list",
|
|
10608
|
+
scope: "root"
|
|
10609
|
+
},
|
|
10610
|
+
"settings.onboarding": {
|
|
10611
|
+
kind: "list",
|
|
10612
|
+
scope: "root"
|
|
10613
|
+
}
|
|
10614
|
+
};
|
|
10615
|
+
ctx.slots.inject("sidebar.settings", () => registerAfterOfficialWave(ctx.slots, "sidebar.settings", officialSettingsReady, () => {
|
|
10616
|
+
const children = {};
|
|
10617
|
+
if (!officialSettingsReady()) {
|
|
10618
|
+
for (const [name, spec] of Object.entries(shellChildren)) if (!declared(name)) Object.assign(children, { [name]: spec });
|
|
10415
10619
|
}
|
|
10416
|
-
|
|
10417
|
-
const remove = ctx.slots.register({
|
|
10620
|
+
return ctx.slots.register({
|
|
10418
10621
|
name: "sidebar.settings",
|
|
10419
10622
|
priority: -1,
|
|
10420
10623
|
locale: NS,
|
|
10421
|
-
children
|
|
10422
|
-
"settings.trigger": {
|
|
10423
|
-
kind: "single",
|
|
10424
|
-
scope: "root"
|
|
10425
|
-
},
|
|
10426
|
-
"settings.header": {
|
|
10427
|
-
kind: "single",
|
|
10428
|
-
scope: "root"
|
|
10429
|
-
},
|
|
10430
|
-
"settings.action": {
|
|
10431
|
-
kind: "list",
|
|
10432
|
-
scope: "root"
|
|
10433
|
-
},
|
|
10434
|
-
"settings.close": {
|
|
10435
|
-
kind: "single",
|
|
10436
|
-
scope: "root"
|
|
10437
|
-
},
|
|
10438
|
-
"settings.section": {
|
|
10439
|
-
kind: "list",
|
|
10440
|
-
scope: "root"
|
|
10441
|
-
},
|
|
10442
|
-
"settings.onboarding": {
|
|
10443
|
-
kind: "list",
|
|
10444
|
-
scope: "root"
|
|
10445
|
-
}
|
|
10446
|
-
},
|
|
10624
|
+
children,
|
|
10447
10625
|
inject: () => ({
|
|
10448
10626
|
sections,
|
|
10449
10627
|
onboarding,
|
|
10450
10628
|
connectionState: connection.state,
|
|
10451
10629
|
reconnect: () => {
|
|
10452
10630
|
connection.reconnect();
|
|
10453
|
-
}
|
|
10631
|
+
},
|
|
10632
|
+
accountLauncher: accountLauncherPresence(ctx.slots),
|
|
10633
|
+
shortcuts
|
|
10454
10634
|
})
|
|
10455
10635
|
}, CodexSettingsPage);
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10636
|
+
}));
|
|
10637
|
+
ctx.slots.inject("settings.section", () => registerAfterOfficialWave(ctx.slots, "settings.section", () => declared("settings.general.item"), () => {
|
|
10638
|
+
const children = {};
|
|
10639
|
+
if (!declared("settings.general.item")) children["settings.general.item"] = {
|
|
10640
|
+
kind: "list",
|
|
10641
|
+
scope: "root"
|
|
10459
10642
|
};
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
}
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
scope: "root"
|
|
10476
|
-
}
|
|
10477
|
-
},
|
|
10478
|
-
inject: () => ({ items })
|
|
10479
|
-
}, CodexGeneralSettings));
|
|
10643
|
+
if (!declared("settings.general.footer")) children["settings.general.footer"] = {
|
|
10644
|
+
kind: "list",
|
|
10645
|
+
scope: "root"
|
|
10646
|
+
};
|
|
10647
|
+
return ctx.slots.register({
|
|
10648
|
+
name: "settings.section",
|
|
10649
|
+
id: "general",
|
|
10650
|
+
priority: -1,
|
|
10651
|
+
order: 0,
|
|
10652
|
+
locale: NS,
|
|
10653
|
+
label: () => t("settings.general"),
|
|
10654
|
+
children,
|
|
10655
|
+
inject: () => ({ items })
|
|
10656
|
+
}, CodexGeneralSettings);
|
|
10657
|
+
}));
|
|
10480
10658
|
}
|
|
10481
10659
|
//#endregion
|
|
10482
10660
|
//#region src/client/official-turn-navigator.ts
|
|
@@ -11207,73 +11385,101 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
11207
11385
|
workspaceShortcuts.dispose();
|
|
11208
11386
|
}, "michengai-codex-ui: workspace shortcuts");
|
|
11209
11387
|
registerWorkspaceDirectoryFlow(ctx);
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
children: {
|
|
11215
|
-
"sidebar.panellist": {
|
|
11216
|
-
kind: "list",
|
|
11217
|
-
scope: "root"
|
|
11218
|
-
},
|
|
11219
|
-
"sidebar.workspaces": {
|
|
11220
|
-
kind: "single",
|
|
11221
|
-
scope: "root"
|
|
11222
|
-
},
|
|
11223
|
-
[WORKSPACE_DIRECTORY_FLOW]: {
|
|
11224
|
-
kind: "single",
|
|
11225
|
-
scope: "root"
|
|
11226
|
-
},
|
|
11227
|
-
"sidebar.settings": {
|
|
11228
|
-
kind: "single",
|
|
11229
|
-
scope: "root"
|
|
11230
|
-
},
|
|
11231
|
-
"sidebar.footer.action": {
|
|
11232
|
-
kind: "list",
|
|
11233
|
-
scope: "root"
|
|
11234
|
-
},
|
|
11235
|
-
"sidebar.channels": {
|
|
11236
|
-
kind: "single",
|
|
11237
|
-
scope: "root"
|
|
11238
|
-
},
|
|
11239
|
-
"sidebar.schedule": {
|
|
11240
|
-
kind: "single",
|
|
11241
|
-
scope: "root"
|
|
11242
|
-
}
|
|
11388
|
+
const ownSidebarChildren = {
|
|
11389
|
+
"sidebar.panellist": {
|
|
11390
|
+
kind: "list",
|
|
11391
|
+
scope: "root"
|
|
11243
11392
|
},
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11393
|
+
[WORKSPACE_DIRECTORY_FLOW]: {
|
|
11394
|
+
kind: "single",
|
|
11395
|
+
scope: "root"
|
|
11396
|
+
},
|
|
11397
|
+
"sidebar.channels": {
|
|
11398
|
+
kind: "single",
|
|
11399
|
+
scope: "root"
|
|
11400
|
+
},
|
|
11401
|
+
"sidebar.schedule": {
|
|
11402
|
+
kind: "single",
|
|
11403
|
+
scope: "root"
|
|
11404
|
+
}
|
|
11405
|
+
};
|
|
11406
|
+
const sharedSidebarChildren = {
|
|
11407
|
+
"sidebar.workspaces": {
|
|
11408
|
+
kind: "single",
|
|
11409
|
+
scope: "root"
|
|
11410
|
+
},
|
|
11411
|
+
"sidebar.settings": {
|
|
11412
|
+
kind: "single",
|
|
11413
|
+
scope: "root"
|
|
11414
|
+
},
|
|
11415
|
+
"sidebar.footer.action": {
|
|
11416
|
+
kind: "list",
|
|
11417
|
+
scope: "root"
|
|
11418
|
+
}
|
|
11419
|
+
};
|
|
11420
|
+
const officialSidebarReady = () => ctx.slots.entries("sidebar").some((entry) => entry.component !== CodexSidebar);
|
|
11421
|
+
ctx.slots.inject("sidebar", () => registerAfterOfficialWave(ctx.slots, "sidebar", officialSidebarReady, () => {
|
|
11422
|
+
const declared = (name) => {
|
|
11423
|
+
const spec = ctx.slots.spec;
|
|
11424
|
+
return typeof spec === "function" && spec.call(ctx.slots, name) !== void 0;
|
|
11425
|
+
};
|
|
11426
|
+
const children = {};
|
|
11427
|
+
for (const [name, spec] of Object.entries({
|
|
11428
|
+
...sharedSidebarChildren,
|
|
11429
|
+
...ownSidebarChildren
|
|
11430
|
+
})) if (!declared(name)) children[name] = spec;
|
|
11431
|
+
const register = (next) => {
|
|
11432
|
+
try {
|
|
11433
|
+
return ctx.slots.register({
|
|
11434
|
+
name: "sidebar",
|
|
11435
|
+
priority: -1,
|
|
11436
|
+
registrant: "michengai-codex-ui",
|
|
11437
|
+
locale: NS,
|
|
11438
|
+
children: next,
|
|
11439
|
+
inject: () => ({
|
|
11440
|
+
newConversationDraft,
|
|
11441
|
+
navigationHistory,
|
|
11442
|
+
workspaceShortcuts,
|
|
11443
|
+
prefillNewConversation: (text) => {
|
|
11444
|
+
const id = currentSessionId(ctx.sessions.list.getSnapshot());
|
|
11445
|
+
const binding = id === void 0 ? void 0 : ctx.sessions.binding(id);
|
|
11446
|
+
return prefillNewConversation(binding === void 0 ? void 0 : ctx.conversation.input.for(binding.ctx), text);
|
|
11447
|
+
},
|
|
11448
|
+
openSession: (sessionId) => {
|
|
11449
|
+
openConversation(ctx, ctx.layout, sessionId);
|
|
11450
|
+
},
|
|
11451
|
+
startSession: (workspaceId) => {
|
|
11452
|
+
startWorkspaceSession(ctx, workspaceId);
|
|
11453
|
+
},
|
|
11454
|
+
toggleSidebar: () => {
|
|
11455
|
+
ctx.layout.toggleSidebar();
|
|
11456
|
+
},
|
|
11457
|
+
archiveSession,
|
|
11458
|
+
canDeleteSession: () => hasArchiveSessionDelete(ctx.get("remote.workspaceRegistry")),
|
|
11459
|
+
deleteSession,
|
|
11460
|
+
forkSession,
|
|
11461
|
+
moveSession,
|
|
11462
|
+
renameSession,
|
|
11463
|
+
openPath,
|
|
11464
|
+
companionSlots,
|
|
11465
|
+
globalPanels,
|
|
11466
|
+
footerActions,
|
|
11467
|
+
selectPanel: (id) => {
|
|
11468
|
+
selectGlobalPanel(ctx.layout, id);
|
|
11469
|
+
}
|
|
11470
|
+
})
|
|
11471
|
+
}, CodexSidebar);
|
|
11472
|
+
} catch (error) {
|
|
11473
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
11474
|
+
const conflict = /slot "([^"]+)" is already declared/.exec(message);
|
|
11475
|
+
if (conflict === null || next[conflict[1]] === void 0) throw error;
|
|
11476
|
+
const rest = { ...next };
|
|
11477
|
+
delete rest[conflict[1]];
|
|
11478
|
+
return register(rest);
|
|
11274
11479
|
}
|
|
11275
|
-
}
|
|
11276
|
-
|
|
11480
|
+
};
|
|
11481
|
+
return register(children);
|
|
11482
|
+
}));
|
|
11277
11483
|
ctx.slots.inject("conversation.session.header.utilities", () => ctx.slots.register({
|
|
11278
11484
|
name: "conversation.session.header.utilities",
|
|
11279
11485
|
id: "turn-navigator",
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
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.29",
|
|
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": {
|
|
@@ -34,11 +34,14 @@
|
|
|
34
34
|
"types": "./lib/session-title-plugin.d.mts",
|
|
35
35
|
"default": "./lib/session-title-plugin.mjs"
|
|
36
36
|
},
|
|
37
|
-
"./package.json": "./package.json"
|
|
37
|
+
"./package.json": "./package.json",
|
|
38
|
+
"./locale/*.json": "./locale/*.json",
|
|
39
|
+
"./session-title/locale/*.json": "./locale/session-title/*.json"
|
|
38
40
|
},
|
|
39
41
|
"files": [
|
|
40
42
|
"lib",
|
|
41
43
|
"assets",
|
|
44
|
+
"locale",
|
|
42
45
|
"cordis.patch.yml",
|
|
43
46
|
"CHANGELOG.md",
|
|
44
47
|
"CHANGELOG.zh-CN.md",
|