dsh-multipane 1.0.49 → 1.0.50

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.en.md CHANGED
@@ -161,6 +161,12 @@ node scripts/check-names.cjs # package name / version / release-age allowanc
161
161
 
162
162
  ## Changelog
163
163
 
164
+ ### 1.0.50 (2026-11-11)
165
+
166
+ - **Root cause of the missing rail in panes: a deadlock.** The host hides the rail with `display:none` whenever its container is 900px or narrower. Once hidden, the rail's internal virtual scroller measures a height of zero and renders no marks at all, and the plugin used "are there marks?" as its show switch - so the switch could never turn on and the rail could never come back. That is why two or three panes (a few hundred pixels each) were always blank, and dragging a pane past 900px suddenly made it appear. The rail is now located structurally, independent of whether marks exist.
167
+ - **Supplied the height it depends on.** The host derives the rail's height limit from two CSS variables (viewport height, composer height). While a tab was hidden it measured `0px` and wrote that, and nothing recomputed it afterwards, so the limit stayed zero. The plugin now rewrites those two variables using the host's own formula, only when they disagree, so the write is idempotent.
168
+ - The 1.0.49 fix (aim the nudge at the real scroll container) stays: it is what wakes the host's `initialized` flag, and measurements show one scroll notification is enough.
169
+
164
170
  ### 1.0.49 (2026-11-11)
165
171
 
166
172
  - **Turn navigator missing in panes, step one: the automatic nudge was aimed at the wrong element.** Scroll ownership inside a pane lives on the host's `[data-conversation-scroll]`; its scroll listener returns immediately unless `event.target` is that very element, and setting `scrollTop` on a non-scrolling wrapper produces no scroll event at all. The 1.0.47 nudge targeted the list wrapper inside the tab content, so five seconds of nudging did nothing. It now targets the real scroll container and escalates: `scroll` event, then `scrollend`, then a real 1px scroll restored on the next frame, stopping as soon as the rail appears.
package/README.md CHANGED
@@ -160,6 +160,12 @@ node scripts/check-names.cjs # 包名 / 版本 / 冷却豁免三处是否一
160
160
 
161
161
  ## 更新记录
162
162
 
163
+ ### 1.0.50(2026-11-11)
164
+
165
+ - **修「窗格里的轮次导航条不出现」的根因**:导航条是死锁的。宿主在容器宽度 ≤900px 时把它 `display:none`;一旦隐藏,它内部的虚拟滚动量不到高度,就一条短横线都不渲染;而插件之前用「里面有没有短横线」当显示开关,于是永远不成立、永远放不出来 —— 分到 2/3 栏(每栏五百多像素)必然全空白,拖到 900px 以上突然出现,就是这个原因。现在只看结构定位那颗导航,与里面有没有短横线无关
166
+ - **补上它的高度来源**:宿主用两个 CSS 变量(可视高度、输入框高度)算导航条的高度上限,标签页被隐藏时它量到 `0px` 并写了下去,之后没人再量,高度上限就一直是 0。现在插件按同样口径补写这两个变量(只在不一致时写,幂等)
167
+ - 1.0.49 那条「对准真正的滚动容器」的补救继续保留:它负责把宿主的「已初始化」标志叫醒,实测一次滚动通知就够
168
+
163
169
  ### 1.0.49(2026-11-11)
164
170
 
165
171
  - **修「窗格里的轮次导航条不出现」,第一步:之前的自动补救敲错了元素**。窗格里内容滚动的所有权在宿主的 `[data-conversation-scroll]` 上,它的滚动监听器第一行就会判断「事件来源是不是我自己(scroller)」,不是就直接返回;1.0.47 的合成滚动打在标签内容里那层列表壳上,既不是监听对象,改它的 `scrollTop` 也不会产生任何滚动事件,所以补了 5 秒等于没补。现在对准真正的滚动容器,按「scroll 事件 → scrollend 事件 → 1px 真滚动(下一帧还原)」逐级升级,出现即停
package/lib/client.js CHANGED
@@ -17,7 +17,7 @@ window.__ModuleLoader__.load({
17
17
  */
18
18
  const PLUGIN_LABEL = "多栏视图";
19
19
  /* 与 package.json 的 version 必须一致(发版时两处同改;check-names.cjs 会校验)。 */
20
- const PLUGIN_VERSION = "1.0.49";
20
+ const PLUGIN_VERSION = "1.0.50";
21
21
  const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
22
22
 
23
23
 
@@ -2307,10 +2307,15 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
2307
2307
  会让宿主的虚拟滚动把可用高度量成 0 并留在状态里,宽度回来也没人重算 ——
2308
2308
  拉窄消失后拖回原宽度也回不来(单向棘轮)。现在显示恒为 block(布局与测量
2309
2309
  一直在),只有窄到放不下时才隐藏**可见性**,恢复宽度立刻可见。
2310
- 选择器用结构条件 nav:has(button[data-index]),不写宿主的哈希类名
2311
- (如 SNx2jG_*),宿主升级换了哈希也不会失效。 */
2312
- .dsv-pane .dsv-body nav:has(button[data-index]){display:block!important}
2313
- @container (width<=240px){.dsv-pane .dsv-body nav:has(button[data-index]){visibility:hidden;pointer-events:none}}
2310
+ 选择器用结构条件、不写宿主的哈希类名(如 SNx2jG_*),宿主升级换了哈希也不会失效。
2311
+
2312
+ ⚠️ 1.0.50 修正:不能用 nav:has(button[data-index]) 当开关。宿主在容器宽度
2313
+ ≤900px 时把这条导航 display:none;一旦隐藏,它内部的虚拟滚动量不到高度,就一条
2314
+ 短横线都不渲染 —— 于是 :has(button) 永远不成立,插件也就永远没法把它放出来,
2315
+ 成了死锁。这也正是「分到 3 栏(每栏 ~567px)怎么补都不出现、拖宽到 900px 以上
2316
+ 突然出现」的原因。现在只按结构定位这颗 nav,与里面有没有按钮无关。 */
2317
+ .dsv-pane .dsv-body [data-conversation-scroll] nav{display:block!important}
2318
+ @container (width<=240px){.dsv-pane .dsv-body [data-conversation-scroll] nav{visibility:hidden;pointer-events:none}}
2314
2319
  /* 窗口最大化时外框有约 7px 溢出到屏幕外,标题栏最顶上那一截落在屏幕外;
2315
2320
  标签原来只有 ~26px 高、上下留 9px,光标贴屏幕最顶时落在标签上方的空白里,点不到标签。
2316
2321
  把标签命中区拉到标题栏整高(内容仍垂直居中)。只改标签自身横向范围,
@@ -3369,6 +3374,34 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3369
3374
  }
3370
3375
  }
3371
3376
 
3377
+ /* 宿主那两个 CSS 变量是它在 composer seat 的 ResizeObserver 里写的:
3378
+ `--dsh-conversation-viewport-height` = scroller.clientHeight、
3379
+ `--dsh-composer-height` = seat.offsetHeight。标签槽被 `display:none` 时它量到 0px
3380
+ 并写了下去,之后就没人再量(1.0.49 的取证里两栏都读到 `0px` / `0px`),
3381
+ `--turn-rail-band` 于是变成 `calc(0px - 0px)`,导航条的 max-height 也被压成 0。
3382
+ 这里按宿主同样的口径补写一次,只在不一致时写,幂等,不改别的样式。 */
3383
+ function syncPaneRailVars(paneEl) {
3384
+ const slot = paneEl.querySelector('.dsv-tab-slot[data-active="1"]');
3385
+ if (slot === null) return;
3386
+ const scroller = slot.querySelector("[data-conversation-scroll]");
3387
+ if (scroller === null) return;
3388
+ const viewport = scroller.clientHeight;
3389
+ if (viewport <= 0) return;
3390
+ const seat = scroller.querySelector("[data-composer-seat]");
3391
+ const composer = seat === null ? 0 : seat.offsetHeight;
3392
+ const computed = getComputedStyle(scroller);
3393
+ const read = (name) => {
3394
+ const value = parseFloat(computed.getPropertyValue(name));
3395
+ return Number.isFinite(value) ? value : null;
3396
+ };
3397
+ if (read("--dsh-conversation-viewport-height") !== viewport) {
3398
+ scroller.style.setProperty("--dsh-conversation-viewport-height", `${viewport}px`);
3399
+ }
3400
+ if (read("--dsh-composer-height") !== composer) {
3401
+ scroller.style.setProperty("--dsh-composer-height", `${composer}px`);
3402
+ }
3403
+ }
3404
+
3372
3405
  function TabContent(props) {
3373
3406
  const { sessionId, hero, sessions, renderFactorySlot, SessionProvider, renderSlot, viewBarOn, active } = props;
3374
3407
  const { reference, status } = useSessionReference(sessions, sessionId);
@@ -3440,6 +3473,20 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3440
3473
  const paneEl = paneId === null || paneId === void 0 ? null : document.querySelector(`.dsv-pane[data-pane-id="${paneId}"]`);
3441
3474
  if (paneEl === null) return;
3442
3475
  const slotOf = () => paneEl.querySelector('.dsv-tab-slot[data-active="1"]');
3476
+ const scrollerOf = () => {
3477
+ const slot = slotOf();
3478
+ return slot === null ? null : slot.querySelector("[data-conversation-scroll]");
3479
+ };
3480
+ /* 先修变量:band 是 0 的时候,哪怕 display 放开了,导航条的高度上限仍然是 0。 */
3481
+ syncPaneRailVars(paneEl);
3482
+ let variablesObserver = null;
3483
+ const scrollerForVars = scrollerOf();
3484
+ if (scrollerForVars !== null && typeof ResizeObserver === "function") {
3485
+ const seatForVars = scrollerForVars.querySelector("[data-composer-seat]");
3486
+ variablesObserver = new ResizeObserver(() => syncPaneRailVars(paneEl));
3487
+ variablesObserver.observe(scrollerForVars);
3488
+ if (seatForVars !== null) variablesObserver.observe(seatForVars);
3489
+ }
3443
3490
  const railCount = () => {
3444
3491
  const slot = slotOf();
3445
3492
  return slot === null ? 0 : slot.querySelectorAll("nav button[data-index]").length;
@@ -3474,9 +3521,11 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3474
3521
  finish("timeout");
3475
3522
  return;
3476
3523
  }
3524
+ /* 变量在标签切换 / 拖动分隔条后可能又被打回 0px,每轮补一次。 */
3525
+ syncPaneRailVars(paneEl);
3477
3526
  const kind = ["scroll", "scrollend", "real"][index % 3];
3478
3527
  const slot = slotOf();
3479
- const scroller = slot === null ? null : slot.querySelector("[data-conversation-scroll]");
3528
+ const scroller = scrollerOf();
3480
3529
  if (scroller !== null) {
3481
3530
  if (kind === "scroll") scroller.dispatchEvent(new Event("scroll"));
3482
3531
  else if (kind === "scrollend") scroller.dispatchEvent(new Event("scrollend"));
@@ -3509,6 +3558,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3509
3558
  return () => {
3510
3559
  stopped = true;
3511
3560
  window.clearTimeout(timer);
3561
+ if (variablesObserver !== null) variablesObserver.disconnect();
3512
3562
  };
3513
3563
  }, [
3514
3564
  active,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-multipane",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Split the DSH main area into up to four panes, each with its own tab strip, composer and view switcher. Drag a tab to a pane edge to split. Bilingual (zh/en).",
5
5
  "displayName": "多栏视图",
6
6
  "dshhub": {