rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Yu-jianhai/dsh-sidebar-layout
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DSH 左侧栏插件入口的整理器:可滚动、可拖动排序、可拖动调高、可逐个显隐。 把被入口吃掉的高度,还给工作区的会话列表。
English below.
DSH 的左侧栏入口是固定高度的一整列,每个入口一行 36px 加 2px 间距。这列的尺寸不随入口数量收敛, 装一个带侧栏的插件,它就长高一行:
宿主提供的唯一缓冲是「更多」菜单里的取消固定(不持久、重启即失效、且 Plugins 永远不能隐藏), 既解决不了高度问题,也没法按自己的习惯排序。
把这个入口列表变成一个有上限、能滚动、顺序可调、逐个可关的窗口:
省下来的高度全部还给工作区的会话列表——装插件不再等于挤掉工作区。
| 能力 | 交互 | 落点 |
|---|---|---|
| 限高滚动 | 鼠标移到入口列表底部 → 出现横向热区,上下拖动 | nav 的 max-height(行数 3…入口数) |
| 排序 | 行内悬浮出现右侧抓手,按住上下拖 | 每行的 CSS order(持久化到 localStorage) |
| 显隐 | 设置 → 侧栏布局 → 逐个勾选,或底栏图标的浮层 | 隐藏的行 display: none |
| 紧凑密度 | 设置里「实验性」开关,行高 36→28px | nav[data-dsl-density="compact"] |
| 拖动表现 | 起拖浮卡跟手、落点画灰块、其余行 FLIP 让位、松手吸附后再落库 | [data-dsl-drag-card] / [data-dsl-drag-ph] |
| 占位形态 | 设置 → 拖动效果:实心灰块 / 虚线框 / 幽灵行;可关掉吸附回弹 | nav[data-dsl-ph] / nav[data-dsl-bounce] |
不改宿主宽度、不改宿主滚动条:滚动条样式完全继承宿主(--dsh-scrollbar-width,5px),
插件只做横向对齐补偿,让列表滚动条与会话列表那条落在同一竖线上;拖动手柄的尺寸也不动。
拖动时看得见落点:按住抓手拖动时,被拖起的行变成一张跟手的浮卡,原位置留一个灰块标出松手后会落到的位置, 其余行以 180ms 缓动让位(FLIP),松手时浮卡吸到灰块位置再写库——所以你看到的落点就是最终落点。 占位可以换成虚线框或幽灵行,也可以关掉吸附回弹;这些只影响观感,不改排序结果,按 Esc 取消会清干净。
设置页自带兜底:万一设置页在某个 DSH 版本上渲染失败,页面会画出错误文本与 __dsl 排查提示,
而不是留一片空白——故障可诊断,侧栏本身也不受影响。
这是一个 DSH 插件包(dsh 字段声明了客户端入口与 bundle patch),安装方式与其它本地插件一致:
把它放进你的 profile 依赖里,并在 bundles 中登记。
// ~/.dsh/profiles/desktop/package.json
{
"dependencies": { "dsh-sidebar-layout": "link:/path/to/dsh-sidebar-layout" },
"dsh": { "profile": { "bundles": [ /* … */ "dsh-sidebar-layout" ] } }
}
再让 node_modules/dsh-sidebar-layout 指向这个目录(联合/联接均可)。
DSH 的 hmr 若是关闭的,装或改之后需要重启 DSH 才生效。
无构建步骤:lib/client.js 直接是 window.__ModuleLoader__.load({…}) 形态的客户端 bundle,无需打包。
装好之后有两个入口能到设置:设置 → 侧栏布局(左侧导航里,靠近底部的「侧栏布局」一页), 以及侧栏底部那枚三条横线的图标(浮层里是同一套开关)。
sidebar 单例槽(该槽 replaceRisk: shadows-shipped-ui,替换等于重画整根侧栏,随上游易碎)。[data-dsl-anchor="1"] 往上找 nav,不依赖 hash 化的 CSS 类名,也不猜中文文案。applyAll() 写入的 CSS order,浮卡与灰块只是视觉;松手先让浮卡吸到灰块位置,再 persist() 落库,所以看到的落点就是最终落点,Esc 一律不提交。dsh-apple-hig 分工:会话树(左侧栏下半部分)的拖拽归 apple-hig 负责,一级导航入口(本插件管理的这一列)归本插件负责,两边各管一层,不重复实现排序,也不会互相抢事件。nav > button,现在(2026-11-13 版)是 nav > div.panelEntry > button[aria-label],行内还多一颗「取消固定」按钮。
插件把 order / display 写到 nav 的直接子元素上,行高与行间距一律实测(新宿主行高 32px,旧版 36px),不写死数值。控制台有把手 window.__dsl:
__dsl.state() — 当前偏好__dsl.mapping() — 入口 id 与实际渲染行的对应__dsl.nav() — 找到的那根 nav__dsl.align() — 滚动条横向对齐的实测值 { margin, navRight, peerRight, peerWidth }__dsl.caps() — 行数上限的派生值 { entries, limit, floor, stored, effective }__dsl.refresh() — 立即重跑一遍__dsl.reset() — 清空偏好偏好存在 localStorage 的 dsh-sidebar-layout:v1:{ v, order: string[], hidden: string[], maxRows: number|null, density: 'comfortable'|'compact' }。
node --check lib/client.js
node test/boot-smoke.mjs # 最小 DOM 桩:注册 / 找 nav / 落偏好 / 设置页能渲染 / 卸载还原
从 bundles 与 dependencies 里删掉名字、删掉目录联接,重启。插件在卸载时会自己清掉注入的 <style>、
所有行内联样式与浮层节点。
dsh-sidebar-layout turns the DSH left sidebar's plugin-entry column into a bounded, scrollable, reorderable, individually hideable window — and gives the reclaimed height back to the workspace session list.
The left sidebar's entry column has a fixed row height (36px + 2px gap per entry). Every plugin that contributes a sidebar entry makes the column one row taller. With eight entries the column reserves about 348px of permanent vertical space; since the sidebar's total height is finite, that space is taken from the session list below it. The host's only relief valve is the "More" menu's unpin action, which is not persisted, resets on reload, and can never hide the built-in Plugins entry.
This is a DSH plugin package (dsh.client + dsh.bundle.patch). Add it to your profile's
dependencies (a link: spec works), list it in dsh.profile.bundles, point
node_modules/dsh-sidebar-layout at this directory, then restart DSH if HMR is disabled.
There is no build step: lib/client.js is a ready-to-load window.__ModuleLoader__.load({…}) bundle.
Two ways into the settings: Settings → 侧栏布局 (a page in the settings nav), and the three-bar icon at the bottom of the sidebar (same toggles in a popover).
sidebar single slot (replaceRisk: shadows-shipped-ui) is never replaced.nav > button (older host) and nav > div.panelEntry > button
(host since 2026-11-13); row height and gap are measured at runtime instead of hard-coded (32px vs 36px).window.__dsl.state() / mapping() / nav() / align() / caps() / refresh() / reset().
Preferences live in localStorage['dsh-sidebar-layout:v1'].
node --check lib/client.js
node test/boot-smoke.mjs
MIT © 2026 Ne_Rn
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。