dsh-multipane 1.0.46 → 1.0.47

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,10 @@ node scripts/check-names.cjs # package name / version / release-age allowanc
161
161
 
162
162
  ## Changelog
163
163
 
164
+ ### 1.0.47 (2026-11-11)
165
+
166
+ - **Fixed the rail being absent the first time a pane opens** (it only appeared after dragging one pane very wide). The host's turn navigator sets its `initialized` flag on a real event, and that one chance is already gone when a pane first mounts; nudging the width slightly does not wake it up, only the scroll produced by a big reflow does - which is why two, three and four panes were all blank after a restart and switching the active pane did nothing. A pane now kicks itself adaptively: every 250ms it checks whether the rail is there and, if not, dispatches a synthetic `scroll` event (no scrolling, no layout change), escalating to an 8px real scroll that is immediately restored every third attempt. It stops as soon as the rail appears, capped at five seconds.
167
+
164
168
  ### 1.0.46 (2026-11-11)
165
169
 
166
170
  - **Fixed the turn navigator flickering in and out, and never coming back after a resize**: 1.0.45 hid the rail below 480px with `display:none`, but the host's rail measures its own height for a virtual scroller - taking it out of layout recorded a height of 0 with nothing to recompute it when the pane grew back, so the rail stayed gone. The rail now keeps its layout at every width and is hidden only by `visibility` below 240px, which leaves the measurement valid and restores instantly.
package/README.md CHANGED
@@ -160,6 +160,10 @@ node scripts/check-names.cjs # 包名 / 版本 / 冷却豁免三处是否一
160
160
 
161
161
  ## 更新记录
162
162
 
163
+ ### 1.0.47(2026-11-11)
164
+
165
+ - **修「分栏后第一次打开,右侧轮次导航条根本不出现,得把某一栏拖得很宽才出来」**:宿主的这条导航要等一次真实事件才会把 `initialized` 置真,而窗格首次挂载时那次机会已经错过;小幅拖宽度不足以叫醒它,只有大幅重排引发的滚动才行——所以两栏、三栏、四栏重启后都是空白的,切换激活栏也无用。现在本栏激活后会自适应补敲:每 250ms 检查一次有没有那条导航,没有就补一次合成 `scroll` 事件(不动滚动条、不改布局),每三次升级成 8px 真滚动并立刻还原,出现即停、5 秒封顶。
166
+
163
167
  ### 1.0.46(2026-11-11)
164
168
 
165
169
  - **修「右侧轮次导航条忽隐忽现、拉窄后再拖宽也回不来」**:1.0.45 用 `display:none` 在 480px 以下收起这条,但宿主的这条导航内部是虚拟滚动,`display` 一关就把可用高度量成 0 并留在状态里,宽度回来也不会重算 —— 成了单向棘轮。现在显示恒为 `block`,只有窄到 240px 以下才隐藏**可见性**(`visibility:hidden`),布局与测量始终保留,恢复宽度立刻可见。
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.46";
20
+ const PLUGIN_VERSION = "1.0.47";
21
21
  const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
22
22
 
23
23
 
@@ -3268,7 +3268,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3268
3268
  * the tab's session through the scope provider.
3269
3269
  */
3270
3270
  function TabContent(props) {
3271
- const { sessionId, hero, sessions, renderFactorySlot, SessionProvider, renderSlot, viewBarOn } = props;
3271
+ const { sessionId, hero, sessions, renderFactorySlot, SessionProvider, renderSlot, viewBarOn, active } = props;
3272
3272
  const { reference, status } = useSessionReference(sessions, sessionId);
3273
3273
  const phase = hero ? "hero" : "active";
3274
3274
  /* The host's own conversation panel is a slot entry in `main.conversation`
@@ -3312,7 +3312,51 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3312
3312
  return null;
3313
3313
  }, []);
3314
3314
 
3315
- if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-empty" }, t("这个版本没有提供会话内容区域"));
3315
+ const paneId = react.useContext(PaneIdCtx);
3316
+
3317
+ /* 1.0.47:宿主的轮次导航条要等一次「真实的滚动/重排事件」才会把 initialized
3318
+ 置真,而窗格初次挂载时那次机会已经错过;之后小幅改宽度也不会把它叫醒
3319
+ (只有大幅拖宽引发的内容重排 + 滚动才行)。这里不猜刺激强度:本栏激活后
3320
+ 每 250ms 看一眼有没有那条导航,没有就补一次合成 scroll 事件(不动滚动
3321
+ 条、不改布局),每三次升级成 8px 真滚动并立刻还原;出现即停,5 秒封顶。 */
3322
+ react.useEffect(() => {
3323
+ if (active !== true || sessionId === null) return;
3324
+ const paneEl = paneId === null || paneId === void 0 ? null : document.querySelector(`.dsv-pane[data-pane-id="${paneId}"]`);
3325
+ if (paneEl === null) return;
3326
+ let tries = 0;
3327
+ let timer = 0;
3328
+ let cancelled = false;
3329
+ const hasRail = () => paneEl.querySelector("nav button[data-index]") !== null;
3330
+ const tick = () => {
3331
+ if (cancelled || hasRail() || tries >= 20) return;
3332
+ tries += 1;
3333
+ const column = paneEl.querySelector('.dsv-tab-slot[data-active="1"] [data-chat-flow]');
3334
+ const scroller = column === null ? null : column.parentElement;
3335
+ if (scroller !== null) {
3336
+ if (tries % 3 === 0) {
3337
+ const before = scroller.scrollTop;
3338
+ scroller.scrollTop = before + 8;
3339
+ window.requestAnimationFrame(() => {
3340
+ scroller.scrollTop = before;
3341
+ });
3342
+ } else {
3343
+ scroller.dispatchEvent(new Event("scroll"));
3344
+ }
3345
+ }
3346
+ timer = window.setTimeout(tick, 250);
3347
+ };
3348
+ timer = window.setTimeout(tick, 250);
3349
+ return () => {
3350
+ cancelled = true;
3351
+ window.clearTimeout(timer);
3352
+ };
3353
+ }, [
3354
+ active,
3355
+ sessionId,
3356
+ paneId
3357
+ ]);
3358
+
3359
+ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-empty" }, t("这个版本没有提供会话内容区域"));
3316
3360
 
3317
3361
  // A blank tab is the host's own "new session" page: the content factory
3318
3362
  // rendered with no session in scope, which is exactly what the native
@@ -4591,6 +4635,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
4591
4635
  h(TabContentMemo, {
4592
4636
  sessionId: tabSessionId,
4593
4637
  hero: tabHero,
4638
+ active: tabActive,
4594
4639
  sessions,
4595
4640
  renderFactorySlot,
4596
4641
  SessionProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-multipane",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
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": {