Repository navigation
Releases
v0.3.0 — 置顶集合宿主持久化:跨浏览器/清缓存不丢
dsh-workspace-pin v0.3.0
置顶集合改为宿主持久化:和会话置顶同一套模型,跨浏览器、清缓存/无痕/换设备都不丢。
变更
- 宿主半边:注册精确路由
GET|POST /plugins/dsh-workspace-pin/state,准入复用官方ctx.connection.requestRejection()(Host/Origin 围栏 + 会话鉴权);状态落盘<DSH_HOME>/storages/dsh-workspace-pin/state.json(临时文件 + rename 原子写);pin/unpin为增量操作、宿主串行化,多浏览器并发不互相覆盖;set仅用于迁移;支持条目 configstateFile自定义位置。 - 浏览器半边:宿主是数据源——首帧 localStorage 缓存兜底后
GET对齐;点击乐观更新后POST {op:"pin"|"unpin"}并用权威集合校正;页面重新可见时再对齐;旧 localStorage 置顶集合一次性迁移到宿主。新增诊断window.__dshWorkspacePinStorageMode(host/cache)。 - 文档:README 拆成中文 README.md 与英文 README.en.md,删除「置顶集合是浏览器本地」的已知限制,补充数据位置/重置/
stateFile说明。 - 测试:新增
test/host-state.test.mjs(node --test,8/8 pass:读写、增量语义、并发串行化、准入拒绝、边界错误、损坏文件降级)。
English
The pin set is now host-persisted, the same model as the official session pins: it survives switching browsers, clearing site data and incognito windows. One exact route (GET|POST /plugins/dsh-workspace-pin/state) guarded by the official connection fence, with an atomic JSON state file under <DSH_HOME>/storages/dsh-workspace-pin/state.json; pin/unpin are incremental and serialized host-side. The browser half treats the host as the source of truth (localStorage is only a first-paint cache and legacy-migration source). Bilingual README split; host-half unit tests added.
Full Changelog: https://github.com/Richard2091/dsh-workspace-pin/blob/main/CHANGELOG.md
v0.2.0 — 与「会话置顶」完全同款的工作区图钉 / workspace pin parity
dsh-workspace-pin v0.2.0
首个公开版本:给 DSH Web 侧栏的工作区(文件夹)行补上和「会话置顶」完全同款的图钉。
亮点
- 悬浮按钮复用官方
*_iconButton类名,并通过平台模块表用官方 React /Tooltip/IconPin*渲染:16×16、--dsw-radius-xs、静止label-tertiary、hoverlabel-primary、无 hover 背景 - 置顶后无 hover 时显示 16×20、
label-caption的灰色实心 pin(对齐官方*_pinIndicator),行 hover 时隐藏,让位给悬浮按钮 - 点击把工作区钉到列表最前,顺序通过
ctx.workspaces.insertBefore写入宿主 registry;置顶集合存浏览器localStorage - 纯浏览器半边插件,不改 dsh 源码;拿不到官方原语时自动退回等价兜底样式
First public release
A workspace pin for the DSH Web sidebar, styled and behaving exactly like the official session pin.
No dsh source changes (browser-side plugin only).
Full Changelog: https://github.com/Richard2091/dsh-workspace-pin/blob/main/CHANGELOG.md