@michengai/dsh-codex-ui 2.0.18 → 2.0.19
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 +4 -0
- package/CHANGELOG.zh-CN.md +4 -0
- package/README.en.md +198 -0
- package/README.md +98 -98
- package/README.zh-CN.md +2 -2
- package/lib/client.js +402 -1
- package/lib/session-title-plugin.mjs +4 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.19] - 2026-11-05
|
|
4
|
+
|
|
5
|
+
- **Mark Sessions as Unread / Read from Row Menu**: Right-click any conversation row or open its action menu to toggle sessions between "Mark as unread" and "Mark as read". Marked unread conversations instantly restore native green status dots and update the sidebar unread counter badge; opening or remarking clears them cleanly. The action item is neatly placed directly after "Pin session" and works consistently across all host versions.
|
|
6
|
+
|
|
3
7
|
## [2.0.18] - 2026-11-05
|
|
4
8
|
|
|
5
9
|
- **Decoupled Composer Glass Layer to Prevent Decorative Skin Collisions (Issue #83)**: Migrated the composer card's frosted glass background and backdrop filters from the shared `[data-composer-card]::before` pseudo-element to a dedicated, scoped surface element (`[data-dcu-glass-composer-surface]`). When third-party skins use `::before` to draw expanded frames, borders, or ribbons outside the input box, the decorative layer is no longer contaminated with dark background tints or blur filters, completely eliminating unwanted frosted rectangles and text occlusion.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [2.0.19] - 2026-11-05
|
|
4
|
+
|
|
5
|
+
- **会话行右键菜单支持「标记为未读 / 标记为已读」**:在会话列表中右键点击任意会话或点击操作菜单,可直接将已读会话重新标记为未读状态,行首立即恢复原生绿色未读状态点,并同步计入侧边栏水位线计数;再次右键可随时切换为「标记为已读」清除状态。选项在右键菜单中精准排列在「置顶会话」之后,并全面适配各版本宿主。
|
|
6
|
+
|
|
3
7
|
## [2.0.18] - 2026-11-05
|
|
4
8
|
|
|
5
9
|
- **解耦输入卡片玻璃材质层,消除与第三方装饰皮肤冲突(Issue #83)**:将输入框的玻璃磨砂与背景层从共享的 `[data-composer-card]::before` 伪元素迁移至专属的独立表面节点(`[data-dcu-glass-composer-surface]`),四边始终精准贴合卡片并置于内容底层。安装并在输入卡片外扩绘制边框、花纹或装饰元素的第三方皮肤时,装饰图层不再被强制叠上深色背景与模糊滤镜,杜绝输入框周围出现方角磨砂矩形或文字遮挡。
|
package/README.en.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/branding/dsh-banner.png" alt="DSH Codex UI" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
# DSH Codex UI v2.0
|
|
8
|
+
|
|
9
|
+
**Modern Interface Suite for DeepSeek Harness: Rapid Input Recall, Full-Screen Settings Skin, Native Physical Glass Themes, and Modular Sidebar**
|
|
10
|
+
|
|
11
|
+
[简体中文](README.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)
|
|
12
|
+
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://www.npmjs.com/package/@michengai/dsh-codex-ui)
|
|
15
|
+
[](https://www.npmjs.com/package/@michengai/dsh-codex-ui)
|
|
16
|
+
[](https://github.com/MichengAI/dsh-codex-ui)
|
|
17
|
+
[](https://nodejs.org/)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
> **Notice**: DSH Codex UI is a community-maintained interface enhancement suite for DeepSeek Harness (DSH), not an official DeepSeek AI product.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Why Codex UI 2.0?
|
|
26
|
+
|
|
27
|
+
When working across complex projects in DeepSeek Harness, users often encounter cramped settings modals, plain monocolor palettes, unstructured sidebars, and lost prompt history. **Codex UI 2.0 rearchitects the entire frontend experience through seven decoupled sub-plugins**, delivering a high-performance, non-intrusive, native-grade modern design:
|
|
28
|
+
|
|
29
|
+
* 🚀 **Instant Prompt Recall & Smart Prediction**: Intelligent inline input prediction (`Tab` to accept, `Alt+Down/Up` to cycle), terminal-style input history (`↑` / `↓` quick recall) with isolated workspace memory and adaptive width sizing;
|
|
30
|
+
* 🪟 **Full-Screen Dual-Island Settings**: Replaces cramped dialogs with Ambient Ground diffuse lighting canvas and dual floating island cards;
|
|
31
|
+
* 🎨 **Native Physical Glass Themes**: 7 built-in high-quality color schemes (featuring Codex Dark & Paper Light), dual layout modes (Stock Flat vs. Mica Floating), 3-tier material presets, and ground glow switch;
|
|
32
|
+
* 🧭 **Modular Dynamic Sidebar**: In-place smooth accordion drawer and fluid drag-and-drop reordering; **100% aligned with host official 56px native rail** when collapsed, keeping all icons crisp and New Session permanently visible;
|
|
33
|
+
* 🧠 **Intelligent Session Titles**: Semantic understanding of initial user prompts, supporting 4096-token reasoning model contexts;
|
|
34
|
+
* 🖥️ **Desktop Native Menus**: Injects a clean Help menu into the official desktop app titlebar, supporting native page reload and reliable cross-platform app/Host restart;
|
|
35
|
+
* 📦 **Ecosystem Companion Hub**: Centralized inspection, version checking, and 1-click batch upgrades for all official and third-party companion plugins.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Architectural Evolution: Why a Ground-Up Rewrite?
|
|
40
|
+
|
|
41
|
+
### 1. The Legacy 1.x Dilemma: Technical Debt of Forceful Component Overrides
|
|
42
|
+
In the early days of the DeepSeek Harness (DSH) plugin ecosystem, host frontend extension infrastructure was still nascent: fine-grained Slots registries were absent, official headless primitive libraries were unavailable, and plugin lifecycle hooks were sparse. To deliver a sleek, Codex-style immersive experience rapidly, **legacy 1.x had to rely heavily on invasive component overriding**: forcefully hijacking host DOM elements, injecting high-specificity CSS stylesheets, and hardcoding global CSS variables.
|
|
43
|
+
|
|
44
|
+
**The Inevitable Maintenance Bottleneck**: As official DSH iterated rapidly (introducing `profile` multi-environment isolation, `shortcuts` service gating, standard Slots registries, and the official primitive suite `@deepseek-ai/dsh-client-ui-primitives`), the technical debt of "forceful overrides" escalated dramatically:
|
|
45
|
+
* 💥 **Extremely Brittle Compatibility**: Any subtle DOM change or build-hash class update in upstream DSH would instantly break CSS overrides or cause full-page rendering crashes, stalling updates;
|
|
46
|
+
* 🎨 **Style Bleed & Half-Degradation Trap**: Injected global CSS tokens lacked clean lifecycle boundaries. Toggling off a theme failed to purge root attributes, resulting in awkward "half-degraded" states where glass effects vanished but hardcoded dark backgrounds lingered;
|
|
47
|
+
* 🧩 **Broken Lifecycles & Zombie Settings**: When a sub-feature was disabled, overridden views could not cleanly fall back to host native interfaces, leaving inert, non-functional configuration controls stuck in the settings modal.
|
|
48
|
+
|
|
49
|
+
### 2. The 2.0.0 Rearchitecture Decision: Fully Embracing Host Natives
|
|
50
|
+
Faced with these compounding challenges, we made the decisive choice in v2.0.0 to **completely scrap all 1.x component override code** and establish a new baseline: **zero-intrusion, micro-kernel decoupling, and native-first engineering**:
|
|
51
|
+
* 🏛️ **Strict Adoption of Official Primitives & Slots**: Prohibited custom hand-drawn CSS widgets; strictly leveraged official `Switch`, `SegmentedControl`, and `Button` primitives. When collapsed, the sidebar strictly aligns with the official 56px native icon rail;
|
|
52
|
+
* 🧩 **Seven Decoupled Micro-Kernel Sub-Plugins**: Broken down into 7 self-contained, high-cohesion sub-plugins with explicit boundaries, enabling independent lifecycle management and streamlined code audits;
|
|
53
|
+
* 🛡️ **Fail-Closed Circuit Breaker & Adaptive UI**: Implemented strict fail-closed safety contracts. When a sub-plugin is disabled or unreachable, the runtime physically cleanses all injected tokens/root attributes, while the settings UI **completely hides the defunct card (0 DOM nodes)**, reverting instantly to pristine host defaults without visual clutter;
|
|
54
|
+
* 🔒 **Authoritative Profile Isolation & Self-Healing**: Unambiguous Profile directory resolution eliminates cross-profile contamination, backed by window-focus self-healing probes for resilient network handling;
|
|
55
|
+
* 🎨 **Authentic Codex Tech Aesthetic**: Purged legacy green color pollution, strictly adhering to `#339cff` tech-blue, minimalist paper, and charcoal dark tones with dual layout modes and ambient ground reflection glows.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Architecture: 7 Core Sub-Plugins
|
|
60
|
+
|
|
61
|
+
| Sub-Plugin ID | Name | Capabilities |
|
|
62
|
+
| :--- | :--- | :--- |
|
|
63
|
+
| `composer` | **Composer Enhancement** | Smart inline input prediction (`Tab` to accept, `Alt+Down/Up` to cycle), terminal-style input history (`↑`/`↓`), workspace-isolated storage, dual drag-resize handles, and contextual prompt hints. |
|
|
64
|
+
| `settings-skin` | **Native Settings Skin** | Full-screen workbench layout, dual floating island system, Ambient Ground lighting canvas, and native search. |
|
|
65
|
+
| `theme` | **Theme & Glassmorphism** | 7 built-in themes with Appearance Cubes, Stock Flat vs. Mica Floating modes, 3 material presets, and ground glow switch. |
|
|
66
|
+
| `sidebar` | **Modular Sidebar** | In-place accordion expansion, smooth drag-and-drop reordering, and right-click “mark as unread / read” for sessions; collapses cleanly into host native 56px icon rail. |
|
|
67
|
+
| `session-title` | **Intelligent Session Title** | Generates standardized session titles from initial prompt semantics, handling reasoning model outputs up to 4096 tokens. |
|
|
68
|
+
| `desktop-menu` | **Desktop Native Menus** | Official desktop app titlebar menu integration with instant view reload and reliable cross-platform app/Host restart. |
|
|
69
|
+
| `dependencies` | **Companion Management** | Centralized dashboard for official/third-party DSH companion plugins with live npm download counts and 1-click updates. |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Live Screenshots
|
|
74
|
+
|
|
75
|
+
> *All screenshots are captured directly from live DeepSeek Harness Web runtime environments using `ego-browser`.*
|
|
76
|
+
|
|
77
|
+
### 1. Immersive Workspace & Composer (Dark Mode)
|
|
78
|
+
Codex Dark palette with centered hero actions, prompt cards, and bottom composer with adaptive resize handles and `↑↓` history hints.
|
|
79
|
+
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### 2. Paper Minimalist Workspace (Light Mode)
|
|
85
|
+
Codex Light palette powered by Ambient Ground diffuse lighting gradient, delivering organic warmth and eye comfort.
|
|
86
|
+
|
|
87
|
+

|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
### 3. Full-Screen Dual-Island Settings (Modular Card System)
|
|
92
|
+
Spacious settings workbench organized into a modular card system (Feature Overview, Theme & Glassmorphism, and Companion Plugins), dynamically adapting based on active sub-components.
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### 4. Theme Customization & Glassmorphism
|
|
99
|
+
7 Appearance Cube color cards (Stock, classic Codex tech-blue/monochrome, Mocha, Macchiato, Frappé, Latte), Segmented Controls for layout modes and material blur, plus ground reflection toggle.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### 5. Modular Sidebar Navigation (Expanded)
|
|
104
|
+
Reorderable navigation entries, in-place accordion drawer for tools (IM Assistant, Cron, Archive, Experts), and quick-action pinned rows.
|
|
105
|
+
|
|
106
|
+

|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### 6. Official Native 56px Rail (Collapsed)
|
|
111
|
+
Collapses seamlessly into the host official 56px compact activity rail. All plugin icons remain centered and accessible, with New Session prominently highlighted.
|
|
112
|
+
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### 7. Enhanced Session Menu
|
|
118
|
+
Quick actions directly on session rows: Pin, Rename, Unread marker, Archive, Fork, and Safe Deletion.
|
|
119
|
+
|
|
120
|
+

|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Host Compatibility
|
|
125
|
+
|
|
126
|
+
* **Supported Generations**: Full DeepSeek Harness `0.2.x` line (`>=0.2.0-rc.1 <0.3.0-0`);
|
|
127
|
+
* **Verified Builds**: Supports every `0.2.x` RC (`0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`–`0.2.1-rc.5`, and `0.2.2-rc.1`); intermediate alphas are not part of the support matrix;
|
|
128
|
+
* **Runtime Requirements**: Node.js `^22.19.0 || >=24.0.0`, pnpm `^11.0.0`.
|
|
129
|
+
|
|
130
|
+
> ⚠️ **Notice**: Do not enable Codex UI and `ds-bot` concurrently. Both redesign sidebar and session slots with overlapping layout mechanics. Disable or uninstall one before enabling the other.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Installation & Getting Started
|
|
135
|
+
|
|
136
|
+
### Option A: Agent-Assisted Installation (Recommended)
|
|
137
|
+
|
|
138
|
+
Copy and send this prompt to any agent capable of executing terminal commands (replace `web` with your target profile):
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
Please install the DSH plugin @michengai/dsh-codex-ui into my local web profile by running:
|
|
142
|
+
dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://registry.npmjs.org/
|
|
143
|
+
Then run dsh --profile web --dump-config to verify codex-ui is active and remind me to refresh my browser.
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Option B: Manual Installation
|
|
147
|
+
|
|
148
|
+
Execute in PowerShell or MSYS Bash:
|
|
149
|
+
|
|
150
|
+
```powershell
|
|
151
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
152
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
153
|
+
dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://registry.npmjs.org/
|
|
154
|
+
dsh --profile web --dump-config
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Once installed, restart your DSH Web instance and hard-refresh your browser (`Ctrl + Shift + R` or `Cmd + Shift + R`).
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Quick Reference
|
|
162
|
+
|
|
163
|
+
| Feature | How to Use |
|
|
164
|
+
| :--- | :--- |
|
|
165
|
+
| **Accept Input Prediction** | Press `Tab` when predictive ghost text appears behind the caret; press `Alt + Down` / `Alt + Up` to cycle recommendations, or `Escape` to dismiss. |
|
|
166
|
+
| **Toggle Predictions** | Go to **Settings → Codex UI** and toggle the switch in the "Composer Enhancements" card. Can also be locked off wholesale across a profile by setting `config.prediction: false` in `cordis.patch.yml`. |
|
|
167
|
+
| **Recall Input History** | Press `↑` / `↓` in an empty composer to cycle through past inputs submitted in the current workspace (up to 200 items). |
|
|
168
|
+
| **Resize Composer Width** | Hover over either lateral border of the composer and drag the blue handles. |
|
|
169
|
+
| **Switch Themes & Blur** | Navigate to **Settings → Codex UI**, choose from 7 palettes, and toggle Stock/Mica or blur presets. |
|
|
170
|
+
| **Reorder Sidebar Items** | Drag any item vertically; blue indicators guide drop positions into or out of the More drawer. |
|
|
171
|
+
| **Collapse Sidebar** | Click the collapse button on top of the sidebar to switch to the official 56px native icon rail. |
|
|
172
|
+
| **Batch Upgrade Plugins** | In **Settings → Codex UI**, click **Update All** on the Companion Plugins card. |
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Ecosystem Matrix
|
|
177
|
+
|
|
178
|
+
Pair Codex UI with the first-party companion plugins for an integrated development workflow:
|
|
179
|
+
|
|
180
|
+
| Plugin | Purpose |
|
|
181
|
+
| :--- | :--- |
|
|
182
|
+
| [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | **UI Core**: Rapid recall, settings skin, physical glass, and modular sidebar |
|
|
183
|
+
| [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | **Specialist Matrix**: Summon and dispatch specialized agent profiles |
|
|
184
|
+
| [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | **Skills Hub**: Discover, import, enable, and configure local agent skills |
|
|
185
|
+
| [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | **Archive Vault**: Deep search, restore, and prune historical sessions |
|
|
186
|
+
| [IM Connect](https://github.com/MichengAI/dsh-im-connect) | **Bridge**: Connect WeChat, DingTalk, Feishu, and QQBot |
|
|
187
|
+
| [Automation](https://github.com/MichengAI/dsh-automation) | **Scheduler**: Cron-based workflows and run evidence auditing |
|
|
188
|
+
| [Code Review](https://github.com/MichengAI/dsh-code-review) | **Reviewer**: `/review` dispatches subagents to audit code in-thread |
|
|
189
|
+
| [Simplify](https://github.com/MichengAI/dsh-simplify) | **Refactor**: `/simplify` concurrent 4-agent code cleanup |
|
|
190
|
+
| [PUA](https://github.com/MichengAI/dsh-pua) | **Resilience**: Failure recovery, hypothesis switching, and evidence verification |
|
|
191
|
+
| [BTW](https://github.com/MichengAI/dsh-btw) | **Side-Questions**: Ephemeral context inquiries without disrupting main tasks |
|
|
192
|
+
| [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) | **Companion**: Desktop interactive pet for approvals and notifications |
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
Distributed and licensed under the [Apache License 2.0](LICENSE).\n
|
package/README.md
CHANGED
|
@@ -6,146 +6,146 @@
|
|
|
6
6
|
|
|
7
7
|
# DSH Codex UI v2.0
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**现代化 DeepSeek Harness 全方位界面增强套件:极速历史召回、全屏设置皮肤、原生物理毛玻璃换肤与模块化侧栏**
|
|
10
10
|
|
|
11
|
-
[
|
|
11
|
+
[English](README.en.md) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
13
|
-
[](LICENSE)
|
|
14
14
|
[](https://www.npmjs.com/package/@michengai/dsh-codex-ui)
|
|
15
|
-
[](https://www.npmjs.com/package/@michengai/dsh-codex-ui)
|
|
16
16
|
[](https://github.com/MichengAI/dsh-codex-ui)
|
|
17
17
|
[](https://nodejs.org/)
|
|
18
18
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
>
|
|
21
|
+
> **声明**:DSH Codex UI 是社区维护的 DeepSeek Harness(DSH)现代化界面增强插件,并非 DeepSeek AI 官方产品。
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## 为什么选择 Codex UI 2.0?
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
在日常使用 DeepSeek Harness 时,原生界面可能存在设置窗口狭小局促、主题配色单一、侧栏长插件列表不易整理、输入历史丢失等痛点。**Codex UI 2.0 经历了从底层架构到视觉体系的全面重塑**,以**七大独立子插件**构建起一套高性能、低侵入、官方原生的现代化界面增强体系:
|
|
28
28
|
|
|
29
|
-
* 🚀
|
|
30
|
-
* 🪟
|
|
31
|
-
* 🎨
|
|
32
|
-
* 🧭
|
|
33
|
-
* 🧠
|
|
34
|
-
* 🖥️
|
|
35
|
-
* 📦
|
|
29
|
+
* 🚀 **极速输入召回与智能预测**:智能行内意图预测与续写(`Tab` 一键采纳,`Alt+↓/↑` 切换候选项),终端风格输入框历史(`↑` / `↓` 快捷召回),支持自适应宽度微调;
|
|
30
|
+
* 🪟 **全屏悬浮双岛设置**:告别局促模态框,接入 Ambient Ground 漫反射画布与双岛卡片工作台;
|
|
31
|
+
* 🎨 **物理级毛玻璃换肤**:内置 7 款高品质主题配色(含 Codex 炭黑与极简纸白),支持原版平铺玻璃与云母悬浮双排版模态、三档材质预设与独立地面光斑;
|
|
32
|
+
* 🧭 **模块化侧边栏**:展开态支持原位平滑折叠抽屉与自由拖拽排序;收缩折叠态 **100% 对齐宿主官方 56px 原生导轨**,所有图标整齐排列、新会话常驻高对比度;
|
|
33
|
+
* 🧠 **智能会话标题**:首条消息语义解析,自动提炼精炼标题,完美适配推理大模型长上下文;
|
|
34
|
+
* 🖥️ **桌面原生窗口菜单**:在官方桌面端系统标题栏无缝注入帮助菜单,提供原生视图刷新与跨端可靠的应用与 Host 重启能力;
|
|
35
|
+
* 📦 **生态配套管理**:官方与第三方生态插件集中看护、版本检测与一键批量升级。
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## 为什么选择彻底重构?(历史演变与技术决策)
|
|
40
40
|
|
|
41
|
-
### 1.
|
|
42
|
-
|
|
41
|
+
### 1. 早期 1.x 时代的无奈选择:“暴力覆盖组件”的技术负债
|
|
42
|
+
在 DeepSeek Harness(DSH)生态起步阶段,官方宿主的客户端扩展能力与基础设施尚不完善:不仅缺少细粒度的标准 Slots 插槽机制,亦未开放官方原语控件库,插件生命周期钩子也相对稀少。为了能在短时间内为开发者打造出接近 OpenAI / Codex 质感的沉浸式体验,**早期 1.x 版本不得不采用了大量激进的“覆盖组件”策略**:直接拦截并强行替换宿主 DOM 树、使用高权重 CSS 暴力覆盖原生视图、全量硬编码注入自定义 CSS 变量。
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
* 💥
|
|
46
|
-
* 🎨
|
|
47
|
-
* 🧩
|
|
44
|
+
**随之而来的维护困局**:随着 DSH 官方宿主的快速迭代演进(先后引入 `profile` 多环境隔离体系、`shortcuts` 服务门控、标准 Slots 插槽注册契约以及官方原生原语库 `@deepseek-ai/dsh-client-ui-primitives` 等),早期“强行覆盖”的技术负债开始集中爆发,日常维护愈发举步维艰:
|
|
45
|
+
* 💥 **版本兼容极度脆弱**:宿主上游稍有 DOM 结构微调或 CSS 类名 hash 变动,就会导致覆盖式选择器失效甚至整页渲染崩溃,难以平滑跟进官方新特性;
|
|
46
|
+
* 🎨 **样式污染与半降级顽疾**:暴力注入的全局样式难以做到干净的生命周期销毁。当用户切换或关闭自定义主题时,残存的根属性与色彩变量导致原生暗色模式被严重污染,甚至出现“毛玻璃材质关闭了、但深色背景被卡死无法复原”的半降级尴尬;
|
|
47
|
+
* 🧩 **状态脱节与“僵尸配置”**:在插件或子特性被停用时,覆盖式组件无法干净退回到宿主原生外观,依然在设置面板中渲染无法生效的失效配置项,破坏了系统的整洁度与用户心智。
|
|
48
48
|
|
|
49
|
-
### 2.
|
|
50
|
-
|
|
51
|
-
* 🏛️
|
|
52
|
-
* 🧩
|
|
53
|
-
* 🛡️
|
|
54
|
-
* 🔒
|
|
55
|
-
* 🎨
|
|
49
|
+
### 2. 2.0.0 的彻底重构决策:全面拥抱官方原生体系
|
|
50
|
+
面对维护困局,我们在 2.0.0 版本痛定思痛,**彻底推翻了 1.x 的全部“组件覆盖”代码**,确立了**“零侵入、微内核解耦、全面拥抱官方原生”**的全新技术路线:
|
|
51
|
+
* 🏛️ **严格复用官方原生原语与标准 Slots**:坚决禁止用 CSS 自行手绘宿主已有控件,全面接入官方 `Switch`、`SegmentedControl`、`Button` 原生原语库;侧栏收起时 100% 严丝合缝退回官方原生 56px 导轨规范,真正做到与宿主体系同生共荣;
|
|
52
|
+
* 🧩 **七大微内核子插件物理解耦**:将臃肿的单体代码彻底拆解为 7 个高内聚、自闭环的独立子插件,彼此边界分明、支持按需独立启停,极大提升了工程可维护性与审计透明度;
|
|
53
|
+
* 🛡️ **严格的 Fail-Closed 熔断与动态隐匿 UI**:建立标准的高可用防御契约。一旦探测到子插件在当前 Profile 被停用或服务端不可达,底层不仅物理熔断 Token 注入并彻底清空根属性,前台设置面板更会**直接整体隐匿对应卡片(0 DOM 节点)**,绝不残留任何置灰死项,瞬间 100% 干净回退至官方原生;
|
|
54
|
+
* 🔒 **严格 Profile 隔离与无缝自愈机制**:统一权威的 Profile 路径解析,彻底杜绝跨环境串读与配置污染;同时接入 `focus` 窗口重获焦点自愈探活,兼顾极致安全与网络抖动下的高可用性;
|
|
55
|
+
* 🎨 **纯正 Codex 科技蓝黑美学**:彻底清洗历史残留的绿色硬编码,精准还原官方 `#339cff` 科技蓝、极简纸白与沉浸炭黑质感,辅以双排版模态与地面柔光反射光斑。
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## 七大核心子插件架构
|
|
60
60
|
|
|
61
|
-
|
|
|
61
|
+
| 子插件 ID | 模块名称 | 核心能力说明 |
|
|
62
62
|
| :--- | :--- | :--- |
|
|
63
|
-
| `composer` |
|
|
64
|
-
| `settings-skin` |
|
|
65
|
-
| `theme` |
|
|
66
|
-
| `sidebar` |
|
|
67
|
-
| `session-title` |
|
|
68
|
-
| `desktop-menu` |
|
|
69
|
-
| `dependencies` |
|
|
63
|
+
| `composer` | **输入框增强** | 智能输入预测与行内续写(`Tab` 采纳、`Alt+↓/↑` 候选循环)、终端风格历史记录(`↑`/`↓`)快捷召回、工作区隔离存储、自适应宽度拖拽手柄与快捷提示。 |
|
|
64
|
+
| `settings-skin` | **原生设置皮肤** | 全屏设置工作台美化、悬浮双岛架构、Ambient Ground 自然光漫反射底板、分类导航与原生输入框搜索。 |
|
|
65
|
+
| `theme` | **主题与界面换肤** | 内置 7 款主题配色(含 Appearance Cube 色彩方块)、原版平铺/云母悬浮双排版、三档材质预设与地面光斑开关。 |
|
|
66
|
+
| `sidebar` | **模块化侧栏导航** | 模块化侧边栏导航、手风琴原位平滑折叠抽屉、自由拖拽排序、会话右键「标记为未读 / 标记为已读」;折叠态 100% 对齐宿主官方 56px 原生导轨。 |
|
|
67
|
+
| `session-title` | **会话智能标题** | 基于首条消息语义提取并生成规范的会话标题,支持推理模型 4096 tokens 上下文,防止乱码截断。 |
|
|
68
|
+
| `desktop-menu` | **桌面窗口菜单** | 官方桌面端系统原生标题栏菜单无缝增强,提供视图快速重载与跨端高可靠的应用与 Host 优雅重启。 |
|
|
69
|
+
| `dependencies` | **配套生态管理** | 深度集成 DSH 官方与第三方生态插件集中管理,实时显示 npm 下载量、安装状态与一键批量升级。 |
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## 真机界面预览
|
|
74
74
|
|
|
75
|
-
>
|
|
75
|
+
> *以下界面均使用 `ego-browser` 在真实的 DeepSeek Harness Web 运行环境中捕获。*
|
|
76
76
|
|
|
77
|
-
### 1.
|
|
78
|
-
Codex Dark
|
|
77
|
+
### 1. 沉浸主界面与输入增强(深色模式)
|
|
78
|
+
沉浸炭黑(Codex Dark)配色,居中展示品牌标语与快捷动作引导卡片,底部输入框提供「↑↓ 翻历史」快捷召回与自适应宽度手柄。
|
|
79
79
|
|
|
80
|
-

|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
84
|
-
### 2.
|
|
85
|
-
Codex Light
|
|
84
|
+
### 2. 极简纸白主界面(浅色模式)
|
|
85
|
+
极简纸白(Codex Light)配色,接入 Ambient Ground 自然光漫反射渐变底板,温润通透,视觉流平滑舒缓。
|
|
86
86
|
|
|
87
|
-

|
|
88
88
|
|
|
89
89
|
---
|
|
90
90
|
|
|
91
|
-
### 3.
|
|
92
|
-
|
|
91
|
+
### 3. 全屏悬浮双岛设置中心(模块化卡片体系)
|
|
92
|
+
告别局促的弹窗,重塑为模块化卡片工作台(功能与内置子插件、界面外观与换肤、配套管理插件),层次严谨秩序井然,支持根据子组件启用状态动态自适应呈现。
|
|
93
93
|
|
|
94
|
-

|
|
95
95
|
|
|
96
96
|
---
|
|
97
97
|
|
|
98
|
-
### 4.
|
|
99
|
-
7
|
|
98
|
+
### 4. 界面外观换肤与毛玻璃配置
|
|
99
|
+
内置 7 款主题色盘(官方默认、Codex 经典科技蓝黑白、Mocha、Macchiato、Frappé、Latte),支持原版平铺玻璃与云母悬浮双模态,清透/标准/磨砂三档材质直选与地面反射光斑开关。
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
### 5.
|
|
104
|
-
|
|
103
|
+
### 5. 模块化侧边栏导航(展开态)
|
|
104
|
+
支持插件、技能、常用工具(IM 助理、定时任务、归档会话、代码审查等)自由拖拽排序与「更多」手风琴平滑折叠收纳。
|
|
105
105
|
|
|
106
|
-

|
|
107
107
|
|
|
108
108
|
---
|
|
109
109
|
|
|
110
|
-
### 6.
|
|
111
|
-
|
|
110
|
+
### 6. 官方原生 56px 折叠导轨(收缩态)
|
|
111
|
+
侧栏收起后自动对齐官方原生紧凑 56px 导轨规范,无缝完整显示全部功能图标,新会话常驻高亮显示,无需鼠标悬停试探。
|
|
112
112
|
|
|
113
|
-

|
|
114
114
|
|
|
115
115
|
---
|
|
116
116
|
|
|
117
|
-
### 7.
|
|
118
|
-
|
|
117
|
+
### 7. 增强会话菜单
|
|
118
|
+
支持在会话项上快速执行置顶、重命名、未读标记、归档、派生新会话与安全清理。
|
|
119
119
|
|
|
120
|
-

|
|
121
121
|
|
|
122
122
|
---
|
|
123
123
|
|
|
124
|
-
##
|
|
124
|
+
## 宿主兼容性
|
|
125
125
|
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
126
|
+
* **支持范围**:DeepSeek Harness `0.2.x` 全系列(`>=0.2.0-rc.1 <0.3.0-0`);
|
|
127
|
+
* **实测验证**:支持矩阵为全部 `0.2.x` RC(`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`~`0.2.1-rc.5`、`0.2.2-rc.1`);中间版本阿尔法不在支持范围内;
|
|
128
|
+
* **环境要求**:Node.js `^22.19.0 || >=24.0.0`,pnpm `^11.0.0`。
|
|
129
129
|
|
|
130
|
-
> ⚠️
|
|
130
|
+
> ⚠️ **互斥提示**:请勿同时启用 Codex UI 与 `ds-bot`。两者均重塑侧栏与主会话插槽,功能重叠。启用前请先停用或卸载另一个。
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
134
|
-
##
|
|
134
|
+
## 安装与快速上手
|
|
135
135
|
|
|
136
|
-
###
|
|
136
|
+
### 方式 A:让 Agent 帮您安装(推荐)
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
复制以下指令发送给任意具备终端执行权限的 Agent(将 `web` 替换为您实际使用的 profile 名称):
|
|
139
139
|
|
|
140
140
|
```text
|
|
141
|
-
|
|
141
|
+
请将 DSH 插件 @michengai/dsh-codex-ui 安装到本机 web profile,执行:
|
|
142
142
|
dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://registry.npmjs.org/
|
|
143
|
-
|
|
143
|
+
安装后执行 dsh --profile web --dump-config 确认包含 codex-ui,并提示我刷新浏览器。
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
###
|
|
146
|
+
### 方式 B:终端手动安装
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
在终端(Windows PowerShell 或 MSYS Bash)中执行:
|
|
149
149
|
|
|
150
150
|
```powershell
|
|
151
151
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -154,45 +154,45 @@ dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://r
|
|
|
154
154
|
dsh --profile web --dump-config
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
安装完成后,重启 DSH Web 实例并硬刷新浏览器页面(`Ctrl + Shift + R` 或 `Cmd + Shift + R`)即可进入全新 2.0 体验!
|
|
158
158
|
|
|
159
159
|
---
|
|
160
160
|
|
|
161
|
-
##
|
|
161
|
+
## 常用操作速查
|
|
162
162
|
|
|
163
|
-
|
|
|
163
|
+
| 场景 | 操作方式 |
|
|
164
164
|
| :--- | :--- |
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
165
|
+
| **采纳输入预测续写** | 打字停顿弹出高亮候选项时,按 `Tab` 键一键采纳补全;按 `Alt + ↓` / `Alt + ↑` 循环切换多条候选,按 `Esc` 退出。 |
|
|
166
|
+
| **启闭输入预测功能** | 打开「设置 → Codex UI」,在「输入框增强」卡片切换「智能输入预测与行内续写」开关;支持在 Profile 的 `cordis.patch.yml` 中配置 `config.prediction: false` 实现站点级统一锁定。 |
|
|
167
|
+
| **找回历史输入** | 输入框为空时按键盘 `↑` / `↓` 方向键,即时召回在当前工作区提交过的历史文本(按工作区隔离存储 200 条)。 |
|
|
168
|
+
| **调节输入框宽度** | 悬停至输入框左右边缘,拖拽蓝色手柄即可自定义最舒适的编写宽度。 |
|
|
169
|
+
| **切换主题与质感** | 打开「设置 → Codex UI」,在「界面外观与换肤」卡片单选 7 款主题,直选原版/云母模式与材质预设。 |
|
|
170
|
+
| **调整侧栏图标顺序** | 鼠标按住展开侧栏中的任意插件条目拖拽上下移动,蓝线指示放置位置,支持拖入/拖出「更多」手风琴。 |
|
|
171
|
+
| **折叠/收起侧边栏** | 点击侧栏顶部折叠按钮;收缩后自动切换为 56px 原生导轨,单手盲点所有功能图标。 |
|
|
172
|
+
| **生态插件批量更新** | 在「设置 → Codex UI」底部「配套管理插件」卡片,点击「全部更新」自动安装最新配套依赖。 |
|
|
173
173
|
|
|
174
174
|
---
|
|
175
175
|
|
|
176
|
-
##
|
|
176
|
+
## DSH 现代化生态矩阵
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
如需搭配完整的开发运维闭环,可按需在配套管理卡片中一键启用以下生态插件:
|
|
179
179
|
|
|
180
|
-
|
|
|
180
|
+
| 插件名称 | 核心用途 |
|
|
181
181
|
| :--- | :--- |
|
|
182
|
-
| [Codex UI](https://github.com/MichengAI/dsh-codex-ui) |
|
|
183
|
-
| [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) |
|
|
184
|
-
| [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) |
|
|
185
|
-
| [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) |
|
|
186
|
-
| [IM Connect](https://github.com/MichengAI/dsh-im-connect) |
|
|
187
|
-
| [Automation](https://github.com/MichengAI/dsh-automation) |
|
|
188
|
-
| [Code Review](https://github.com/MichengAI/dsh-code-review) |
|
|
189
|
-
| [Simplify](https://github.com/MichengAI/dsh-simplify) |
|
|
190
|
-
| [PUA](https://github.com/MichengAI/dsh-pua) |
|
|
191
|
-
| [BTW](https://github.com/MichengAI/dsh-btw) |
|
|
192
|
-
| [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) |
|
|
182
|
+
| [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | **界面总控**:极速输入召回、全屏设置皮肤、毛玻璃换肤与模块化侧栏 |
|
|
183
|
+
| [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | **专家调度**:任务精准画像,一键召唤行业专家角色矩阵 |
|
|
184
|
+
| [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | **技能枢纽**:本地技能统一发现、导入、启停与智能配置 |
|
|
185
|
+
| [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | **归档管理**:历史会话深度检索、恢复与安全物理归档清理 |
|
|
186
|
+
| [IM Connect](https://github.com/MichengAI/dsh-im-connect) | **消息串联**:连接微信、钉钉、飞书、QQBot 双向派发与接收任务 |
|
|
187
|
+
| [Automation](https://github.com/MichengAI/dsh-automation) | **定时管家**:Cron 定时流水线看护与运行证据追踪 |
|
|
188
|
+
| [Code Review](https://github.com/MichengAI/dsh-code-review) | **代码审查**:`/review` 独立审查子代理并直接向当前会话投递严谨评审报告 |
|
|
189
|
+
| [Simplify](https://github.com/MichengAI/dsh-simplify) | **代码精简**:`/simplify` 4-agent 并发精简与坏味道消除 |
|
|
190
|
+
| [PUA](https://github.com/MichengAI/dsh-pua) | **韧性强化**:失败自动归因重试,完工证据多维校验守门员 |
|
|
191
|
+
| [BTW](https://github.com/MichengAI/dsh-btw) | **临时旁问**:长任务进行中轻量旁问,不破坏主线程上下文 |
|
|
192
|
+
| [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) | **桌面宠物**:任务状态动态浮窗交互、工具审批与拟人化提醒 |
|
|
193
193
|
|
|
194
194
|
---
|
|
195
195
|
|
|
196
|
-
##
|
|
196
|
+
## 许可证
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
本项目基于 [Apache License 2.0](LICENSE) 开源协议分发与维护。
|
package/README.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**现代化 DeepSeek Harness 全方位界面增强套件:极速历史召回、全屏设置皮肤、原生物理毛玻璃换肤与模块化侧栏**
|
|
10
10
|
|
|
11
|
-
[English](README.md) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
|
|
11
|
+
[English](README.en.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)
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
| `composer` | **输入框增强** | 智能输入预测与行内续写(`Tab` 采纳、`Alt+↓/↑` 候选循环)、终端风格历史记录(`↑`/`↓`)快捷召回、工作区隔离存储、自适应宽度拖拽手柄与快捷提示。 |
|
|
64
64
|
| `settings-skin` | **原生设置皮肤** | 全屏设置工作台美化、悬浮双岛架构、Ambient Ground 自然光漫反射底板、分类导航与原生输入框搜索。 |
|
|
65
65
|
| `theme` | **主题与界面换肤** | 内置 7 款主题配色(含 Appearance Cube 色彩方块)、原版平铺/云母悬浮双排版、三档材质预设与地面光斑开关。 |
|
|
66
|
-
| `sidebar` | **模块化侧栏导航** |
|
|
66
|
+
| `sidebar` | **模块化侧栏导航** | 模块化侧边栏导航、手风琴原位平滑折叠抽屉、自由拖拽排序、会话右键「标记为未读 / 标记为已读」;折叠态 100% 对齐宿主官方 56px 原生导轨。 |
|
|
67
67
|
| `session-title` | **会话智能标题** | 基于首条消息语义提取并生成规范的会话标题,支持推理模型 4096 tokens 上下文,防止乱码截断。 |
|
|
68
68
|
| `desktop-menu` | **桌面窗口菜单** | 官方桌面端系统原生标题栏菜单无缝增强,提供视图快速重载与跨端高可靠的应用与 Host 优雅重启。 |
|
|
69
69
|
| `dependencies` | **配套生态管理** | 深度集成 DSH 官方与第三方生态插件集中管理,实时显示 npm 下载量、安装状态与一键批量升级。 |
|
package/lib/client.js
CHANGED
|
@@ -3334,6 +3334,8 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
3334
3334
|
"sections.new": "新建分区",
|
|
3335
3335
|
"sections.newName": "新分区名称",
|
|
3336
3336
|
"sections.settings": "分区设置",
|
|
3337
|
+
"session.markUnread": "标记为未读",
|
|
3338
|
+
"session.markRead": "标记为已读",
|
|
3337
3339
|
"about.title": "Codex UI",
|
|
3338
3340
|
"about.viewProject": "GitHub",
|
|
3339
3341
|
"about.feedback": "问题反馈",
|
|
@@ -3528,6 +3530,8 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
3528
3530
|
"sections.new": "New section",
|
|
3529
3531
|
"sections.newName": "Section name",
|
|
3530
3532
|
"sections.settings": "Section settings",
|
|
3533
|
+
"session.markUnread": "Mark as unread",
|
|
3534
|
+
"session.markRead": "Mark as read",
|
|
3531
3535
|
"about.title": "Codex UI",
|
|
3532
3536
|
"about.viewProject": "GitHub",
|
|
3533
3537
|
"about.feedback": "Issues",
|
|
@@ -10642,6 +10646,390 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
10642
10646
|
return dispose;
|
|
10643
10647
|
}
|
|
10644
10648
|
//#endregion
|
|
10649
|
+
//#region src/client/sidebar/session-unread/model.ts
|
|
10650
|
+
/** 会话行 `data-row-key` 的前缀。 */
|
|
10651
|
+
const SESSION_ROW_KEY_PREFIX = "session:";
|
|
10652
|
+
/** 宿主行内操作区(CSS Module 哈希前后都保留 `rowActions`)。 */
|
|
10653
|
+
const ROW_ACTIONS_SELECTOR = "[class*=\"rowActions\"]";
|
|
10654
|
+
/**
|
|
10655
|
+
* 从宿主行的 `data-row-key` 解析会话 id。
|
|
10656
|
+
*
|
|
10657
|
+
* @param key - 行节点的 `data-row-key`。
|
|
10658
|
+
* @returns 会话 id;工作区行、其它行与空键返回 undefined。
|
|
10659
|
+
*/
|
|
10660
|
+
function sessionIdOfRowKey(key) {
|
|
10661
|
+
if (key === null || key === void 0 || !key.startsWith(SESSION_ROW_KEY_PREFIX)) return void 0;
|
|
10662
|
+
const id = key.slice(8);
|
|
10663
|
+
return id === "" ? void 0 : id;
|
|
10664
|
+
}
|
|
10665
|
+
/**
|
|
10666
|
+
* 是否有外部插件往操作区塞了非菜单按钮(归档管理器的星标就是这么插的)。
|
|
10667
|
+
*
|
|
10668
|
+
* @param button - 操作区内的候选按钮。
|
|
10669
|
+
* @returns 是外部按钮时返回 true。
|
|
10670
|
+
*/
|
|
10671
|
+
function isForeignButton(button) {
|
|
10672
|
+
const className = button.getAttribute("class") ?? "";
|
|
10673
|
+
return className.includes("rowStar") || className.includes("dsham_");
|
|
10674
|
+
}
|
|
10675
|
+
/**
|
|
10676
|
+
* 找到会话行的「···」菜单锚点。
|
|
10677
|
+
*
|
|
10678
|
+
* 两代宿主结构都要认:
|
|
10679
|
+
* - 0.2.2+ 给锚点打了 `data-context-menu-trigger`,快捷操作收进 `rowQuickActions`;
|
|
10680
|
+
* - 0.2.1 由 `Menu` 原语把锚点包在自己的 `span` 里,归档 / 置顶按钮与它平级。
|
|
10681
|
+
* 标记优先,其次按「非快捷操作区的包裹果」、再按「直接子按钮」兜底。空白会话行没有
|
|
10682
|
+
* 操作区,返回 null(右击时保留浏览器原生菜单)。
|
|
10683
|
+
*
|
|
10684
|
+
* @param row - 会话行节点。
|
|
10685
|
+
* @returns 菜单锚点按钮或 null。
|
|
10686
|
+
*/
|
|
10687
|
+
function findSessionMenuButton(row) {
|
|
10688
|
+
const actions = row.querySelector(ROW_ACTIONS_SELECTOR);
|
|
10689
|
+
if (actions === null) return null;
|
|
10690
|
+
const marked = actions.querySelector("button[data-context-menu-trigger]");
|
|
10691
|
+
if (marked !== null && !isForeignButton(marked)) return marked;
|
|
10692
|
+
const notQuickAction = (button) => !isForeignButton(button) && button.closest("[class*=\"rowQuickActions\"]") === null;
|
|
10693
|
+
const wrapped = Array.from(actions.querySelectorAll(":scope > span > button")).filter(notQuickAction);
|
|
10694
|
+
if (wrapped.length > 0) return wrapped[0] ?? null;
|
|
10695
|
+
const direct = Array.from(actions.querySelectorAll(":scope > button")).filter(notQuickAction);
|
|
10696
|
+
if (direct.length > 0) return direct[0] ?? null;
|
|
10697
|
+
return Array.from(actions.querySelectorAll("button")).filter(notQuickAction)[0] ?? null;
|
|
10698
|
+
}
|
|
10699
|
+
/**
|
|
10700
|
+
* 读取可写的未读集合。
|
|
10701
|
+
*
|
|
10702
|
+
* @param host - 宿主 `uiSession` 服务的最小可用面。
|
|
10703
|
+
* @returns 未读集合;服务缺失或内部字段改名时返回 undefined。
|
|
10704
|
+
*/
|
|
10705
|
+
function unreadSetOf(host) {
|
|
10706
|
+
if (host === void 0) return void 0;
|
|
10707
|
+
if (!(host.completionUnread instanceof Set)) return void 0;
|
|
10708
|
+
if (typeof host.publishStatus !== "function") return void 0;
|
|
10709
|
+
return host.completionUnread;
|
|
10710
|
+
}
|
|
10711
|
+
/**
|
|
10712
|
+
* 宿主未读服务是否具备可写能力(未读集合有效且广播方法存在)。
|
|
10713
|
+
*/
|
|
10714
|
+
function canMarkSession(host) {
|
|
10715
|
+
return unreadSetOf(host) !== void 0;
|
|
10716
|
+
}
|
|
10717
|
+
/**
|
|
10718
|
+
* 目标会话是否处于已归档状态。
|
|
10719
|
+
*/
|
|
10720
|
+
function isSessionArchived(archivedSessionIds, sessionId) {
|
|
10721
|
+
return archivedSessionIds?.includes(sessionId) === true;
|
|
10722
|
+
}
|
|
10723
|
+
/**
|
|
10724
|
+
* 目标会话是否正在主视图中打开。
|
|
10725
|
+
*/
|
|
10726
|
+
function isSessionOpenInMainView(sessionItem) {
|
|
10727
|
+
return (sessionItem?.retainedBy?.mainView ?? 0) > 0;
|
|
10728
|
+
}
|
|
10729
|
+
/**
|
|
10730
|
+
* 目标会话是否处于忙碌态(运行中或等待交互)。
|
|
10731
|
+
*/
|
|
10732
|
+
function isSessionBusy(status, sessionItem) {
|
|
10733
|
+
return status?.running === true || status?.pendingInteraction !== void 0 || sessionItem?.running === true;
|
|
10734
|
+
}
|
|
10735
|
+
/**
|
|
10736
|
+
* 综合判断是否应向用户展示未读/已读切换菜单项。
|
|
10737
|
+
*
|
|
10738
|
+
* - 宿主契约漂移不可写时:不展示(fail-closed,杜绝点击静默无效);
|
|
10739
|
+
* - 已归档会话:不展示;
|
|
10740
|
+
* - 当前处于已读态,但在主视图打开中或忙碌中:不展示(标记后会被宿主重算冲掉);
|
|
10741
|
+
* - 当前处于未读态:始终展示「标记为已读」。
|
|
10742
|
+
*/
|
|
10743
|
+
function shouldShowSessionUnreadAction(params) {
|
|
10744
|
+
if (!params.canWrite) return false;
|
|
10745
|
+
if (params.isArchived) return false;
|
|
10746
|
+
if (!params.isUnread && (params.isOpenInMainView || params.isBusy)) return false;
|
|
10747
|
+
return true;
|
|
10748
|
+
}
|
|
10749
|
+
/**
|
|
10750
|
+
* 写入或清除未读标记,并让宿主重算状态。
|
|
10751
|
+
*
|
|
10752
|
+
* 已经是目标值时直接成功(不重复广播);广播抛错时回滚集合,避免内存状态与宿主
|
|
10753
|
+
* 渲染结果分叉。失败返回 false,调用方不做任何 UI 承诺。
|
|
10754
|
+
*
|
|
10755
|
+
* @param host - 宿主 `uiSession` 服务的最小可用面。
|
|
10756
|
+
* @param sessionId - 目标会话。
|
|
10757
|
+
* @param unread - 目标状态。
|
|
10758
|
+
* @returns 宿主状态是否已按目标写入。
|
|
10759
|
+
*/
|
|
10760
|
+
function writeSessionUnread(host, sessionId, unread) {
|
|
10761
|
+
const unreadSet = unreadSetOf(host);
|
|
10762
|
+
if (unreadSet === void 0 || sessionId === "") return false;
|
|
10763
|
+
const had = unreadSet.has(sessionId);
|
|
10764
|
+
if (had === unread) return true;
|
|
10765
|
+
if (unread) unreadSet.add(sessionId);
|
|
10766
|
+
else unreadSet.delete(sessionId);
|
|
10767
|
+
try {
|
|
10768
|
+
host.publishStatus();
|
|
10769
|
+
return true;
|
|
10770
|
+
} catch {
|
|
10771
|
+
if (had) unreadSet.add(sessionId);
|
|
10772
|
+
else unreadSet.delete(sessionId);
|
|
10773
|
+
return false;
|
|
10774
|
+
}
|
|
10775
|
+
}
|
|
10776
|
+
//#endregion
|
|
10777
|
+
//#region src/client/sidebar/session-unread/index.tsx
|
|
10778
|
+
/** 宿主会话行菜单槽位(行操作列表)。 */
|
|
10779
|
+
const MENU_SLOT = "sidebar.workspaces.session.menu.item";
|
|
10780
|
+
/** 槽位内本子插件的行 id:命名空间化,避免与宿主行冲突。 */
|
|
10781
|
+
const MENU_ITEM_ID = "codex-ui:session-unread";
|
|
10782
|
+
/** 排在置顶(100)之后、重命名(200)之前。 */
|
|
10783
|
+
const MENU_ORDER = 150;
|
|
10784
|
+
/** 图标插槽 entryKey。 */
|
|
10785
|
+
const ICON_UNREAD_KEY = "codex-ui:icon-session-unread";
|
|
10786
|
+
const ICON_READ_KEY = "codex-ui:icon-session-read";
|
|
10787
|
+
/**
|
|
10788
|
+
* 「标记为未读 / 标记为已读」菜单行。
|
|
10789
|
+
*
|
|
10790
|
+
* 宿主标准 hook 缺一环就整行不渲染:这是可选增强,绝不能让一个缺失的宿主能力
|
|
10791
|
+
* 把整份会话菜单拖垮。
|
|
10792
|
+
*
|
|
10793
|
+
* @param props - 宿主组合 props(见 {@link MarkUnreadMenuProps})。
|
|
10794
|
+
* @returns 一行菜单项,或 null(未读不可写 / 已归档 / 正在主视图打开)。
|
|
10795
|
+
*/
|
|
10796
|
+
function MarkUnreadMenuItem(props) {
|
|
10797
|
+
const { useMenuOpenState, useSessionStatus, useSessions, useWorkspaces } = props;
|
|
10798
|
+
if (typeof useMenuOpenState !== "function" || typeof useSessionStatus !== "function" || typeof useSessions !== "function" || typeof useWorkspaces !== "function" || typeof props.markUnread !== "function" || typeof props.markRead !== "function") return null;
|
|
10799
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkUnreadMenuRow, { ...props });
|
|
10800
|
+
}
|
|
10801
|
+
/**
|
|
10802
|
+
* 菜单行的渲染主体:hooks 必须无条件调用,因此与能力守卫拆成两个组件。
|
|
10803
|
+
*
|
|
10804
|
+
* @param props - 已确认具备全部宿主 hook 的组合 props。
|
|
10805
|
+
* @returns 菜单项或 null。
|
|
10806
|
+
*/
|
|
10807
|
+
function MarkUnreadMenuRow(props) {
|
|
10808
|
+
const { markRead, markUnread, sessionId, t } = props;
|
|
10809
|
+
const [, setMenuOpen] = props.useMenuOpenState();
|
|
10810
|
+
const unread = props.useSessionStatus((statuses) => statuses.get(sessionId)?.completionUnread === true);
|
|
10811
|
+
const busy = props.useSessionStatus((statuses) => isSessionBusy(statuses.get(sessionId)));
|
|
10812
|
+
const openInMainView = props.useSessions((list) => isSessionOpenInMainView(list.byId[sessionId]));
|
|
10813
|
+
const archived = props.useWorkspaces((state) => isSessionArchived(state.archivedSessionIds, sessionId));
|
|
10814
|
+
if (!shouldShowSessionUnreadAction({
|
|
10815
|
+
canWrite: typeof props.canWrite === "function" ? props.canWrite() : props.canWrite === true,
|
|
10816
|
+
isUnread: unread,
|
|
10817
|
+
isArchived: archived,
|
|
10818
|
+
isOpenInMainView: openInMainView,
|
|
10819
|
+
isBusy: busy
|
|
10820
|
+
})) return null;
|
|
10821
|
+
const select = (next) => {
|
|
10822
|
+
setMenuOpen(false);
|
|
10823
|
+
if (next) markUnread(sessionId);
|
|
10824
|
+
else markRead(sessionId);
|
|
10825
|
+
};
|
|
10826
|
+
if (unread) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
10827
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckCircleOutlineRegular, { size: 16 }),
|
|
10828
|
+
onSelect: () => select(false),
|
|
10829
|
+
children: t("session.markRead")
|
|
10830
|
+
});
|
|
10831
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
10832
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
10833
|
+
state: "done",
|
|
10834
|
+
size: 10
|
|
10835
|
+
}),
|
|
10836
|
+
onSelect: () => select(true),
|
|
10837
|
+
children: t("session.markUnread")
|
|
10838
|
+
});
|
|
10839
|
+
}
|
|
10840
|
+
/**
|
|
10841
|
+
* 从客户端 Context 惰性读取宿主 `uiSession`。
|
|
10842
|
+
*
|
|
10843
|
+
* 故意不列入插件 inject:服务缺失时本能力整体降级,不影响插件其它功能加载;
|
|
10844
|
+
* 服务晚到时因为每次点击才读取,标记依然可用。
|
|
10845
|
+
*
|
|
10846
|
+
* @param ctx - 客户端插件 Context。
|
|
10847
|
+
* @returns 宿主服务的最小可用面或 undefined。
|
|
10848
|
+
*/
|
|
10849
|
+
function unreadHostOf(ctx) {
|
|
10850
|
+
try {
|
|
10851
|
+
const service = ctx.get?.("uiSession") ?? ctx.uiSession;
|
|
10852
|
+
if (service === null || typeof service !== "object") return void 0;
|
|
10853
|
+
return service;
|
|
10854
|
+
} catch {
|
|
10855
|
+
return;
|
|
10856
|
+
}
|
|
10857
|
+
}
|
|
10858
|
+
/**
|
|
10859
|
+
* 宿主是否自带右键菜单服务(0.2.2+ 把 `contextmenu` 绑定到了会话行本身)。
|
|
10860
|
+
*/
|
|
10861
|
+
function getNativeContextMenuService(ctx) {
|
|
10862
|
+
try {
|
|
10863
|
+
const service = ctx.get?.("contextMenus") ?? ctx.contextMenus;
|
|
10864
|
+
if (service === null || typeof service !== "object") return void 0;
|
|
10865
|
+
return service;
|
|
10866
|
+
} catch {
|
|
10867
|
+
return;
|
|
10868
|
+
}
|
|
10869
|
+
}
|
|
10870
|
+
function hostOwnsContextMenu(ctx) {
|
|
10871
|
+
return typeof getNativeContextMenuService(ctx)?.open === "function";
|
|
10872
|
+
}
|
|
10873
|
+
/**
|
|
10874
|
+
* 挂载会话未读能力。
|
|
10875
|
+
*
|
|
10876
|
+
* - DSH 0.2.2+:宿主拥有 contextMenus 服务,直接通过 contextMenus.register(..., order: 150)
|
|
10877
|
+
* 注入会话菜单,精准排在置顶(100)之后、重命名(200)之前;同时注入 contextMenu.icon。
|
|
10878
|
+
* - DSH 0.2.0 / 0.2.1:老版宿主无 contextMenus 服务,注册 sidebar.workspaces.session.menu.item
|
|
10879
|
+
* 并安装文档级 contextmenu 委托点击「···」锚点唤起菜单。
|
|
10880
|
+
*
|
|
10881
|
+
* @param ctx - 客户端插件 Context。
|
|
10882
|
+
* @returns 卸载函数(重复调用安全)。
|
|
10883
|
+
*/
|
|
10884
|
+
function observeSessionUnread(ctx) {
|
|
10885
|
+
const slots = ctx.slots;
|
|
10886
|
+
let disposed = false;
|
|
10887
|
+
const markUnread = (sessionId) => writeSessionUnread(unreadHostOf(ctx), sessionId, true);
|
|
10888
|
+
const markRead = (sessionId) => writeSessionUnread(unreadHostOf(ctx), sessionId, false);
|
|
10889
|
+
const nativeContextMenus = getNativeContextMenuService(ctx);
|
|
10890
|
+
if (typeof nativeContextMenus?.register === "function") {
|
|
10891
|
+
let disposeUnreadIcon;
|
|
10892
|
+
let disposeReadIcon;
|
|
10893
|
+
if (slots !== void 0 && typeof slots.inject === "function" && typeof slots.register === "function") {
|
|
10894
|
+
try {
|
|
10895
|
+
const u1 = slots.inject("contextMenu.icon", () => slots.register({
|
|
10896
|
+
name: "contextMenu.icon",
|
|
10897
|
+
key: ICON_UNREAD_KEY
|
|
10898
|
+
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
10899
|
+
state: "done",
|
|
10900
|
+
size: 10
|
|
10901
|
+
})));
|
|
10902
|
+
if (typeof u1 === "function") disposeUnreadIcon = u1;
|
|
10903
|
+
} catch {}
|
|
10904
|
+
try {
|
|
10905
|
+
const u2 = slots.inject("contextMenu.icon", () => slots.register({
|
|
10906
|
+
name: "contextMenu.icon",
|
|
10907
|
+
key: ICON_READ_KEY
|
|
10908
|
+
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckCircleOutlineRegular, { size: 16 })));
|
|
10909
|
+
if (typeof u2 === "function") disposeReadIcon = u2;
|
|
10910
|
+
} catch {}
|
|
10911
|
+
}
|
|
10912
|
+
let unregNative;
|
|
10913
|
+
try {
|
|
10914
|
+
unregNative = nativeContextMenus.register({
|
|
10915
|
+
id: MENU_ITEM_ID,
|
|
10916
|
+
target: "session",
|
|
10917
|
+
order: MENU_ORDER,
|
|
10918
|
+
observe: () => {
|
|
10919
|
+
const sessionStatus = unreadHostOf(ctx)?.sessionStatus;
|
|
10920
|
+
return [ctx.locale, ...sessionStatus?.subscribe ? [sessionStatus] : []];
|
|
10921
|
+
},
|
|
10922
|
+
resolve: (target) => {
|
|
10923
|
+
const sessionId = target?.sessionId;
|
|
10924
|
+
if (!sessionId) return [];
|
|
10925
|
+
const unreadHost = unreadHostOf(ctx);
|
|
10926
|
+
const canWrite = canMarkSession(unreadHost);
|
|
10927
|
+
const isUnread = unreadSetOf(unreadHost)?.has(sessionId) === true;
|
|
10928
|
+
let archived = false;
|
|
10929
|
+
try {
|
|
10930
|
+
const workspaces = ctx.get?.("workspaces") ?? ctx.workspaces;
|
|
10931
|
+
archived = isSessionArchived((workspaces?.list?.getSnapshot?.() ?? workspaces?.getSnapshot?.())?.archivedSessionIds, sessionId);
|
|
10932
|
+
} catch {}
|
|
10933
|
+
let openInMainView = false;
|
|
10934
|
+
let busy = false;
|
|
10935
|
+
try {
|
|
10936
|
+
const sessions = ctx.get?.("sessions") ?? ctx.sessions;
|
|
10937
|
+
const list = sessions?.list?.getSnapshot?.() ?? sessions?.getSnapshot?.();
|
|
10938
|
+
const sessionItem = list?.byId?.[sessionId] ?? list?.items?.find?.((s) => s.id === sessionId);
|
|
10939
|
+
openInMainView = isSessionOpenInMainView(sessionItem);
|
|
10940
|
+
const uiSession = unreadHost;
|
|
10941
|
+
const statusMap = uiSession?.sessionStatus?.getSnapshot?.() ?? uiSession?.sessionStatus;
|
|
10942
|
+
busy = isSessionBusy(statusMap instanceof Map ? statusMap.get(sessionId) : statusMap?.[sessionId] ?? uiSession?.statusOf?.(sessionId), sessionItem);
|
|
10943
|
+
} catch {}
|
|
10944
|
+
if (!shouldShowSessionUnreadAction({
|
|
10945
|
+
canWrite,
|
|
10946
|
+
isUnread,
|
|
10947
|
+
isArchived: archived,
|
|
10948
|
+
isOpenInMainView: openInMainView,
|
|
10949
|
+
isBusy: busy
|
|
10950
|
+
})) return [];
|
|
10951
|
+
const t = ctx.locale?.bind?.("michengai.codexUi") ?? ((k) => k);
|
|
10952
|
+
if (isUnread) return [{
|
|
10953
|
+
id: "mark-read",
|
|
10954
|
+
label: t("session.markRead"),
|
|
10955
|
+
icon: { key: ICON_READ_KEY },
|
|
10956
|
+
run: () => {
|
|
10957
|
+
markRead(sessionId);
|
|
10958
|
+
}
|
|
10959
|
+
}];
|
|
10960
|
+
return [{
|
|
10961
|
+
id: "mark-unread",
|
|
10962
|
+
label: t("session.markUnread"),
|
|
10963
|
+
icon: { key: ICON_UNREAD_KEY },
|
|
10964
|
+
run: () => {
|
|
10965
|
+
markUnread(sessionId);
|
|
10966
|
+
}
|
|
10967
|
+
}];
|
|
10968
|
+
}
|
|
10969
|
+
});
|
|
10970
|
+
} catch (error) {
|
|
10971
|
+
console.warn("[codex-ui:session-unread] 注册原生 contextMenus 失败,跳过。", error);
|
|
10972
|
+
}
|
|
10973
|
+
return () => {
|
|
10974
|
+
if (disposed) return;
|
|
10975
|
+
disposed = true;
|
|
10976
|
+
if (typeof unregNative === "function") try {
|
|
10977
|
+
unregNative();
|
|
10978
|
+
} catch {}
|
|
10979
|
+
if (typeof disposeUnreadIcon === "function") try {
|
|
10980
|
+
disposeUnreadIcon();
|
|
10981
|
+
} catch {}
|
|
10982
|
+
if (typeof disposeReadIcon === "function") try {
|
|
10983
|
+
disposeReadIcon();
|
|
10984
|
+
} catch {}
|
|
10985
|
+
};
|
|
10986
|
+
}
|
|
10987
|
+
if (slots === void 0 || typeof slots.inject !== "function" || typeof slots.register !== "function") return () => {};
|
|
10988
|
+
let disposeEntry;
|
|
10989
|
+
try {
|
|
10990
|
+
disposeEntry = slots.inject(MENU_SLOT, () => slots.register({
|
|
10991
|
+
name: MENU_SLOT,
|
|
10992
|
+
id: MENU_ITEM_ID,
|
|
10993
|
+
order: MENU_ORDER,
|
|
10994
|
+
locale: NS,
|
|
10995
|
+
inject: () => ({
|
|
10996
|
+
markUnread,
|
|
10997
|
+
markRead,
|
|
10998
|
+
canWrite: () => canMarkSession(unreadHostOf(ctx))
|
|
10999
|
+
})
|
|
11000
|
+
}, MarkUnreadMenuItem));
|
|
11001
|
+
} catch (error) {
|
|
11002
|
+
console.warn("[codex-ui:session-unread] 会话菜单项注册失败,已跳过。", error);
|
|
11003
|
+
return () => {};
|
|
11004
|
+
}
|
|
11005
|
+
const onContextMenu = (event) => {
|
|
11006
|
+
if (disposed || event.defaultPrevented) return;
|
|
11007
|
+
const target = event.target;
|
|
11008
|
+
if (!(target instanceof Element)) return;
|
|
11009
|
+
if (target.closest("input, textarea, [contenteditable='true']") !== null) return;
|
|
11010
|
+
if (target.closest("[role=\"menu\"]") !== null) return;
|
|
11011
|
+
const row = target.closest("[data-row-key]");
|
|
11012
|
+
if (row === null || sessionIdOfRowKey(row.getAttribute("data-row-key")) === void 0) return;
|
|
11013
|
+
if (hostOwnsContextMenu(ctx) || row.querySelector("[data-context-menu-trigger]") !== null) return;
|
|
11014
|
+
const selection = typeof window.getSelection === "function" ? window.getSelection() : null;
|
|
11015
|
+
if (selection !== null && selection.toString().trim() !== "") return;
|
|
11016
|
+
const menuButton = findSessionMenuButton(row);
|
|
11017
|
+
if (menuButton === null) return;
|
|
11018
|
+
event.preventDefault();
|
|
11019
|
+
menuButton.click();
|
|
11020
|
+
};
|
|
11021
|
+
document.addEventListener("contextmenu", onContextMenu, true);
|
|
11022
|
+
return () => {
|
|
11023
|
+
if (disposed) return;
|
|
11024
|
+
disposed = true;
|
|
11025
|
+
document.removeEventListener("contextmenu", onContextMenu, true);
|
|
11026
|
+
if (typeof disposeEntry !== "function") return;
|
|
11027
|
+
try {
|
|
11028
|
+
disposeEntry();
|
|
11029
|
+
} catch {}
|
|
11030
|
+
};
|
|
11031
|
+
}
|
|
11032
|
+
//#endregion
|
|
10645
11033
|
//#region src/client/desktop-menu/restart-client.ts
|
|
10646
11034
|
/**
|
|
10647
11035
|
* 「重启应用与 Host」的客户端通道与进度卡片。
|
|
@@ -11226,6 +11614,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
11226
11614
|
en
|
|
11227
11615
|
}), "michengai-codex-ui: dictionaries");
|
|
11228
11616
|
const t = ctx.locale.bind(NS);
|
|
11617
|
+
const sidebarReady = checkSidebarEnabled();
|
|
11229
11618
|
ctx.effect(() => observeTheme(ctx), "michengai-codex-ui: theme & appearance");
|
|
11230
11619
|
ctx.effect(() => observeSidebarNav(ctx), "michengai-codex-ui: sidebar navigation");
|
|
11231
11620
|
ctx.effect(() => {
|
|
@@ -11251,7 +11640,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
11251
11640
|
ctx.effect(() => {
|
|
11252
11641
|
let stop;
|
|
11253
11642
|
let cancelled = false;
|
|
11254
|
-
|
|
11643
|
+
sidebarReady.then((enabled) => {
|
|
11255
11644
|
if (cancelled || !enabled) return;
|
|
11256
11645
|
const translate = (key, fallback) => {
|
|
11257
11646
|
try {
|
|
@@ -11268,6 +11657,18 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
11268
11657
|
stop?.();
|
|
11269
11658
|
};
|
|
11270
11659
|
}, "michengai-codex-ui: workspace sections");
|
|
11660
|
+
ctx.effect(() => {
|
|
11661
|
+
let stop;
|
|
11662
|
+
let cancelled = false;
|
|
11663
|
+
sidebarReady.then((enabled) => {
|
|
11664
|
+
if (cancelled || !enabled) return;
|
|
11665
|
+
stop = observeSessionUnread(ctx);
|
|
11666
|
+
});
|
|
11667
|
+
return () => {
|
|
11668
|
+
cancelled = true;
|
|
11669
|
+
stop?.();
|
|
11670
|
+
};
|
|
11671
|
+
}, "michengai-codex-ui: session unread");
|
|
11271
11672
|
ctx.effect(() => observeComposerEnhancements(ctx), "michengai-codex-ui: composer enhancements");
|
|
11272
11673
|
ctx.effect(() => observeSettingsSkin(), "michengai-codex-ui: official settings skin");
|
|
11273
11674
|
ctx.effect(() => observeSettingsNavIcon(() => t("about.nav")), "michengai-codex-ui: settings nav icon");
|
|
@@ -49,6 +49,8 @@ const zh = {
|
|
|
49
49
|
"sections.new": "新建分区",
|
|
50
50
|
"sections.newName": "新分区名称",
|
|
51
51
|
"sections.settings": "分区设置",
|
|
52
|
+
"session.markUnread": "标记为未读",
|
|
53
|
+
"session.markRead": "标记为已读",
|
|
52
54
|
"about.title": "Codex UI",
|
|
53
55
|
"about.viewProject": "GitHub",
|
|
54
56
|
"about.feedback": "问题反馈",
|
|
@@ -243,6 +245,8 @@ const en = {
|
|
|
243
245
|
"sections.new": "New section",
|
|
244
246
|
"sections.newName": "Section name",
|
|
245
247
|
"sections.settings": "Section settings",
|
|
248
|
+
"session.markUnread": "Mark as unread",
|
|
249
|
+
"session.markRead": "Mark as read",
|
|
246
250
|
"about.title": "Codex UI",
|
|
247
251
|
"about.viewProject": "GitHub",
|
|
248
252
|
"about.feedback": "Issues",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19",
|
|
4
4
|
"description": "DSH Codex UI — 为 DeepSeek Harness 提供极速历史召回、全屏设置皮肤、原生物理毛玻璃换肤、模块化侧栏与桌面原生窗口菜单 · Input enhancement, settings skin, native glass theme, modular sidebar, and desktop titlebar menu for DSH",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"CHANGELOG.zh-CN.md",
|
|
74
74
|
"LICENSE",
|
|
75
75
|
"README.md",
|
|
76
|
+
"README.en.md",
|
|
76
77
|
"README.zh-CN.md"
|
|
77
78
|
],
|
|
78
79
|
"dsh": {
|