dsh-background-by-model 0.4.3 → 0.4.4

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
@@ -225,6 +225,11 @@ No. Both were removed in 0.3.0; each rule uses a static image.
225
225
 
226
226
  ## Recent Optimizations
227
227
 
228
+ ### v0.4.4
229
+
230
+ - **The dock contracts stop asking a stylesheet question about JS attributes** — `dockkit.content` and `dockkit.float` were `rule` checks ("does a host stylesheet mention this literal?"). The host sets both attributes from JavaScript — `data-dockkit-content` on a tab host that has a tab, `data-dockkit-float` on a pane the user has floated — and never writes a CSS rule for either, so that question could only ever be answered "no". Both are now **presence** checks, guarded by the host's own tab marker (`data-dockkit-tab`) and by float mode respectively, so a dock with no tab open reads as *n/a* rather than as a rename. `dockkit.empty` — the empty seat the host renders in place of a populated tab host — is a presence check too. Verified against a live host: with no tab open `data-dockkit-tab`/`data-dockkit-content` are absent; clicking the dock's `+` makes both appear (tab 0→1, content 0→1, empty 1→0), and the checks then answer instead of skipping.
231
+ - **Anchors no longer depend on combinators** — The populated-tab anchor started out as `[data-dockkit-strip-tabs] > *`, which a DOM stand-in cannot answer and which let the fixture and the browser disagree. It is now a plain attribute selector.
232
+
228
233
  ### v0.4.3
229
234
 
230
235
  - **The Host check tab stops crying wolf** — Its first real run on a healthy 0.1.7 install reported **9 failures out of 28 contracts** (7 tokens "no longer declared", 2 attributes gone). Every one was the *probe reading the wrong place*, not the host: the tokens are published as `body{--dsw-…}` while the probe asked `getComputedStyle(document.documentElement)`, and `data-plugin` — which the host's own CSS modules set on every `<style>` they inject — was being used to mean "this plugin's sheet", so the check skipped the entire host theme and then called the tokens renamed. Both are fixed, and both now have tests that fail if they come back: the token root is a named part of `ProbeEnv`, and reading the plugin's own sheets goes through a marker the plugin writes itself (`data-dab-side`), via `getAttribute` rather than `dataset` — `dataset` only exposes the camel-cased key, so a probe indexing it by the dashed name works in a fixture and silently returns nothing in a browser.
package/README.zh.md CHANGED
@@ -225,6 +225,11 @@ pnpm test # 约定表、实时探测逻辑、界面样式表、版本下
225
225
 
226
226
  ## 近期优化
227
227
 
228
+ ### v0.4.4
229
+
230
+ - **停靠相关的约定不再拿「样式表问题」去问 JS 属性** — `dockkit.content` 与 `dockkit.float` 原本是 `rule` 检查(「宿主样式表里有没有提到这个字面量」)。但这两个属性都是宿主从 **JavaScript** 打上去的:`data-dockkit-content` 只在**有 tab** 的停靠页宿主上,`data-dockkit-float` 只在用户真的把面板浮动起来时;宿主从来没为它们写过任何 CSS 规则。所以那个问题无论宿主健不健康都只会回答「没有」。现在两条都改成**存在性**检查,分别用宿主自己的 tab 标记(`data-dockkit-tab`)和浮动态做守卫,于是「没开 tab 的停靠」会报成 *未观察*,而不是「属性改名」。`dockkit.empty`(宿主在「有 tab」时用来替换空位的那个座位)同样改成存在性检查。已在真实宿主上验证:没开 tab 时 `data-dockkit-tab`/`data-dockkit-content` 都不存在;点一下停靠栏的 `+`,两者同时出现(tab 0→1、content 0→1、empty 1→0),此时检查会给出结论而不是跳过。
231
+ - **锚点不再依赖组合符** — 「有 tab」的锚点最初写成 `[data-dockkit-strip-tabs] > *`,这种写法 DOM 替身回答不了,也让夹具和浏览器悄悄产生分歧。现在改成一个普通属性选择器。
232
+
228
233
  ### v0.4.3
229
234
 
230
235
  - **「宿主自检」不再虚报故障** — 它第一次在健康的 0.1.7 上实跑,28 条约定报了 **9 条失效**(7 个令牌「不再声明」、2 个属性「消失」)。**全部是探测读错了地方,宿主一条都没坏**:设计令牌发布在 `body{--dsw-…}` 上,探测却去问 `getComputedStyle(document.documentElement)`;而 `data-plugin` —— 宿主自己的 CSS 模块在**每一个** `<style>` 上都写它 —— 被我当成了「这是插件自己的样式表」,于是检查跳过了整个宿主主题,再把令牌报成改名。两处都已修正,并且各配了会让它复发的测试:令牌读取的宿主元素成了 `ProbeEnv` 的显式成员;识别自己的样式表改用一个只由本插件写入的标记(`data-dab-side`),且用 `getAttribute` 而不是 `dataset` —— `dataset` 只暴露驼峰键,按带连字符的名字去索引它,在夹具里能通过、在浏览器里静默返回空。
package/lib/client.js CHANGED
@@ -2831,9 +2831,9 @@ window.__ModuleLoader__.load({
2831
2831
  },
2832
2832
  target: "[data-dockkit-content]",
2833
2833
  checks: [{
2834
- kind: "rule",
2835
- match: "[data-dockkit-content]",
2836
- hint: "dock tab host"
2834
+ kind: "selector",
2835
+ selector: "[data-dockkit-content]",
2836
+ optionalWhen: "noDockTab"
2837
2837
  }],
2838
2838
  sources: [{
2839
2839
  path: ".",
@@ -2858,9 +2858,9 @@ window.__ModuleLoader__.load({
2858
2858
  },
2859
2859
  target: "[data-dockkit-empty]",
2860
2860
  checks: [{
2861
- kind: "rule",
2862
- match: "[data-dockkit-empty]",
2863
- hint: "dock empty seat"
2861
+ kind: "selector",
2862
+ selector: "[data-dockkit-empty]",
2863
+ optionalWhen: "noDockTab"
2864
2864
  }],
2865
2865
  sources: [{
2866
2866
  path: `${SIDEBAR_RIGHT}/lib/client.js`,
@@ -2884,9 +2884,9 @@ window.__ModuleLoader__.load({
2884
2884
  },
2885
2885
  target: "[data-dockkit-float]",
2886
2886
  checks: [{
2887
- kind: "rule",
2888
- match: "[data-dockkit-float]",
2889
- hint: "floating pane flag"
2887
+ kind: "selector",
2888
+ selector: "[data-dockkit-float]",
2889
+ optionalWhen: "noFloatPane"
2890
2890
  }],
2891
2891
  sources: [{
2892
2892
  path: `${SIDEBAR_RIGHT}/lib/client.js`,
@@ -3352,7 +3352,9 @@ window.__ModuleLoader__.load({
3352
3352
  chatNotMounted: "[data-chat-flow],[data-conversation-scroll]",
3353
3353
  trajectoryNotMounted: "[data-conversation-composer-overlay]",
3354
3354
  noRightPanel: "div[data-sidebar-right-panel],[data-dockkit-strip],[data-dockkit-pane]",
3355
- cordisClosed: "[data-cordis-panel]"
3355
+ cordisClosed: "[data-cordis-panel]",
3356
+ noDockTab: "[data-dockkit-tab]",
3357
+ noFloatPane: "[data-dockkit-float],[data-sidebar-right-mode=\"float\"]"
3356
3358
  };
3357
3359
  function mounted(env, anchorId) {
3358
3360
  const sel = ANCHORS[anchorId];
@@ -3693,7 +3695,7 @@ window.__ModuleLoader__.load({
3693
3695
  //#endregion
3694
3696
  //#region src/client/build-info.ts
3695
3697
  /** This plugin's version at build time ('0.0.0' when built unbundled). */
3696
- const PLUGIN_VERSION = "0.4.3";
3698
+ const PLUGIN_VERSION = "0.4.4";
3697
3699
  /** The dsh floor this build declares, straight from `engines.dsh`. */
3698
3700
  const DSH_FLOOR = "0.1.7-rc.2";
3699
3701
  //#endregion