condaThinker/dsh-left-sidebar-collapse ↗★ 0
dsh-left-sidebar-collapse
Auto-collapse / fully-collapse the DSH left sidebar on session select, as a standalone installable plugin. General-settings toggles plus a single floating expand button.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:condaThinker/dsh-left-sidebar-collapse说明文档
阅读完整 README ↗dsh-left-sidebar-collapse
English | 中文
选中会话后自动收起 / 彻底收起 DSH 左侧边栏。一个独立、可安装的 DSH 插件(纯客户端,不改 ui-layout 框架)。
在 设置 → General 里有两个独立偏好:
- 自动收起侧边栏 —— 选中某个会话后,左侧边栏收起为 56px 的工具栏。行为确定:插件内置状态机驱动
ctx.layout,读取稳定的data-sidebar-collapsedframe 信号,并对布局自身的反馈进行抑制,因此不会来回翻转。 - 完全缩回 —— 当侧边栏处于收起态时,把它整个隐藏(移除工具栏,grid 第一轨道收为 0),并在左上角显示一个浮动展开按钮。点击即恢复完整侧边栏;会话内容保持全宽,其余界面不受影响。
偏好存储在 localStorage(进程内浏览器偏好),因此开关始终可写、并能在刷新后保留。
安装
需要 DSH(DeepSeek Harness)的 dsh CLI。
dsh plugin --profile web add git+https://github.com/condaThinker/dsh-left-sidebar-collapse
然后重启目标 profile:
dsh --profile web
安装后打开 设置 → General,打开 自动收起侧边栏(可选再加 完全缩回)。
该插件带一个
prepare构建脚本。以 Git 方式安装时会执行该脚本构建lib/,因此 profile 需要允许:先把dsh-left-sidebar-collapse加入 profile 的allowBuilds(见pnpm install文档),再执行dsh plugin add。或者,若要免构建安装,可把构建好的lib/提交进 Git 并去掉prepare。
构建
pnpm install
pnpm build
pnpm test
工作原理
- 自动收起:监听
ctx.sessions.list,当当前会话切到另一个真实会话时,AutoCollapseMachine仅在 frame 渲染为展开(读取data-sidebar-collapsed)时通过ctx.layout.toggleSidebar()收起,并抑制后续翻转直到 frame 确认收起——不会双击、不会弹回。 - 完全缩回:
shell.overlay里的FullCollapseButton组件响应式监听data-sidebar-collapsed;当已收起且开启“完全缩回”时,注入一条 覆盖(侧边栏轨道 → 0,中心列重回全宽),并显示唯一的展开按钮。