dsh-multipane 1.0.45 → 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,14 @@ 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
+
168
+ ### 1.0.46 (2026-11-11)
169
+
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.
171
+
164
172
  ### 1.0.45 (2026-11-11)
165
173
 
166
174
  - **Brought the host's turn navigator back inside panes** (the column of short marks on the right of a conversation, with the "turn N" hover preview). The plugin never removed it: the host hides the rail whenever a conversation is narrower than 900px (`@container (width<=900px)`), and a two-pane layout puts each pane at roughly 650px, so the rule fires as soon as you split. The plugin now re-enables the rail inside panes only (still hidden below 480px), in CSS alone - no host DOM is touched and no React state is involved.
package/README.md CHANGED
@@ -160,6 +160,14 @@ 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
+
167
+ ### 1.0.46(2026-11-11)
168
+
169
+ - **修「右侧轮次导航条忽隐忽现、拉窄后再拖宽也回不来」**:1.0.45 用 `display:none` 在 480px 以下收起这条,但宿主的这条导航内部是虚拟滚动,`display` 一关就把可用高度量成 0 并留在状态里,宽度回来也不会重算 —— 成了单向棘轮。现在显示恒为 `block`,只有窄到 240px 以下才隐藏**可见性**(`visibility:hidden`),布局与测量始终保留,恢复宽度立刻可见。
170
+
163
171
  ### 1.0.45(2026-11-11)
164
172
 
165
173
  - **恢复窗格里的「轮次导航条」**(会话右侧那列短横线,悬停弹出「第 N 轮」预览卡)。它不是被插件删掉的:宿主有一条 `@container (width<=900px)` 的响应式规则,会话宽度不到 900px 就整条隐藏;分成两栏后每栏大约 650px,规则一命中就没了。现在插件只在窗格里把它放开(窗格窄于 480px 时仍收起),仍是不碰宿主 DOM、不动 React,纯 CSS 覆盖。
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.45";
20
+ const PLUGIN_VERSION = "1.0.47";
21
21
  const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
22
22
 
23
23
 
@@ -2301,13 +2301,16 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
2301
2301
  在窄栏里尤其明显;这里把它的预留位清零。 */
2302
2302
  .dsv-pane .dsv-body [data-chat-turn-spacer]{height:0!important}
2303
2303
 
2304
- /* ==== 1.0.45:窗格内恢复宿主的「轮次导航条」(会话右侧那列短横线)====
2305
- 宿主在会话宽度 ≤900px 时把这条整条隐藏(@container 查询),分栏后每栏必然更窄,
2306
- 于是开着插件它就没了。这里只在窗格里重新放开;窗格窄于 480px(约四栏)时仍
2307
- 收起,免得挤正文。选择器用结构条件 nav:has(button[data-index]),不写宿主的
2308
- 哈希类名(如 SNx2jG_*),宿主升级换了哈希也不会失效。 */
2304
+ /* ==== 1.0.46:窗格里的「轮次导航条」不再忽隐忽现(会话右侧那列短横线)====
2305
+ 宿主在会话宽度 ≤900px 时整条 display:none,分栏后每栏必然更窄,于是开着插件
2306
+ 它就没了。1.0.45 把它放开,却又用 display:none 在窄窗格里收回:来回切 display
2307
+ 会让宿主的虚拟滚动把可用高度量成 0 并留在状态里,宽度回来也没人重算 ——
2308
+ 拉窄消失后拖回原宽度也回不来(单向棘轮)。现在显示恒为 block(布局与测量
2309
+ 一直在),只有窄到放不下时才隐藏**可见性**,恢复宽度立刻可见。
2310
+ 选择器用结构条件 nav:has(button[data-index]),不写宿主的哈希类名
2311
+ (如 SNx2jG_*),宿主升级换了哈希也不会失效。 */
2309
2312
  .dsv-pane .dsv-body nav:has(button[data-index]){display:block!important}
2310
- @container (width<=480px){.dsv-pane .dsv-body nav:has(button[data-index]){display:none!important}}
2313
+ @container (width<=240px){.dsv-pane .dsv-body nav:has(button[data-index]){visibility:hidden;pointer-events:none}}
2311
2314
  /* 窗口最大化时外框有约 7px 溢出到屏幕外,标题栏最顶上那一截落在屏幕外;
2312
2315
  标签原来只有 ~26px 高、上下留 9px,光标贴屏幕最顶时落在标签上方的空白里,点不到标签。
2313
2316
  把标签命中区拉到标题栏整高(内容仍垂直居中)。只改标签自身横向范围,
@@ -3265,7 +3268,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3265
3268
  * the tab's session through the scope provider.
3266
3269
  */
3267
3270
  function TabContent(props) {
3268
- const { sessionId, hero, sessions, renderFactorySlot, SessionProvider, renderSlot, viewBarOn } = props;
3271
+ const { sessionId, hero, sessions, renderFactorySlot, SessionProvider, renderSlot, viewBarOn, active } = props;
3269
3272
  const { reference, status } = useSessionReference(sessions, sessionId);
3270
3273
  const phase = hero ? "hero" : "active";
3271
3274
  /* The host's own conversation panel is a slot entry in `main.conversation`
@@ -3309,7 +3312,51 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3309
3312
  return null;
3310
3313
  }, []);
3311
3314
 
3312
- 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("这个版本没有提供会话内容区域"));
3313
3360
 
3314
3361
  // A blank tab is the host's own "new session" page: the content factory
3315
3362
  // rendered with no session in scope, which is exactly what the native
@@ -4588,6 +4635,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
4588
4635
  h(TabContentMemo, {
4589
4636
  sessionId: tabSessionId,
4590
4637
  hero: tabHero,
4638
+ active: tabActive,
4591
4639
  sessions,
4592
4640
  renderFactorySlot,
4593
4641
  SessionProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-multipane",
3
- "version": "1.0.45",
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": {