dsh-multipane 1.0.36 → 1.0.38
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 +11 -0
- package/README.md +11 -0
- package/lib/client.js +150 -28
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -161,6 +161,17 @@ node scripts/check-names.cjs # package name / version / release-age allowanc
|
|
|
161
161
|
|
|
162
162
|
## Changelog
|
|
163
163
|
|
|
164
|
+
### 1.0.38 (2026-11-11)
|
|
165
|
+
|
|
166
|
+
- **Fixed the big gap under the last message after a reply**: the host's slot wrapper is `display:contents` and never takes part in layout, so the earlier `margin-top:auto` on it did nothing. The auto margin now sits on the real flex item (`.an3WzG_viewArea`), and the host scroll manager's reserved room after collapsing a turn (up to half a viewport) is zeroed — short conversations dock above the composer, long ones still start at the top
|
|
167
|
+
- **Fixed the "loading history" flash when switching tabs**: tabs were keyed by tab id, so every switch unmounted and remounted the host conversation view and re-fetched its history. Each tab now keeps a resident slot and inactive ones are hidden with `display:none` — switching only toggles visibility, so nothing remounts and no history is re-fetched
|
|
168
|
+
- **Fixed unclickable tabs when the pointer sits at the very top of a maximized window**: a maximized frame overflows about 7px above the screen, while tabs were only ~26px tall and vertically centered in the 44px header, leaving 9px of drag area above and below. The tab hit area now fills the header height (labels stay centered); the empty header still drags the window and double-click maximizes
|
|
169
|
+
- **Fixed the bottom stats line flickering**: the stats-row scan is now limited to the active tab, so the copy inside hidden tabs is no longer mistaken for a freshly rendered row
|
|
170
|
+
|
|
171
|
+
### 1.0.37 (2026-11-11)
|
|
172
|
+
|
|
173
|
+
- **Fixed Ctrl+W dying on a second machine**: the host's Ctrl+W binding lives in a per-device file (`keybindings.json` in Electron's userData), so configuring one machine left the next one back on "close the window". The plugin now releases that binding itself on startup (via the host's `ctx.shortcuts.edit()`) and restores it when the switch is turned off or the plugin is disabled — no manual file copying on new machines
|
|
174
|
+
|
|
164
175
|
### 1.0.36 (2026-11-11)
|
|
165
176
|
|
|
166
177
|
- **Ctrl+W closes the tab, with two switches**: the settings page gains "Ctrl+W closes the tab" (master) and "Close the window on the last tab" (depends on the former; greyed out and disabled while the master is off). Pressing Ctrl+W on the last remaining tab now closes the window instead of appearing to do nothing
|
package/README.md
CHANGED
|
@@ -160,6 +160,17 @@ node scripts/check-names.cjs # 包名 / 版本 / 冷却豁免三处是否一
|
|
|
160
160
|
|
|
161
161
|
## 更新记录
|
|
162
162
|
|
|
163
|
+
### 1.0.38(2026-11-11)
|
|
164
|
+
|
|
165
|
+
- **修「回复完,最后一条消息下面一大块空白」**:宿主的插槽包裹元素是 `display:contents`,不参与布局,之前把 `margin-top:auto` 写在它身上等于没写。现在改挂到真正的 flex 项 `.an3WzG_viewArea` 上,并把宿主滚动管理器在明细折叠后预留的空白(最多半屏)清零 —— 内容不足一屏时贴输入框,内容超一屏时照常从顶部排
|
|
166
|
+
- **修「切标签先闪一下『载入历史』」**:同一栏的标签原来按「标签 id」换 key,切一次就卸载重建一次宿主会话组件,宿主于是重新拉历史。现在每个标签各占一个常驻槽位,非活动的用 `display:none` 隐藏 —— 切标签只切显示,组件不卸载,历史不重拉
|
|
167
|
+
- **修「最大化时鼠标贴屏幕最顶端点不到标签」**:最大化窗口外框向上溢出约 7px,而标签只有约 26px 高、在 44px 标题栏里居中,上下各留 9px 拖动区。现在标签命中区拉到标题栏整高(文字仍居中),标签之外的空白照旧可拖动窗口 / 双击最大化
|
|
168
|
+
- **修「底部统计数字来回跳」**:统计行扫描收窄到当前激活标签,隐藏标签里的那一份不再被当成「宿主新建的行」反复搬运
|
|
169
|
+
|
|
170
|
+
### 1.0.37(2026-11-11)
|
|
171
|
+
|
|
172
|
+
- **修「换台机器 Ctrl+W 就失效」**:宿主的 Ctrl+W 绑定是**每台设备本地一份**(Electron userData 的 `keybindings.json`),手工配好这台、换机器又变回关窗口。现在插件启动时自己把这个绑定交出来(走宿主的 `ctx.shortcuts.edit()`),关掉「Ctrl+W 关闭标签」开关或停用插件时再还回去 —— 换机器、重装、清配置都不用手工补
|
|
173
|
+
|
|
163
174
|
### 1.0.36(2026-11-11)
|
|
164
175
|
|
|
165
176
|
- **Ctrl+W 关标签,两个开关可配**:设置页「界面元素」新增「Ctrl+W 关闭标签」(总开关)与「最后一个标签时关闭窗口」(依赖前者,前者关闭时自动变灰禁用)。只剩一个标签时再按 Ctrl+W 直接关窗口,不再像以前那样「按了没反应」
|
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.
|
|
20
|
+
const PLUGIN_VERSION = "1.0.38";
|
|
21
21
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
22
22
|
|
|
23
23
|
|
|
@@ -262,13 +262,13 @@ window.__ModuleLoader__.load({
|
|
|
262
262
|
"显示视图切换条": "Show view switcher bar",
|
|
263
263
|
"已关闭:每栏不显示「对话 / 轨迹 / 上下文 …」那一行。": "Off: panes hide the \"Chat / Trace / Context …\" row.",
|
|
264
264
|
"已开启:每栏显示「对话 / 轨迹 / 上下文 …」那一行。位置与显示哪些视图,见下面两项。": "On: panes show the \"Chat / Trace / Context …\" row. Position and which views appear are set in the next two items.",
|
|
265
|
-
"双击关闭标签": "Double-click to close tabs",
|
|
266
|
-
"Ctrl+W 关闭标签": "Ctrl+W closes the tab",
|
|
267
|
-
"已关闭:Ctrl+W 按应用默认行为处理(关闭窗口)。": "Off: Ctrl+W falls back to the app default (close the window).",
|
|
268
|
-
"已开启:Ctrl+W 关闭当前栏的当前标签。": "On: Ctrl+W closes the current tab of the active pane.",
|
|
269
|
-
"最后一个标签时关闭窗口": "Close the window on the last tab",
|
|
270
|
-
"需要先打开上面的「Ctrl+W 关闭标签」。": "Turn on \"Ctrl+W closes the tab\" above first.",
|
|
271
|
-
"已关闭:只剩一个标签时 Ctrl+W 不动作,标签保留。": "Off: Ctrl+W does nothing when only one tab is left.",
|
|
265
|
+
"双击关闭标签": "Double-click to close tabs",
|
|
266
|
+
"Ctrl+W 关闭标签": "Ctrl+W closes the tab",
|
|
267
|
+
"已关闭:Ctrl+W 按应用默认行为处理(关闭窗口)。": "Off: Ctrl+W falls back to the app default (close the window).",
|
|
268
|
+
"已开启:Ctrl+W 关闭当前栏的当前标签。": "On: Ctrl+W closes the current tab of the active pane.",
|
|
269
|
+
"最后一个标签时关闭窗口": "Close the window on the last tab",
|
|
270
|
+
"需要先打开上面的「Ctrl+W 关闭标签」。": "Turn on \"Ctrl+W closes the tab\" above first.",
|
|
271
|
+
"已关闭:只剩一个标签时 Ctrl+W 不动作,标签保留。": "Off: Ctrl+W does nothing when only one tab is left.",
|
|
272
272
|
"已开启:只剩一个标签时再按 Ctrl+W 直接关闭窗口。": "On: pressing Ctrl+W again on the last tab closes the window.",
|
|
273
273
|
"已关闭:双击标签不关闭(中键、× 仍然可用)。": "Off: double-clicking a tab does not close it (middle-click and × still work).",
|
|
274
274
|
"已开启:双击标签直接关闭(中键、× 也可用)。": "On: double-clicking a tab closes it (middle-click and × also work).",
|
|
@@ -1341,8 +1341,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1341
1341
|
lineOpacity: LINE_OPACITY_IDS.indexOf(parsed?.lineOpacity) >= 0 ? parsed.lineOpacity : DEFAULT_LINE_OPACITY,
|
|
1342
1342
|
/* 外观分组:老数据没有这一项 → 用 lineOpacity / lineWidth 还原分隔条,升级不跳变。 */
|
|
1343
1343
|
appearance: normalizeAppearance(parsed?.appearance, parsed),
|
|
1344
|
-
dblclickClose: parsed?.dblclickClose !== false,
|
|
1345
|
-
ctrlWCloseTab: parsed?.ctrlWCloseTab !== false,
|
|
1344
|
+
dblclickClose: parsed?.dblclickClose !== false,
|
|
1345
|
+
ctrlWCloseTab: parsed?.ctrlWCloseTab !== false,
|
|
1346
1346
|
ctrlWCloseWindowOnLast: parsed?.ctrlWCloseWindowOnLast !== false,
|
|
1347
1347
|
viewBarPlacement: VIEWBAR_PLACEMENTS.indexOf(parsed?.viewBarPlacement) >= 0 ? parsed.viewBarPlacement : DEFAULT_VIEWBAR_PLACEMENT,
|
|
1348
1348
|
viewBarOrder: cleanIdList(parsed?.viewBarOrder),
|
|
@@ -1367,8 +1367,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1367
1367
|
lineWidth: nearestWidthId(appearance.divider.width),
|
|
1368
1368
|
lineOpacity: nearestOpacityId(appearance.divider.alpha),
|
|
1369
1369
|
appearance,
|
|
1370
|
-
dblclickClose: prefs.state.dblclickClose !== false,
|
|
1371
|
-
ctrlWCloseTab: prefs.state.ctrlWCloseTab !== false,
|
|
1370
|
+
dblclickClose: prefs.state.dblclickClose !== false,
|
|
1371
|
+
ctrlWCloseTab: prefs.state.ctrlWCloseTab !== false,
|
|
1372
1372
|
ctrlWCloseWindowOnLast: prefs.state.ctrlWCloseWindowOnLast !== false,
|
|
1373
1373
|
viewBarPlacement: VIEWBAR_PLACEMENTS.indexOf(prefs.state.viewBarPlacement) >= 0 ? prefs.state.viewBarPlacement : DEFAULT_VIEWBAR_PLACEMENT,
|
|
1374
1374
|
viewBarOrder: cleanIdList(prefs.state.viewBarOrder),
|
|
@@ -2268,6 +2268,27 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
2268
2268
|
centred hero in the hero phase). No overrides are needed — this rule only
|
|
2269
2269
|
guards the case where a future host drops that variant. */
|
|
2270
2270
|
.dsv-body [data-conversation-content]:not([data-content-phase]) [data-composer-seat]{position:sticky;bottom:0;z-index:7}
|
|
2271
|
+
/* ==== multipane fix 2026-11-11: 常驻标签页 + 栏内会话底部对齐(消除回复后下方空白) ==== */
|
|
2272
|
+
/* 同一栏的每个标签各占一个常驻槽位,非活动标签用 display:none 隐藏;
|
|
2273
|
+
切换标签不再卸载/重挂宿主会话组件 → 不再闪「载入历史」中间页。 */
|
|
2274
|
+
.dsv-pane .dsv-body .dsv-tab-slot{flex:1 1 auto;min-height:0;min-width:0;height:100%;display:flex;flex-direction:column;position:relative}
|
|
2275
|
+
.dsv-pane .dsv-body .dsv-tab-slot>*{flex:1 1 auto;min-height:0;min-width:0}
|
|
2276
|
+
.dsv-pane .dsv-body .dsv-tab-slot[data-active="0"]{display:none!important}
|
|
2277
|
+
/* 活动阶段:让会话内容贴着输入框底部对齐(内容不足一屏时空白落到上方,而不是堆在回复下方)。
|
|
2278
|
+
⚠️ 槽位 [data-slot="conversation.session"] 在宿主里是 display:contents(见 renderer 的
|
|
2279
|
+
ANCHOR_STYLE),它不参与布局,写 margin-top:auto 是空操作 —— 真正的 flex item 是它的
|
|
2280
|
+
子元素 .an3WzG_viewArea,auto margin 必须写在这里才生效。 */
|
|
2281
|
+
.dsv-pane .dsv-body [data-content-phase="active"] .an3WzG_viewArea{flex:0 0 auto;margin-top:auto}
|
|
2282
|
+
.dsv-pane .dsv-body [data-content-phase="active"] .an3WzG_composerSeat{margin-top:0}
|
|
2283
|
+
/* 宿主聊天滚动管理器在「工具/明细折叠」后会在内容下方预留最多半个滚动区高度的空白,
|
|
2284
|
+
在窄栏里尤其明显;这里把它的预留位清零。 */
|
|
2285
|
+
.dsv-pane .dsv-body [data-chat-turn-spacer]{height:0!important}
|
|
2286
|
+
/* 窗口最大化时外框有约 7px 溢出到屏幕外,标题栏最顶上那一截落在屏幕外;
|
|
2287
|
+
标签原来只有 ~26px 高、上下留 9px,光标贴屏幕最顶时落在标签上方的空白里,点不到标签。
|
|
2288
|
+
把标签命中区拉到标题栏整高(内容仍垂直居中)。只改标签自身横向范围,
|
|
2289
|
+
标题栏空白处的拖动窗口 / 双击最大化不受影响。 */
|
|
2290
|
+
.dsv-paneheader .dsv-tabs{height:100%;align-items:stretch}
|
|
2291
|
+
.dsv-paneheader .dsv-tab{height:100%;padding:0 5px 0 8px;align-items:center;box-sizing:border-box}
|
|
2271
2292
|
.dsv-divider{flex:0 0 7px;position:relative;cursor:col-resize;touch-action:none;background:transparent;app-region:no-drag;-webkit-app-region:no-drag}
|
|
2272
2293
|
.dsv-divider::after{content:"";position:absolute;top:0;bottom:0;left:2px;width:var(--dsv-div-w,2px);border-radius:calc(var(--dsv-div-w,2px) / 2);background:var(--dsv-div-soft,rgba(167,170,175,.85));transition:background .12s,width .12s}
|
|
2273
2294
|
.dsv-divider:hover::after,.dsv-divider[data-dragging="1"]::after{background:var(--dsv-div-c,#a7aaaf);width:var(--dsv-div-w,2px)}
|
|
@@ -2374,9 +2395,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
2374
2395
|
.dsv-switch{position:relative;flex:0 0 auto;width:40px;height:22px;border-radius:11px;border:1px solid var(--dsh-border-color,rgba(128,128,128,.4));background:transparent;cursor:pointer;padding:0;transition:background .14s,border-color .14s}
|
|
2375
2396
|
.dsv-switch::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:currentColor;opacity:.55;transition:transform .14s,opacity .14s}
|
|
2376
2397
|
.dsv-switch[data-on="1"]{background:var(--dsh-accent-color,#4a8cf7);border-color:var(--dsh-accent-color,#4a8cf7)}
|
|
2377
|
-
.dsv-switch[data-on="1"]::after{transform:translateX(18px);background:#fff;opacity:1}
|
|
2378
|
-
/* 依赖未满足的卡片整块变灰、开关不可点(第二个 Ctrl+W 开关用)。 */
|
|
2379
|
-
.dsv-card[data-muted="1"]{opacity:.45}
|
|
2398
|
+
.dsv-switch[data-on="1"]::after{transform:translateX(18px);background:#fff;opacity:1}
|
|
2399
|
+
/* 依赖未满足的卡片整块变灰、开关不可点(第二个 Ctrl+W 开关用)。 */
|
|
2400
|
+
.dsv-card[data-muted="1"]{opacity:.45}
|
|
2380
2401
|
.dsv-switch:disabled{cursor:not-allowed;opacity:.5}
|
|
2381
2402
|
.dsv-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
2382
2403
|
.dsv-primary{height:28px;padding:0 12px;border-radius:7px;border:1px solid var(--dsh-accent-color,#4a8cf7);background:var(--dsh-accent-color,#4a8cf7);color:#fff;font-size:12px;font-family:inherit;cursor:pointer}
|
|
@@ -3741,6 +3762,60 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
3741
3762
|
*
|
|
3742
3763
|
* 设置页 / 插件停用时页面上没有 .dsv-pane,直接放行给宿主。
|
|
3743
3764
|
*/
|
|
3765
|
+
/**
|
|
3766
|
+
* 让宿主把 Ctrl+W(命令 `page.close`)的绑定交出来。
|
|
3767
|
+
*
|
|
3768
|
+
* 为什么必须这么做:Windows/macOS Desktop 的快捷键服务在**局部处理器之前**由可信
|
|
3769
|
+
* preload 拦截已接受的完整组合 —— 插件在渲染层 addEventListener 根本收不到 Ctrl+W
|
|
3770
|
+
* (合成事件能收到是假象,真实按键进不到 DOM)。宿主把「关闭页面」注册成 `page.close`
|
|
3771
|
+
* (code:KeyW + modifiers:[primary]),只有把它的绑定清掉,按键才会落到 DOM 被我们接管。
|
|
3772
|
+
*
|
|
3773
|
+
* 那份偏好是**每台设备本地一份**(Electron userData 的 keybindings.json),
|
|
3774
|
+
* 所以不能靠手工放文件,也不能靠换机器时同步 —— 插件自己写。
|
|
3775
|
+
* 走宿主的 `ctx.shortcuts.edit()`,由宿主负责序列化与校验,格式变了也是宿主自己的事。
|
|
3776
|
+
* 官方语义:`binding: null` = 清除该命令的绑定;`reset` = 恢复默认(把 Ctrl+W 还回去)。
|
|
3777
|
+
*
|
|
3778
|
+
* 只在「插件已启用 且 Ctrl+W 关标签开关打开」时清空;关掉开关或停用插件就还回去。
|
|
3779
|
+
* 宿主没有这个服务 / 命令改名 / 版本不兼容时,全部静默降级(回到「Ctrl+W 关窗口」),
|
|
3780
|
+
* 不会让插件崩掉,也不会吞掉用户其它快捷键。
|
|
3781
|
+
*/
|
|
3782
|
+
function syncHostCtrlWBinding() {
|
|
3783
|
+
const shortcuts = service("shortcuts");
|
|
3784
|
+
if (shortcuts === void 0 || typeof shortcuts.edit !== "function") return;
|
|
3785
|
+
if (typeof shortcuts.config?.getSnapshot !== "function") return;
|
|
3786
|
+
let snapshot = null;
|
|
3787
|
+
try {
|
|
3788
|
+
snapshot = shortcuts.config.getSnapshot();
|
|
3789
|
+
} catch {
|
|
3790
|
+
return;
|
|
3791
|
+
}
|
|
3792
|
+
if (snapshot === null || snapshot === void 0 || snapshot.status !== "ready") return;
|
|
3793
|
+
const profile = `${shortcuts.runtime ?? "desktop"}:${shortcuts.platform ?? "windows"}`;
|
|
3794
|
+
const overrides = snapshot.document?.profiles?.[profile] ?? {};
|
|
3795
|
+
const has = Object.prototype.hasOwnProperty.call(overrides, "page.close");
|
|
3796
|
+
const isCleared = has && overrides["page.close"] === null;
|
|
3797
|
+
const wantCleared = prefs.state.enabled === true && prefs.state.ctrlWCloseTab !== false;
|
|
3798
|
+
if (isCleared === wantCleared) return;
|
|
3799
|
+
const action = wantCleared
|
|
3800
|
+
? { type: "set", id: "page.close", binding: null }
|
|
3801
|
+
: { type: "reset", id: "page.close" };
|
|
3802
|
+
try {
|
|
3803
|
+
const result = shortcuts.edit(action, snapshot.revision);
|
|
3804
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
3805
|
+
result.then(
|
|
3806
|
+
(outcome) => {
|
|
3807
|
+
if (outcome !== null && outcome !== void 0 && outcome.status !== "saved") {
|
|
3808
|
+
console.warn("[split-view] page.close 绑定同步未完成:", outcome.status);
|
|
3809
|
+
}
|
|
3810
|
+
},
|
|
3811
|
+
(error) => console.warn("[split-view] page.close 绑定同步失败:", error)
|
|
3812
|
+
);
|
|
3813
|
+
}
|
|
3814
|
+
} catch (error) {
|
|
3815
|
+
console.warn("[split-view] page.close 绑定同步异常:", error);
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
|
|
3744
3819
|
function installCloseTabShortcut() {
|
|
3745
3820
|
const totalTabs = () => {
|
|
3746
3821
|
const state = LIVE_STATE;
|
|
@@ -4279,6 +4354,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
4279
4354
|
const sessionId = active?.sessionId ?? null;
|
|
4280
4355
|
const row = sessionId === null ? void 0 : rowMap.get(sessionId);
|
|
4281
4356
|
const hero = row === void 0 || row.blank === true;
|
|
4357
|
+
/* 常驻槽位里「哪一个可见」:优先 activeTabId,找不到就退回第一个标签;
|
|
4358
|
+
空栏(无标签)时用哨兵 "__blank" 对应下面渲染的空白槽,避免整栏被隐藏。 */
|
|
4359
|
+
const slotActiveId = active?.id ?? "__blank";
|
|
4282
4360
|
|
|
4283
4361
|
const wantInline = viewBar.enabled === true && viewBar.placement === "top" && sessionId !== null;
|
|
4284
4362
|
const [vbInline, setVbInline] = react.useState(true);
|
|
@@ -4474,15 +4552,24 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
4474
4552
|
h(
|
|
4475
4553
|
PaneIdCtx.Provider,
|
|
4476
4554
|
{ value: pane.id },
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4555
|
+
(pane.tabs.length > 0 ? pane.tabs : [{ id: "__blank", sessionId: null }]).map((tab) => {
|
|
4556
|
+
const tabSessionId = tab.sessionId ?? null;
|
|
4557
|
+
const tabRow = tabSessionId === null ? void 0 : rowMap.get(tabSessionId);
|
|
4558
|
+
const tabHero = tabRow === void 0 || tabRow.blank === true;
|
|
4559
|
+
const tabActive = tab.id === slotActiveId;
|
|
4560
|
+
return h(
|
|
4561
|
+
"div",
|
|
4562
|
+
{ key: tab.id, className: "dsv-tab-slot", "data-active": tabActive ? "1" : "0" },
|
|
4563
|
+
h(TabContentMemo, {
|
|
4564
|
+
sessionId: tabSessionId,
|
|
4565
|
+
hero: tabHero,
|
|
4566
|
+
sessions,
|
|
4567
|
+
renderFactorySlot,
|
|
4568
|
+
SessionProvider,
|
|
4569
|
+
renderSlot,
|
|
4570
|
+
viewBarOn: viewBar.enabled === true
|
|
4571
|
+
})
|
|
4572
|
+
);
|
|
4486
4573
|
})
|
|
4487
4574
|
)
|
|
4488
4575
|
),
|
|
@@ -4667,7 +4754,11 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
4667
4754
|
const hideStrayRows = (host) => {
|
|
4668
4755
|
const keep = moved !== null ? moved.node : null;
|
|
4669
4756
|
for (const pane of Array.from(document.querySelectorAll(".dsv-pane"))) {
|
|
4670
|
-
|
|
4757
|
+
/* 只认这一栏**当前激活标签**里的统计行:同栏其它标签现在也常驻挂载
|
|
4758
|
+
(display:none),它们各自带一份统计行,扫全栏会误把它们当成
|
|
4759
|
+
「宿主重建的新行」,于是底栏数据每轮来回跳。 */
|
|
4760
|
+
const scope = pane.querySelector('.dsv-tab-slot[data-active="1"]') ?? pane;
|
|
4761
|
+
for (const dock of Array.from(scope.querySelectorAll(".cm-stat-dock"))) {
|
|
4671
4762
|
const row = dock.parentElement?.parentElement ?? null;
|
|
4672
4763
|
if (row === null || row === keep) continue;
|
|
4673
4764
|
if (host.contains(row)) continue;
|
|
@@ -4686,8 +4777,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
4686
4777
|
藏起来的行)永远算作「新行」,于是每 500ms 都判定「宿主重建了」→
|
|
4687
4778
|
把我们手里那行又拆回去、再搬进来 → 底栏两份数字来回闪。
|
|
4688
4779
|
焦点栏里没有新行 = 没重建,保持现状。 */
|
|
4689
|
-
const
|
|
4690
|
-
if (
|
|
4780
|
+
const focusedPaneEl = Array.from(document.querySelectorAll(".dsv-pane")).find((p) => p.getAttribute("data-focus") === "1") ?? null;
|
|
4781
|
+
if (focusedPaneEl === null) return null;
|
|
4782
|
+
const focused = focusedPaneEl.querySelector('.dsv-tab-slot[data-active="1"]') ?? focusedPaneEl;
|
|
4691
4783
|
for (const dock of Array.from(focused.querySelectorAll(".cm-stat-dock"))) {
|
|
4692
4784
|
const row = dock.parentElement?.parentElement ?? null;
|
|
4693
4785
|
if (row === null || host.contains(row)) continue;
|
|
@@ -4731,10 +4823,12 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
4731
4823
|
let target = null;
|
|
4732
4824
|
for (const pane of Array.from(document.querySelectorAll(".dsv-pane"))) {
|
|
4733
4825
|
const focusedPane = pane.getAttribute("data-focus") === "1";
|
|
4826
|
+
/* 同上:只看当前激活标签,非活动标签里的统计行不参与「焦点行」判定。 */
|
|
4827
|
+
const scope = pane.querySelector('.dsv-tab-slot[data-active="1"]') ?? pane;
|
|
4734
4828
|
// 同一栏里也可能出现多行(宿主重建后新旧并存):只留第一行做焦点行,
|
|
4735
4829
|
// 其余全部隐藏,绝不把第二行搬进底栏。
|
|
4736
4830
|
const rows = [];
|
|
4737
|
-
for (const dock of Array.from(
|
|
4831
|
+
for (const dock of Array.from(scope.querySelectorAll(".cm-stat-dock"))) {
|
|
4738
4832
|
const row = dock.parentElement?.parentElement ?? null;
|
|
4739
4833
|
if (row !== null && rows.indexOf(row) < 0) rows.push(row);
|
|
4740
4834
|
}
|
|
@@ -9344,6 +9438,34 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
9344
9438
|
/* 栏内标签切换:Ctrl+Tab / Ctrl+Shift+Tab。设置页没有 .dsv-pane,自然不会触发。 */
|
|
9345
9439
|
ctx.effect(() => installTabCycling(), "dsh-split-view: tab cycling shortcut");
|
|
9346
9440
|
ctx.effect(() => installCloseTabShortcut(), "dsh-split-view: ctrl+w closes the tab");
|
|
9441
|
+
/* 把宿主的 page.close 绑定交出来,否则 Ctrl+W 在原生层就被吃掉、插件永远收不到。
|
|
9442
|
+
跟随启用状态与「Ctrl+W 关闭标签」开关变化;值没变时不写盘。 */
|
|
9443
|
+
ctx.effect(() => {
|
|
9444
|
+
syncHostCtrlWBinding();
|
|
9445
|
+
/* 宿主的 shortcuts 配置是异步加载的:插件 apply 时它往往还是 loading,
|
|
9446
|
+
只在 prefs 变化时重试会永远错过 → 这里也订阅它,等它 ready 再写一次。 */
|
|
9447
|
+
const stops = [prefs.subscribe(syncHostCtrlWBinding)];
|
|
9448
|
+
try {
|
|
9449
|
+
const shortcuts = service("shortcuts");
|
|
9450
|
+
if (shortcuts !== void 0 && typeof shortcuts.config?.subscribe === "function") {
|
|
9451
|
+
stops.push(shortcuts.config.subscribe(() => syncHostCtrlWBinding()));
|
|
9452
|
+
}
|
|
9453
|
+
} catch {
|
|
9454
|
+
/* 服务不可用就算了 */
|
|
9455
|
+
}
|
|
9456
|
+
/* 兜底:异步服务晚到时再补一次(幂等,值没变不写盘)。 */
|
|
9457
|
+
const timers = [setTimeout(syncHostCtrlWBinding, 1500), setTimeout(syncHostCtrlWBinding, 4000)];
|
|
9458
|
+
return () => {
|
|
9459
|
+
for (const stop of stops) {
|
|
9460
|
+
try {
|
|
9461
|
+
if (typeof stop === "function") stop();
|
|
9462
|
+
} catch {
|
|
9463
|
+
/* 忽略 */
|
|
9464
|
+
}
|
|
9465
|
+
}
|
|
9466
|
+
for (const timer of timers) clearTimeout(timer);
|
|
9467
|
+
};
|
|
9468
|
+
}, "dsh-split-view: release host ctrl+w binding");
|
|
9347
9469
|
|
|
9348
9470
|
/* 把「锁定标签」作为一项贡献进宿主的**会话右键菜单**。
|
|
9349
9471
|
标签上右键 → 打开的就是宿主这份菜单(open 见 TabItem),所以标签右键与侧栏会话行右键
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-multipane",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
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": {
|