dsh-at-file
FSMargoo/dsh-at-fileCodex 风格的 `@file` 文件引用,输入框里直接搜索并引用工作区文件。
在会话行菜单加入 Pin/Unpin,并在侧边栏列表上方提供可折叠的 Pinned Sessions 分组:主机端持久化、悬停快速取消置顶、折叠状态记忆与实时运行状态点。
GET /pin-session/pins · POST /pin-session/pin · POST /pin-session/unpin
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.
... menu — one entry per row, label reflects current state.sessions.open);× quick-unpin;localStorage);$DSH_HOME/storages/pin-session.json — pin order
is oldest-first and consistent across browsers and origins.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
| 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.
... → Rename / Fork / Archive + a pushpin-iconed Pin.... opens right at that row with the same actions.localStorage).cat ~/.dsh/storages/pin-session.json shows the id list.GET /pin-session/pins -> { pins: [{ id, title?, pinnedAt }] }
POST /pin-session/pin {id, title?} -> { pins }
POST /pin-session/unpin {id} -> { pins }
npm test # node --test — 11 cases across store + HTTP router
MIT — see LICENSE.