dsh-multipane 1.0.50 → 1.0.51
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 +6 -0
- package/README.md +6 -0
- package/lib/client.js +100 -12
- package/package.json +2 -1
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.51 (2026-11-11)
|
|
165
|
+
|
|
166
|
+
- **The rail's hide threshold is now a setting.** A new card in Settings → UI elements, "Hide the turn rail in narrow panes", adds a 0-600px slider (default 240px, `0` = never hide). The 240px cutoff used to be hard-coded, so a narrow pane always lost the rail and there was no way to change it.
|
|
167
|
+
- Changes take effect immediately without a restart, and each pane is judged on its own width (two- and three-pane layouts do not affect each other).
|
|
168
|
+
- Under the hood the fixed `@container (width<=240px)` rule is replaced by one generated at runtime: container queries accept literals, not CSS variables, so the threshold has to be spliced into the rule text. Only `visibility` is hidden - `display` stays `block` - so the 1.0.46 ratchet (narrow it and it never comes back) cannot return.
|
|
169
|
+
|
|
164
170
|
### 1.0.50 (2026-11-11)
|
|
165
171
|
|
|
166
172
|
- **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.
|
package/README.md
CHANGED
|
@@ -160,6 +160,12 @@ node scripts/check-names.cjs # 包名 / 版本 / 冷却豁免三处是否一
|
|
|
160
160
|
|
|
161
161
|
## 更新记录
|
|
162
162
|
|
|
163
|
+
### 1.0.51(2026-11-11)
|
|
164
|
+
|
|
165
|
+
- **轮次导航条的隐藏阈值变成设置项**:设置页「界面元素」新增「窄栏隐藏轮次导航条」,一根 0–600px 的滑杆,默认 240px,`0` = 永不隐藏。以前 240 是写死的,栏一窄就消失、改不了
|
|
166
|
+
- 阈值即时生效、不用重启;每栏按自己的宽度单独判断(2 栏、3 栏互不影响)
|
|
167
|
+
- 实现上把 `@container (width<=240px)` 换成运行时生成的一段规则:容器查询只认固定数字、不认 CSS 变量,所以阈值只能拼进规则文本。仍然只隐藏 `visibility`,`display` 恒为 block —— 不再碰 1.0.46 那个「隐藏后拖回来不出现」的棘轮
|
|
168
|
+
|
|
163
169
|
### 1.0.50(2026-11-11)
|
|
164
170
|
|
|
165
171
|
- **修「窗格里的轮次导航条不出现」的根因**:导航条是死锁的。宿主在容器宽度 ≤900px 时把它 `display:none`;一旦隐藏,它内部的虚拟滚动量不到高度,就一条短横线都不渲染;而插件之前用「里面有没有短横线」当显示开关,于是永远不成立、永远放不出来 —— 分到 2/3 栏(每栏五百多像素)必然全空白,拖到 900px 以上突然出现,就是这个原因。现在只看结构定位那颗导航,与里面有没有短横线无关
|
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
|
-
|
|
20
|
+
const PLUGIN_VERSION = "1.0.51";
|
|
21
21
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
22
22
|
|
|
23
23
|
|
|
@@ -272,6 +272,11 @@ window.__ModuleLoader__.load({
|
|
|
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).",
|
|
275
|
+
"窄栏隐藏轮次导航条": "Hide the turn rail in narrow panes",
|
|
276
|
+
"栏宽不超过 {0}px 时隐藏这条导航;每栏按自己的宽度判断。": "Hidden when a pane is {0}px wide or narrower; each pane is judged on its own width.",
|
|
277
|
+
"已关闭:无论栏多窄都显示这条导航。": "Off: the rail stays visible no matter how narrow a pane gets.",
|
|
278
|
+
"隐藏阈值": "Hide below",
|
|
279
|
+
"0 = 永不隐藏;默认 240px": "0 = never hide; default 240px",
|
|
275
280
|
"在侧边栏显示入口": "Show entry in sidebar",
|
|
276
281
|
"已关闭:侧边栏不显示本插件入口。": "Off: the sidebar hides this plugin's entry.",
|
|
277
282
|
"已开启:侧边栏显示本插件入口(默认)。": "On: the sidebar shows this plugin's entry (default).",
|
|
@@ -427,6 +432,8 @@ window.__ModuleLoader__.load({
|
|
|
427
432
|
}
|
|
428
433
|
const STORAGE_KEY = "dsh-split-view:workspace:v1";
|
|
429
434
|
const STYLE_ID = "dsh-split-view-style";
|
|
435
|
+
/* 轮次导航条的阈值规则单独一张表:阈值是设置项,改一次只重写这一小段。 */
|
|
436
|
+
const RAIL_STYLE_ID = "dsh-split-view-rail-threshold";
|
|
430
437
|
const CONTENT_FACTORY = "conversation.content";
|
|
431
438
|
const PANE_SLOT = "split-view.pane";
|
|
432
439
|
const RETAIN_SOURCE = "splitView";
|
|
@@ -950,6 +957,12 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
950
957
|
const LINE_COLOR_IDS = LINE_COLORS.map((item) => item.id);
|
|
951
958
|
const DEFAULT_LINE_COLOR = "graphite";
|
|
952
959
|
|
|
960
|
+
/* 轮次导航条(会话右侧那列短横线)在栏窄到放不下时隐藏。
|
|
961
|
+
1.0.51 起阈值由设置项 railHideBelow 决定,默认 240px;0 = 永不隐藏。 */
|
|
962
|
+
const DEFAULT_RAIL_HIDE_BELOW = 240;
|
|
963
|
+
const RAIL_HIDE_MIN = 0;
|
|
964
|
+
const RAIL_HIDE_MAX = 600;
|
|
965
|
+
|
|
953
966
|
/* 线宽档位。**只作用于分隔条、拖动预览虚线框、虚位标签边框**;
|
|
954
967
|
标签下方的焦点线固定 2px,不跟这个档位走(用户明确要求)。 */
|
|
955
968
|
const LINE_WIDTHS = [
|
|
@@ -1094,7 +1107,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1094
1107
|
viewBarPlacement: state.viewBarPlacement,
|
|
1095
1108
|
viewBarOrder: cleanIdList(state.viewBarOrder),
|
|
1096
1109
|
viewBarHidden: cleanIdList(state.viewBarHidden),
|
|
1097
|
-
hostBar: state.hostBar !== false
|
|
1110
|
+
hostBar: state.hostBar !== false,
|
|
1111
|
+
railHideBelow: clampRailHide(state.railHideBelow)
|
|
1098
1112
|
}
|
|
1099
1113
|
};
|
|
1100
1114
|
}
|
|
@@ -1162,7 +1176,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1162
1176
|
const keys = Object.keys(src).filter((k) => ignore.indexOf(k) < 0);
|
|
1163
1177
|
if (keys.length === 0) throw new Error(t("文件里没有可识别的设置项"));
|
|
1164
1178
|
/* 只接受已知字段,其余忽略:别让陌生键混进 state。 */
|
|
1165
|
-
const known = ["enabled", "showInSidebar", "titlebarDrag", "lineColor", "lineWidth", "lineOpacity", "appearance", "dblclickClose", "ctrlWCloseTab", "ctrlWCloseWindowOnLast", "viewBarPlacement", "viewBarOrder", "viewBarHidden", "hostBar"];
|
|
1179
|
+
const known = ["enabled", "showInSidebar", "titlebarDrag", "lineColor", "lineWidth", "lineOpacity", "appearance", "dblclickClose", "ctrlWCloseTab", "ctrlWCloseWindowOnLast", "viewBarPlacement", "viewBarOrder", "viewBarHidden", "hostBar", "railHideBelow"];
|
|
1166
1180
|
const patch = {};
|
|
1167
1181
|
let applied = 0;
|
|
1168
1182
|
for (const k of keys) {
|
|
@@ -1301,10 +1315,19 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1301
1315
|
viewBarPlacement: DEFAULT_VIEWBAR_PLACEMENT,
|
|
1302
1316
|
viewBarOrder: [],
|
|
1303
1317
|
viewBarHidden: [],
|
|
1304
|
-
hostBar: true
|
|
1318
|
+
hostBar: true,
|
|
1319
|
+
/* 栏宽小于这个值就隐藏轮次导航条;0 = 永不隐藏。 */
|
|
1320
|
+
railHideBelow: DEFAULT_RAIL_HIDE_BELOW
|
|
1305
1321
|
};
|
|
1306
1322
|
}
|
|
1307
1323
|
|
|
1324
|
+
/** 阈值统一成 0–600、10px 一档的整数;坏值回默认,别让存坏的 JSON 把导航条弄没。 */
|
|
1325
|
+
function clampRailHide(value) {
|
|
1326
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return DEFAULT_RAIL_HIDE_BELOW;
|
|
1327
|
+
const clamped = Math.min(RAIL_HIDE_MAX, Math.max(RAIL_HIDE_MIN, value));
|
|
1328
|
+
return Math.round(clamped / 10) * 10;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1308
1331
|
/** 只留下字符串 id,去重保序 —— 存坏了的 JSON 不该把设置页搞乱。 */
|
|
1309
1332
|
function cleanIdList(value) {
|
|
1310
1333
|
if (!Array.isArray(value)) return [];
|
|
@@ -1347,7 +1370,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1347
1370
|
viewBarPlacement: VIEWBAR_PLACEMENTS.indexOf(parsed?.viewBarPlacement) >= 0 ? parsed.viewBarPlacement : DEFAULT_VIEWBAR_PLACEMENT,
|
|
1348
1371
|
viewBarOrder: cleanIdList(parsed?.viewBarOrder),
|
|
1349
1372
|
viewBarHidden: cleanIdList(parsed?.viewBarHidden),
|
|
1350
|
-
hostBar: parsed?.hostBar !== false
|
|
1373
|
+
hostBar: parsed?.hostBar !== false,
|
|
1374
|
+
railHideBelow: clampRailHide(parsed?.railHideBelow)
|
|
1351
1375
|
};
|
|
1352
1376
|
} catch {
|
|
1353
1377
|
return DEFAULTS();
|
|
@@ -1373,7 +1397,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1373
1397
|
viewBarPlacement: VIEWBAR_PLACEMENTS.indexOf(prefs.state.viewBarPlacement) >= 0 ? prefs.state.viewBarPlacement : DEFAULT_VIEWBAR_PLACEMENT,
|
|
1374
1398
|
viewBarOrder: cleanIdList(prefs.state.viewBarOrder),
|
|
1375
1399
|
viewBarHidden: cleanIdList(prefs.state.viewBarHidden),
|
|
1376
|
-
hostBar: prefs.state.hostBar !== false
|
|
1400
|
+
hostBar: prefs.state.hostBar !== false,
|
|
1401
|
+
railHideBelow: clampRailHide(prefs.state.railHideBelow)
|
|
1377
1402
|
})
|
|
1378
1403
|
);
|
|
1379
1404
|
} catch {
|
|
@@ -1586,6 +1611,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1586
1611
|
try {
|
|
1587
1612
|
const style = document.getElementById(STYLE_ID);
|
|
1588
1613
|
if (style !== null) style.remove();
|
|
1614
|
+
const railStyle = document.getElementById(RAIL_STYLE_ID);
|
|
1615
|
+
if (railStyle !== null) railStyle.remove();
|
|
1589
1616
|
} catch {
|
|
1590
1617
|
/* 非浏览器环境 */
|
|
1591
1618
|
}
|
|
@@ -1618,6 +1645,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
1618
1645
|
/* 颜色 / 浓度 / 粗细写到 <html>:侧栏会话行在插件根之外,只有根上的变量它读得到。 */
|
|
1619
1646
|
applyLineVars();
|
|
1620
1647
|
prefs.subscribe(applyLineVars);
|
|
1648
|
+
/* 阈值改了要立刻重写那段容器查询,不用重启。 */
|
|
1649
|
+
prefs.subscribe(applyRailThreshold);
|
|
1621
1650
|
/* 把解析后的完整 prefs 立即写回一次。
|
|
1622
1651
|
老用户存的 JSON 里根本没有 showInSidebar 这个键 —— 不写回的话,
|
|
1623
1652
|
每次 read() 都用默认 true 覆盖,导致「关闭侧栏入口」改了等于没改。 */
|
|
@@ -2315,7 +2344,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
2315
2344
|
成了死锁。这也正是「分到 3 栏(每栏 ~567px)怎么补都不出现、拖宽到 900px 以上
|
|
2316
2345
|
突然出现」的原因。现在只按结构定位这颗 nav,与里面有没有按钮无关。 */
|
|
2317
2346
|
.dsv-pane .dsv-body [data-conversation-scroll] nav{display:block!important}
|
|
2318
|
-
|
|
2347
|
+
/* 窄到放不下时只隐藏可见性。阈值是设置项(默认 240px,0 = 永不隐藏),而容器查询
|
|
2348
|
+
只认固定数字、不认 CSS 变量,所以这条规则不写在这里:由 railThresholdCss() 生成到
|
|
2349
|
+
独立的 <style> 里,改设置即时重写。 */
|
|
2319
2350
|
/* 窗口最大化时外框有约 7px 溢出到屏幕外,标题栏最顶上那一截落在屏幕外;
|
|
2320
2351
|
标签原来只有 ~26px 高、上下留 9px,光标贴屏幕最顶时落在标签上方的空白里,点不到标签。
|
|
2321
2352
|
把标签命中区拉到标题栏整高(内容仍垂直居中)。只改标签自身横向范围,
|
|
@@ -2414,6 +2445,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
2414
2445
|
.dsv-settings h2{margin:0;font-size:17px;font-weight:600}
|
|
2415
2446
|
.dsv-settings p{margin:0;font-size:13px;line-height:1.65;opacity:.72}
|
|
2416
2447
|
.dsv-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 16px;border:1px solid var(--dsh-border-color,rgba(128,128,128,.26));border-radius:10px;background:rgba(255,255,255,.012);transition:border-color .15s ease,background-color .15s ease}
|
|
2448
|
+
/* 带滑杆的卡片:标题在上、控件占满整行(横向两列会把滑杆挤成一条缝)。 */
|
|
2449
|
+
.dsv-card-col{flex-direction:column;align-items:stretch;gap:10px}
|
|
2417
2450
|
.dsv-card:hover{border-color:var(--dsh-border-color,rgba(128,128,128,.42));background:rgba(255,255,255,.028)}
|
|
2418
2451
|
.dsv-card-text{display:flex;flex-direction:column;gap:3px;min-width:0}
|
|
2419
2452
|
.dsv-card-title{font-size:13px;font-weight:600;letter-spacing:.01em}
|
|
@@ -2545,16 +2578,42 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
2545
2578
|
可能比 apply() 早 —— 于是先闪一帧「没有样式的白板页」,再跳到正常样式。 */
|
|
2546
2579
|
installStyles();
|
|
2547
2580
|
|
|
2581
|
+
function railThresholdCss(below) {
|
|
2582
|
+
/* 容器查询只认固定数字、不认 CSS 变量,所以阈值只能拼进规则文本。
|
|
2583
|
+
0 = 永不隐藏:返回空串,表里一个字都不留。 */
|
|
2584
|
+
const px = clampRailHide(below);
|
|
2585
|
+
if (!(px > 0)) return "";
|
|
2586
|
+
return `@container (width<=${px}px){.dsv-pane .dsv-body [data-conversation-scroll] nav{visibility:hidden;pointer-events:none}}`;
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
function applyRailThreshold() {
|
|
2590
|
+
try {
|
|
2591
|
+
const el = document.getElementById(RAIL_STYLE_ID);
|
|
2592
|
+
if (el === null) return;
|
|
2593
|
+
const next = railThresholdCss(prefs.state.railHideBelow);
|
|
2594
|
+
if (el.textContent !== next) el.textContent = next;
|
|
2595
|
+
} catch {
|
|
2596
|
+
/* ignore */
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2548
2600
|
/**
|
|
2549
2601
|
* Install the stylesheet once per document.
|
|
2550
2602
|
*/
|
|
2551
2603
|
function installStyles() {
|
|
2552
2604
|
try {
|
|
2553
|
-
if (document.getElementById(STYLE_ID)
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2605
|
+
if (document.getElementById(STYLE_ID) === null) {
|
|
2606
|
+
const style = document.createElement("style");
|
|
2607
|
+
style.id = STYLE_ID;
|
|
2608
|
+
style.textContent = CSS;
|
|
2609
|
+
document.head.appendChild(style);
|
|
2610
|
+
}
|
|
2611
|
+
if (document.getElementById(RAIL_STYLE_ID) === null) {
|
|
2612
|
+
const railStyle = document.createElement("style");
|
|
2613
|
+
railStyle.id = RAIL_STYLE_ID;
|
|
2614
|
+
document.head.appendChild(railStyle);
|
|
2615
|
+
}
|
|
2616
|
+
applyRailThreshold();
|
|
2558
2617
|
} catch (error) {
|
|
2559
2618
|
console.warn("[split-view] styles unavailable:", error);
|
|
2560
2619
|
}
|
|
@@ -7957,6 +8016,35 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
7957
8016
|
onClick: () => prefs.update({ hostBar: p.hostBar === false })
|
|
7958
8017
|
})
|
|
7959
8018
|
),
|
|
8019
|
+
/* 轮次导航条(会话右侧那列短横线):栏窄到放不下时隐藏。
|
|
8020
|
+
阈值用户可调(1.0.51),0 = 永不隐藏。 */
|
|
8021
|
+
h(
|
|
8022
|
+
"div",
|
|
8023
|
+
{ className: "dsv-card dsv-card-col", key: "rail-threshold" },
|
|
8024
|
+
h(
|
|
8025
|
+
"div",
|
|
8026
|
+
{ className: "dsv-card-text" },
|
|
8027
|
+
h("div", { className: "dsv-card-title" }, t("窄栏隐藏轮次导航条")),
|
|
8028
|
+
h(
|
|
8029
|
+
"div",
|
|
8030
|
+
{ className: "dsv-card-desc" },
|
|
8031
|
+
clampRailHide(p.railHideBelow) > 0
|
|
8032
|
+
? t("栏宽不超过 {0}px 时隐藏这条导航;每栏按自己的宽度判断。", [
|
|
8033
|
+
String(clampRailHide(p.railHideBelow))
|
|
8034
|
+
])
|
|
8035
|
+
: t("已关闭:无论栏多窄都显示这条导航。")
|
|
8036
|
+
)
|
|
8037
|
+
),
|
|
8038
|
+
h(AppearanceWidth, {
|
|
8039
|
+
label: t("隐藏阈值"),
|
|
8040
|
+
hint: t("0 = 永不隐藏;默认 240px"),
|
|
8041
|
+
min: RAIL_HIDE_MIN,
|
|
8042
|
+
max: RAIL_HIDE_MAX,
|
|
8043
|
+
step: 10,
|
|
8044
|
+
value: clampRailHide(p.railHideBelow),
|
|
8045
|
+
onChange: (value) => prefs.update({ railHideBelow: clampRailHide(value) })
|
|
8046
|
+
})
|
|
8047
|
+
),
|
|
7960
8048
|
/* 视图切换条:开关 + 位置 + 逐项列表,三块连在一起
|
|
7961
8049
|
(用户口径 2026-11-08:开关和它的具体设置必须挨着,原来中间隔着别的卡)。 */
|
|
7962
8050
|
h(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-multipane",
|
|
3
|
-
"version":
|
|
3
|
+
"version": "1.0.51",
|
|
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": {
|
|
@@ -84,3 +84,4 @@
|
|
|
84
84
|
"access": "public"
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
|