@michengai/dsh-codex-ui 0.2.78 → 0.2.80
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 +89 -0
- package/CHANGELOG.zh-CN.md +89 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/client.js +112 -100
- package/package.json +3 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
[简体中文](CHANGELOG.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
This changelog records the five most recent published releases of DSH Codex UI and its one-click Suite. Earlier changes remain available in the [Git history](https://github.com/MichengAI/dsh-codex-ui/commits/main).
|
|
6
|
+
|
|
7
|
+
## 0.2.80 — 2026-08-23
|
|
8
|
+
|
|
9
|
+
Companion release: `@michengai/dsh-codex-suite@0.1.12`.
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
- Added bilingual changelogs covering the five most recent UI releases.
|
|
14
|
+
- Linked the release history from both README editions and included it in the npm package.
|
|
15
|
+
|
|
16
|
+
### Suite 0.1.12
|
|
17
|
+
|
|
18
|
+
- Refreshed every bundled plugin to the changelog release published on 2026-08-23.
|
|
19
|
+
- Pinned Agency Agents `0.1.21`, Archive Manager `0.1.13`, Automation `0.1.14`, IM Connect `0.1.23`, and Skills Manager `0.1.24`.
|
|
20
|
+
|
|
21
|
+
Published packages: [`@michengai/dsh-codex-ui@0.2.80`](https://www.npmjs.com/package/@michengai/dsh-codex-ui/v/0.2.80) and [`@michengai/dsh-codex-suite@0.1.12`](https://www.npmjs.com/package/@michengai/dsh-codex-suite/v/0.1.12).
|
|
22
|
+
|
|
23
|
+
## 0.2.79 — 2026-08-23
|
|
24
|
+
|
|
25
|
+
Companion release: `@michengai/dsh-codex-suite@0.1.11`.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Removed the delayed expanded state that could stretch compact navigation icons across an already-wide sidebar.
|
|
30
|
+
- Made expansion reveal the fixed-width wide layout immediately while the host column clips it during motion.
|
|
31
|
+
- Made collapse fade the wide layout for 140 ms before switching to the compact rail.
|
|
32
|
+
- Anchored the 56 px compact rail to the left so its icons no longer drift while the host column changes width.
|
|
33
|
+
|
|
34
|
+
### Performance and accessibility
|
|
35
|
+
|
|
36
|
+
- Kept the workspace tree at its target width during the host transition, avoiding per-frame list reflow or remounting.
|
|
37
|
+
- Preserved the reduced-motion path for users who disable interface motion.
|
|
38
|
+
- Added regression coverage for both collapse and re-expansion without workspace-tree rerenders.
|
|
39
|
+
|
|
40
|
+
### Suite 0.1.11
|
|
41
|
+
|
|
42
|
+
- Pinned `@michengai/dsh-codex-ui` to `0.2.79`.
|
|
43
|
+
- Updated `@michengai/dsh-im-connect` to `0.1.22`.
|
|
44
|
+
|
|
45
|
+
Release commit: [`e8d2f4b`](https://github.com/MichengAI/dsh-codex-ui/commit/e8d2f4b).
|
|
46
|
+
|
|
47
|
+
## 0.2.78 — 2026-08-23
|
|
48
|
+
|
|
49
|
+
Companion releases: `@michengai/dsh-codex-suite@0.1.9` and dependency-only refresh `0.1.10`.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- Restored the host sidebar-width transition after the performance hardening in `0.2.77`.
|
|
54
|
+
- Added compositor-only reveal motion for expanded and compact shells, search, and workspace sections.
|
|
55
|
+
- Kept the large workspace tree mounted while switching sidebar modes.
|
|
56
|
+
|
|
57
|
+
### Suite 0.1.9–0.1.10
|
|
58
|
+
|
|
59
|
+
- Refreshed all Suite member pins.
|
|
60
|
+
- Suite `0.1.10` advanced Automation to `0.1.13` and IM Connect to `0.1.20` without changing the UI package version.
|
|
61
|
+
|
|
62
|
+
Release commits: [`b7980e3`](https://github.com/MichengAI/dsh-codex-ui/commit/b7980e3), [`cc71abf`](https://github.com/MichengAI/dsh-codex-ui/commit/cc71abf).
|
|
63
|
+
|
|
64
|
+
## 0.2.77 — 2026-08-23
|
|
65
|
+
|
|
66
|
+
Companion release: `@michengai/dsh-codex-suite@0.1.8`.
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- Persisted pinned workspaces in the DSH Host profile so they survive Desktop tray reloads and dynamic-port changes.
|
|
71
|
+
- Added safe client hydration, legacy local-storage migration, serialized writes, and protection against clearing pins from incomplete startup data.
|
|
72
|
+
|
|
73
|
+
### Fixed
|
|
74
|
+
|
|
75
|
+
- Improved workspace and session drag-and-drop reliability and drop-target handling.
|
|
76
|
+
- Isolated search state and deferred filtering so typing does not rerender the workspace tree.
|
|
77
|
+
- Kept the workspace slot mounted across compact and expanded sidebar modes.
|
|
78
|
+
|
|
79
|
+
Release commit: [`b96d5a8`](https://github.com/MichengAI/dsh-codex-ui/commit/b96d5a8).
|
|
80
|
+
|
|
81
|
+
## 0.2.76 — 2026-08-23
|
|
82
|
+
|
|
83
|
+
Companion release: `@michengai/dsh-codex-suite@0.1.7`.
|
|
84
|
+
|
|
85
|
+
### Fixed
|
|
86
|
+
|
|
87
|
+
- Removed the duplicate drop indicator that could appear while reordering pinned workspaces.
|
|
88
|
+
|
|
89
|
+
Release commit: [`e2a38d1`](https://github.com/MichengAI/dsh-codex-ui/commit/e2a38d1).
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
[English](CHANGELOG.md)
|
|
4
|
+
|
|
5
|
+
本日志记录 DSH Codex UI 及其一键 Suite 最近发布的五个版本;更早的变更可查看 [Git 提交历史](https://github.com/MichengAI/dsh-codex-ui/commits/main)。
|
|
6
|
+
|
|
7
|
+
## 0.2.80 — 2026-08-23
|
|
8
|
+
|
|
9
|
+
配套版本:`@michengai/dsh-codex-suite@0.1.12`。
|
|
10
|
+
|
|
11
|
+
### 文档
|
|
12
|
+
|
|
13
|
+
- 新增中英文更新日志,展示最近五个 UI 发布版本。
|
|
14
|
+
- 在中英文 README 中加入更新日志入口,并将日志纳入 npm 包。
|
|
15
|
+
|
|
16
|
+
### Suite 0.1.12
|
|
17
|
+
|
|
18
|
+
- 将全部聚合插件刷新到 2026-08-23 发布的更新日志版本。
|
|
19
|
+
- 固定 Agency Agents `0.1.21`、Archive Manager `0.1.13`、Automation `0.1.14`、IM Connect `0.1.23` 和 Skills Manager `0.1.24`。
|
|
20
|
+
|
|
21
|
+
发布包:[`@michengai/dsh-codex-ui@0.2.80`](https://www.npmjs.com/package/@michengai/dsh-codex-ui/v/0.2.80) 与 [`@michengai/dsh-codex-suite@0.1.12`](https://www.npmjs.com/package/@michengai/dsh-codex-suite/v/0.1.12)。
|
|
22
|
+
|
|
23
|
+
## 0.2.79 — 2026-08-23
|
|
24
|
+
|
|
25
|
+
配套版本:`@michengai/dsh-codex-suite@0.1.11`。
|
|
26
|
+
|
|
27
|
+
### 修复
|
|
28
|
+
|
|
29
|
+
- 移除展开阶段的额外等待,解决侧栏已经变宽、窄轨图标仍居中显示的问题。
|
|
30
|
+
- 展开时立即呈现固定宽度的宽态内容,由宿主侧栏列在动画过程中负责裁切。
|
|
31
|
+
- 收缩时先用 140ms 淡出宽态内容,再切换到窄轨。
|
|
32
|
+
- 将 56px 窄轨固定在左侧,避免图标跟随宿主列宽变化而横向漂移。
|
|
33
|
+
|
|
34
|
+
### 性能与无障碍
|
|
35
|
+
|
|
36
|
+
- 宿主动画期间保持工作区树的目标宽度,避免长列表逐帧重排或重新挂载。
|
|
37
|
+
- 保留减少动态效果模式,尊重用户的 `prefers-reduced-motion` 设置。
|
|
38
|
+
- 增加收缩和重新展开的双向回归测试,并验证工作区树不会额外渲染。
|
|
39
|
+
|
|
40
|
+
### Suite 0.1.11
|
|
41
|
+
|
|
42
|
+
- 将 `@michengai/dsh-codex-ui` 固定为 `0.2.79`。
|
|
43
|
+
- 将 `@michengai/dsh-im-connect` 更新为 `0.1.22`。
|
|
44
|
+
|
|
45
|
+
发布提交:[`e8d2f4b`](https://github.com/MichengAI/dsh-codex-ui/commit/e8d2f4b)。
|
|
46
|
+
|
|
47
|
+
## 0.2.78 — 2026-08-23
|
|
48
|
+
|
|
49
|
+
配套版本:`@michengai/dsh-codex-suite@0.1.9`,以及仅刷新依赖的 `0.1.10`。
|
|
50
|
+
|
|
51
|
+
### 调整
|
|
52
|
+
|
|
53
|
+
- 在 `0.2.77` 的性能优化基础上恢复宿主侧栏宽度动画。
|
|
54
|
+
- 为展开态、窄轨态、搜索弹窗和工作区分区增加仅使用合成层的轻量显现动画。
|
|
55
|
+
- 侧栏模式切换时继续保留大型工作区树实例。
|
|
56
|
+
|
|
57
|
+
### Suite 0.1.9–0.1.10
|
|
58
|
+
|
|
59
|
+
- 刷新 Suite 全部成员的固定版本。
|
|
60
|
+
- Suite `0.1.10` 将 Automation 更新到 `0.1.13`、IM Connect 更新到 `0.1.20`,UI 包版本保持不变。
|
|
61
|
+
|
|
62
|
+
发布提交:[`b7980e3`](https://github.com/MichengAI/dsh-codex-ui/commit/b7980e3)、[`cc71abf`](https://github.com/MichengAI/dsh-codex-ui/commit/cc71abf)。
|
|
63
|
+
|
|
64
|
+
## 0.2.77 — 2026-08-23
|
|
65
|
+
|
|
66
|
+
配套版本:`@michengai/dsh-codex-suite@0.1.8`。
|
|
67
|
+
|
|
68
|
+
### 新增
|
|
69
|
+
|
|
70
|
+
- 将置顶工作区持久化到 DSH Host Profile,使其在 Desktop 托盘重载和动态端口变化后仍可恢复。
|
|
71
|
+
- 增加安全的客户端水合、旧 localStorage 数据迁移、串行写入,以及启动数据不完整时的误清理保护。
|
|
72
|
+
|
|
73
|
+
### 修复
|
|
74
|
+
|
|
75
|
+
- 提升工作区和会话拖放的可靠性,修正落点判断。
|
|
76
|
+
- 隔离搜索状态并延迟过滤,避免输入搜索词时重新渲染工作区树。
|
|
77
|
+
- 在窄轨态和展开态之间切换时保持工作区插槽挂载。
|
|
78
|
+
|
|
79
|
+
发布提交:[`b96d5a8`](https://github.com/MichengAI/dsh-codex-ui/commit/b96d5a8)。
|
|
80
|
+
|
|
81
|
+
## 0.2.76 — 2026-08-23
|
|
82
|
+
|
|
83
|
+
配套版本:`@michengai/dsh-codex-suite@0.1.7`。
|
|
84
|
+
|
|
85
|
+
### 修复
|
|
86
|
+
|
|
87
|
+
- 移除置顶工作区排序时可能重复出现的落点指示线。
|
|
88
|
+
|
|
89
|
+
发布提交:[`e2a38d1`](https://github.com/MichengAI/dsh-codex-ui/commit/e2a38d1)。
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**Rebuild the DeepSeek Harness Web sidebar, workspace tree, search, and turn navigation in a Codex-style layout**
|
|
10
10
|
|
|
11
|
-
[简体中文](README.zh-CN.md) · [Apache-2.0](LICENSE)
|
|
11
|
+
[简体中文](README.zh-CN.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](https://www.npmjs.com/package/@michengai/dsh-codex-ui)
|
package/README.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**为 DeepSeek Harness Web 重构 Codex 风格侧栏、工作区会话树、全局搜索和轮次导航**
|
|
10
10
|
|
|
11
|
-
[English](README.md) · [Apache-2.0](LICENSE)
|
|
11
|
+
[English](README.md) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](https://www.npmjs.com/package/@michengai/dsh-codex-ui)
|
package/dist/client.js
CHANGED
|
@@ -3107,24 +3107,112 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3107
3107
|
const handle = target.closest("[data-side=\"sidebar\"]");
|
|
3108
3108
|
return handle !== null && String(handle.className).includes("handle");
|
|
3109
3109
|
}
|
|
3110
|
+
/** 解析宿主 AppFrame 的 grid-template-columns。 */
|
|
3111
|
+
function parseSidebarGrid(value) {
|
|
3112
|
+
const match = /^(\d+(?:\.\d+)?)px\s+(minmax\(0,\s*1fr\))\s+(\d+(?:\.\d+)?)px$/.exec(value.trim());
|
|
3113
|
+
if (match === null) return void 0;
|
|
3114
|
+
return {
|
|
3115
|
+
sidebar: Number(match[1]),
|
|
3116
|
+
middle: match[2],
|
|
3117
|
+
details: Number(match[3])
|
|
3118
|
+
};
|
|
3119
|
+
}
|
|
3120
|
+
/** 折叠列保持原值;默认展开列收到 Codex 宽度,用户再拉宽时只减去默认多出来的部分。 */
|
|
3121
|
+
function slimedSidebarWidth(hostWidth, collapsed) {
|
|
3122
|
+
if (collapsed || hostWidth <= 80) return hostWidth;
|
|
3123
|
+
if (hostWidth <= 280) return 240;
|
|
3124
|
+
return hostWidth - 40;
|
|
3125
|
+
}
|
|
3126
|
+
function slimedGridTemplate(tracks, collapsed) {
|
|
3127
|
+
return `${slimedSidebarWidth(tracks.sidebar, collapsed)}px ${tracks.middle} ${tracks.details}px`;
|
|
3128
|
+
}
|
|
3129
|
+
function findSidebarFrame(root) {
|
|
3130
|
+
const marked = root.querySelector("[data-sidebar-collapsed]");
|
|
3131
|
+
if (marked !== null) return marked;
|
|
3132
|
+
for (const node of root.querySelectorAll("div")) if (parseSidebarGrid(node.style.gridTemplateColumns) !== void 0) return node;
|
|
3133
|
+
}
|
|
3134
|
+
function applySlimSidebar(frame) {
|
|
3135
|
+
if (frame.hasAttribute("data-dragging")) return false;
|
|
3136
|
+
const tracks = parseSidebarGrid(frame.style.gridTemplateColumns);
|
|
3137
|
+
if (tracks === void 0) return false;
|
|
3138
|
+
const collapsed = frame.hasAttribute("data-sidebar-collapsed");
|
|
3139
|
+
const next = slimedGridTemplate(tracks, collapsed);
|
|
3140
|
+
if (frame.style.gridTemplateColumns === next) return false;
|
|
3141
|
+
frame.style.gridTemplateColumns = next;
|
|
3142
|
+
const handle = frame.querySelector("[data-side=\"sidebar\"]");
|
|
3143
|
+
if (handle !== null && !collapsed) handle.style.left = `${slimedSidebarWidth(tracks.sidebar, collapsed)}px`;
|
|
3144
|
+
return true;
|
|
3145
|
+
}
|
|
3146
|
+
function observeSlimSidebar() {
|
|
3147
|
+
if (typeof document === "undefined" || document.body === null) return () => {};
|
|
3148
|
+
let applying = false;
|
|
3149
|
+
let frame;
|
|
3150
|
+
let pending;
|
|
3151
|
+
let frameObserver;
|
|
3152
|
+
const watchFrame = (next) => {
|
|
3153
|
+
if (frame === next) return;
|
|
3154
|
+
frameObserver?.disconnect();
|
|
3155
|
+
frame = next;
|
|
3156
|
+
if (frame === void 0) return;
|
|
3157
|
+
frameObserver = new MutationObserver(schedule);
|
|
3158
|
+
frameObserver.observe(frame, {
|
|
3159
|
+
attributes: true,
|
|
3160
|
+
attributeFilter: [
|
|
3161
|
+
"style",
|
|
3162
|
+
"data-sidebar-collapsed",
|
|
3163
|
+
"data-dragging"
|
|
3164
|
+
]
|
|
3165
|
+
});
|
|
3166
|
+
};
|
|
3167
|
+
const apply = () => {
|
|
3168
|
+
if (applying) return;
|
|
3169
|
+
applying = true;
|
|
3170
|
+
try {
|
|
3171
|
+
if (frame === void 0 || !frame.isConnected) watchFrame(findSidebarFrame(document));
|
|
3172
|
+
if (frame !== void 0) applySlimSidebar(frame);
|
|
3173
|
+
} finally {
|
|
3174
|
+
applying = false;
|
|
3175
|
+
}
|
|
3176
|
+
};
|
|
3177
|
+
const schedule = () => {
|
|
3178
|
+
if (pending !== void 0) return;
|
|
3179
|
+
pending = window.requestAnimationFrame(() => {
|
|
3180
|
+
pending = void 0;
|
|
3181
|
+
apply();
|
|
3182
|
+
});
|
|
3183
|
+
};
|
|
3184
|
+
apply();
|
|
3185
|
+
const observer = new MutationObserver(() => {
|
|
3186
|
+
if (frame === void 0 || !frame.isConnected) schedule();
|
|
3187
|
+
});
|
|
3188
|
+
observer.observe(document.body, {
|
|
3189
|
+
childList: true,
|
|
3190
|
+
subtree: true
|
|
3191
|
+
});
|
|
3192
|
+
return () => {
|
|
3193
|
+
observer.disconnect();
|
|
3194
|
+
frameObserver?.disconnect();
|
|
3195
|
+
if (pending !== void 0) window.cancelAnimationFrame(pending);
|
|
3196
|
+
};
|
|
3197
|
+
}
|
|
3110
3198
|
//#endregion
|
|
3111
3199
|
//#region src/client/CodexSidebar.tsx
|
|
3112
3200
|
const subscribeEmptyCompanionTabs = () => () => {};
|
|
3113
3201
|
const getEmptyCompanionTabs = () => EMPTY_COMPANION_TABS;
|
|
3114
|
-
const
|
|
3202
|
+
const SIDEBAR_COLLAPSE_SETTLE_MS = 140;
|
|
3115
3203
|
const stylesheet$3 = `
|
|
3116
|
-
.dcu-root{--dcu-font:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei UI",sans-serif;--dcu-sidebar-primary:#393d3e;--dcu-sidebar-secondary:#676b6c;--dcu-sidebar-tertiary:#9a9f9f;--dcu-sidebar-navigation:#4e5253;--dcu-sidebar-icon:#4e5253;--dcu-sidebar-hover:#dfe8e5;--dcu-sidebar-border:rgba(37,46,41,.10);--dcu-tip-bg:#ffffff;--dcu-tip-shadow:0 10px 32px rgba(31,39,36,.22);height:100%;min-width:0;box-sizing:border-box;display:flex;flex-direction:column;background:#eef7f5;color:var(--dcu-sidebar-primary);font:14px/20px var(--dcu-font)}body[data-ds-dark-theme] .dcu-root{background:#1d2120;--dcu-sidebar-primary:#b9bab9;--dcu-sidebar-secondary:#909191;--dcu-sidebar-tertiary:#666867;--dcu-sidebar-navigation:#b9bab9;--dcu-sidebar-icon:#afafaf;--dcu-sidebar-hover:#303432;--dcu-sidebar-border:rgba(255,255,255,.08);--dcu-tip-bg:#2a2e2c;--dcu-tip-shadow:0 10px 30px rgba(0,0,0,.28)}
|
|
3117
|
-
.dcu-expanded-shell{display:flex;min-height:0;flex:1;flex-direction:column;animation:dcu-sidebar-expanded-in
|
|
3204
|
+
.dcu-root{--dcu-font:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei UI",sans-serif;--dcu-sidebar-wide-width:240px;--dcu-sidebar-primary:#393d3e;--dcu-sidebar-secondary:#676b6c;--dcu-sidebar-tertiary:#9a9f9f;--dcu-sidebar-navigation:#4e5253;--dcu-sidebar-icon:#4e5253;--dcu-sidebar-hover:#dfe8e5;--dcu-sidebar-border:rgba(37,46,41,.10);--dcu-tip-bg:#ffffff;--dcu-tip-shadow:0 10px 32px rgba(31,39,36,.22);height:100%;min-width:0;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;background:#eef7f5;color:var(--dcu-sidebar-primary);font:14px/20px var(--dcu-font)}body[data-ds-dark-theme] .dcu-root{background:#1d2120;--dcu-sidebar-primary:#b9bab9;--dcu-sidebar-secondary:#909191;--dcu-sidebar-tertiary:#666867;--dcu-sidebar-navigation:#b9bab9;--dcu-sidebar-icon:#afafaf;--dcu-sidebar-hover:#303432;--dcu-sidebar-border:rgba(255,255,255,.08);--dcu-tip-bg:#2a2e2c;--dcu-tip-shadow:0 10px 30px rgba(0,0,0,.28)}
|
|
3205
|
+
.dcu-expanded-shell{display:flex;width:var(--dcu-sidebar-wide-width);min-height:0;flex:1 0 auto;flex-direction:column;transform-origin:left center;transition:opacity 140ms ease-out,transform 180ms cubic-bezier(.16,1,.3,1);animation:dcu-sidebar-expanded-in 180ms cubic-bezier(.16,1,.3,1)}.dcu-compact-shell{display:none;width:56px}.dcu-root.dcu-collapsing .dcu-expanded-shell{opacity:0;transform:translateX(-6px);pointer-events:none}.dcu-root.dcu-compact .dcu-expanded-shell{display:none}.dcu-root.dcu-compact .dcu-compact-shell{display:flex;min-height:0;flex:1;flex-direction:column;align-items:center;animation:dcu-sidebar-compact-in 140ms ease-out}@keyframes dcu-sidebar-expanded-in{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:none}}@keyframes dcu-sidebar-compact-in{from{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:none}}
|
|
3118
3206
|
.dcu-root *{box-sizing:border-box}.dcu-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;height:60px;padding:8px 8px 8px 12px}.dcu-brand{border:0;background:transparent;color:inherit;padding:0;display:flex;align-items:center;min-width:0;overflow:hidden}.dcu-brand svg{display:block;width:auto;max-width:100%;height:24px;min-width:0}.dcu-head-actions{display:grid;grid-auto-flow:column;grid-auto-columns:28px;align-items:center;column-gap:8px;height:28px}
|
|
3119
3207
|
.dcu-icon,.dcu-menu button,.dcu-footer-link{appearance:none;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}.dcu-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:8px;color:var(--dcu-sidebar-icon)}.dcu-head .dcu-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:0;padding:0;border-radius:50%;line-height:0}.dcu-head .dcu-icon svg{display:block;width:16px;height:16px}
|
|
3120
3208
|
.dcu-icon:hover,.dcu-menu button:hover:not(:disabled),.dcu-footer-link:hover{background:var(--dcu-sidebar-hover);color:var(--dcu-sidebar-primary)}
|
|
3121
3209
|
.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}
|
|
3122
3210
|
.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)}
|
|
3123
3211
|
.dcu-extension-items{display:grid;gap:1px;margin:1px 0 4px 28px}.dcu-extension-items button{min-height:32px;color:var(--dcu-sidebar-secondary);font-size:13px;font-weight:400}
|
|
3124
|
-
.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(--dcu-font);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-foot{display:grid;gap:4px;padding:8px 6px 12px;border-top:1px solid var(--dcu-sidebar-border)}.dcu-footer-actions:empty,.dcu-settings-seat:empty{display:none}.dcu-settings-seat>button{width:100%;min-height:36px;padding-left:4px!important;color:var(--dcu-sidebar-navigation);font:14px/20px var(--dcu-font);font-weight:400}.dcu-compact{width:100%;align-items:
|
|
3212
|
+
.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(--dcu-font);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-foot{display:grid;width:var(--dcu-sidebar-wide-width);gap:4px;padding:8px 6px 12px;border-top:1px solid var(--dcu-sidebar-border);transition:opacity 120ms ease-out,transform 160ms 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>button{width:100%;min-height:36px;padding-left:4px!important;color:var(--dcu-sidebar-navigation);font:14px/20px var(--dcu-font);font-weight:400}.dcu-compact{width:100%;align-items:flex-start;overflow:hidden;padding:10px 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>button{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>button 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}
|
|
3125
3213
|
.dcu-dependency-notice{margin:0 10px 8px;border:1px solid var(--dcu-sidebar-border);border-radius:8px;padding:8px;color:var(--dcu-sidebar-secondary);font-size:12px;line-height:18px}
|
|
3126
3214
|
[role="dialog"][aria-labelledby]{width:min(1000px,calc(100vw - 48px));max-width:calc(100vw - 48px);height:min(800px,calc(100vh - 48px))}
|
|
3127
|
-
.dcu-search-scrim{position:fixed;z-index:10020;inset:0;display:flex;justify-content:center;align-items:flex-start;padding:72px 20px;background:color-mix(in srgb,#000 48%,transparent);animation:dcu-search-scrim-in 140ms ease-out}.dcu-search-dialog{width:min(560px,100%);max-height:min(640px,calc(100vh - 120px));overflow:auto;border:1px solid var(--dcu-sidebar-border);border-radius:16px;padding:10px;background:var(--dsw-specific-menu);box-shadow:var(--dsw-shadow-lv4);animation:dcu-search-dialog-in 180ms cubic-bezier(.16,1,.3,1)}@keyframes dcu-search-scrim-in{from{opacity:0}to{opacity:1}}@keyframes dcu-search-dialog-in{from{opacity:0;transform:translateY(-6px) scale(.985)}to{opacity:1;transform:none}}.dcu-search-input{margin-bottom:8px}.dcu-search-section{padding:6px 0}.dcu-search-title{padding:0 8px 4px;color:var(--dcu-sidebar-tertiary);font-size:12px;font-weight:600}.dcu-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:34px;border:0;border-radius:8px;padding:6px 8px;background:transparent;color:var(--dcu-sidebar-primary);font:inherit;text-align:left;cursor:pointer}.dcu-search-row:hover,.dcu-search-row[data-active=true]{background:var(--dcu-sidebar-hover)}.dcu-search-main{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dcu-search-detail{max-width:160px;overflow:hidden;color:var(--dcu-sidebar-tertiary);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.dcu-search-empty{padding:18px 8px;color:var(--dcu-sidebar-tertiary);font-size:13px}@media (prefers-reduced-motion:reduce){.dcu-expanded-shell,.dcu-root.dcu-compact .dcu-compact-shell,.dcu-search-scrim,.dcu-search-dialog{animation:none}}
|
|
3215
|
+
.dcu-search-scrim{position:fixed;z-index:10020;inset:0;display:flex;justify-content:center;align-items:flex-start;padding:72px 20px;background:color-mix(in srgb,#000 48%,transparent);animation:dcu-search-scrim-in 140ms ease-out}.dcu-search-dialog{width:min(560px,100%);max-height:min(640px,calc(100vh - 120px));overflow:auto;border:1px solid var(--dcu-sidebar-border);border-radius:16px;padding:10px;background:var(--dsw-specific-menu);box-shadow:var(--dsw-shadow-lv4);animation:dcu-search-dialog-in 180ms cubic-bezier(.16,1,.3,1)}@keyframes dcu-search-scrim-in{from{opacity:0}to{opacity:1}}@keyframes dcu-search-dialog-in{from{opacity:0;transform:translateY(-6px) scale(.985)}to{opacity:1;transform:none}}.dcu-search-input{margin-bottom:8px}.dcu-search-section{padding:6px 0}.dcu-search-title{padding:0 8px 4px;color:var(--dcu-sidebar-tertiary);font-size:12px;font-weight:600}.dcu-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;min-height:34px;border:0;border-radius:8px;padding:6px 8px;background:transparent;color:var(--dcu-sidebar-primary);font:inherit;text-align:left;cursor:pointer}.dcu-search-row:hover,.dcu-search-row[data-active=true]{background:var(--dcu-sidebar-hover)}.dcu-search-main{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dcu-search-detail{max-width:160px;overflow:hidden;color:var(--dcu-sidebar-tertiary);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.dcu-search-empty{padding:18px 8px;color:var(--dcu-sidebar-tertiary);font-size:13px}@media (prefers-reduced-motion:reduce){.dcu-expanded-shell,.dcu-root.dcu-compact .dcu-compact-shell,.dcu-foot,.dcu-search-scrim,.dcu-search-dialog{animation:none;transition:none}}
|
|
3128
3216
|
[data-conversation-scroll]{--dsh-chat-content-width:800px;--dsh-composer-card-max-width:calc(var(--dsh-chat-content-width) + 32px);--dsh-composer-side-clearance:24px}[data-conversation-scroll] [data-chat-flow]{gap:20px}[data-conversation-scroll] [data-composer-card]{min-height:96px;padding-top:10px;border-radius:16px;box-shadow:var(--dsw-shadow-lv3);transition:border-color 180ms ease,box-shadow 180ms ease}[data-conversation-scroll] [data-composer-card]:focus-within{border-color:var(--dsw-alias-button-info-fill);box-shadow:0 0 0 2px var(--dsw-static-deepseek-50),var(--dsw-shadow-lv3)}[data-conversation-scroll] [data-input-mirror]{min-height:44px}@media (prefers-reduced-motion:reduce){[data-conversation-scroll] [data-composer-card]{transition:none}}
|
|
3129
3217
|
`;
|
|
3130
3218
|
function MenuIcon({ children }) {
|
|
@@ -3425,6 +3513,9 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3425
3513
|
function CodexSidebar({ collapsed, width, openSession, startSession, toggleSidebar, archiveSession, deleteSession, forkSession, renameSession, openPath, companionSlots, renderSlot, t, useSessions, useWorkspaces }) {
|
|
3426
3514
|
const compact = collapsed || width < 80;
|
|
3427
3515
|
const [visualCompact, setVisualCompact] = (0, react.useState)(compact);
|
|
3516
|
+
const [collapsing, setCollapsing] = (0, react.useState)(false);
|
|
3517
|
+
const lastWideWidth = (0, react.useRef)(width >= 80 ? width : 240);
|
|
3518
|
+
if (!compact) lastWideWidth.current = width;
|
|
3428
3519
|
const settingsSeat = (0, react.useRef)(null);
|
|
3429
3520
|
const search = (0, react.useRef)(null);
|
|
3430
3521
|
const toggleSidebarRef = (0, react.useRef)(toggleSidebar);
|
|
@@ -3493,18 +3584,25 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3493
3584
|
};
|
|
3494
3585
|
}, [toggleSidebar]);
|
|
3495
3586
|
(0, react.useLayoutEffect)(() => {
|
|
3496
|
-
if (compact) {
|
|
3497
|
-
|
|
3587
|
+
if (!compact) {
|
|
3588
|
+
setCollapsing(false);
|
|
3589
|
+
setVisualCompact(false);
|
|
3590
|
+
return;
|
|
3591
|
+
}
|
|
3592
|
+
if (visualCompact) {
|
|
3593
|
+
setCollapsing(false);
|
|
3498
3594
|
return;
|
|
3499
3595
|
}
|
|
3500
|
-
if (!visualCompact) return;
|
|
3501
3596
|
if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true) {
|
|
3502
|
-
|
|
3597
|
+
setCollapsing(false);
|
|
3598
|
+
setVisualCompact(true);
|
|
3503
3599
|
return;
|
|
3504
3600
|
}
|
|
3601
|
+
setCollapsing(true);
|
|
3505
3602
|
const timer = window.setTimeout(() => {
|
|
3506
|
-
setVisualCompact(
|
|
3507
|
-
|
|
3603
|
+
setVisualCompact(true);
|
|
3604
|
+
setCollapsing(false);
|
|
3605
|
+
}, SIDEBAR_COLLAPSE_SETTLE_MS);
|
|
3508
3606
|
return () => {
|
|
3509
3607
|
window.clearTimeout(timer);
|
|
3510
3608
|
};
|
|
@@ -3513,8 +3611,10 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3513
3611
|
wide: true,
|
|
3514
3612
|
expandSidebar
|
|
3515
3613
|
}), [expandSidebar, renderSlot]);
|
|
3614
|
+
const sidebarStyle = { "--dcu-sidebar-wide-width": `${lastWideWidth.current}px` };
|
|
3516
3615
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
|
|
3517
|
-
className: `dcu-root${visualCompact ? " dcu-compact" : ""}`,
|
|
3616
|
+
className: `dcu-root${visualCompact ? " dcu-compact" : ""}${collapsing ? " dcu-collapsing" : ""}`,
|
|
3617
|
+
style: sidebarStyle,
|
|
3518
3618
|
"aria-label": t("sidebar.label"),
|
|
3519
3619
|
children: [
|
|
3520
3620
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: stylesheet$3 }),
|
|
@@ -4407,94 +4507,6 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4407
4507
|
if (frame !== void 0) window.cancelAnimationFrame(frame);
|
|
4408
4508
|
};
|
|
4409
4509
|
}
|
|
4410
|
-
/** 解析宿主 AppFrame 的 grid-template-columns。 */
|
|
4411
|
-
function parseSidebarGrid(value) {
|
|
4412
|
-
const match = /^(\d+(?:\.\d+)?)px\s+(minmax\(0,\s*1fr\))\s+(\d+(?:\.\d+)?)px$/.exec(value.trim());
|
|
4413
|
-
if (match === null) return void 0;
|
|
4414
|
-
return {
|
|
4415
|
-
sidebar: Number(match[1]),
|
|
4416
|
-
middle: match[2],
|
|
4417
|
-
details: Number(match[3])
|
|
4418
|
-
};
|
|
4419
|
-
}
|
|
4420
|
-
/** 折叠列保持原值;默认展开列收到 Codex 宽度,用户再拉宽时只减去默认多出来的部分。 */
|
|
4421
|
-
function slimedSidebarWidth(hostWidth, collapsed) {
|
|
4422
|
-
if (collapsed || hostWidth <= 80) return hostWidth;
|
|
4423
|
-
if (hostWidth <= 280) return 240;
|
|
4424
|
-
return hostWidth - 40;
|
|
4425
|
-
}
|
|
4426
|
-
function slimedGridTemplate(tracks, collapsed) {
|
|
4427
|
-
return `${slimedSidebarWidth(tracks.sidebar, collapsed)}px ${tracks.middle} ${tracks.details}px`;
|
|
4428
|
-
}
|
|
4429
|
-
function findSidebarFrame(root) {
|
|
4430
|
-
const marked = root.querySelector("[data-sidebar-collapsed]");
|
|
4431
|
-
if (marked !== null) return marked;
|
|
4432
|
-
for (const node of root.querySelectorAll("div")) if (parseSidebarGrid(node.style.gridTemplateColumns) !== void 0) return node;
|
|
4433
|
-
}
|
|
4434
|
-
function applySlimSidebar(frame) {
|
|
4435
|
-
if (frame.hasAttribute("data-dragging")) return false;
|
|
4436
|
-
const tracks = parseSidebarGrid(frame.style.gridTemplateColumns);
|
|
4437
|
-
if (tracks === void 0) return false;
|
|
4438
|
-
const collapsed = frame.hasAttribute("data-sidebar-collapsed");
|
|
4439
|
-
const next = slimedGridTemplate(tracks, collapsed);
|
|
4440
|
-
if (frame.style.gridTemplateColumns === next) return false;
|
|
4441
|
-
frame.style.gridTemplateColumns = next;
|
|
4442
|
-
const handle = frame.querySelector("[data-side=\"sidebar\"]");
|
|
4443
|
-
if (handle !== null && !collapsed) handle.style.left = `${slimedSidebarWidth(tracks.sidebar, collapsed)}px`;
|
|
4444
|
-
return true;
|
|
4445
|
-
}
|
|
4446
|
-
function observeSlimSidebar() {
|
|
4447
|
-
if (typeof document === "undefined" || document.body === null) return () => {};
|
|
4448
|
-
let applying = false;
|
|
4449
|
-
let frame;
|
|
4450
|
-
let pending;
|
|
4451
|
-
let frameObserver;
|
|
4452
|
-
const watchFrame = (next) => {
|
|
4453
|
-
if (frame === next) return;
|
|
4454
|
-
frameObserver?.disconnect();
|
|
4455
|
-
frame = next;
|
|
4456
|
-
if (frame === void 0) return;
|
|
4457
|
-
frameObserver = new MutationObserver(schedule);
|
|
4458
|
-
frameObserver.observe(frame, {
|
|
4459
|
-
attributes: true,
|
|
4460
|
-
attributeFilter: [
|
|
4461
|
-
"style",
|
|
4462
|
-
"data-sidebar-collapsed",
|
|
4463
|
-
"data-dragging"
|
|
4464
|
-
]
|
|
4465
|
-
});
|
|
4466
|
-
};
|
|
4467
|
-
const apply = () => {
|
|
4468
|
-
if (applying) return;
|
|
4469
|
-
applying = true;
|
|
4470
|
-
try {
|
|
4471
|
-
if (frame === void 0 || !frame.isConnected) watchFrame(findSidebarFrame(document));
|
|
4472
|
-
if (frame !== void 0) applySlimSidebar(frame);
|
|
4473
|
-
} finally {
|
|
4474
|
-
applying = false;
|
|
4475
|
-
}
|
|
4476
|
-
};
|
|
4477
|
-
const schedule = () => {
|
|
4478
|
-
if (pending !== void 0) return;
|
|
4479
|
-
pending = window.requestAnimationFrame(() => {
|
|
4480
|
-
pending = void 0;
|
|
4481
|
-
apply();
|
|
4482
|
-
});
|
|
4483
|
-
};
|
|
4484
|
-
apply();
|
|
4485
|
-
const observer = new MutationObserver(() => {
|
|
4486
|
-
if (frame === void 0 || !frame.isConnected) schedule();
|
|
4487
|
-
});
|
|
4488
|
-
observer.observe(document.body, {
|
|
4489
|
-
childList: true,
|
|
4490
|
-
subtree: true
|
|
4491
|
-
});
|
|
4492
|
-
return () => {
|
|
4493
|
-
observer.disconnect();
|
|
4494
|
-
frameObserver?.disconnect();
|
|
4495
|
-
if (pending !== void 0) window.cancelAnimationFrame(pending);
|
|
4496
|
-
};
|
|
4497
|
-
}
|
|
4498
4510
|
//#endregion
|
|
4499
4511
|
//#region src/client/conversation-dom.ts
|
|
4500
4512
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.80",
|
|
4
4
|
"description": "以 Codex 风格重构 DSH Web 侧栏的独立客户端插件",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"dist",
|
|
33
33
|
"assets",
|
|
34
34
|
"cordis.patch.yml",
|
|
35
|
+
"CHANGELOG.md",
|
|
36
|
+
"CHANGELOG.zh-CN.md",
|
|
35
37
|
"LICENSE",
|
|
36
38
|
"README.md",
|
|
37
39
|
"README.zh-CN.md"
|