dsh-background-by-model 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -94,10 +94,10 @@ One interface, one config — only the current model differs:
94
94
 
95
95
  ### Global settings (Interface tab)
96
96
 
97
- - **Per-part Interface Opacity** — Independent sliders for the main background, sidebar, file preview panel, cards & panels (including the dropdowns and menus around the dialog), the input & controls (composer box, Cordis panel), plus the settings panel and the conversation text box.
97
+ - **Per-part Interface Opacity** — Independent sliders for the main background, left panel, right panel, cards & panels (including the dropdowns and menus around the dialog), the input & controls (composer box, Cordis panel), plus the settings panel and the conversation text box.
98
98
  - **Per-part Interface Blur** — Frosted-glass `backdrop-filter` blur (`0–60 px`) for each interface part, including a real backdrop on the composer and Cordis panel via stable host selectors.
99
99
  - **Conversation & Trajectory** — The message list is wrapped in a translucent card automatically, and the trajectory page gets whole-page opacity & blur controls, letting the wallpaper shine through the content.
100
- - **File Preview Panel** — The column that slides in from the right when you open a file now has a card of its own: its opacity follows **Main background** until you drag it (then this card owns it), and its blur stacks on top of the main-background blur. While closed it takes no space and costs nothing.
100
+ - **Right Panel** — The column that slides in from the right when you open a file now has a card of its own: its opacity follows **Main background** until you drag it (then this card owns it), and its blur stacks on top of the main-background blur. While closed it takes no space and costs nothing.
101
101
 
102
102
  ## Settings
103
103
 
@@ -105,7 +105,7 @@ Settings → **Theme** now has three tabs:
105
105
 
106
106
  | Tab | Scope | Contents |
107
107
  | --- | --- | --- |
108
- | **Interface** | Global, shared by every model | Opacity & blur for the main background, sidebar, file preview panel, cards & panels, input & controls, settings panel, conversation text box and trajectory page |
108
+ | **Interface** | Global, shared by every model | Opacity & blur for the main background, left panel, right panel, cards & panels, input & controls, settings panel, conversation text box and trajectory page |
109
109
  | **Model Background** | Per rule | The ordered rule list, the live match readout, and each rule's wallpaper, theme color, layout mode, framing, opacity and blur |
110
110
  | **Config** | — | Import / export the whole rule set (`dsh-background-by-model-theme.json`) |
111
111
 
@@ -182,6 +182,7 @@ After changing anything under `src/`, run `pnpm run bundle` again — the mounte
182
182
 
183
183
  ## Compatibility
184
184
 
185
+ - **dsh `>=0.1.7-rc.2`** — Declared in `peerDependencies` (every `@deepseek-ai/dsh-*` entry) and mirrored in `engines.dsh`. The host evaluates those peers against its own runtime version, so an older host reports the plugin as incompatible instead of running it silently.
185
186
  - **[`dsh web`](https://github.com/deepseek-ai/deepseek-harness)** — Full support on both the npm release and the new source build. The plugin auto-detects which client-module table the host ships (the new `@deepseek-ai/dsh-client-store` or the legacy `@deepseek-ai/dsh-client-runtime`) and resolves `defineStore` accordingly at runtime.
186
187
  - **[deepseek-harness-desktop](https://github.com/anywhere-labs/deepseek-harness-desktop)** — Supported
187
188
 
@@ -204,6 +205,27 @@ No. Both were removed in 0.3.0; each rule uses a static image.
204
205
 
205
206
  ## Recent Optimizations
206
207
 
208
+ ### v0.4.1
209
+
210
+ - **The right panel stops painting a permanent frosted plate** — dsh 0.1.7 no longer paints the file-preview panel itself: the container became the slide / fullscreen viewport, stays mounted at its full width for the whole session, and collapsing it only slides the dock out (`transform` + `visibility`, never `display`). A background plus a backdrop-filter on that container therefore covered the empty right half of the frame whenever the panel was closed — the frosted plate 0.1.7 showed. The card now paints the elements the host actually paints (the dock's tab hosts: `[data-dockkit-content]`, `[data-dockkit-empty]`) and rides the host's own open/close and slide transitions; the old panel selector survives behind a `:has()` guard for older hosts, and the backdrop-filter is gated on `[data-sidebar-right-open]` so a collapsed panel is never filtered.
211
+ - **Switching models switches the background again** — 0.1.7's `sessions.list` snapshot no longer publishes `current`, so the plugin could not tell which session was on screen: no session id, no `modelSelection` projection, empty model text, and every model fell through to rule 1. The session id now comes from the host's own `uiSession.current.key` binding, with the legacy `list.current` and a `retainedBy.mainView` row as fallbacks — all optional, so the lookup also works while `uiSession` mounts late. Model switches remain instant, because they ride the per-session `modelSelection` projection subscription rather than a poll.
212
+ - **Menu group headings stop reading as white bands** — 0.1.7 split the menu surface in two: the shared `MenuSurface` material paints the new `--dsw-menu-surface-fill`, and every other overlay paints `--dsw-specific-menu`, which the host aliases to it. The plugin re-emitted only the latter, so a model-selector panel kept the host glass while its sticky provider headings took the plugin's near-opaque palette colour. Both tokens are now generated from one expression and read one plugin-owned variable, so the card slider fades them together and the alias can no longer break.
213
+ - **The card slider's label says what it owns** — It covers menus as well as cards, so the Chinese label changed from 「对话框中选项面板」 to 「卡片与菜单面板」 and the English one from `Cards & panels` to `Cards & menus`.
214
+ - **Declared host raised to `0.1.7-rc.2`** — Every `@deepseek-ai/dsh-*` peer and `engines.dsh` now require 0.1.7-rc.2 or later. The host's compatibility check matches those peers against its own runtime version (`includePrerelease`), so an older host reports the plugin as incompatible by name instead of running it silently. The code's own version fallbacks are unchanged.
215
+
216
+ ### v0.4.0
217
+
218
+ - **Color extraction now measures brightness the way a display does** — The auto light/dark band was decided from the average HSV *value* (the max channel), which reads every saturated pixel as bright: pure blue is `v = 1.0` while its Rec.709 luma is `0.072`. A dark, saturated wallpaper was therefore pushed into the light band and got a light palette built on top of a dark picture. The extractor now averages Rec.709 luma — the same measure the wallpaper verdict always used.
219
+ - **Choosing an image now themes the rule** — Picking or replacing a rule's image extracts its theme color automatically (global toggle, on by default). It only ever fills a rule that has *no* color, so a color you picked — or deliberately cleared — is never overwritten; because the decode is asynchronous the rule is re-checked on arrival, so a color chosen while it ran wins.
220
+ - **Match test card replaces the "Active now" readout** — The status card answered "what is active" and went stale between switches; the tester answers the better question one step earlier. Type any model name (the field follows the detected model until you type) and it reports which rule would match, or that the fallback would. The diagnostics it could not express — the value being *host default* rather than this session's model, and a sessions service that is not up yet — moved into the card as hints, so a broken lookup still cannot masquerade as a correct read.
221
+ - **Config** — The one new persisted field (`autoExtract`) landed in the shared schema, so both halves sanitize it identically.
222
+
223
+ ### v0.3.3
224
+
225
+ - **The config shape is declared once, for both halves** — The node half (which sanitizes every write to disk) and the browser half (the UI's own view of the same file) used to spell the shape out separately: the key lists appeared 6 times across the two halves plus two sets of defaults, so a field added to one side only was silently dropped by the other side's sanitizer — the slider stayed live in memory, `writeConfig` wrote a config without it, and the next load fell back to the default. That is exactly how `blurs.rightbar` / `rightbarOpacity` were lost in 0.3.2. The types, the key lists, the defaults and the pure normalizers now live in one shared module (`src/schema.ts`) that both halves import, and both run the *same* sanitizer, so the UI and the disk copy can no longer disagree.
226
+ - **Unknown config fields are now reported** — While sanitizing a write, the node half logs one warning per key the shared shape does not declare (`ignoring unknown config field "blurs.produced" (declared in one half only?)`), so this class of drift shows up in the host log instead of quietly discarding a setting. Legacy pre-0.3 top-level keys are exempt (the migration consumes them).
227
+ - **No behaviour change** — Defaults, clamps, migration and the persisted file stay byte-for-byte what they were; this release only removes the duplication.
228
+
207
229
  ### v0.3.2
208
230
 
209
231
  - **New "File preview panel" card** — The column that slides in from the right when you open a file now has opacity and blur sliders of its own. Its only surface was `--dsw-alias-bg-base` — the very token the Main background slider rewrites — so it used to be an unnamed second copy of the main background with no control of its own. The new card's opacity **follows Main background by default** and only takes over on the first drag, so nothing changes on upgrade; its blur stacks on top of the main-background blur. While the panel is closed it is merely slid off-screen, so the card costs nothing.
package/README.zh.md CHANGED
@@ -94,10 +94,10 @@
94
94
 
95
95
  ### 全局设置(「界面」页)
96
96
 
97
- - **分部位界面透明度** — 主背景、侧边栏、文件预览侧栏、卡片面板(含对话框周围的选项框/菜单)、输入框与控件(发送框、Cordis 插件面板)、设置面板与对话文本框各自独立滑块。
97
+ - **分部位界面透明度** — 主背景、左侧栏、右侧栏、卡片面板(含对话框周围的选项框/菜单)、输入框与控件(发送框、Cordis 插件面板)、设置面板与对话文本框各自独立滑块。
98
98
  - **分部位界面模糊度** — 每个界面部位可独立调整毛玻璃 `backdrop-filter` 模糊(`0–60 px`),并通过宿主的稳定选择器为发送框与 Cordis 面板提供真实背景模糊。
99
99
  - **对话与轨迹页** — 消息列表自动包裹为半透明卡片,轨迹页可整页调节透明度与模糊,让壁纸从内容后方透出来。
100
- - **文件预览侧栏** — 点开文件后从右侧滑出的那一栏有了自己的卡片:透明度默认跟随「主背景」(拖动后本卡片接管),模糊则在主背景模糊之上再叠加;关闭时不占位置、无副作用。
100
+ - **右侧栏** — 点开文件后从右侧滑出的那一栏有了自己的卡片:透明度默认跟随「主背景」(拖动后本卡片接管),模糊则在主背景模糊之上再叠加;关闭时不占位置、无副作用。
101
101
 
102
102
  ## 设置界面
103
103
 
@@ -105,7 +105,7 @@
105
105
 
106
106
  | 选项卡 | 作用范围 | 内容 |
107
107
  | --- | --- | --- |
108
- | **界面** | 全局,所有模型共用 | 主背景、侧边栏、文件预览侧栏、卡片面板、输入框与控件、设置面板、对话文本框、轨迹页的透明度与模糊度 |
108
+ | **界面** | 全局,所有模型共用 | 主背景、左侧栏、右侧栏、卡片面板、输入框与控件、设置面板、对话文本框、轨迹页的透明度与模糊度 |
109
109
  | **模型背景** | 每条规则 | 有序规则列表、顶部实时状态,以及每条规则的壁纸、主题色、布局模式、取景、透明度与模糊度 |
110
110
  | **配置** | — | 导入 / 导出整套规则(`dsh-background-by-model-theme.json`) |
111
111
 
@@ -182,6 +182,7 @@ pnpm run typecheck
182
182
 
183
183
  ## 兼容性
184
184
 
185
+ - **dsh `>=0.1.7-rc.2`** — 在 `peerDependencies`(所有 `@deepseek-ai/dsh-*` 条目)中声明,并在 `engines.dsh` 中同步。宿主会用自身运行时版本校验这些 peer,因此更旧的宿主会直接按名字报出「不兼容」,而不是静默运行。
185
186
  - **[`dsh web`](https://github.com/deepseek-ai/deepseek-harness)** — 同时兼容 npm 发布版与新版源码构建。插件会自动检测宿主携带的客户端模块表(新版 `@deepseek-ai/dsh-client-store` 或旧版 `@deepseek-ai/dsh-client-runtime`),并在运行时据此解析 `defineStore`。
186
187
  - **[deepseek-harness-desktop](https://github.com/anywhere-labs/deepseek-harness-desktop)** — 支持
187
188
 
@@ -204,6 +205,27 @@ pnpm run typecheck
204
205
 
205
206
  ## 近期优化
206
207
 
208
+ ### v0.4.1
209
+
210
+ - **右侧面板不再糊出一块常驻磨砂板** — dsh 0.1.7 不再自己绘制文件预览面板:容器变成了滑动/全屏视口,整场会话都以全宽挂载,折叠只是把 dock 用 `transform` + `visibility` 滑出去(从不 `display:none`)。于是这个容器上的背景加 backdrop-filter 在面板折叠时照样盖住右半屏——就是那块磨砂板。现在卡片只画宿主真正在画的元素(dock 的 tab host:`[data-dockkit-content]`、`[data-dockkit-empty]`),跟着宿主自己的开合与滑动过渡走;旧的容器选择器留在 `:has()` 守卫后面以兼容老宿主,backdrop-filter 只在 `[data-sidebar-right-open]` 时生效,折叠态绝不走滤镜。
211
+ - **切换模型重新能切背景** — 0.1.7 的 `sessions.list` 快照不再发布 `current`,插件无法得知当前在屏的是哪个会话:拿不到会话 id → 没有 `modelSelection` 投影 → 模型文本为空 → 所有模型都退到规则 1。现在会话 id 先取宿主自己的 `uiSession.current.key`,老字段 `list.current` 与带 `retainedBy.mainView` 的行作为兜底,三跳都是可选的(`uiSession` 挂载晚也能解析)。换模型仍是即时的:它走的是该会话 `modelSelection` 投影的订阅,而不是轮询。
212
+ - **菜单分组标题不再是白道** — 0.1.7 把菜单面拆成了两个 token:共享的 `MenuSurface` 材质画新的 `--dsw-menu-surface-fill`,其他浮层画 `--dsw-specific-menu`,而宿主把后者别名到前者。插件只重新发射了后者,于是模型选择菜单的面板还是宿主玻璃,吸顶的分组标题却变成了插件近乎不透明的调色板色。现在两个 token 由同一个表达式生成、读同一个插件变量,卡片滑块让它们一起变化,别名也不会再被打断。
213
+ - **卡片滑块的标签改名** — 它同时管菜单与卡片,中文标签从「对话框中选项面板」改为「卡片与菜单面板」,英文从 `Cards & panels` 改为 `Cards & menus`。
214
+ - **声明宿主抬到 `0.1.7-rc.2`** — 所有 `@deepseek-ai/dsh-*` peer 与 `engines.dsh` 现在都要求 0.1.7-rc.2 及以后。宿主的兼容性校验会用自身运行时版本比对(带 `includePrerelease`),因此更旧的宿主会按名字报出插件不兼容,而不是静默运行。代码里的版本兜底逻辑未改动。
215
+
216
+ ### v0.4.0
217
+
218
+ - **取色改用「显示器看到的亮度」** — 亮暗带此前按 HSV 明度(max 通道)取平均,它把每个饱和像素都算成亮:纯蓝 `v = 1.0`,而 Rec.709 luma 只有 `0.072`。于是深色但饱和的壁纸被判进亮色带,在暗画面上配出一套浅色界面。现在改为平均 Rec.709 luma——与壁纸判定的同一套度量。
219
+ - **选图即上色** — 选图或换图后自动为规则取主题色(全局开关,默认开)。它**只补空**:你手动选过的颜色(或刻意清空的)绝不会被覆盖;由于解码是异步的,回来时会再确认一次,期间你手选的色优先。
220
+ - **匹配试跑卡取代「当前生效」卡片** — 原状态卡回答的是「现在生效什么」,且会在切换之间留旧值;试跑卡把同一个问题提前一步回答。输入任意模型名(未输入时自动跟随检测到的模型),即时显示会命中哪条规则,或提示走兜底。状态卡里那几句它表达不了的诊断——比如读到的只是**宿主默认**而非本会话模型、会话服务还没就绪——作为提示保留在卡片里,所以坏掉的链路依旧不会伪装成一次正常读取。
221
+ - **配置** — 新增的持久化字段只有一个(`autoExtract`),落在共享 schema 一处,两半边的净化行为因此完全一致。
222
+
223
+ ### v0.3.3
224
+
225
+ - **配置结构只声明一份,两半边共用** — node 半边(落盘前净化)与浏览器半边(UI 自己读同一份文件)此前各写一遍结构:键表在两侧合计 6 处、默认值两套,于是只在一边声明的字段会被另一边的净化静默丢掉——滑块当次有效、`writeConfig` 写下的配置里没有它、刷新即回默认。0.3.2 的 `blurs.rightbar` / `rightbarOpacity` 正是这么丢的。现在类型、键表、默认值与纯净化函数都收在 `src/schema.ts` 一处、两半边共同 import,两侧跑的是**同一份**净化代码,界面与磁盘的取值不可能再不一致。
226
+ - **未知字段会被点名** — node 半边净化写入时,对任何「共用结构里未声明」的字段打一次警告(`ignoring unknown config field "blurs.produced" (declared in one half only?)`),这类不同步会出现在宿主日志里,而不是安静地吞掉一个设置项。0.3 之前的旧顶层字段除外(迁移会消费它们)。
227
+ - **行为不变** — 默认值、夹取范围、迁移结果与落盘文件与此前逐字节一致,本次只消除重复声明。
228
+
207
229
  ### v0.3.2
208
230
 
209
231
  - **「文件预览侧栏」卡片** — 点开文件后从右侧滑出的那一栏现在有自己的透明度与模糊度滑块。它此前的唯一表面就是 `--dsw-alias-bg-base`,也就是「主背景」滑块改写的那个令牌,所以它一直是主背景的第二份拷贝、无法单独调节。新卡片的透明度**默认跟随「主背景」**(首次拖动后才由自己接管),因此升级后外观零变化;模糊则叠加在主背景模糊之上。面板关闭时只是滑出屏幕,这张卡片不会带来任何副作用。