@michengai/dsh-codex-ui 0.2.89 → 0.2.91
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 +21 -0
- package/CHANGELOG.zh-CN.md +21 -0
- package/dist/client.js +36 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
This changelog records recent releases of DSH Codex UI and its one-click installer. Earlier changes remain available in the [Git history](https://github.com/MichengAI/dsh-codex-ui/commits/main).
|
|
6
6
|
|
|
7
|
+
## 0.2.91 — 2026-08-28
|
|
8
|
+
|
|
9
|
+
### Release process
|
|
10
|
+
|
|
11
|
+
- Replaced manual npm publication with tag-triggered GitHub Actions npm Trusted Publishing (OIDC).
|
|
12
|
+
- Added a full-test and tag/package-version gate before `npm publish`; npm credentials are no longer stored in the repository or Actions secrets.
|
|
13
|
+
|
|
14
|
+
## 0.2.90 — 2026-08-27
|
|
15
|
+
|
|
16
|
+
Companion release: `@michengai/dsh-codex-suite-installer@0.1.7`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Matched the expandable sidebar to the installed Codex desktop client: 275px default width, 240px minimum, and 520px maximum, capped by available viewport width.
|
|
21
|
+
- Mapped the DSH host's narrower persisted drag range to the Codex visual range while preserving the 275px default anchor.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Replaced the previous coordinate-based collapse gesture with Codex behavior: dragging below 240px collapses the sidebar.
|
|
26
|
+
- Prevented the DOM width adapter from reapplying its own mapped output during host drag and rerender cycles.
|
|
27
|
+
|
|
7
28
|
## 0.2.89 — 2026-08-27
|
|
8
29
|
|
|
9
30
|
Companion release: `@michengai/dsh-codex-suite-installer@0.1.6`.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
本日志记录 DSH Codex UI 及其一键安装器的最近发布;更早的变更可查看 [Git 提交历史](https://github.com/MichengAI/dsh-codex-ui/commits/main)。
|
|
6
6
|
|
|
7
|
+
## 0.2.91 — 2026-08-28
|
|
8
|
+
|
|
9
|
+
### 发布流程
|
|
10
|
+
|
|
11
|
+
- npm 发布从本机手动执行改为由版本标签触发 GitHub Actions npm Trusted Publishing(OIDC)。
|
|
12
|
+
- `npm publish` 前新增完整测试和标签/package.json 版本一致性门禁;不再在仓库或 Actions Secrets 中保存 npm 凭据。
|
|
13
|
+
|
|
14
|
+
## 0.2.90 — 2026-08-27
|
|
15
|
+
|
|
16
|
+
配套版本:`@michengai/dsh-codex-suite-installer@0.1.7`。
|
|
17
|
+
|
|
18
|
+
### 调整
|
|
19
|
+
|
|
20
|
+
- 侧边栏展开宽度按本机 Codex 桌面客户端对齐:默认 275px、最小 240px、最大 520px,并受可用视口宽度限制。
|
|
21
|
+
- 将 DSH 宿主较窄的持久化拖拽范围映射到 Codex 的视觉范围,同时保留 275px 默认锚点。
|
|
22
|
+
|
|
23
|
+
### 修复
|
|
24
|
+
|
|
25
|
+
- 收缩手势改为 Codex 行为:拖到小于 240px 时收缩,不再使用固定屏幕坐标阈值。
|
|
26
|
+
- 防止 DOM 宽度适配器在宿主拖动和重渲染期间重复换算自身已映射的输出。
|
|
27
|
+
|
|
7
28
|
## 0.2.89 — 2026-08-27
|
|
8
29
|
|
|
9
30
|
配套版本:`@michengai/dsh-codex-suite-installer@0.1.6`。
|
package/dist/client.js
CHANGED
|
@@ -3371,15 +3371,6 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3371
3371
|
]
|
|
3372
3372
|
});
|
|
3373
3373
|
}
|
|
3374
|
-
/** 侧栏拖动手柄持续向左拉过阈值后,松手才收缩。 */
|
|
3375
|
-
function shouldCollapseOnSidebarDrag(startX, endX) {
|
|
3376
|
-
return startX - endX >= 100 && endX <= 180;
|
|
3377
|
-
}
|
|
3378
|
-
function isSidebarDragHandle(target) {
|
|
3379
|
-
if (target === null || typeof target !== "object" || !("closest" in target)) return false;
|
|
3380
|
-
const handle = target.closest("[data-side=\"sidebar\"]");
|
|
3381
|
-
return handle !== null && String(handle.className).includes("handle");
|
|
3382
|
-
}
|
|
3383
3374
|
/** 解析宿主 AppFrame 的 grid-template-columns。 */
|
|
3384
3375
|
function parseSidebarGrid(value) {
|
|
3385
3376
|
const match = /^(\d+(?:\.\d+)?)px\s+(minmax\(0,\s*1fr\))\s+(\d+(?:\.\d+)?)px$/.exec(value.trim());
|
|
@@ -3390,14 +3381,19 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3390
3381
|
details: Number(match[3])
|
|
3391
3382
|
};
|
|
3392
3383
|
}
|
|
3393
|
-
/**
|
|
3394
|
-
|
|
3384
|
+
/**
|
|
3385
|
+
* Translate the DSH host's 264–420px drag range to Codex's measured
|
|
3386
|
+
* 240–520px range, preserving the 280px-host / 275px-Codex default anchor.
|
|
3387
|
+
*/
|
|
3388
|
+
function slimedSidebarWidth(hostWidth, collapsed, viewportWidth = Number.POSITIVE_INFINITY) {
|
|
3395
3389
|
if (collapsed || hostWidth <= 80) return hostWidth;
|
|
3396
|
-
|
|
3397
|
-
|
|
3390
|
+
const maximum = Math.max(240, Math.min(520, viewportWidth - 240));
|
|
3391
|
+
const source = Math.max(264, Math.min(420, hostWidth));
|
|
3392
|
+
if (source <= 280) return 240 + (source - 264) * 35 / 16;
|
|
3393
|
+
return 275 + (source - 280) * (maximum - 275) / 140;
|
|
3398
3394
|
}
|
|
3399
|
-
function slimedGridTemplate(tracks, collapsed) {
|
|
3400
|
-
return `${slimedSidebarWidth(tracks.sidebar, collapsed)}px ${tracks.middle} ${tracks.details}px`;
|
|
3395
|
+
function slimedGridTemplate(tracks, collapsed, viewportWidth = Number.POSITIVE_INFINITY) {
|
|
3396
|
+
return `${slimedSidebarWidth(tracks.sidebar, collapsed, viewportWidth)}px ${tracks.middle} ${tracks.details}px`;
|
|
3401
3397
|
}
|
|
3402
3398
|
function findSidebarFrame(root) {
|
|
3403
3399
|
const marked = root.querySelector("[data-sidebar-collapsed]");
|
|
@@ -3405,15 +3401,20 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3405
3401
|
for (const node of root.querySelectorAll("div")) if (parseSidebarGrid(node.style.gridTemplateColumns) !== void 0) return node;
|
|
3406
3402
|
}
|
|
3407
3403
|
function applySlimSidebar(frame) {
|
|
3408
|
-
if (frame.hasAttribute("data-dragging"))
|
|
3404
|
+
if (frame.hasAttribute("data-dragging")) {
|
|
3405
|
+
frame.removeAttribute("data-dcu-codex-sidebar-grid");
|
|
3406
|
+
return false;
|
|
3407
|
+
}
|
|
3409
3408
|
const tracks = parseSidebarGrid(frame.style.gridTemplateColumns);
|
|
3410
3409
|
if (tracks === void 0) return false;
|
|
3411
3410
|
const collapsed = frame.hasAttribute("data-sidebar-collapsed");
|
|
3412
|
-
const next = slimedGridTemplate(tracks, collapsed);
|
|
3411
|
+
const next = slimedGridTemplate(tracks, collapsed, frame.getBoundingClientRect().width);
|
|
3412
|
+
if (frame.getAttribute("data-dcu-codex-sidebar-grid") === frame.style.gridTemplateColumns) return false;
|
|
3413
3413
|
if (frame.style.gridTemplateColumns === next) return false;
|
|
3414
3414
|
frame.style.gridTemplateColumns = next;
|
|
3415
|
+
frame.setAttribute("data-dcu-codex-sidebar-grid", next);
|
|
3415
3416
|
const handle = frame.querySelector("[data-side=\"sidebar\"]");
|
|
3416
|
-
if (handle !== null && !collapsed) handle.style.left = `${slimedSidebarWidth(tracks.sidebar, collapsed)}px`;
|
|
3417
|
+
if (handle !== null && !collapsed) handle.style.left = `${slimedSidebarWidth(tracks.sidebar, collapsed, frame.getBoundingClientRect().width)}px`;
|
|
3417
3418
|
return true;
|
|
3418
3419
|
}
|
|
3419
3420
|
function observeSlimSidebar() {
|
|
@@ -3469,6 +3470,17 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3469
3470
|
};
|
|
3470
3471
|
}
|
|
3471
3472
|
//#endregion
|
|
3473
|
+
//#region src/client/sidebar-drag.ts
|
|
3474
|
+
/** Codex collapses the sidebar when a resize drag would make it narrower than 240px. */
|
|
3475
|
+
function shouldCollapseOnSidebarDrag(startWidth, startX, endX) {
|
|
3476
|
+
return startWidth + endX - startX < 240;
|
|
3477
|
+
}
|
|
3478
|
+
function isSidebarDragHandle(target) {
|
|
3479
|
+
if (target === null || typeof target !== "object" || !("closest" in target)) return false;
|
|
3480
|
+
const handle = target.closest("[data-side=\"sidebar\"]");
|
|
3481
|
+
return handle !== null && String(handle.className).includes("handle");
|
|
3482
|
+
}
|
|
3483
|
+
//#endregion
|
|
3472
3484
|
//#region src/client/automation-task-settings.ts
|
|
3473
3485
|
const AUTOMATION_TASK_SETTINGS_EVENT = "dsh-automation:open-task-settings";
|
|
3474
3486
|
const AUTOMATION_TASK_SETTINGS_STORAGE_KEY = "dsh-automation:pending-task-settings";
|
|
@@ -3819,7 +3831,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3819
3831
|
const compact = collapsed || width < 80;
|
|
3820
3832
|
const [visualCompact, setVisualCompact] = (0, react.useState)(compact);
|
|
3821
3833
|
const [collapsing, setCollapsing] = (0, react.useState)(false);
|
|
3822
|
-
const lastWideWidth = (0, react.useRef)(width >= 80 ? width :
|
|
3834
|
+
const lastWideWidth = (0, react.useRef)(width >= 80 ? width : 275);
|
|
3823
3835
|
if (!compact) lastWideWidth.current = width;
|
|
3824
3836
|
const settingsSeat = (0, react.useRef)(null);
|
|
3825
3837
|
const search = (0, react.useRef)(null);
|
|
@@ -3855,6 +3867,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3855
3867
|
]);
|
|
3856
3868
|
(0, react.useEffect)(() => {
|
|
3857
3869
|
let startX = 0;
|
|
3870
|
+
let startWidth = 275;
|
|
3858
3871
|
let dragging = false;
|
|
3859
3872
|
let pointerId;
|
|
3860
3873
|
const onDown = (event) => {
|
|
@@ -3862,12 +3875,14 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3862
3875
|
dragging = true;
|
|
3863
3876
|
pointerId = event.pointerId;
|
|
3864
3877
|
startX = event.clientX;
|
|
3878
|
+
const match = (document.querySelector("[data-sidebar-collapsed]") ?? [...document.querySelectorAll("div")].find((node) => node.style.gridTemplateColumns.includes("minmax(0, 1fr)")))?.style.gridTemplateColumns.match(/^(\d+(?:\.\d+)?)px\s/);
|
|
3879
|
+
startWidth = match === null || match === void 0 ? 275 : Number(match[1]);
|
|
3865
3880
|
};
|
|
3866
3881
|
const onUp = (event) => {
|
|
3867
3882
|
if (!dragging || event.pointerId !== pointerId) return;
|
|
3868
3883
|
dragging = false;
|
|
3869
3884
|
pointerId = void 0;
|
|
3870
|
-
if (!shouldCollapseOnSidebarDrag(startX, event.clientX)) return;
|
|
3885
|
+
if (!shouldCollapseOnSidebarDrag(startWidth, startX, event.clientX)) return;
|
|
3871
3886
|
window.requestAnimationFrame(() => {
|
|
3872
3887
|
window.requestAnimationFrame(() => {
|
|
3873
3888
|
toggleSidebar();
|
|
@@ -3942,7 +3957,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3942
3957
|
useSessions,
|
|
3943
3958
|
useWorkspaces
|
|
3944
3959
|
]);
|
|
3945
|
-
const sidebarStyle = { "--dcu-sidebar-wide-width": `${lastWideWidth.current}px` };
|
|
3960
|
+
const sidebarStyle = { "--dcu-sidebar-wide-width": `${slimedSidebarWidth(lastWideWidth.current, false, window.innerWidth)}px` };
|
|
3946
3961
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
|
|
3947
3962
|
className: `dcu-root${visualCompact ? " dcu-compact" : ""}${collapsing ? " dcu-collapsing" : ""}`,
|
|
3948
3963
|
style: sidebarStyle,
|