dsh-ui-tweaks 0.4.0 → 0.5.0

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/README.en.md CHANGED
@@ -10,6 +10,10 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
10
10
  | **Conversation timeline**: right-side rail — hover to preview messages, click to jump, scroll-highlighting, auto-dodges a right sidebar | **Table style**: the Claude Desktop look (light-gray rounded cards) |
11
11
  | ![Dialog width](assets/dialog_box.png) | ![Settings panel](assets/settings.png) |
12
12
  | **Dialog width**: message column, composer and stats line widen together | **Settings panel**: font size / table style / dialog width / timeline |
13
+ | ![GitBar](assets/git.png) | |
14
+ | **GitBar**: git pills inside the composer tool row (branch after the access-mode control, diff before the model select) — branch management, per-file diff, and commit & push from the diff panel | |
15
+ | ![Archive manager](assets/archive.png) | ![MCP manager](assets/mcp.png) |
16
+ | **Archive manager**: an Archive page in the Settings dialog listing archived sessions (title / workspace / relative time) with Restore and Delete actions | **MCP manager**: an MCP page in the Settings dialog listing configured MCP servers with live status and full management (Add / Edit / Enable / Disable / Delete / Restart) |
13
17
 
14
18
  ## Features
15
19
 
@@ -17,6 +21,10 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
17
21
  - **Table style** — choose `Default` or the **Claude Desktop** look (light-gray rounded cell cards with small gaps, no borders; cells share the inline-code background; header not bold).
18
22
  - **Dialog width (px)** — type any value (600–1600); the message column, the composer input and the stats line below it widen together.
19
23
  - **Conversation timeline (toggleable, off by default)** — a thin navigation rail at the right of the message area: one indicator line per user message, hover to expand a preview panel, scroll-highlighting of the current position, click to smooth-scroll to that message (loading older history on demand). Works in **light and dark mode**, and **always hugs the message area's right edge** — even with a right sidebar installed and expanded (e.g. dsh-better-sidebar), the rail dodges it instead of overlapping. Auto-hidden while a session has fewer than two user messages.
24
+ - **GitBar (toggleable, off by default)** — when the session's working directory is a git repository, two compact pills render **inside the composer's tool row** (styled like the native access-mode / model-select controls, so the input area no longer carries a separate row above the card):
25
+ - **Branch pill** — right after the access-mode control; shows the current branch and opens an upward branch panel (local / remote lists, `git switch` on click, new-branch field).
26
+ - **Diff pill** — right before the model select; shows `+N −M · K files` and opens the right slide-over diff panel (changed-file list + per-file diff, resizable, commit band kept at its foot for 提交 / 提交并推送). The standalone commit pill is gone — commit now happens from the diff panel.
27
+ - **Squeeze-aware**: the composer tool row is an inline-size container, so when it tightens (e.g. the stretched diff panel pushes the column), the pills degrade like the native chrome — first hiding the "· K files" meta, then collapsing to **icon-only** — never overlapping the access / model controls.
20
28
  - **Archive manager (toggleable, off by default)** — an **Archive** page in the Settings dialog listing archived sessions (title / workspace / relative time) with per-row **Restore** and **Delete** actions plus batch **Restore all** / **Delete all** buttons.
21
29
  - **Restore** removes a session from the archive set (its log and workspace slot are kept, so the conversation returns to the normal sidebar list).
22
30
  - **Delete** PERMANENTLY deletes the session — the server removes its JSONL log from disk, detaches it from workspace accounting and the archive set, and clears its projection cache (irreversible). Only genuinely **running** sessions are refused; opened-but-idle sessions are also removed from the in-memory store, so the row disappears live.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-ui-tweaks
2
2
 
3
- [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:在设置面板中实时调整对话界面——字体大小、表格样式、对话框宽度、可开关的对话时间线、输入框上方的 **GitBar**(git 状态胶囊:分支 / 差异 / 提交),以及可开关的**归档管理**(设置中的「归档」页面:查看、恢复或彻底删除已归档会话)。
3
+ [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:在设置面板中实时调整对话界面——字体大小、表格样式、对话框宽度、可开关的对话时间线、**GitBar**(输入框工具行内的 git 状态胶囊:分支在权限旁、差异在模型前),以及可开关的**归档管理**(设置中的「归档」页面:查看、恢复或彻底删除已归档会话)。
4
4
 
5
5
  ## 预览
6
6
 
@@ -11,7 +11,9 @@
11
11
  | ![对话框宽度](assets/dialog_box.png) | ![设置面板](assets/settings.png) |
12
12
  | **对话框宽度**:消息列、输入框、统计栏同步变宽 | **设置面板**:字体大小 / 表格样式 / 对话框宽度 / 时间线 / Git 状态栏 |
13
13
  | ![GitBar](assets/git.png) | |
14
- | **GitBar**:输入框上方的 git 状态胶囊(分支 / 差异 / 提交),支持分支切换、删除、推送到远程,差异面板与提交弹窗 | |
14
+ | **GitBar**:输入框工具行内的 git 状态胶囊(分支在权限旁、差异在模型前),支持分支切换、删除、推送到远程,差异面板内可直接提交 | |
15
+ | ![归档管理](assets/archive.png) | ![MCP 管理](assets/mcp.png) |
16
+ | **归档管理**:设置中的「归档」页面,列出所有已归档会话(标题 / 工作区 / 相对时间),支持恢复与彻底删除 | **MCP 管理**:设置中的「MCP 管理」页面,列出所有配置的 MCP 服务器及其运行状态,支持添加 / 编辑 / 启用停用 / 删除 / 重启 |
15
17
 
16
18
  ## 功能
17
19
 
@@ -19,11 +21,11 @@
19
21
  - **表格样式**:可选 `默认` 或 **Claude Desktop** 风格(浅灰圆角单元格卡片、单元格间有间隙、无边框、单元格与行内代码同底色、表头不加粗)。
20
22
  - **对话框宽度(px)**:直接输入数字(600–1600);消息列、输入框、输入框下方的统计栏(轮数/步数/耗时/tok/s)**三者同步变宽**。
21
23
  - **对话时间线(可开关,默认关闭)**:在消息区右侧显示细竖导航轨——每条用户消息一根指示线,悬停展开面板预览消息、随滚动高亮当前位置、点击平滑跳转到对应消息(自动加载更早历史)。**浅色/深色模式都正常显示**,且**始终贴在消息区右侧**:即使安装了右侧边栏(如 dsh-better-sidebar)并展开,时间线也会自动避让、不会与侧边栏重叠。会话中用户消息少于 2 条时自动隐藏。
22
- - **GitBar(默认关闭,可在设置中开启)**:当会话的工作目录是一个 git 仓库时,在输入框上方显示三颗 DSH 原生风格的紧凑胶囊(与输入框同宽、随“对话框宽度”设置联动):
23
- - **分支胶囊(左)**:当前分支名(有未提交改动时带橙色圆点);点击**向上**弹出分支面板——本地 / 远程分支列表(点击即 `git switch`),底部可**新建分支**(`git switch -c` 并自动切换)。
24
- - **差异胶囊(右)**:`+N −M · K 个文件`;点击从右侧滑出**差异面板**:文件列表 + 逐文件 diff(默认**只显示有差异的 hunk**,右上可切“完整文件”视图)。面板**支持拖动拉伸宽度**,展开时**自动把对话区往左挤**(不影响右侧时间线),底部可直接**提交 / 提交并推送**。面板内三段(文件列表 / diff 内容 / 提交区)之间的分隔线**可上下拖动调整高度**(双击复位;提交说明框随提交区高度拉伸,可写多行,Shift+Enter 换行)。
25
- - **commit message 胶囊(右)**:点击弹出提交对话框——输入说明(**留空点提交会自动生成**,LLM 优先、失败回退启发式规则)、待提交文件清单(只显示文件与 ±行数,**点击文件即打开差异面板定位到该文件**),按钮:取消 / ✨ 生成 / 提交 / 提交并推送(新分支自动 `-u` 设上游)。
26
- - 非 git 仓库或无会话 cwd 时整行自动隐藏;所有操作走服务端 `execFile('git', …)`(无 shell、带超时)。
24
+ - **GitBar(默认关闭,可在设置中开启)**:当会话的工作目录是一个 git 仓库时,在**输入框工具行内**显示两颗与输入框原生控件(权限 / 模型选择)同款样式的紧凑胶囊——不再占用输入框上方单独一行,输入区因此更矮:
25
+ - **分支胶囊**:位于权限(访问模式)控件之后;显示当前分支名(有未提交改动时在标题提示)。点击**向上**弹出分支面板——本地 / 远程分支列表(点击即 `git switch`),底部可**新建分支**(`git switch -c` 并自动切换)。
26
+ - **差异胶囊**:位于模型选择之前;显示 `+N −M · K 个文件`。点击从右侧滑出**差异面板**:文件列表 + 逐文件 diff(默认**只显示有差异的 hunk**,右上可切“完整文件”视图)。面板**支持拖动拉伸宽度**,展开时**自动把对话区往左挤**(不影响右侧时间线);面板内三段(文件列表 / diff 内容 / 提交区)之间的分隔线**可上下拖动调整高度**(双击复位;提交说明框随提交区高度拉伸,可写多行,Shift+Enter 换行)。**提交区保留在差异面板底部**(提交 / 提交并推送,说明留空自动生成)——原来的独立 commit 胶囊已移除。
27
+ - **挤压自适应**:输入框工具行变窄时(例如差异面板拉宽把对话列挤小),胶囊像原生控件一样自动降级——先隐藏“· K 个文件”元信息,行再窄时**收敛为纯图标**,分支名与差异文字绝不会和权限、模型选择重叠。
28
+ - 非 git 仓库或无会话 cwd 时胶囊自动隐藏;所有操作走服务端 `execFile('git', …)`(无 shell、带超时)。
27
29
  - **归档管理(可开关,默认关闭)**:设置面板中的「归档」页面,列出所有已归档会话(标题 / 所在工作区 / 相对时间),支持**恢复**与**彻底删除**:
28
30
  - **恢复**:把会话移出归档——日志与工作区槽位原样保留,会话回到侧边栏列表。
29
31
  - **删除**:**彻底删除**该会话——服务端将其 JSONL 日志从磁盘移除、从工作区记账与归档集合中清除、并清理投影缓存,会话永久消失(不可恢复)。只有**正在运行**(有任务在跑)的会话会被拒绝;已打开但空闲的会话也会从内存中移除,删除后实时从列表消失。
@@ -90,7 +92,7 @@ npx -y @deepseek-ai/dsh plugin --profile web add . # 从本目录作为 b
90
92
  - **Git 后端**(`src/git.ts` + `src/git-web.ts`):通过 `ctx.get('sessions')`(可选服务)解析会话 header 的 `cwd` 作为“当前项目”,用 `child_process.execFile('git', …)`(无 shell、cwd 固定、超时 + 中止传播)执行只读/写操作;同源路由 `/_dsh/ui-tweaks/git/*` 提供 status / branches / diff(hunk 或完整文件,含绝对行号)/ suggest / commit / push / checkout / create。提交说明生成优先走 `ctx.get('llm')`(可选服务,收集 `text-delta` 流),不可用时回退到启发式规则(按文件类型推断 conventional commit 类型与 scope)。
91
93
  - **浏览器端**(`src/client/index.tsx`):读写该路由、渲染设置页,并通过运行时 `<style>` 元素实时应用样式,覆盖稳定的 DSH 锚点(`[data-chat-flow]`、`[data-composer-card]`、`body` 上的 markdown 字体 token、`[data-slot="conversation.chat.node"]` 内的 markdown 表格)。
92
94
  - **时间线**(`src/client/timeline.tsx`):挂在 `conversation.input.dock` 插槽、portal 到 `body`。数据按速度优先:会话投影 → 已加载聊天节点 → 后台 `loadOlder`。位置通过测量 `[data-conversation-scroll]`(消息区)右缘与垂直中线动态锚定,因此 DSH 原生列布局与右侧边栏(`#root` 的 margin-right 布局推挤)变化时都会自动跟随;颜色全部使用 DSH 主题变量(`--dsw-alias-*`),浅色/深色模式均正常。
93
- - **GitBar**(`src/client/gitbar.tsx`):挂在同一个 `conversation.input.dock` 插槽。胶囊行以 `width:100%` + `max-width` composer 卡片同宽(buildRuntimeCss 在“对话框宽度”变化时同步覆盖该宽度,实现联动),胶囊行自身背景透明、只有胶囊可见;差异面板展开时通过 `#root { margin-right }` 把对话区往左挤,时间线 rail(锚定消息区右缘)因此不被遮挡。面板内的高度分配采用「只给被拖的那一段显式高度、diff 段 `flex:1` 吃掉余量」的方式,配合 45% 上限,拖动永远不会撑破面板。
95
+ - **GitBar**(`src/client/gitbar.tsx`):拆成两个组件,分别挂在 composer 工具行**内部**的 `conversation.input.left`(分支,位于权限控件之后)与 `conversation.input.right`(差异,位于模型选择之前)插槽——输入区不再有独立的一行胶囊。样式与输入框原生控件一致(28px 高、radius 24px、`--dsw-alias-label-secondary` 颜色、hover 用 `--dsw-alias-interactive-bg-hover`)。工具行是 DSH 的 inline-size 容器(`container-type:inline-size`),胶囊用 `@container` 查询做挤压降级:行宽 <700px 隐藏差异的“· K 个文件”元信息,<620px 全部收敛为纯图标,避免与权限 / 模型选择重叠;分支名另加 `text-overflow:ellipsis` 上限。差异面板展开时通过 `#root { margin-right }` 把对话区往左挤,时间线 rail(锚定消息区右缘)因此不被遮挡;面板内的高度分配采用「只给被拖的那一段显式高度、diff 段 `flex:1` 吃掉余量」的方式,配合 45% 上限,拖动永远不会撑破面板。独立 commit 胶囊已移除,提交保留在差异面板底部的提交区。
94
96
  - **归档管理**(服务端 `src/archive.ts` + 浏览器端 `src/client/archive.tsx`):作为 `settings.section` 插槽(设置面板中的「归档」页面)。列表数据直接来自框架标准 hook `useSessions` + `useWorkspaces`(`archivedSessionIds`),无需额外查询;操作走同源路由 `/_dsh/ui-tweaks/archive`。**恢复**把会话 id 从工作区存储域的 `archivedSessionIds` 全局单例中移除(DSH 只暴露单向 `archiveSession`,无公开的取消归档 API,故直接写活体存储域句柄并同步工作区注册表的内存缓存)。**彻底删除**依次:拒绝正在运行的会话(agent `status === 'running'` 才拒绝,空闲会话先 `cancel` + `whenIdle`)→ 用持久化后端自身的 `findLog` 定位并 `rm` 会话日志目录 → 调用公开的 `WorkspaceEntity.detachSession` 摘除工作区记账 → 从归档集合移除并同步注册表内存缓存与 header 索引 → 清理 `session_projcache` → 从内存 SessionStore 摘除该会话(触发 `host/session-removed` 实时消失)。
95
97
  - **MCP 管理**(服务端 `src/mcp.ts` + 浏览器端 `src/client/mcp.tsx`):同源路由 `/_dsh/ui-tweaks/mcp`。**列表**枚举 `ctx.loader.entries()` 中 `@deepseek-ai/dsh-mcp-client` 实例(id / config / fiber 状态:active=2、failed=3 等)并按 `mcp__<serverName>__` 前缀从工具注册表统计工具。**重启**调用 `entry.fiber.restart()`(仅运行时)。**添加 / 编辑 / 删除 / 启用停用**通过 `yaml`(eemeli)的 Document API 直接编辑 profile 的 `cordis.patch.yml`(保留注释与未知补丁结构,原子写 tmp+rename),随后由 DSH 内置的 `watchUserPatches` 热重载监视器重新应用补丁——`cordis-plugin-include` 对根组做**增量** `root.update`,因此只有被改动的 MCP 实例会重启,其它不受影响;环境变量值返回给同源浏览器(本机配置编辑需要),YAML 模式在服务端用 `yaml.parse` + 白名单校验。
96
98
 
Binary file
package/assets/git.png CHANGED
Binary file
package/assets/mcp.png ADDED
Binary file
Binary file