@michengai/dsh-codex-ui 1.1.28 → 1.1.30
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 +15 -0
- package/CHANGELOG.zh-CN.md +15 -0
- package/README.md +3 -1
- package/README.zh-CN.md +3 -1
- package/cordis.patch.yml +4 -1
- package/lib/client.js +374 -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 +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,21 @@ This changelog records recent releases of DSH Codex UI. Earlier changes remain a
|
|
|
6
6
|
|
|
7
7
|
## Unreleased
|
|
8
8
|
|
|
9
|
+
## 1.1.30 - 2026-10-07
|
|
10
|
+
|
|
11
|
+
- On macOS, the settings Back button and search stay below the traffic lights in a normal window (#37). Fullscreen, Windows, and the browser are unchanged.
|
|
12
|
+
- The Model Pro settings page uses the available column width instead of the 864px reading width. Other settings pages stay the same. Model Pro's own cards still have a width limit until that plugin is updated.
|
|
13
|
+
|
|
14
|
+
## 1.1.29 - 2026-10-06
|
|
15
|
+
|
|
16
|
+
- Account-launcher settings navigation reports missing sections immediately, supports late launcher registration, and reads Settings shortcut hints when the shortcuts service becomes ready.
|
|
17
|
+
- Desktop settings shortcuts open the requested section directly while keeping the official account launcher. Closing Settings restores keyboard focus.
|
|
18
|
+
- Installing from GitHub now includes the compiled runtime, so no manual build is required.
|
|
19
|
+
- 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/`.
|
|
20
|
+
- 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.
|
|
21
|
+
- 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.
|
|
22
|
+
- 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.
|
|
23
|
+
|
|
9
24
|
## 1.1.28 - 2026-10-05
|
|
10
25
|
|
|
11
26
|
- 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,21 @@
|
|
|
6
6
|
|
|
7
7
|
## 未发布
|
|
8
8
|
|
|
9
|
+
## 1.1.30 - 2026-10-07
|
|
10
|
+
|
|
11
|
+
- macOS 普通窗口里,设置页的返回和搜索不再被红绿灯挡住(#37)。全屏、Windows 和浏览器不受影响。
|
|
12
|
+
- 模型 Pro 设置页改用主栏可用宽度,不再限制在 864px。其他设置页宽度不变。模型 Pro 自己的卡片仍有宽度上限,要等该插件更新后才会完全拉开。
|
|
13
|
+
|
|
14
|
+
## 1.1.29 - 2026-10-06
|
|
15
|
+
|
|
16
|
+
- 账号入口下的设置导航立即处理缺失分区,支持账号入口晚注册,并在快捷键服务就绪后显示设置快捷键提示。
|
|
17
|
+
- 桌面端保留官方账号入口时,设置快捷入口可直接打开目标分区;关闭设置后恢复键盘焦点。
|
|
18
|
+
- 从 GitHub 安装时已包含运行文件,不必再手动构建。
|
|
19
|
+
- 已安装插件列表显示「Codex UI」和中文简介,不再只用包名。会话标题子入口显示「Codex 会话标题」。显示名来自 `locale/zh.json`、`locale/en.json` 和 `locale/session-title/` 的 `meta.title`、`meta.description`。
|
|
20
|
+
- 桌面端左下角保留官方头像和登录入口,不再用设置按钮覆盖。网页端没有该入口时仍显示自己的设置按钮。
|
|
21
|
+
- 安装期间补丁会停用官方 `ui-sidebar` 和 `ui-settings-general`,避免桌面端 0.2 因重复声明子插槽而激活失败。禁用或卸载后这些行随安装包失效,官方侧栏和设置壳回来。标题服务仍暂时停用官方 `session-title-llm`,因为宿主同时只接受一个标题提供方。若 profile 的 `cordis.patch.yml` 里仍有这两行 `disabled: true`,需要删掉后重载。
|
|
22
|
+
- 禁用或卸载时恢复宿主侧栏列宽。不再把官方侧栏留在 240px,并撤掉插件写上的宽度变量和顶栏样式。
|
|
23
|
+
|
|
9
24
|
## 1.1.28 - 2026-10-05
|
|
10
25
|
|
|
11
26
|
- 修复 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
|
/* 宿主列负责缩放,宽态内容保持展开宽度,避免中文竖排与工作区逐帧重排。 */
|
|
@@ -9807,6 +9889,8 @@ body[data-ds-dark-theme] .dcu-settings-page{--sp-bg:#181818;--sp-nav:var(--dcu-s
|
|
|
9807
9889
|
.dcu-settings-page button{cursor:pointer}
|
|
9808
9890
|
.dcu-settings-page :focus-visible{outline:2px solid #459cff;outline-offset:3px}
|
|
9809
9891
|
.dcu-settings-nav{--sp-text:var(--dcu-sidebar-navigation,#4e5253);--sp-muted:var(--dcu-sidebar-secondary,#676b6c);--sp-hover:var(--dcu-sidebar-hover,#dfe8e5);--sp-active:var(--dcu-sidebar-hover,#dfe8e5);--sp-border:var(--dcu-sidebar-border,rgba(37,46,41,.10));display:flex;flex-direction:column;min-height:0;padding:18px 8px;background:var(--sp-nav);box-shadow:inset -1px 0 var(--sp-border);overflow-y:auto}
|
|
9892
|
+
/* macOS 普通窗口的原生按钮覆盖 Web 内容;沿用宿主标题栏安全区,仅抬高设置导航。 */
|
|
9893
|
+
html[data-platform=darwin]:not([data-fullscreen]) .dcu-settings-nav{padding-top:calc(var(--dsh-frame-top-clearance,48px) + 8px)}
|
|
9810
9894
|
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))}
|
|
9811
9895
|
.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}
|
|
9812
9896
|
.dcu-settings-back:hover,.dcu-settings-link:hover{background:var(--sp-hover)}
|
|
@@ -9829,6 +9913,8 @@ body[data-ds-dark-theme] .dcu-settings-nav{--sp-text:var(--dcu-sidebar-navigatio
|
|
|
9829
9913
|
.dcu-settings-empty{padding:8px;color:var(--sp-muted);font-size:13px}
|
|
9830
9914
|
.dcu-settings-main{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;background:var(--sp-bg);scrollbar-width:thin;scrollbar-color:var(--sp-border) transparent}
|
|
9831
9915
|
.dcu-settings-inner{width:min(100%,864px);margin:0 auto;padding:48px 48px}
|
|
9916
|
+
/* 模型 Pro 的多列表格按主栏宽度伸展;其他设置页仍保持易读的常规宽度。 */
|
|
9917
|
+
.dcu-settings-inner[data-settings-section=dsh-model-pro]{width:100%}
|
|
9832
9918
|
.dcu-settings-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px}
|
|
9833
9919
|
.dcu-settings-heading h1,.dcu-settings-inner:is([data-settings-section=models],[data-settings-section=plugins],[data-settings-section=agent-presets]) [class$="_section"]>h2:is([class$="_title"],[class$="_heading"]){margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px}
|
|
9834
9920
|
.dcu-settings-inner:is([data-settings-section=models],[data-settings-section=plugins],[data-settings-section=agent-presets]) [class$="_section"]>p[class$="_intro"]{margin:0;font-size:14px;line-height:22px}
|
|
@@ -9933,10 +10019,17 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9933
10019
|
return Box;
|
|
9934
10020
|
}
|
|
9935
10021
|
/** 独立设置视图复用原始 section/close 合约,退出时保留底层会话与输入状态。 */
|
|
9936
|
-
|
|
10022
|
+
const noShortcuts = [];
|
|
10023
|
+
const emptyShortcuts$1 = {
|
|
10024
|
+
subscribe: () => () => {},
|
|
10025
|
+
getSnapshot: () => noShortcuts
|
|
10026
|
+
};
|
|
10027
|
+
function CodexSettingsPage({ wide, sections, onboarding, connectionState, reconnect, accountLauncher, shortcuts = emptyShortcuts$1, useSessions, renderSlot, t }) {
|
|
9937
10028
|
const rows = (0, react.useSyncExternalStore)(sections.subscribe, sections.getSnapshot);
|
|
9938
10029
|
const steps = (0, react.useSyncExternalStore)(onboarding.subscribe, onboarding.getSnapshot);
|
|
9939
10030
|
const connection = (0, react.useSyncExternalStore)(connectionState.subscribe, connectionState.getSnapshot);
|
|
10031
|
+
const hostAccountLauncher = (0, react.useSyncExternalStore)(accountLauncher?.subscribe ?? (() => () => {}), accountLauncher?.getSnapshot ?? (() => false));
|
|
10032
|
+
const settingsShortcut = (0, react.useSyncExternalStore)(shortcuts.subscribe, shortcuts.getSnapshot).find((row) => row.id === "settings.open");
|
|
9940
10033
|
const onboardingActive = useSessions((state) => isBlankOnboardingSession(state));
|
|
9941
10034
|
const [completed, setCompleted] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
|
9942
10035
|
const [open, setOpen] = (0, react.useState)(false);
|
|
@@ -9945,6 +10038,8 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9945
10038
|
const [recovered, setRecovered] = (0, react.useState)(false);
|
|
9946
10039
|
const previousConnection = (0, react.useRef)(connection);
|
|
9947
10040
|
const trigger = (0, react.useRef)(null);
|
|
10041
|
+
const launcherRoot = (0, react.useRef)(null);
|
|
10042
|
+
const returnFocus = (0, react.useRef)(null);
|
|
9948
10043
|
const page = (0, react.useRef)(null);
|
|
9949
10044
|
const back = (0, react.useRef)(null);
|
|
9950
10045
|
const onboardingRoot = (0, react.useRef)(null);
|
|
@@ -9974,28 +10069,46 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9974
10069
|
animation.onfinish = finish;
|
|
9975
10070
|
}, []);
|
|
9976
10071
|
const openSection = (0, react.useCallback)((id) => {
|
|
10072
|
+
if (page.current === null) returnFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
9977
10073
|
exitAnimation.current?.cancel();
|
|
9978
10074
|
exitAnimation.current = null;
|
|
9979
10075
|
setActiveId(id);
|
|
9980
10076
|
setOpen(true);
|
|
9981
10077
|
}, []);
|
|
9982
|
-
(0, react.
|
|
9983
|
-
const element = trigger.current;
|
|
10078
|
+
(0, react.useLayoutEffect)(() => {
|
|
10079
|
+
const element = launcherRoot.current ?? trigger.current;
|
|
10080
|
+
const openRoot = (event) => {
|
|
10081
|
+
event.preventDefault();
|
|
10082
|
+
openSection("general");
|
|
10083
|
+
};
|
|
9984
10084
|
const navigate = (event) => {
|
|
9985
|
-
const
|
|
10085
|
+
const detail = event.detail;
|
|
10086
|
+
const labels = detail?.labels;
|
|
9986
10087
|
if (!Array.isArray(labels)) return;
|
|
9987
10088
|
const row = labels.flatMap((label) => rows.filter((item) => (item.id === "general" ? t("settings.general") : item.label) === label))[0];
|
|
9988
|
-
if (!row)
|
|
10089
|
+
if (!row) {
|
|
10090
|
+
if (element === launcherRoot.current) {
|
|
10091
|
+
event.preventDefault();
|
|
10092
|
+
detail.result = "missing";
|
|
10093
|
+
}
|
|
10094
|
+
return;
|
|
10095
|
+
}
|
|
9989
10096
|
event.preventDefault();
|
|
10097
|
+
detail.result = "selected";
|
|
9990
10098
|
setQuery("");
|
|
9991
10099
|
openSection(row.id);
|
|
9992
10100
|
};
|
|
9993
10101
|
element?.addEventListener(SETTINGS_OPEN_SECTION_EVENT, navigate);
|
|
9994
|
-
|
|
10102
|
+
element?.addEventListener(SETTINGS_OPEN_ROOT_EVENT, openRoot);
|
|
10103
|
+
return () => {
|
|
10104
|
+
element?.removeEventListener(SETTINGS_OPEN_SECTION_EVENT, navigate);
|
|
10105
|
+
element?.removeEventListener(SETTINGS_OPEN_ROOT_EVENT, openRoot);
|
|
10106
|
+
};
|
|
9995
10107
|
}, [
|
|
9996
10108
|
rows,
|
|
9997
10109
|
t,
|
|
9998
|
-
openSection
|
|
10110
|
+
openSection,
|
|
10111
|
+
hostAccountLauncher
|
|
9999
10112
|
]);
|
|
10000
10113
|
(0, react.useEffect)(() => () => {
|
|
10001
10114
|
exitAnimation.current?.cancel();
|
|
@@ -10019,7 +10132,10 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10019
10132
|
};
|
|
10020
10133
|
}, [connection]);
|
|
10021
10134
|
(0, react.useEffect)(() => {
|
|
10022
|
-
if (wasOpen.current && !open)
|
|
10135
|
+
if (wasOpen.current && !open) {
|
|
10136
|
+
const previous = returnFocus.current;
|
|
10137
|
+
(hostAccountLauncher ? previous?.isConnected && previous !== document.body ? previous : launcherRoot.current?.querySelector("button,a[href],[tabindex=\"0\"]") : trigger.current)?.focus();
|
|
10138
|
+
}
|
|
10023
10139
|
wasOpen.current = open;
|
|
10024
10140
|
if (!open || page.current === null) return;
|
|
10025
10141
|
if (settingsElementAvailable(page.current) && settingsOverlays().length === 0) back.current?.focus();
|
|
@@ -10090,7 +10206,8 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10090
10206
|
}, [
|
|
10091
10207
|
open,
|
|
10092
10208
|
close,
|
|
10093
|
-
step?.id
|
|
10209
|
+
step?.id,
|
|
10210
|
+
hostAccountLauncher
|
|
10094
10211
|
]);
|
|
10095
10212
|
(0, react.useEffect)(() => {
|
|
10096
10213
|
if (main.current !== null) main.current.scrollTop = 0;
|
|
@@ -10100,7 +10217,25 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10100
10217
|
const connectionIndicator = connection === "disconnected" ? "disconnected" : connection === "connecting" ? "connecting" : recovered ? "recovered" : void 0;
|
|
10101
10218
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
10102
10219
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: settingsPageStyles }),
|
|
10103
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
10220
|
+
hostAccountLauncher ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10221
|
+
ref: launcherRoot,
|
|
10222
|
+
"data-dcu-settings-owner": true,
|
|
10223
|
+
style: { display: "contents" },
|
|
10224
|
+
children: renderSlot("settings.launcher", {
|
|
10225
|
+
wide,
|
|
10226
|
+
settingsOpen: open,
|
|
10227
|
+
...settingsShortcut?.keys.length ? { settingsShortcut: {
|
|
10228
|
+
keys: settingsShortcut.keys,
|
|
10229
|
+
aria: settingsShortcut.aria
|
|
10230
|
+
} } : {},
|
|
10231
|
+
openSettings: () => {
|
|
10232
|
+
openSection("general");
|
|
10233
|
+
},
|
|
10234
|
+
openOnboarding: (id) => {
|
|
10235
|
+
openSection(id);
|
|
10236
|
+
}
|
|
10237
|
+
})
|
|
10238
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
10104
10239
|
ref: trigger,
|
|
10105
10240
|
type: "button",
|
|
10106
10241
|
className: "dcu-settings-trigger",
|
|
@@ -10320,27 +10455,62 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10320
10455
|
}
|
|
10321
10456
|
//#endregion
|
|
10322
10457
|
//#region src/client/settings-page-registration.ts
|
|
10323
|
-
/**
|
|
10458
|
+
/** 快捷键服务可能晚于本插件启动。等到它就绪后再读 catalog,避免注册时一次取值把提示永久丢掉。 */
|
|
10459
|
+
const emptyShortcuts = [];
|
|
10460
|
+
function liveShortcutCatalog(ctx) {
|
|
10461
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
10462
|
+
let catalog;
|
|
10463
|
+
const notify = () => {
|
|
10464
|
+
for (const listener of listeners) listener();
|
|
10465
|
+
};
|
|
10466
|
+
ctx.inject(["shortcuts"], (shortcutCtx) => {
|
|
10467
|
+
catalog = shortcutCtx.shortcuts.catalog;
|
|
10468
|
+
const unsubscribe = catalog.subscribe(notify);
|
|
10469
|
+
notify();
|
|
10470
|
+
return () => {
|
|
10471
|
+
unsubscribe();
|
|
10472
|
+
catalog = void 0;
|
|
10473
|
+
notify();
|
|
10474
|
+
};
|
|
10475
|
+
});
|
|
10476
|
+
return {
|
|
10477
|
+
getSnapshot: () => catalog?.getSnapshot() ?? emptyShortcuts,
|
|
10478
|
+
subscribe: (listener) => {
|
|
10479
|
+
listeners.add(listener);
|
|
10480
|
+
return () => {
|
|
10481
|
+
listeners.delete(listener);
|
|
10482
|
+
};
|
|
10483
|
+
}
|
|
10484
|
+
};
|
|
10485
|
+
}
|
|
10486
|
+
function accountLauncherPresence(slots) {
|
|
10487
|
+
const read = () => {
|
|
10488
|
+
try {
|
|
10489
|
+
return slots.entriesOfSlot("settings.launcher").length > 0;
|
|
10490
|
+
} catch {
|
|
10491
|
+
return false;
|
|
10492
|
+
}
|
|
10493
|
+
};
|
|
10494
|
+
return {
|
|
10495
|
+
getSnapshot: read,
|
|
10496
|
+
subscribe: (listener) => {
|
|
10497
|
+
try {
|
|
10498
|
+
return slots.subscribe("settings.launcher", listener);
|
|
10499
|
+
} catch {
|
|
10500
|
+
return () => {};
|
|
10501
|
+
}
|
|
10502
|
+
}
|
|
10503
|
+
};
|
|
10504
|
+
}
|
|
10324
10505
|
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
10506
|
const t = ctx.locale.bind(NS);
|
|
10507
|
+
const declared = (name) => {
|
|
10508
|
+
const spec = ctx.slots.spec;
|
|
10509
|
+
return typeof spec === "function" && spec.call(ctx.slots, name) !== void 0;
|
|
10510
|
+
};
|
|
10511
|
+
const officialSettingsReady = () => declared("settings.launcher") || ctx.slots.entries("sidebar.settings").some((entry) => entry.component !== CodexSettingsPage);
|
|
10343
10512
|
const connection = ctx.get("connection");
|
|
10513
|
+
const shortcuts = liveShortcutCatalog(ctx);
|
|
10344
10514
|
const source = (name) => {
|
|
10345
10515
|
let revision = "";
|
|
10346
10516
|
let cached = [];
|
|
@@ -10370,15 +10540,22 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10370
10540
|
const sections = source("settings.section");
|
|
10371
10541
|
const onboarding = source("settings.onboarding");
|
|
10372
10542
|
const items = source("settings.general.item");
|
|
10373
|
-
ctx.slots.inject("settings.trigger", () =>
|
|
10543
|
+
ctx.slots.inject("settings.trigger", () => ctx.slots.register({
|
|
10374
10544
|
name: "settings.trigger",
|
|
10545
|
+
priority: -1,
|
|
10375
10546
|
locale: NS
|
|
10376
10547
|
}, ({ wide }) => (0, react.createElement)("span", { className: "dcu-settings-trigger-content" }, (0, react.createElement)(Settings, {
|
|
10377
10548
|
size: 16,
|
|
10378
10549
|
strokeWidth: 1.6
|
|
10379
10550
|
}), wide ? (0, react.createElement)("span", null, t("settings.title")) : null)));
|
|
10380
|
-
ctx.slots.inject("settings.
|
|
10551
|
+
ctx.slots.inject("settings.header", () => ctx.slots.register({
|
|
10552
|
+
name: "settings.header",
|
|
10553
|
+
priority: -1,
|
|
10554
|
+
locale: NS
|
|
10555
|
+
}, () => null));
|
|
10556
|
+
ctx.slots.inject("settings.close", () => ctx.slots.register({
|
|
10381
10557
|
name: "settings.close",
|
|
10558
|
+
priority: -1,
|
|
10382
10559
|
locale: NS
|
|
10383
10560
|
}, () => t("settings.back")));
|
|
10384
10561
|
let documentBound = false;
|
|
@@ -10388,9 +10565,10 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10388
10565
|
if (!remote.$host.isLoopback) return;
|
|
10389
10566
|
documentBound = true;
|
|
10390
10567
|
const describe = forms.describe();
|
|
10391
|
-
const remove = settingsCtx.slots.inject("settings.general.footer", () =>
|
|
10568
|
+
const remove = settingsCtx.slots.inject("settings.general.footer", () => settingsCtx.slots.register({
|
|
10392
10569
|
name: "settings.general.footer",
|
|
10393
10570
|
id: "open-document",
|
|
10571
|
+
priority: -1,
|
|
10394
10572
|
locale: NS,
|
|
10395
10573
|
inject: () => ({
|
|
10396
10574
|
describe,
|
|
@@ -10408,75 +10586,79 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10408
10586
|
ctx.inject(["settingsScope", "remote.settings"], (settingsCtx) => {
|
|
10409
10587
|
return bindSettingsDocument(settingsCtx, settingsCtx.settingsScope);
|
|
10410
10588
|
});
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10589
|
+
const shellChildren = {
|
|
10590
|
+
"settings.launcher": {
|
|
10591
|
+
kind: "single",
|
|
10592
|
+
scope: "root"
|
|
10593
|
+
},
|
|
10594
|
+
"settings.trigger": {
|
|
10595
|
+
kind: "single",
|
|
10596
|
+
scope: "root"
|
|
10597
|
+
},
|
|
10598
|
+
"settings.header": {
|
|
10599
|
+
kind: "single",
|
|
10600
|
+
scope: "root"
|
|
10601
|
+
},
|
|
10602
|
+
"settings.action": {
|
|
10603
|
+
kind: "list",
|
|
10604
|
+
scope: "root"
|
|
10605
|
+
},
|
|
10606
|
+
"settings.close": {
|
|
10607
|
+
kind: "single",
|
|
10608
|
+
scope: "root"
|
|
10609
|
+
},
|
|
10610
|
+
"settings.section": {
|
|
10611
|
+
kind: "list",
|
|
10612
|
+
scope: "root"
|
|
10613
|
+
},
|
|
10614
|
+
"settings.onboarding": {
|
|
10615
|
+
kind: "list",
|
|
10616
|
+
scope: "root"
|
|
10617
|
+
}
|
|
10618
|
+
};
|
|
10619
|
+
ctx.slots.inject("sidebar.settings", () => registerAfterOfficialWave(ctx.slots, "sidebar.settings", officialSettingsReady, () => {
|
|
10620
|
+
const children = {};
|
|
10621
|
+
if (!officialSettingsReady()) {
|
|
10622
|
+
for (const [name, spec] of Object.entries(shellChildren)) if (!declared(name)) Object.assign(children, { [name]: spec });
|
|
10415
10623
|
}
|
|
10416
|
-
|
|
10417
|
-
const remove = ctx.slots.register({
|
|
10624
|
+
return ctx.slots.register({
|
|
10418
10625
|
name: "sidebar.settings",
|
|
10419
10626
|
priority: -1,
|
|
10420
10627
|
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
|
-
},
|
|
10628
|
+
children,
|
|
10447
10629
|
inject: () => ({
|
|
10448
10630
|
sections,
|
|
10449
10631
|
onboarding,
|
|
10450
10632
|
connectionState: connection.state,
|
|
10451
10633
|
reconnect: () => {
|
|
10452
10634
|
connection.reconnect();
|
|
10453
|
-
}
|
|
10635
|
+
},
|
|
10636
|
+
accountLauncher: accountLauncherPresence(ctx.slots),
|
|
10637
|
+
shortcuts
|
|
10454
10638
|
})
|
|
10455
10639
|
}, CodexSettingsPage);
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
|
|
10640
|
+
}));
|
|
10641
|
+
ctx.slots.inject("settings.section", () => registerAfterOfficialWave(ctx.slots, "settings.section", () => declared("settings.general.item"), () => {
|
|
10642
|
+
const children = {};
|
|
10643
|
+
if (!declared("settings.general.item")) children["settings.general.item"] = {
|
|
10644
|
+
kind: "list",
|
|
10645
|
+
scope: "root"
|
|
10459
10646
|
};
|
|
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));
|
|
10647
|
+
if (!declared("settings.general.footer")) children["settings.general.footer"] = {
|
|
10648
|
+
kind: "list",
|
|
10649
|
+
scope: "root"
|
|
10650
|
+
};
|
|
10651
|
+
return ctx.slots.register({
|
|
10652
|
+
name: "settings.section",
|
|
10653
|
+
id: "general",
|
|
10654
|
+
priority: -1,
|
|
10655
|
+
order: 0,
|
|
10656
|
+
locale: NS,
|
|
10657
|
+
label: () => t("settings.general"),
|
|
10658
|
+
children,
|
|
10659
|
+
inject: () => ({ items })
|
|
10660
|
+
}, CodexGeneralSettings);
|
|
10661
|
+
}));
|
|
10480
10662
|
}
|
|
10481
10663
|
//#endregion
|
|
10482
10664
|
//#region src/client/official-turn-navigator.ts
|
|
@@ -11207,73 +11389,101 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
11207
11389
|
workspaceShortcuts.dispose();
|
|
11208
11390
|
}, "michengai-codex-ui: workspace shortcuts");
|
|
11209
11391
|
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
|
-
}
|
|
11392
|
+
const ownSidebarChildren = {
|
|
11393
|
+
"sidebar.panellist": {
|
|
11394
|
+
kind: "list",
|
|
11395
|
+
scope: "root"
|
|
11243
11396
|
},
|
|
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
|
-
|
|
11397
|
+
[WORKSPACE_DIRECTORY_FLOW]: {
|
|
11398
|
+
kind: "single",
|
|
11399
|
+
scope: "root"
|
|
11400
|
+
},
|
|
11401
|
+
"sidebar.channels": {
|
|
11402
|
+
kind: "single",
|
|
11403
|
+
scope: "root"
|
|
11404
|
+
},
|
|
11405
|
+
"sidebar.schedule": {
|
|
11406
|
+
kind: "single",
|
|
11407
|
+
scope: "root"
|
|
11408
|
+
}
|
|
11409
|
+
};
|
|
11410
|
+
const sharedSidebarChildren = {
|
|
11411
|
+
"sidebar.workspaces": {
|
|
11412
|
+
kind: "single",
|
|
11413
|
+
scope: "root"
|
|
11414
|
+
},
|
|
11415
|
+
"sidebar.settings": {
|
|
11416
|
+
kind: "single",
|
|
11417
|
+
scope: "root"
|
|
11418
|
+
},
|
|
11419
|
+
"sidebar.footer.action": {
|
|
11420
|
+
kind: "list",
|
|
11421
|
+
scope: "root"
|
|
11422
|
+
}
|
|
11423
|
+
};
|
|
11424
|
+
const officialSidebarReady = () => ctx.slots.entries("sidebar").some((entry) => entry.component !== CodexSidebar);
|
|
11425
|
+
ctx.slots.inject("sidebar", () => registerAfterOfficialWave(ctx.slots, "sidebar", officialSidebarReady, () => {
|
|
11426
|
+
const declared = (name) => {
|
|
11427
|
+
const spec = ctx.slots.spec;
|
|
11428
|
+
return typeof spec === "function" && spec.call(ctx.slots, name) !== void 0;
|
|
11429
|
+
};
|
|
11430
|
+
const children = {};
|
|
11431
|
+
for (const [name, spec] of Object.entries({
|
|
11432
|
+
...sharedSidebarChildren,
|
|
11433
|
+
...ownSidebarChildren
|
|
11434
|
+
})) if (!declared(name)) children[name] = spec;
|
|
11435
|
+
const register = (next) => {
|
|
11436
|
+
try {
|
|
11437
|
+
return ctx.slots.register({
|
|
11438
|
+
name: "sidebar",
|
|
11439
|
+
priority: -1,
|
|
11440
|
+
registrant: "michengai-codex-ui",
|
|
11441
|
+
locale: NS,
|
|
11442
|
+
children: next,
|
|
11443
|
+
inject: () => ({
|
|
11444
|
+
newConversationDraft,
|
|
11445
|
+
navigationHistory,
|
|
11446
|
+
workspaceShortcuts,
|
|
11447
|
+
prefillNewConversation: (text) => {
|
|
11448
|
+
const id = currentSessionId(ctx.sessions.list.getSnapshot());
|
|
11449
|
+
const binding = id === void 0 ? void 0 : ctx.sessions.binding(id);
|
|
11450
|
+
return prefillNewConversation(binding === void 0 ? void 0 : ctx.conversation.input.for(binding.ctx), text);
|
|
11451
|
+
},
|
|
11452
|
+
openSession: (sessionId) => {
|
|
11453
|
+
openConversation(ctx, ctx.layout, sessionId);
|
|
11454
|
+
},
|
|
11455
|
+
startSession: (workspaceId) => {
|
|
11456
|
+
startWorkspaceSession(ctx, workspaceId);
|
|
11457
|
+
},
|
|
11458
|
+
toggleSidebar: () => {
|
|
11459
|
+
ctx.layout.toggleSidebar();
|
|
11460
|
+
},
|
|
11461
|
+
archiveSession,
|
|
11462
|
+
canDeleteSession: () => hasArchiveSessionDelete(ctx.get("remote.workspaceRegistry")),
|
|
11463
|
+
deleteSession,
|
|
11464
|
+
forkSession,
|
|
11465
|
+
moveSession,
|
|
11466
|
+
renameSession,
|
|
11467
|
+
openPath,
|
|
11468
|
+
companionSlots,
|
|
11469
|
+
globalPanels,
|
|
11470
|
+
footerActions,
|
|
11471
|
+
selectPanel: (id) => {
|
|
11472
|
+
selectGlobalPanel(ctx.layout, id);
|
|
11473
|
+
}
|
|
11474
|
+
})
|
|
11475
|
+
}, CodexSidebar);
|
|
11476
|
+
} catch (error) {
|
|
11477
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
11478
|
+
const conflict = /slot "([^"]+)" is already declared/.exec(message);
|
|
11479
|
+
if (conflict === null || next[conflict[1]] === void 0) throw error;
|
|
11480
|
+
const rest = { ...next };
|
|
11481
|
+
delete rest[conflict[1]];
|
|
11482
|
+
return register(rest);
|
|
11274
11483
|
}
|
|
11275
|
-
}
|
|
11276
|
-
|
|
11484
|
+
};
|
|
11485
|
+
return register(children);
|
|
11486
|
+
}));
|
|
11277
11487
|
ctx.slots.inject("conversation.session.header.utilities", () => ctx.slots.register({
|
|
11278
11488
|
name: "conversation.session.header.utilities",
|
|
11279
11489
|
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.30",
|
|
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",
|
|
@@ -69,7 +72,7 @@
|
|
|
69
72
|
"test": "pnpm run typecheck && vitest run && tsdown && node tests/run-assertions.mjs && pnpm run test:layout",
|
|
70
73
|
"test:host": "node scripts/verify-settings-exit.mjs",
|
|
71
74
|
"test:settings-backdrop": "node scripts/verify-settings-backdrop.mjs",
|
|
72
|
-
"test:layout": "node scripts/verify-workspace-drop-layout.mjs --run && node scripts/verify-sidebar-transition.mjs && node scripts/verify-sidebar-expand-control.mjs && node scripts/verify-composer-style.mjs && node scripts/verify-new-conversation.mjs && node scripts/verify-composer-tools.mjs && node scripts/verify-hero-width.mjs && node scripts/verify-settings-backdrop.mjs && node scripts/verify-upstream-style-regressions.mjs",
|
|
75
|
+
"test:layout": "node scripts/verify-workspace-drop-layout.mjs --run && node scripts/verify-sidebar-transition.mjs && node scripts/verify-sidebar-expand-control.mjs && node scripts/verify-composer-style.mjs && node scripts/verify-new-conversation.mjs && node scripts/verify-composer-tools.mjs && node scripts/verify-hero-width.mjs && node scripts/verify-settings-backdrop.mjs && node scripts/verify-settings-geometry.mjs && node scripts/verify-upstream-style-regressions.mjs",
|
|
73
76
|
"test:compat": "node scripts/run-compat-host.mjs"
|
|
74
77
|
},
|
|
75
78
|
"peerDependencies": {
|