dsh-panel-opacity
v1.0.2
Published
Separate opacity sliders for the chat column, the composer, the Windows title bar and the sidebar column.
Maintainers
Readme
dsh-panel-opacity
给 DeepSeek Harness 桌面版用的一个小插件:把窗口拆成四块,各自单独调不透明度。
设置 → 侧边栏「界面透明度」,四个滑块,互不干扰:
| 滑块 | 默认 | 作用对象 |
|---|---|---|
| 聊天区 | 74% | 中间会话列(.centerCol) |
| 输入框 | 100% | 底部输入卡片,以及输入区里的附件卡 |
| 顶部栏 | 74% | 窗口最上方那条可拖动的标题条 |
| 侧边栏 | 35% | 左侧导航整列 |
100% = 完全不透明(实色)。数值越小,背后透出的越多。
为什么需要它
DSH 原本只有一个底色 token 在管这三块:
--dsw-specific-sidebar-fill → 整窗底板 .frame
→ 顶部栏 .frame::before
→ 侧边栏列 .sidebarCol而侧边栏内层容器又自己读同一个 token 再铺一层底。所以:
- 你改这个 token,整窗一起变——改侧边栏等于改聊天区底板;
- 侧边栏实际透过率 =
底板透过率 × 面板透过率,数学上永远比聊天区更实,想单独把侧边栏调透做不到; - 内层盖住外层,改外层"看起来没反应"。
这个插件不解 token 的方程,而是换赛道:让底板透明,四块各自用自己的 background 覆写,侧边栏列上再把 token 重绑成自己的值——自定义属性按 DOM 树继承,这一层重绑只影响侧边栏子树,顶部栏和底板是它的兄弟/祖先,读不到。
安装
已发布到 npm:[email protected]
插件本质是一个 bundle 包:package.json 里的 dsh.bundle.patch 指向 cordis.patch.yml,dsh.client 声明浏览器半侧入口。
方式一:插件窗口输入包名(推荐)
DSH 侧边栏 → 插件 → 右上角 添加插件,输入框里填:
dsh-panel-opacity按回车确认,装好后按 Ctrl+R 刷新一次页面,设置里就出现「界面透明度」。
等价命令:
dsh plugin add dsh-panel-opacity下载慢或超时就点对话框里的安装源,切到「中国大陆镜像源」——npmmirror 上已有同步副本。
方式二:本地目录
想离线装、或者改了代码装自己那份:
git clone https://github.com/SYFabric/dsh-panel-opacity.git也可以直接取 Releases 里的 zip 解压,得到 dsh-panel-opacity/ 目录。
然后让 DSH 装上这个目录:
用 Agent:调用
plugin_manager,action: install_bundle,target填绝对路径,例如D:\plugins\dsh-panel-opacity手动:把这个目录放进 profile 的
node_modules(或用 pnpm link),并在 profile 的组合补丁里加一行:- insert: - id: panel-opacity name: 'dsh-panel-opacity'
方式三:Git 地址直装
在添加插件输入框里贴仓库地址:
git+https://github.com/SYFabric/dsh-panel-opacity.git适合想跟仓库最新提交、不等 npm 发版的情况。
它到底改了什么
全部实现就是九条 CSS,没有别的副作用:
/* 整窗底板让开,露出手底下的壁纸层 */
html[data-windows-titlebar] body [class*="_frame"]:has([class*="_sidebarCol"]) { background: transparent !important; }
/* 四块各自持底,浅色/深色两套 */
body:not([data-ds-dark-theme]) [class*="_centerCol"] { background: rgba(255,255,255,α) !important; }
body[data-ds-dark-theme] [class*="_centerCol"] { background: rgba(22,24,32,α) !important; }
body:not([data-ds-dark-theme]) [data-conversation-region="composer"] [class*="_card"] { ... }
body[data-ds-dark-theme] [data-conversation-region="composer"] [class*="_card"] { ... }
html[data-windows-titlebar]:not([data-ds-dark-theme]) body:not([data-ds-dark-theme]) [class*="_frame"]:has([class*="_sidebarCol"])::before { ... }
html[data-windows-titlebar] body[data-ds-dark-theme] [class*="_frame"]:has([class*="_sidebarCol"])::before { ... }
/* 侧边栏:列自己持底 + token 重绑,让列内读该 token 的容器一起跟随 */
body:not([data-ds-dark-theme]) [class*="_sidebarCol"] { background: ... !important; --dsw-specific-sidebar-fill: ... !important; }
body[data-ds-dark-theme] [class*="_sidebarCol"] { background: ... !important; --dsw-specific-sidebar-fill: ... !important; }为什么它不打架
- 不抢共享 token。
--dsw-alias-*、--dsw-specific-input-major这些 token 还喂着审批卡、文件卡、账号通知卡,一个都没动。 - 不硬编码构建 hash。用
[class*="_centerCol"]这类只看 CSS Modules 局部名的属性选择器。_sidebarCol/_centerCol全仓唯一;_frame有七个包同名,所以加了:has([class*="_sidebarCol"])认准唯一那个。 - 特异性压得住。
[boot-suite](https://github.com/LeeRolling/dsh-boot-suite)的「聊天背景」写.mP3x-q_centerCol{…!important}特异性(0,1,0);这里是(0,1,2)~(0,4,2)。谁先注入谁后注入都不影响结果,boot-suite 重注入样式也顶不掉。 - 明暗自动跟。靠 body 上的
data-ds-dark-theme属性切两套 rgba,不订阅主题事件、不重算。 - 生命周期干净。
<style>由ctx.effect创建、插件卸载时整块移除;设置只写localStorage['dsh-panel-opacity.v1'],不碰 profile 配置。
已知边界
- 要透出壁纸,得有壁纸。聊天区/侧边栏是半透明时,露出来的是它们背后的东西。装了壁纸类插件就是壁纸;没装就是应用底色(看起来"没变化")。
_frame之外挑不出更稳的锚点。DSH 没给这三块加data-*属性,只能靠 CSS Modules 的局部名。哪天 DSH 把centerCol改名,对应那条规则失效——结果是回到原生外观,不会坏到不可用。- 和 boot-suite 分工重叠。装了 boot-suite 的话,它「聊天背景」页里的侧边栏/聊天透明度选项从此不再决定这两块(被本插件压住)。默认值刻意对齐了它当时的取值,观感连续。
卸载
在插件管理里禁用或移除即可:
<style>随插件卸载移除;- 留一个
localStorage['dsh-panel-opacity.v1'],不删也无害,重装后设置还在。
文件
package.json 清单:dsh.bundle.patch + dsh.client
cordis.patch.yml 插入一行 host entry
index.js host 半侧(空实现)
client.js 全部实现:CSS 生成 + 设置页
locale/zh.json 中文文案与插件页标题/描述
locale/en.json 英文同上
icon.svg 插件图标client.js 是单文件、无构建步骤、只依赖 require('react')。
License
MIT
