dsh-any-background 0.2.9 → 0.2.10
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 +17 -9
- package/README.zh.md +17 -9
- package/lib/client.js +772 -240
- package/lib/client.js.map +1 -1
- package/lib/index.js +133 -37
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ A **DeepSeek Harness** appearance plugin: custom theme color, background wallpap
|
|
|
75
75
|
- **Per-surface Interface Blur** — Frosted-glass `backdrop-filter` blur (0–60 px) per surface, including a real backdrop on the composer, the Cordis panel and popover surfaces via stable host selectors.
|
|
76
76
|
- **Produced / Highlights** — Code blocks in conversation content (with their language banner), inline `code` highlight chips and produced chips share one opacity + blur slider. The opacity is the alpha of **each surface's own background color** (no second color stacked on top of the original), and the blur frosts that same layer so the wallpaper shows through the content.
|
|
77
77
|
- **better-sidebar workbench** — With dsh-better-sidebar installed, a dedicated slider pair (`panelOpacity` / `blurs.panel`) takes over its bottom workbench panel and the native right sidebar's surface tokens. Without that plugin the row is hidden and the sliders are inert.
|
|
78
|
+
- **Sidebar "Theme" page** — With dsh-better-sidebar installed, its sidebar gains a "Theme" card: opening it shows **the very same five pages** as the settings panel (Color / Interface / Font / Background / Profiles) with a shell rebuilt for the panel — full height with the page body owning the scroll, and a compact one-row tab rail (not a side rail, which would spend 150px of a narrow panel). **The layout adapts to the panel width**: card grids fill as many columns as fit (two from roughly 430px, three or four in a wide panel), and only a narrow panel tightens padding and headings and falls back to a single column. The background type cards do the same. Both surfaces share one page implementation and one state store, so editing in either place shows up in the other. Without better-sidebar the page simply never registers, and nothing else changes.
|
|
78
79
|
- **Conversation View Cards** — 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.
|
|
79
80
|
- **Theme Export / Import** — One-click export to a self-contained `dsh-any-theme.json` (config + wallpaper, video embedded as a data URL) and import to restore it anywhere.
|
|
80
81
|
- **Appearance Presets & Profiles** — Six one-click presets (Default / Frosted glass / Minimal / Midnight / Cyber / Warm daylight) plus named profiles: save the current look and re-apply it anytime. A two-step confirm guards deletion.
|
|
@@ -87,8 +88,22 @@ A **DeepSeek Harness** appearance plugin: custom theme color, background wallpap
|
|
|
87
88
|
- **Bilingual** — Full Chinese / English UI with automatic locale detection.
|
|
88
89
|
- **Theme Watchdog** — Re-asserts the custom theme if the host resets it.
|
|
89
90
|
|
|
90
|
-
## Changelog
|
|
91
|
-
|
|
91
|
+
## Changelog (latest two releases)
|
|
92
|
+
|
|
93
|
+
### v0.2.10 (Last version 0.15 RC2 update)
|
|
94
|
+
|
|
95
|
+
- A "Theme" page in dsh-better-sidebar's sidebar: with better-sidebar installed, the sidebar gains a "Theme" card that opens the same five pages as the settings panel (Color / Interface / Font / Background / Profiles). Both surfaces share one page implementation and one state store, so a change in either place shows up in the other. The shell adapts to the panel width — card grids fill as many columns as fit (two from roughly 430px, three or four in a wider panel) and only a narrow panel tightens padding and drops back to a single column.
|
|
96
|
+
- Phone-width support for the settings panel: once the content column gets narrow, headings, card paddings, the color orb and the wheel card tighten up, and the card grids stop overflowing. Background type cards switch to width-based columns instead of being squeezed into one.
|
|
97
|
+
- The crash fallback now shows the error stack, so a broken panel explains itself without devtools.
|
|
98
|
+
- Fixed `getSnapshot is not a function` crashing the panel on some installs: the installed dsh-client-store is an older build whose `defineStore()` returns a declaration, not an instance, and the code treated it as an instance — which also silently disconnected the state sync (the settings panel kept showing defaults). The store is now normalized into one shared instance that both surfaces read; an unexpected shape in the future only warns and skips the sidebar page.
|
|
99
|
+
- Fixed the background editor's pan and pinch never working on touch devices: the listeners were attached to a node inside a Portal that has no node on its first render, and the effect's dependencies never changed, so it never ran again. The modal node is held in state now, so the effect runs as soon as the node exists. Touch handling also moved from the preview card to the full-screen overlay (pinching the backdrop no longer zooms the page), and a gesture that ends outside the preview no longer closes the editor.
|
|
100
|
+
- Fixed slider thumbs snapping back mid-drag: the sync effect depended on inline arrow functions, so any parent re-render wrote the last committed value back into the input. The formatter is read through a ref, and only a real value change moves the thumb.
|
|
101
|
+
- Fixed the Interface and Font pages showing stale values after applying a preset or importing a theme: they did not subscribe to the store. They follow `metaRev` now (the background page's layout chips follow `bgRev`).
|
|
102
|
+
- Fixed settings being silently lost when a healthy config file was mistaken for a corrupt one: any read failure (file in use, antivirus, permissions) used to archive the good file, and the next launch then treated the install as a first run and wrote defaults over it. Only a JSON parse failure counts as corruption now; a read failure just falls back to the defaults and leaves the file alone.
|
|
103
|
+
- Fixed oversized uploads failing silently: the server answered 413 but the client never read the body. All three upload entries (video / wallpaper / font) now say "file too large, limit 100 MB", and an oversized video no longer plays as if it had been saved.
|
|
104
|
+
- Fixed the night schedule throwing on hosts without `matchMedia`, which aborted the boot restore and repeated every 30 seconds.
|
|
105
|
+
- Streaming no longer re-runs the full blur/opacity pass on every token (the observer's short-circuit condition could never hold on the real host). Bursts are coalesced into one animation frame and skipped when neither the values nor the targets moved.
|
|
106
|
+
- Also: config writes are atomic now (temp file + rename, temp cleaned up on failure) with the parsed result cached by mtime/size; and a batch of leak and race fixes (document listeners left behind when a panel closed mid-drag, stale animation frames overwriting a regenerated background, rotation writes clobbering debounced saves, leftover styles after disabling the plugin).
|
|
92
107
|
### v0.2.9
|
|
93
108
|
|
|
94
109
|
- **Fixed: opacity and blur sliders looked inert until each was dragged once** — Not a defaults problem: two gates stood in the application path. ① `applyCustomTokensNow()` returned early whenever there was no palette, and `paletteTokens()` returns exactly null when **no color is picked and no scheme is forced** — so the four opacity sliders' alpha variables were never written at all. ② `applyWp()` additionally gated the call behind `rHasColor() || rBgDark() !== null || ...`, all false on a fresh install, so it was never even invoked. Opacity now applies unconditionally, falling back to the host's own resolved surface tokens when the plugin has no palette (`readHostOpacityTokens()`, the same host fallback the workbench-panel slider already used). The sliders only supply the alpha — colors still come from the host skin, so a custom host theme survives.
|
|
@@ -101,13 +116,6 @@ A **DeepSeek Harness** appearance plugin: custom theme color, background wallpap
|
|
|
101
116
|
- **Per-part text outline** — Nine groups, each with its own outline width (0–4 px, 0.5 steps, 0 = off) and color. Colors are stored as **preset keys**, not resolved values: "auto" inverts the font direction (light glyphs get a dark outline) and "accent" follows the current primary, so both re-derive automatically with the theme. Code blocks, inline `code`, icons and placeholders are explicitly exempted.
|
|
102
117
|
- **Known trade-off** — `-webkit-text-stroke` may clip by about 1px inside some single-line ellipsis containers; multi-line containers are unaffected.
|
|
103
118
|
|
|
104
|
-
### v0.2.8
|
|
105
|
-
|
|
106
|
-
- **Fixed: produced / highlight opacity and blur were lost on reload** — The config shape is declared twice, once per half, and the node half (which sanitizes before writing to disk) never learned `producedOpacity` / `blurs.produced`. The sliders stayed live in memory, `writeConfig` silently dropped both fields, and the next load fell back to the defaults. The host now declares them in `PartBlurs`, `ThemeConfig` and `ProfileAppearance` — structure, defaults, and both sanitizers (the config itself plus the profile snapshot).
|
|
107
|
-
- **Saved profiles lost those two values as well** — A profile snapshot never carried the produced parameters, so applying one quietly reset that slider to its default. Profiles, the six presets and the day/night switch all carry them now.
|
|
108
|
-
- **New two-half drift guard** — When sanitizing, the host now logs a one-time warning for any field declared on only one side (`ignoring unknown config field "blurs.xxx"`), so this class of drift surfaces in the host log instead of silently discarding a setting.
|
|
109
|
-
- **Imported configs now refresh the whole UI** — Importing a theme JSON used to refresh only the background and colors, leaving the profile list, wallpaper rotation pool, day/night schedule and scheme control showing their pre-import values; the import now pushes that meta state too.
|
|
110
|
-
|
|
111
119
|
## Installation
|
|
112
120
|
|
|
113
121
|
### Method 1: npm install (Recommended)
|
package/README.zh.md
CHANGED
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
- **分部位界面模糊度** — 每个界面部位可独立调整毛玻璃 `backdrop-filter` 模糊(0–60 px),并通过宿主的稳定选择器为发送框、Cordis 面板与弹出层提供真实背景模糊。
|
|
76
76
|
- **产出物 / 高亮内容** — 对话正文里的代码块(含语言顶栏)、行内 `code` 高亮芯片与产出物 chip 共用一支滑块:透明度只**调制这些表面原本的背景色**(不会在旧背景上再叠一层新色),模糊度给同一层表面加磨砂,壁纸从内容后方透出来。
|
|
77
77
|
- **better-sidebar 工作台** — 安装 dsh-better-sidebar 时出现独立滑块(`panelOpacity` / `blurs.panel`),接管其底部工作台面板与原生右侧栏的表面令牌;未安装该插件时该行不显示,滑块无副作用。
|
|
78
|
+
- **侧边栏「主题」页面** — 安装 dsh-better-sidebar 后,它的侧边栏会多出一张「主题」卡片:点开是与设置面板**完全相同的五页**(色彩 / 界面 / 字体 / 背景 / 配置),外壳按侧边栏重做——全高、页面自带滚动区、导航收成一行紧凑标签(不放侧边,省下 150px 给内容)。**排版随面板宽度自适应**:卡片网格按可用宽度自动排成 2 / 3 / 4 列(约 430px 起两列),面板窄时才收紧内边距与标题字号并回到单列;类型卡片同理。两处共用同一套页面代码与同一份状态,改一处两边同步;未安装 better-sidebar 时静默不注册,不影响任何其它功能。
|
|
78
79
|
- **对话视图卡片** — 消息列表自动包裹为半透明卡片,轨迹页可整页调节透明度与模糊,让壁纸从内容后方透出来。
|
|
79
80
|
- **主题导出 / 导入** — 一键导出为自包含的 `dsh-any-theme.json`(配置 + 壁纸,视频以 data URL 内嵌),可随时导入还原。
|
|
80
81
|
- **外观预设与配置档案** — 六套一键预设(默认 / 毛玻璃 / 极简白 / 暗夜紫 / 赛博 / 暖阳),外加自定义命名档案:随时保存当前观感、随时套回,删除有二次确认保护。
|
|
@@ -87,8 +88,22 @@
|
|
|
87
88
|
- **中英双语** — 完整的中英文界面,自动跟随语言设置。
|
|
88
89
|
- **主题守护** — 宿主重置主题后自动重新激活自定义主题。
|
|
89
90
|
|
|
90
|
-
##
|
|
91
|
-
|
|
91
|
+
## 更新日志(最新两个版本)
|
|
92
|
+
|
|
93
|
+
### v0.2.10(最后一版0.15 rc2更新)
|
|
94
|
+
|
|
95
|
+
- 侧边栏「主题」页:安装 dsh-better-sidebar 后,侧边栏会多出一张「主题」卡片,点开就是和设置面板一样的五页(色彩 / 界面 / 字体 / 背景 / 配置)。两边共用同一套页面和同一份状态,在哪边改都会同步。外壳按面板宽度自适应,卡片网格能排几列就排几列(面板 430px 左右起两列,更宽三列、四列),窄了才收紧内边距、回到单列。
|
|
96
|
+
- 设置面板适配手机宽度:内容列窄到一定程度后,标题、卡片内边距、色球和色轮卡都会收紧;各处卡片网格加了防溢出的最小宽度,背景类型卡片在窄屏改成按宽度自动排两列,不再挤成一条。
|
|
97
|
+
- 面板崩溃时直接把出错堆栈显示在兜底页里,不用再开开发者工具查原因。
|
|
98
|
+
- 修复部分环境下面板直接报错 `getSnapshot is not a function`:装着的 dsh-client-store 是旧版,`defineStore()` 返回的是声明而不是实例,代码把它当实例用就炸了,连带把状态同步整个关掉(设置面板会一直显示默认值)。现在启动时归一化成单个共享实例,两处读同一份状态;以后形状再变也只是告警并跳过侧边栏页。
|
|
99
|
+
- 修复手机上背景编辑器的拖动、捏合完全无效:监听器挂在 Portal 里的节点上,首帧拿不到节点,effect 依赖又是恒定的,所以永远不会再跑。现在弹窗节点改用 state 持有,出现即绑定;触摸监听同时从预览卡片挪到全屏遮罩,两指落在遮罩上不会再缩放整个页面;在预览图外松手也不会误关编辑器。
|
|
100
|
+
- 修复拖滑块时拇指弹回旧位置:同步 effect 的依赖里有内联箭头函数,任何父级重渲染都会把值写回上次提交的结果。现在格式化函数走 ref,只有数值真的变了才会动滑块。
|
|
101
|
+
- 修复套预设 / 导入主题后「界面」「字体」页滑块停在旧值:这两页此前没有订阅 store,现在跟随 `metaRev`(背景页的布局选项跟随 `bgRev`)。
|
|
102
|
+
- 修复配置文件被误判为损坏、整套设置静默丢失:之前文件被占用或权限失败也会把好文件改名归档,下次启动就按首次运行写入默认值。现在只有 JSON 解析失败才归档,读取失败只用默认值,不动磁盘上的文件。
|
|
103
|
+
- 修复上传超限毫无提示:服务端返回 413 但客户端从不读响应体。现在视频 / 壁纸 / 字体三个入口都会提示「文件过大,上限 100 MB」,超限视频也不会再「能播但不保存」。
|
|
104
|
+
- 修复夜间自动切换在缺少 `matchMedia` 的环境抛错,并因此反复中断启动恢复。
|
|
105
|
+
- 正常聊天时每个流式 token 都会触发一遍完整的模糊 / 透明度应用(观察器的短路条件在真实宿主上恒为假)。现在按帧合并,值和目标都没变就整帧跳过。
|
|
106
|
+
- 其它:配置写入改成原子写(tmp + rename,失败清理临时文件),解析结果按 mtime/size 缓存;修了一批泄漏和竞态(拖动中关面板遗留监听、动态背景旧帧覆盖新画面、轮换写回覆盖防抖保存、禁用后样式残留等)。
|
|
92
107
|
### v0.2.9
|
|
93
108
|
|
|
94
109
|
- **修复:初次安装时透明度与模糊度滑块「要手动拖一次才生效」** —— 根因不是默认值,而是应用链路有两道门槛:① `applyCustomTokensNow()` 遇到没有调色板的情况直接 return,而**没选主题色且没强制明暗**时 `paletteTokens()` 正是返回 null,于是四个透明度滑块的 alpha 变量从头到尾没被写过;② `applyWp()` 外面还有一层 `rHasColor() || rBgDark() !== null || ...` 的门,初次安装全部落空,连 apply 都没调用。现在透明度无条件应用,没有自有调色板时回落去读宿主已解析的表面 token(`readHostOpacityTokens()`,与工作台面板 opacity 的宿主回落同源)——滑块只提供 alpha,配色仍由宿主皮肤决定。
|
|
@@ -100,13 +115,6 @@
|
|
|
100
115
|
- **分组文字描边** — 九个界面分组各自独立的描边粗细(0–4 px,0.5 步进,0 = 关闭)与颜色;颜色存的是**预设键**而非解析后的色值:「自动」按字体明暗取反色(浅字配深描边),「主题色」跟随当前主色,二者都会随主题自动重算。代码块、行内 `code`、图标与 placeholder 显式豁免,多色语法着色不会糊。
|
|
101
116
|
- **已知取舍** — `-webkit-text-stroke` 在部分单行省略号容器边缘可能有 1px 级裁切;多行容器正常。
|
|
102
117
|
|
|
103
|
-
### v0.2.8
|
|
104
|
-
|
|
105
|
-
- **修复:产出物 / 高亮内容的透明度与模糊度刷新即丢** — 配置结构在插件两半边各声明一份,node 半边(按自己的结构净化后落盘)一直没跟上 `producedOpacity` 与 `blurs.produced`:滑块当次有效(内存里是对的),`writeConfig` 落盘时却把这两个字段静默丢掉,刷新自然回到默认值。现已在宿主侧补齐:`PartBlurs` / `ThemeConfig` / `ProfileAppearance` 结构与默认值,以及两处净化表(整份配置 + 档案快照)。
|
|
106
|
-
- **档案快照同样会丢这两个值** — 保存的档案一直没带产出物参数,套用档案会把产出物滑块悄悄重置回默认;档案、六套预设与昼夜切换现在都完整携带。
|
|
107
|
-
- **新增「两半边结构漂移」守护** — 宿主净化配置时,对任何「只在一侧声明过」的字段打一次警告日志(`ignoring unknown config field "blurs.xxx"`),让这类不同步在宿主日志里当场暴露,而不是静默吞掉一个设置项。
|
|
108
|
-
- **导入配置后界面状态补齐** — 导入 JSON 时此前只刷新背景与配色,档案列表、壁纸轮换池、昼夜调度与明暗分段控件仍显示导入前的旧值;现在导入会一并同步这部分元状态。
|
|
109
|
-
|
|
110
118
|
## 安装
|
|
111
119
|
|
|
112
120
|
### 方式一:npm 安装(推荐)
|