dsh-background-by-model 0.4.0 → 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 +9 -0
- package/README.zh.md +9 -0
- package/lib/client.js +143 -94
- package/lib/client.js.map +1 -1
- package/lib/index.js +2 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -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,14 @@ 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
|
+
|
|
207
216
|
### v0.4.0
|
|
208
217
|
|
|
209
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.
|
package/README.zh.md
CHANGED
|
@@ -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,14 @@ 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
|
+
|
|
207
216
|
### v0.4.0
|
|
208
217
|
|
|
209
218
|
- **取色改用「显示器看到的亮度」** — 亮暗带此前按 HSV 明度(max 通道)取平均,它把每个饱和像素都算成亮:纯蓝 `v = 1.0`,而 Rec.709 luma 只有 `0.072`。于是深色但饱和的壁纸被判进亮色带,在暗画面上配出一套浅色界面。现在改为平均 Rec.709 luma——与壁纸判定的同一套度量。
|
package/lib/client.js
CHANGED
|
@@ -33,7 +33,7 @@ window.__ModuleLoader__.load({
|
|
|
33
33
|
uiBlur: "模糊度",
|
|
34
34
|
uiOpacityBg: "主背景",
|
|
35
35
|
uiOpacitySide: "左侧栏",
|
|
36
|
-
uiOpacityCard: "
|
|
36
|
+
uiOpacityCard: "卡片与菜单面板",
|
|
37
37
|
uiOpacityInput: "输入框与控件",
|
|
38
38
|
uiSop: "设置界面透明度",
|
|
39
39
|
uiChatRegion: "对话文本框",
|
|
@@ -138,7 +138,7 @@ window.__ModuleLoader__.load({
|
|
|
138
138
|
uiBlur: "Blur",
|
|
139
139
|
uiOpacityBg: "Main background",
|
|
140
140
|
uiOpacitySide: "Left panel",
|
|
141
|
-
uiOpacityCard: "Cards &
|
|
141
|
+
uiOpacityCard: "Cards & menus",
|
|
142
142
|
uiOpacityInput: "Input & controls",
|
|
143
143
|
uiSop: "Settings interface opacity",
|
|
144
144
|
uiChatRegion: "Conversation text frame",
|
|
@@ -249,7 +249,8 @@ window.__ModuleLoader__.load({
|
|
|
249
249
|
* Main interface opacities (0..1), global (Interface page):
|
|
250
250
|
* `bg` main background (`--dsw-alias-bg-base`)
|
|
251
251
|
* `sidebar` sidebar (`--dsw-specific-sidebar-fill`)
|
|
252
|
-
* `card` cards/panels (`--dsw-alias-bg-layer-1/2/3`, `--dsw-specific-menu`
|
|
252
|
+
* `card` cards/panels (`--dsw-alias-bg-layer-1/2/3`, `--dsw-specific-menu`
|
|
253
|
+
* and its 0.1.7 alias `--dsw-menu-surface-fill`)
|
|
253
254
|
* `input` input/control surfaces (`--dsw-specific-input-major`)
|
|
254
255
|
*/
|
|
255
256
|
const PART_OPACITY_KEYS = [
|
|
@@ -726,90 +727,95 @@ window.__ModuleLoader__.load({
|
|
|
726
727
|
const l = (d) => Math.max(0, Math.min(1, lit + d));
|
|
727
728
|
const hsl = (hh, ss, ll) => `hsl(${Math.round(hh)},${Math.round(ss * 100)}%,${Math.round(ll * 100)}%)`;
|
|
728
729
|
const rgba = (hh, ss, ll, a) => `hsla(${Math.round(hh)},${Math.round(ss * 100)}%,${Math.round(ll * 100)}%,${a})`;
|
|
729
|
-
if (dark)
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
"
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
730
|
+
if (dark) {
|
|
731
|
+
const menuFill = hsl(h(0), s(0), l(.08));
|
|
732
|
+
return {
|
|
733
|
+
colorScheme: "dark",
|
|
734
|
+
tokens: {
|
|
735
|
+
"--dsw-alias-bg-base": hsl(h(0), s(0), l(-.04)),
|
|
736
|
+
"--dsw-alias-bg-layer-1": hsl(h(0), s(0), l(.02)),
|
|
737
|
+
"--dsw-alias-bg-layer-2": hsl(h(0), s(0), l(.07)),
|
|
738
|
+
"--dsw-alias-bg-layer-3": hsl(h(0), s(-.05), l(.12)),
|
|
739
|
+
"--dsw-alias-bg-overlay": hsl(h(0), s(-.05), l(.12)),
|
|
740
|
+
"--dsw-alias-bg-module-platform": hsl(h(0), s(0), l(.05)),
|
|
741
|
+
"--dsw-alias-bg-multi-select": hsl(h(0), s(0), l(.1)),
|
|
742
|
+
"--dsw-alias-bg-skeleton": "rgba(255,255,255,0.08)",
|
|
743
|
+
"--dsw-alias-border-l1": rgba(h(0), s(-.1), l(.18), .12),
|
|
744
|
+
"--dsw-alias-border-l2": rgba(h(0), s(-.1), l(.22), .22),
|
|
745
|
+
"--dsw-alias-border-l3": "rgba(255,255,255,0.16)",
|
|
746
|
+
"--dsw-alias-border-l4": "rgba(255,255,255,0.2)",
|
|
747
|
+
"--dsw-alias-border-inverted": "rgba(255,255,255,0.06)",
|
|
748
|
+
"--dsw-alias-label-primary": hsl(0, 0, 1),
|
|
749
|
+
"--dsw-alias-label-secondary": "rgba(255,255,255,0.85)",
|
|
750
|
+
"--dsw-alias-label-tertiary": "rgba(255,255,255,0.7)",
|
|
751
|
+
"--dsw-alias-label-caption": "rgba(255,255,255,0.5)",
|
|
752
|
+
"--dsw-alias-label-dimmed": "rgba(255,255,255,0.35)",
|
|
753
|
+
"--dsw-alias-label-quaternary": "rgba(255,255,255,0.25)",
|
|
754
|
+
"--dsw-alias-label-primary-dimmed": "rgba(255,255,255,0.92)",
|
|
755
|
+
"--dsw-alias-label-primary-foreground": hsl(0, 0, 1),
|
|
756
|
+
"--dsw-alias-label-primary-inverted": hsl(h(0), s(.08), Math.min(l(.06), .16)),
|
|
757
|
+
"--dsw-alias-label-primary-bluish": hsl(0, 0, 1),
|
|
758
|
+
"--dsw-alias-brand-primary": hsl(h(0), s(.1), Math.max(l(.2), .5)),
|
|
759
|
+
"--dsw-alias-brand-text": l(.2) > .6 ? "#000" : "#fff",
|
|
760
|
+
"--dsw-alias-button-primary-fill": hsl(h(0), s(.1), Math.max(l(.2), .5)),
|
|
761
|
+
"--dsw-alias-button-primary-hover": hsl(h(0), s(.1), Math.max(l(.28), .58)),
|
|
762
|
+
"--dsw-alias-button-primary-dimmed": hsl(h(0), s(0), l(.07)),
|
|
763
|
+
"--dsw-alias-button-elevated-fill": hsl(h(0), s(0), l(.04)),
|
|
764
|
+
"--dsw-alias-button-floating-fill": hsl(h(0), s(0), l(.02)),
|
|
765
|
+
"--dsw-alias-button-floating-hover": hsl(h(0), s(0), l(.1)),
|
|
766
|
+
"--dsw-alias-button-tool-bar-fill": "rgba(255,255,255,0.08)",
|
|
767
|
+
"--dsw-alias-button-tool-bar-hover": "rgba(255,255,255,0.12)",
|
|
768
|
+
"--dsw-alias-button-ghost-active-fill": hsl(h(0), s(0), l(.06)),
|
|
769
|
+
"--dsw-alias-button-ghost-active-border": "rgba(255,255,255,0.16)",
|
|
770
|
+
"--dsw-alias-button-ghost-active-hover": hsl(h(0), s(0), l(.09)),
|
|
771
|
+
"--dsw-alias-button-info-fill": "#679efe",
|
|
772
|
+
"--dsw-alias-button-info-hover": "#4176e6",
|
|
773
|
+
"--dsw-alias-button-contrast-fill": hsl(0, 0, 1),
|
|
774
|
+
"--dsw-alias-interactive-bg-hover": rgba(h(0), s(0), Math.max(l(.15), .4), .12),
|
|
775
|
+
"--dsw-alias-interactive-bg-hover-solid": rgba(h(0), s(0), Math.max(l(.15), .4), .16),
|
|
776
|
+
"--dsw-alias-interactive-bg-hover-accent": "rgba(255,255,255,0.24)",
|
|
777
|
+
"--dsw-alias-interactive-bg-hover-danger": "rgba(242,90,90,0.15)",
|
|
778
|
+
"--dsw-alias-interactive-bg-active": rgba(h(0), s(0), Math.max(l(.15), .4), .2),
|
|
779
|
+
"--dsw-alias-markdown-code-block": hsl(h(0), s(0), l(-.06)),
|
|
780
|
+
"--dsw-alias-markdown-code-block-banner": hsl(h(0), s(0), l(-.02)),
|
|
781
|
+
"--dsw-alias-markdown-inline-code": hsl(h(0), s(0), l(.04)),
|
|
782
|
+
"--dsw-alias-markdown-placeholder": hsl(h(0), s(0), l(-.02)),
|
|
783
|
+
"--dsw-alias-markdown-tag": hsl(h(0), s(0), l(.05)),
|
|
784
|
+
"--dsw-alias-markdown-citation": hsl(h(0), s(0), l(.06)),
|
|
785
|
+
"--dsw-alias-markdown-code-segment-selected": hsl(h(0), s(0), l(.05)),
|
|
786
|
+
"--dsw-alias-markdown-code-segment-unselected": hsl(h(0), s(0), l(-.05)),
|
|
787
|
+
"--dsw-alias-state-error-primary": "#ff5c72",
|
|
788
|
+
"--dsw-alias-state-error-secondary": "#ff8aa0",
|
|
789
|
+
"--dsw-alias-state-success-primary": "#3ddc84",
|
|
790
|
+
"--dsw-alias-state-success-secondary": "#69eea4",
|
|
791
|
+
"--dsw-alias-state-success-tertiary": "#233c2c",
|
|
792
|
+
"--dsw-alias-state-warn-primary": "#ffb347",
|
|
793
|
+
"--dsw-alias-state-warn-secondary": "#ffc980",
|
|
794
|
+
"--dsw-alias-state-warn-tertiary": "#27241f",
|
|
795
|
+
"--dsw-alias-state-warn-label": "#dd8629",
|
|
796
|
+
"--dsw-alias-state-business-primary": "#679efe",
|
|
797
|
+
"--dsw-alias-state-business-tertiary": "#34415b",
|
|
798
|
+
"--dsw-specific-sidebar-fill": hsl(h(0), s(0), l(-.06)),
|
|
799
|
+
"--dsw-specific-sidebar-nav-item-active": hsl(h(0), s(0), l(.04)),
|
|
800
|
+
"--dsw-specific-sidebar-nav-item-hover": hsl(h(0), s(0), l(0)),
|
|
801
|
+
"--dsw-specific-input-major": hsl(h(0), s(0), l(.02)),
|
|
802
|
+
"--dsw-specific-menu": menuFill,
|
|
803
|
+
"--dsw-menu-surface-fill": menuFill,
|
|
804
|
+
"--dsw-specific-bubble": hsl(h(0), s(0), l(.03)),
|
|
805
|
+
"--dsw-specific-bubble-highlight": hsl(h(0), s(0), l(.08)),
|
|
806
|
+
"--dsw-specific-selector": hsl(h(0), s(0), l(.05)),
|
|
807
|
+
"--dsw-specific-login-input": hsl(h(0), s(0), l(.03)),
|
|
808
|
+
"--dsw-specific-tip": hsl(h(0), s(0), l(.05)),
|
|
809
|
+
"--dsw-alias-toast-bg": hsl(h(0), s(0), l(.08)),
|
|
810
|
+
"--dsw-alias-tooltip-bg": hsl(h(0), s(0), l(.08)),
|
|
811
|
+
"--dsw-alias-scrollbar-bg-l1": hsl(h(0), s(-.05), l(.12)),
|
|
812
|
+
"--dsw-alias-scrollbar-bg-l2": hsl(h(0), s(-.05), l(.16)),
|
|
813
|
+
"--dsw-alias-scrollbar-hover-l1": hsl(h(0), s(-.05), l(.22)),
|
|
814
|
+
"--dsw-alias-scrollbar-hover-l2": hsl(h(0), s(-.05), l(.22))
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
const menuFill = hsl(h(0), s(-.12), l(.15));
|
|
813
819
|
return {
|
|
814
820
|
colorScheme: "light",
|
|
815
821
|
tokens: {
|
|
@@ -840,7 +846,8 @@ window.__ModuleLoader__.load({
|
|
|
840
846
|
"--dsw-specific-sidebar-nav-item-active": hsl(h(0), s(-.08), l(.05)),
|
|
841
847
|
"--dsw-specific-sidebar-nav-item-hover": hsl(h(0), s(-.12), l(0)),
|
|
842
848
|
"--dsw-specific-input-major": hsl(h(0), s(-.12), l(.1)),
|
|
843
|
-
"--dsw-specific-menu":
|
|
849
|
+
"--dsw-specific-menu": menuFill,
|
|
850
|
+
"--dsw-menu-surface-fill": menuFill,
|
|
844
851
|
"--dsw-alias-scrollbar-bg-l1": hsl(h(0), s(-.1), l(-.08)),
|
|
845
852
|
"--dsw-alias-scrollbar-bg-l2": hsl(h(0), s(-.08), l(-.12)),
|
|
846
853
|
"--dsw-alias-scrollbar-hover-l1": hsl(h(0), s(-.08), l(-.16)),
|
|
@@ -1079,7 +1086,8 @@ window.__ModuleLoader__.load({
|
|
|
1079
1086
|
"--dsw-alias-bg-layer-1",
|
|
1080
1087
|
"--dsw-alias-bg-layer-2",
|
|
1081
1088
|
"--dsw-alias-bg-layer-3",
|
|
1082
|
-
"--dsw-specific-menu"
|
|
1089
|
+
"--dsw-specific-menu",
|
|
1090
|
+
"--dsw-menu-surface-fill"
|
|
1083
1091
|
]
|
|
1084
1092
|
},
|
|
1085
1093
|
{
|
|
@@ -1094,7 +1102,8 @@ window.__ModuleLoader__.load({
|
|
|
1094
1102
|
"--dsw-alias-bg-layer-2": "--dsh-any-op-card-2",
|
|
1095
1103
|
"--dsw-alias-bg-layer-3": "--dsh-any-op-card-3",
|
|
1096
1104
|
"--dsw-specific-input-major": "--dsh-any-op-input",
|
|
1097
|
-
"--dsw-specific-menu": "--dsh-any-op-menu"
|
|
1105
|
+
"--dsw-specific-menu": "--dsh-any-op-menu",
|
|
1106
|
+
"--dsw-menu-surface-fill": "--dsh-any-op-menu"
|
|
1098
1107
|
};
|
|
1099
1108
|
let baseTokenKey = "";
|
|
1100
1109
|
let pendingOps = null;
|
|
@@ -1168,7 +1177,7 @@ window.__ModuleLoader__.load({
|
|
|
1168
1177
|
if (layer2 !== void 0) document.documentElement.style.setProperty("--dsh-any-traj-layer-2", toRgba(layer2, op));
|
|
1169
1178
|
if (layer3 !== void 0) document.documentElement.style.setProperty("--dsh-any-traj-layer-3", toRgba(layer3, op));
|
|
1170
1179
|
}
|
|
1171
|
-
const RIGHTBAR_STYLE_RULE = "div[data-sidebar-right-panel]{background:var(--dsh-any-bg-rightbar,var(--dsw-alias-bg-base))!important
|
|
1180
|
+
const RIGHTBAR_STYLE_RULE = "div[data-sidebar-right-panel]:not(:has([data-dockkit-content],[data-dockkit-empty]))[data-sidebar-right-open],div[data-sidebar-right-panel] [data-dockkit-content]:not([data-dockkit-float]),div[data-sidebar-right-panel] [data-dockkit-empty]{background:var(--dsh-any-bg-rightbar,var(--dsw-alias-bg-base))!important}div[data-sidebar-right-panel][data-sidebar-right-open]{-webkit-backdrop-filter:var(--dsh-any-blur-rightbar,none);backdrop-filter:var(--dsh-any-blur-rightbar,none)}";
|
|
1172
1181
|
/** Paint the file-preview panel's surface from its own slider. */
|
|
1173
1182
|
function applyRightbarOverrides(op) {
|
|
1174
1183
|
const root = document.documentElement;
|
|
@@ -1887,6 +1896,46 @@ window.__ModuleLoader__.load({
|
|
|
1887
1896
|
model
|
|
1888
1897
|
};
|
|
1889
1898
|
}
|
|
1899
|
+
/** A non-empty string id, or null. */
|
|
1900
|
+
function asId(value) {
|
|
1901
|
+
return typeof value === "string" && value !== "" ? value : null;
|
|
1902
|
+
}
|
|
1903
|
+
/**
|
|
1904
|
+
* The id of the session the main view is showing.
|
|
1905
|
+
*
|
|
1906
|
+
* The model is read per session, so this hop has to answer before any of the
|
|
1907
|
+
* others can. 0.1.7 moved the answer: `sessions.list` stopped publishing a single
|
|
1908
|
+
* `current` id in favour of a row table (`ids` / `byId` / `phase`), and the main
|
|
1909
|
+
* view's session is now whatever holds a `mainView` retention — the same row the
|
|
1910
|
+
* host's own `uiSession.current` binding source is built from. Reading only
|
|
1911
|
+
* `list.current` therefore finds nothing on 0.1.7, and a plugin with no session
|
|
1912
|
+
* id can only ever fall back to rule 1: the background stops following the model.
|
|
1913
|
+
*
|
|
1914
|
+
* The hops are tried in order of authority and every one is optional, so this
|
|
1915
|
+
* answers on both host generations — and while `uiSession` is still mounting.
|
|
1916
|
+
*/
|
|
1917
|
+
function resolveMainSessionId(uiCurrent, snapshot) {
|
|
1918
|
+
const fromUiSession = asId(uiCurrent?.key);
|
|
1919
|
+
if (fromUiSession !== null) return fromUiSession;
|
|
1920
|
+
const legacy = asId(snapshot?.current);
|
|
1921
|
+
if (legacy !== null) return legacy;
|
|
1922
|
+
const byId = snapshot?.byId;
|
|
1923
|
+
if (byId !== void 0 && byId !== null) {
|
|
1924
|
+
for (const row of Object.values(byId)) if ((row?.retainedBy?.mainView ?? 0) > 0) {
|
|
1925
|
+
const id = asId(row?.id);
|
|
1926
|
+
if (id !== null) return id;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
return null;
|
|
1930
|
+
}
|
|
1931
|
+
/** Read `uiSession.current` (if that service is on this host) and resolve. */
|
|
1932
|
+
function mainSessionId(ctx, list) {
|
|
1933
|
+
let uiCurrent;
|
|
1934
|
+
try {
|
|
1935
|
+
uiCurrent = ctx.get("uiSession")?.current?.getSnapshot?.();
|
|
1936
|
+
} catch {}
|
|
1937
|
+
return resolveMainSessionId(uiCurrent, list?.getSnapshot());
|
|
1938
|
+
}
|
|
1890
1939
|
/**
|
|
1891
1940
|
* Watch the current session's model selection.
|
|
1892
1941
|
*
|
|
@@ -1945,7 +1994,7 @@ window.__ModuleLoader__.load({
|
|
|
1945
1994
|
};
|
|
1946
1995
|
const note = () => {
|
|
1947
1996
|
if (service === null) return "no-service";
|
|
1948
|
-
if (
|
|
1997
|
+
if (sessionId === null) return "no-session";
|
|
1949
1998
|
if (projected === null && directory === null) return "no-projection";
|
|
1950
1999
|
return "empty-selection";
|
|
1951
2000
|
};
|
|
@@ -1977,7 +2026,7 @@ window.__ModuleLoader__.load({
|
|
|
1977
2026
|
onChange(text, name !== "" ? name : model !== "" ? model : provider, "session", noteValue);
|
|
1978
2027
|
};
|
|
1979
2028
|
const bind = () => {
|
|
1980
|
-
const id = list
|
|
2029
|
+
const id = mainSessionId(ctx, list);
|
|
1981
2030
|
if (id === sessionId && (directory !== null || projected !== null)) {
|
|
1982
2031
|
emit(false);
|
|
1983
2032
|
return;
|
|
@@ -2010,7 +2059,7 @@ window.__ModuleLoader__.load({
|
|
|
2010
2059
|
};
|
|
2011
2060
|
const tick = () => {
|
|
2012
2061
|
if (list === null) return;
|
|
2013
|
-
if ((list
|
|
2062
|
+
if (mainSessionId(ctx, list) !== sessionId || directory === null && projected === null) bind();
|
|
2014
2063
|
else emit(false);
|
|
2015
2064
|
};
|
|
2016
2065
|
/**
|