dsh-background-by-model 0.5.1 → 0.5.3
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 +22 -3
- package/README.zh.md +22 -3
- package/lib/client.js +345 -99
- package/lib/client.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ One interface, one config — only the current model differs:
|
|
|
86
86
|
### Per-rule settings
|
|
87
87
|
|
|
88
88
|
- **Wallpaper** — Upload any image as this rule's wallpaper; each rule keeps its own file.
|
|
89
|
-
- **Theme Color** — HSL wheel plus numeric input and an inspiration palette, with **Extract from this image** and an **eyedropper**. When a rule sets no theme color, the system theme is used. Generates the full CSS design-token set in real time.
|
|
89
|
+
- **Theme Color** — HSL wheel plus numeric input and an inspiration palette, with **Extract from this image** and an **eyedropper**. When a rule sets no theme color, the system theme is used. Generates the full CSS design-token set in real time. Following the system theme hands the palette back to the host while the wallpaper and the Interface-tab opacity/blur sliders keep working — the surface colors are read back from the host's own tokens and re-emitted with your alpha, so the wallpaper is never buried under an opaque plate.
|
|
90
90
|
- **Layout Mode** — Fit / Fill / Stretch / Tile / Center.
|
|
91
91
|
- **Framing** — Drag to pan and scroll to zoom inside a viewport-proportional editor; **only editable in Fit mode**, and the committed framing stays consistent across window resizes and cross-monitor moves.
|
|
92
92
|
- **Background Opacity** — `0–100%` for the rule's wallpaper layer.
|
|
@@ -94,7 +94,7 @@ 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, 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.
|
|
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. Independent of the theme color: a rule with no color keeps every one of these sliders live.
|
|
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
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.
|
|
@@ -205,11 +205,30 @@ Yes — export it from the **Config** tab; the JSON inlines every rule's image.
|
|
|
205
205
|
**Are video or generated backgrounds supported?**
|
|
206
206
|
No. Both were removed in 0.3.0; each rule uses a static image.
|
|
207
207
|
|
|
208
|
+
**After switching a rule back to "System theme", why is the settings dialog a different palette from the rest of the interface?**
|
|
209
|
+
That was a bug, and it is fixed: clearing the color only dropped the `body` token set, while the three **no-host-fallback** redirects inside the dialog (`--dsw-alias-bg-layer-*` → plugin-owned variables), the trajectory view and the AppFrame columns' inline backgrounds all kept the previous color — a dark interface with a light dialog and white-on-white text. Every surface is now driven by a single palette source: the rule's own tokens while it has a color, and the host's own tokens (read back and re-emitted with your alpha) while it follows the system theme, handed back to the host on the way out.
|
|
210
|
+
|
|
211
|
+
**Why does "Custom color" produce a color the moment I press it?**
|
|
212
|
+
Pressing it means leaving the system-theme state, so it has to hand out a starting color. It runs the same **Extract from this image** pass first and only falls back to a default swatch when the image has nothing vivid, so a press no longer jumps from a light interface straight to a dark blue that has nothing to do with the wallpaper.
|
|
213
|
+
|
|
214
|
+
**After switching back to "System theme" the interface stays light until I drag a slider — why?**
|
|
215
|
+
The other half of the same hole: while it owns a color the plugin **forces** `body[data-ds-dark-theme]` (setting its marker for a dark palette, removing the attribute for a light one), and the host only rewrites that flag when it projects a **theme snapshot** — it does not watch the attribute. A flag dropped by a light skin therefore sticks, so the readback captured the host's light palette at the moment the color was cleared and nothing ever re-read it until an unrelated apply ran. Now the switch hands the flag back synchronously in the host's own boolean form, the scheme the host resolved (`ctx.theme`'s `active.colorScheme`, falling back to `html[data-ds-theme-source]` plus `prefers-color-scheme`) is pushed into the render layer, and the one-second watchdog re-reads the host palette while a rule has no color, repainting when it moved.
|
|
216
|
+
|
|
208
217
|
## Recent Optimizations
|
|
209
218
|
|
|
219
|
+
### v0.5.3
|
|
220
|
+
|
|
221
|
+
- **One palette at a time: clearing the theme color no longer leaves the previous skin behind** — The three redirects inside the settings dialog (`--dsw-alias-bg-layer-*` → plugin-owned variables) have **no host fallback**, and neither do the trajectory view's scope or the AppFrame columns' inline backgrounds; all of them were only ever cleaned up at teardown. Switching a rule back to **System theme** therefore left a dark interface with a light dialog and white-on-white text. Every surface is now driven by one palette source: the rule's own tokens while it has a color, and the host's own tokens read back out of the cascade and re-emitted with your alpha when it has none, handed back on the way out. The no-fallback redirects are gated on `html[data-dab-themed]`, so they are only live while the variables they read are actually written.
|
|
222
|
+
- **Following the system theme keeps the wallpaper and the Interface sliders** — Clearing the color used to drop the whole token set, and the host's opaque `--dsw-alias-bg-base` then buried the wallpaper while every opacity/blur slider (main background, sidebar, cards, input, settings panel, trajectory view, right panel) silently stopped working. The surfaces are now the host's own colors times your opacity, so the wallpaper keeps showing through.
|
|
223
|
+
- **Following the system theme hands the host's dark flag back** — While it owns a color the plugin forces `body[data-ds-dark-theme]` (removing it outright for a light palette), and the host only rewrites that flag when it projects a **theme snapshot** — it does not watch the attribute. A flag dropped by a light skin therefore sticks: the readback captures the host's light palette the moment the color is cleared, and the interface only turned dark once an unrelated slider drag re-ran an apply. The switch now hands the flag back synchronously in the host's own boolean form, using the scheme the host resolved (`ctx.theme`'s `active.colorScheme`, falling back to `html[data-ds-theme-source]` plus `prefers-color-scheme`); the one-second watchdog re-reads the host palette while a rule has no color, and the handback side no longer sits behind the 60 ms skin debounce (which made it read the plugin's own skin on its way out).
|
|
224
|
+
- **The no-color button no longer does the opposite of its label** — It read **System theme** while its action was to install a hard-coded dark blue `#1D3463` (the same label means "clear → follow the system theme" one state over). It is now **Custom color**, and it runs the *Extract from this image* pass first, falling back to the seed swatch only when the image has nothing vivid.
|
|
225
|
+
- **The token fingerprint is only recorded after the stylesheet write succeeds**, so a failed write is retried instead of pinning the interface to the old palette until another key happens to change.
|
|
226
|
+
- **Fixed the mojibake dash in the `package.json` description**, which is what the npm page shows.
|
|
227
|
+
|
|
210
228
|
### v0.5.0
|
|
211
229
|
|
|
212
|
-
- **The host self-check is gone.** Removed together with everything that fed it: the settings page's **Host check** tab, the contract table (`src/host-contracts.ts`), the browser probe (`src/client/judge.ts`), the installed-file scan (`src/host-scan.ts`), the `hostCheck` RPC, the `pnpm scan` script and its test suite. The plugin keeps only what it does: rules, wallpapers and interface opacity/blur.
|
|
230
|
+
- **The host self-check is gone.** Removed together with everything that fed it: the settings page's **Host check** tab, the contract table (`src/host-contracts.ts`), the browser probe (`src/client/judge.ts`), the installed-file scan (`src/host-scan.ts`), the `hostCheck` RPC, the `pnpm scan` script and its test suite. The plugin keeps only what it does: rules, wallpapers and interface opacity/blur.
|
|
231
|
+
- **`0.5.0` is implemented identically in `0.5.1` and `0.5.2`.** Those two are publisher-side noise: the first `npm publish` returned HTTP 202 and the version took a few minutes to appear on the registry, which was mistaken for a failure and re-published twice before the async publish landed. All three are live, byte-identical (12 files, same code), and `latest` pointed at `0.5.2` at that point. Install any of them — pin `0.5.2` if you want that tag's target by name.
|
|
213
232
|
|
|
214
233
|
### v0.4.5
|
|
215
234
|
|
package/README.zh.md
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
### 每条规则自带的外观
|
|
87
87
|
|
|
88
88
|
- **背景图片** — 上传任意图片作为该规则的壁纸,每条规则一张独立图片文件。
|
|
89
|
-
- **主题色** — HSL 色轮 + 数值输入 + 灵感色板,支持「从本图提取」与吸管「从图片取色」;不设主题色时跟随系统主题。实时生成整套 CSS
|
|
89
|
+
- **主题色** — HSL 色轮 + 数值输入 + 灵感色板,支持「从本图提取」与吸管「从图片取色」;不设主题色时跟随系统主题。实时生成整套 CSS 设计令牌。跟随系统主题时,界面配色交还宿主,而壁纸与「界面」页的透明度、模糊照旧生效——表面颜色是从宿主自己的令牌读出来后套上你的透明度的,所以壁纸不会被一块不透明底板盖住。
|
|
90
90
|
- **布局模式** — 适应 / 填充 / 拉伸 / 平铺 / 居中。
|
|
91
91
|
- **取景** — 在视口比例的编辑器中拖动平移、滚轮缩放;**仅「适应」模式下可编辑**,提交的构图在窗口缩放、跨屏移动后保持一致。
|
|
92
92
|
- **背景透明度** — `0–100%`,作用于该规则的壁纸层。
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
|
|
95
95
|
### 全局设置(「界面」页)
|
|
96
96
|
|
|
97
|
-
- **分部位界面透明度** — 主背景、左侧栏、右侧栏、卡片面板(含对话框周围的选项框/菜单)、输入框与控件(发送框、Cordis
|
|
97
|
+
- **分部位界面透明度** — 主背景、左侧栏、右侧栏、卡片面板(含对话框周围的选项框/菜单)、输入框与控件(发送框、Cordis 插件面板)、设置面板与对话文本框各自独立滑块。与主题色无关:某条规则没有主题色时这些滑块同样生效。
|
|
98
98
|
- **分部位界面模糊度** — 每个界面部位可独立调整毛玻璃 `backdrop-filter` 模糊(`0–60 px`),并通过宿主的稳定选择器为发送框与 Cordis 面板提供真实背景模糊。
|
|
99
99
|
- **对话与轨迹页** — 消息列表自动包裹为半透明卡片,轨迹页可整页调节透明度与模糊,让壁纸从内容后方透出来。
|
|
100
100
|
- **右侧栏** — 点开文件后从右侧滑出的那一栏有了自己的卡片:透明度默认跟随「主背景」(拖动后本卡片接管),模糊则在主背景模糊之上再叠加;关闭时不占位置、无副作用。
|
|
@@ -205,11 +205,30 @@ pnpm run typecheck
|
|
|
205
205
|
**支持视频或生成式背景吗?**
|
|
206
206
|
不支持。两者都在 0.3.0 中移除,每条规则使用一张静态图片。
|
|
207
207
|
|
|
208
|
+
**把主题色切回「系统主题」后,界面和设置弹窗为什么不是一套配色?**
|
|
209
|
+
这是已经修掉的旧行为:清空主题色时插件只撤掉了 `body` 上那套令牌,设置弹窗里那三个**没有宿主回退**的重定向(`--dsw-alias-bg-layer-*` → 插件私有变量)以及轨迹页、三栏的内联背景都还留着上一次的颜色,于是出现「深色界面 + 浅色弹窗、白底白字」。现在这些表面统一由一个调色板来源驱动:有主题色时用规则自己的令牌,没有时**读取宿主当前令牌**再套上你的透明度重发,切换时一并交还宿主。
|
|
210
|
+
|
|
211
|
+
**切回「系统主题」后一开始还是浅色,拖一下滑块才变深,为什么?**
|
|
212
|
+
同一个洞的另一半:插件在持有主题色时会**强改** `body[data-ds-dark-theme]`(深色调色板写标记、浅色调色板直接删掉),而宿主只在**主题快照变化时**才重写这个标记(它不监听属性)。于是浅色皮肤留下的「标记被删」会一直生效,插件在切回系统主题那一刻读到的就是宿主的浅色调色板,并且之后没有任何事件再去重读——直到你碰了某个滑块。现在:切换时同步交还标记(宿主深色就写成宿主的布尔形式),并把宿主解析出的配色方案(`ctx.theme` 的 `active.colorScheme`,过期则回退到 `html[data-ds-theme-source]` + `prefers-color-scheme`)推给渲染层;每秒的守护定时器在「无主题色」状态下也会重读一次宿主调色板,变了就重画。
|
|
213
|
+
|
|
214
|
+
**为什么「自定义颜色」点下去就有颜色了?**
|
|
215
|
+
因为按下它就等于离开「跟随系统主题」,必须给出一个起始色。它先跑一次「从本图提取」(和「从本图提取」按钮同一条链路),取不到鲜明颜色时才退回默认色,所以不会再出现「点一下就从浅色跳成一块跟壁纸无关的深蓝」。
|
|
216
|
+
|
|
208
217
|
## 近期优化
|
|
209
218
|
|
|
219
|
+
### v0.5.3
|
|
220
|
+
|
|
221
|
+
- **一次只用一个调色板:清空主题色不再留下上一次的皮肤** — 设置弹窗里那三段重定向(`--dsw-alias-bg-layer-*` → 插件私有变量)**没有宿主回退**,轨迹页与三栏的内联背景同理,而它们只在 teardown 时才清理。于是把主题色切回「系统主题」后会留下「深色界面 + 浅色弹窗、白底白字」。现在这些表面由一个调色板来源统一驱动:有主题色时用规则自己的令牌,没有时**读取宿主自己的令牌**再套上你的透明度,切换时一并交还;无回退的重定向用 `html[data-dab-themed]` 门控,只有变量确实写了才生效。
|
|
222
|
+
- **无主题色也保住壁纸与「界面」页的滑块** — 以前清空主题色会撤掉整套令牌,宿主的实心 `--dsw-alias-bg-base` 就把壁纸整块盖住,主背景 / 左侧栏 / 卡片 / 输入框 / 设置面板 / 轨迹页 / 右侧栏的透明度与模糊也全部失效。现在表面是宿主的颜色乘你的透明度,壁纸继续从背后透出来。
|
|
223
|
+
- **跟随系统主题会把宿主的深色标记交还回去** — 插件持有主题色时会强改 `body[data-ds-dark-theme]`(浅色皮肤直接删掉),而宿主只在**主题快照变化时**才重写它、并不监听这个属性。被删掉的标记因此会一直生效:切回系统主题时读到的是宿主的浅色调色板,界面要等你碰一下滑块才变深。现在切换时按宿主自己解析出的方案同步交还标记(`ctx.theme` 的 `active.colorScheme`,取不到则回退 `html[data-ds-theme-source]` + `prefers-color-scheme`),并且每秒的守护定时器在无主题色状态下也会重读一次宿主调色板;「交还」这一侧不再走 60ms 防抖,避免读到插件自己那套即将下线的皮肤。
|
|
224
|
+
- **无颜色状态下的按钮不再做相反的事** — 那个按钮的文案是「系统主题」,动作却是塞一个硬编码的深蓝 `#1D3463`(同一条文案在有颜色时表示「清空 → 跟随系统主题」)。现在它叫 **「自定义颜色」**,并且先跑一次「从本图提取」,取不到鲜明颜色才退回种子色。
|
|
225
|
+
- **令牌指纹只在样式表写入成功后记账** — 写入抛错时不再把指纹提前记下,避免界面卡在旧调色板上直到另一个 key 变化。
|
|
226
|
+
- **`package.json` 描述里的乱码破折号修正**(它直接显示在 npm 页面上)。
|
|
227
|
+
|
|
210
228
|
### v0.5.0
|
|
211
229
|
|
|
212
|
-
- **宿主自检整块删掉了。** 连同它的一切:设置页的 **「宿主自检」** 选项卡、约定表(`src/host-contracts.ts`)、浏览器探测(`src/client/judge.ts`)、安装目录扫描(`src/host-scan.ts`)、`hostCheck` RPC、`pnpm scan`
|
|
230
|
+
- **宿主自检整块删掉了。** 连同它的一切:设置页的 **「宿主自检」** 选项卡、约定表(`src/host-contracts.ts`)、浏览器探测(`src/client/judge.ts`)、安装目录扫描(`src/host-scan.ts`)、`hostCheck` RPC、`pnpm scan` 脚本以及它的测试。插件只留下它真正做的事:规则、壁纸、界面透明度与模糊。
|
|
231
|
+
- **`0.5.1` 与 `0.5.2` 的内容与 `0.5.0` 完全相同。** 这两个号是发布端的噪音:第一次 `npm publish` 返回的是 HTTP 202,版本要几分钟后才出现在 registry 上,被误当成失败又发了两遍。三个版本都在线上、代码逐字节一致(12 个文件),当时 `latest` 指向 `0.5.2`。装哪个都行;想按标签点名就固定 `0.5.2`。
|
|
213
232
|
|
|
214
233
|
### v0.4.5
|
|
215
234
|
|