在会话行菜单加入 Pin/Unpin,并在侧边栏列表上方提供可折叠的 Pinned Sessions 分组:主机端持久化、悬停快速取消置顶、折叠状态记忆与实时运行状态点。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:NattoCB/dsh-plugin-pin-session
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness web plugin that pins sessions: a collapsible Pinned Sessions group above the sidebar session list, plus Pin / Unpin entries in every session row's
...menu. Pure client+host bundle — zero changes to DSH core, pin order stored host-side so it follows you across browsers and origins.
✨ Features
- 📌 Pin / Unpin in the row
...menu — one entry per row, label reflects current state. - 🗂️ Collapsible Pinned Sessions group directly above the session list:
- click a pinned row to open that session (
sessions.open); - hover reveals an
×quick-unpin; - header toggles collapse (persisted per browser via
localStorage); - sessions no longer present in the list render dimmed and are not clickable.
- click a pinned row to open that session (
- 💾 Host-side storage at
$DSH_HOME/storages/pin-session.json— pin order is oldest-first and consistent across browsers and origins. - 🧩 Zero core surgery — pinned sessions stay in the chronological list; the shipped WorkspaceBrowser is left untouched.
🚀 Install
dsh plugin --profile web add github:NattoCB/dsh-plugin-pin-session
Then add "dsh-plugin-pin-session" to dsh.profile.bundles in the profile's
package.json. A DSH restart is required — new client bundles join the boot
graph only at process start.
Local checkout instead?
dsh plugin --profile web add file:/absolute/path/to/dsh-plugin-pin-session
⚙️ How it works
| Half | Mechanism |
|---|---|
| Host | webServer.register({ kind: 'prefix', path: '/pin-session' }) JSON API over an atomic JSON file store |
| Row menu | The shipped session-row menu portals a role="menu" element to document.body; a MutationObserver matches each menu to its row via React fibers (props.node.id) and appends one Pin/Unpin item styled with the menu's own classes, closed by an outside pointerdown |
| Section | A React root planted before the [role="tree"] session list renders each pinned row's own real primitives.Menu, anchored at that row's ... button and wired to the same live callbacks (onRename(id, title) / onFork(id) / onArchive(id)) resolved from the row's fiber |
The shell freezes every vendor module it serves (Object.isFrozen(primitives) === true),
so shared components cannot be monkey-patched — but they can be called. The
section menu therefore opens at the pinned row (not wherever the original row
is scrolled) while rename/fork/archive stay single-sourced in the shipped
browser; the ... affordance hides while the real row is not rendered
(collapsed group / filtered list).
No pin icon ships in the primitives set, so the menu item embeds its own pushpin SVG.
✅ Verify after refresh
- Sidebar shows Pinned Sessions above the list once at least one session is pinned.
- Hover a session row →
...→ Rename / Fork / Archive + a pushpin-iconed Pin. - Click Pin → row appears under Pinned Sessions; menu flips to Unpin.
- The pinned row's own
...opens right at that row with the same actions. - Click a pinned row → that session opens; Unpin removes it.
- Collapse the group → reload page → collapsed state survives (
localStorage). cat ~/.dsh/storages/pin-session.jsonshows the id list.
🔌 API
GET /pin-session/pins -> { pins: [{ id, title?, pinnedAt }] }
POST /pin-session/pin {id, title?} -> { pins }
POST /pin-session/unpin {id} -> { pins }
🧪 Test
npm test # node --test — 11 cases across store + HTTP router
License
MIT — see LICENSE.
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-task-board★ 8759
侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
zhu1090093659/dsh-web#packages/dsh-web-all★ 8759
DSH Web UI 插件与皮肤合集:任务看板、git 图、右侧面板、远程移动端 UI、桌宠、实时 token 统计与皮肤中心。
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 4819
右下角常驻的小鲸鱼挂件:余额、今日已用与每轮对话消耗(含峰谷价),余额预警与今日预算的泡泡内容都可编辑;泡泡点击序列模块化自定义,支持并列加权 A/B、随机台词与随机图片;内置 30+ 厂商模板(OpenAI / OpenRouter / Kimi / 硅基流动 / 方舟 / 智谱 / MiniMax 等),按模型查余额与订阅额度;另有任务结束音效、导入音频、自定义角色与资源管理。数据全在本机,无遥测。
ccch1mneyyy/dsh-TUI★ 4602
Claude Code 风格全屏终端 UI:像素鲸鱼顶栏、实时工作状态行、思考流式展开。
omdsh-dev/DSH-better-sidebar★ 4181
侧边栏完整工作台:内置文件渲染编辑、终端、Git 与子代理,支持三方插件注册新 Tab。
Devin-AXIS/deepseek-design#deepseek-idesign★ 1461
可视化设计工作室,支持网站、App 原型、海报、信息卡、报告和杂志的模板创建、元素编辑、选区级 AI 草稿衔接与导出。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。