dsh-multipane 1.0.35 → 1.0.36

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,13 @@ node scripts/check-names.cjs # package name / version / release-age allowanc
161
161
 
162
162
  ## Changelog
163
163
 
164
+ ### 1.0.36 (2026-11-11)
165
+
166
+ - **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
167
+ - **Bar thickness is now a continuous slider**: "Focused row bar thickness" and "Open-row bar thickness" were 1–8px chip buttons; they are sliders now, 0.5% steps up to 30% of the session-row width. Existing px values are converted to percentages automatically
168
+ - **Dragging a tab no longer lights up every divider**: only the divider the pointer is actually over highlights
169
+ - **New "Interaction" section in settings** explaining that motion follows the system animation setting, so the app stays still when Windows animations are off (by design)
170
+
164
171
  ### 1.0.35 (2026-11-10)
165
172
 
166
173
  - **Fixed the janky pulse in the session list**: the breathing effect no longer restyles and repaints the whole row every frame; it animates the opacity of a pseudo-element instead, which the compositor handles. Same look, a fraction of the cost
package/README.md CHANGED
@@ -160,6 +160,13 @@ node scripts/check-names.cjs # 包名 / 版本 / 冷却豁免三处是否一
160
160
 
161
161
  ## 更新记录
162
162
 
163
+ ### 1.0.36(2026-11-11)
164
+
165
+ - **Ctrl+W 关标签,两个开关可配**:设置页「界面元素」新增「Ctrl+W 关闭标签」(总开关)与「最后一个标签时关闭窗口」(依赖前者,前者关闭时自动变灰禁用)。只剩一个标签时再按 Ctrl+W 直接关窗口,不再像以前那样「按了没反应」
166
+ - **竖线粗细改成无级滑轨**:侧栏「焦点行竖线粗细」「打开行竖线粗细」原来是 1~8px 的 8 个胶囊按钮,改成滑轨,0.5% 一档、上限 30%(占会话行宽度);老配置里的 px 值自动折算成百分比
167
+ - **拖标签时不再点亮所有分隔线**:以前拖标签会让所有栏间分割线一起高亮,现在只有鼠标真正指着的那一条亮
168
+ - **设置页新增「交互」分区**:说明动效依赖系统动画设置,系统关闭动画时应用会自动静止(属设计行为)
169
+
163
170
  ### 1.0.35(2026-11-10)
164
171
 
165
172
  - **修掉会话列表呼吸卡顿**:呼吸不再逐帧重算样式、重绘整行,改成行内一层伪元素做透明度动画,交给合成器跑——视觉一样,开销降到零头
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.35";
20
+ const PLUGIN_VERSION = "1.0.36";
21
21
  const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
22
22
 
23
23
 
@@ -166,6 +166,7 @@ window.__ModuleLoader__.load({
166
166
  "你正在看的那个会话": "The session you are viewing",
167
167
  "焦点行底色浓度": "Focused row background opacity",
168
168
  "焦点行竖线粗细": "Focused row bar thickness",
169
+ "拖动滑轨,0.5% 一档,最大 30%(占会话行宽度)": "Drag the slider; 0.5% steps, up to 30% of the session-row width",
169
170
  "最粗 8px;调这里最直观": "Up to 8px; the most visible knob",
170
171
  "焦点行文字加粗": "Bold focused row text",
171
172
  "默认不加粗(本机中文字体只有常规/粗两档,加粗会明显变重)": "Off by default (the CJK font here only has regular and bold, so bold looks much heavier)",
@@ -261,7 +262,14 @@ window.__ModuleLoader__.load({
261
262
  "显示视图切换条": "Show view switcher bar",
262
263
  "已关闭:每栏不显示「对话 / 轨迹 / 上下文 …」那一行。": "Off: panes hide the \"Chat / Trace / Context …\" row.",
263
264
  "已开启:每栏显示「对话 / 轨迹 / 上下文 …」那一行。位置与显示哪些视图,见下面两项。": "On: panes show the \"Chat / Trace / Context …\" row. Position and which views appear are set in the next two items.",
264
- "双击关闭标签": "Double-click to close tabs",
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
+ "已开启:只剩一个标签时再按 Ctrl+W 直接关闭窗口。": "On: pressing Ctrl+W again on the last tab closes the window.",
265
273
  "已关闭:双击标签不关闭(中键、× 仍然可用)。": "Off: double-clicking a tab does not close it (middle-click and × still work).",
266
274
  "已开启:双击标签直接关闭(中键、× 也可用)。": "On: double-clicking a tab closes it (middle-click and × also work).",
267
275
  "在侧边栏显示入口": "Show entry in sidebar",
@@ -269,6 +277,9 @@ window.__ModuleLoader__.load({
269
277
  "已开启:侧边栏显示本插件入口(默认)。": "On: the sidebar shows this plugin's entry (default).",
270
278
  "外观": "Appearance",
271
279
  "颜色、粗细、呼吸": "Colors, thickness, pulse",
280
+ "交互": "Interaction",
281
+ "动效说明": "Motion",
282
+ "动效依赖系统动画设置,系统关闭动画时 DSH 会自动静止,属设计行为。": "Animations follow the Windows animation setting. With system animations off, DSH stays still by design.",
272
283
  "鼠标移到任一组上,上方预览会高亮对应元素;每组可单独换色,也可全部跟随全局色。": "Hover any group to highlight it in the preview above; each group can take its own color or follow the global one.",
273
284
  "怎么用": "How to use",
274
285
  "点左侧会话,替换当前标签;把会话拖进标签栏可新开标签。": "Click a session on the left to replace the current tab; drag a session onto the tab bar to open a new tab.",
@@ -1013,7 +1024,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1013
1024
  return {
1014
1025
  divider: { color: "", alpha: 0.85, width: 2 },
1015
1026
  tabline: { color: "", focus: 0.75, idle: 0.3, hover: 0.45, width: 2 },
1016
- siderow: { color: "", barFocus: 0.75, bgFocus: 0.15, barOpen: 0.52, bgOpen: 0.06, widthFocus: 4, widthOpen: 2, bold: false, hiddenBar: false },
1027
+ siderow: { color: "", barFocus: 0.75, bgFocus: 0.15, barOpen: 0.52, bgOpen: 0.06, widthFocus: 3, widthOpen: 1.5, widthUnit: "pct", bold: false, hiddenBar: false },
1017
1028
  drop: { color: "", alpha: 0.8, bg: 0.06, width: 2, previewBg: 0.12, ghostBg: 0.16 },
1018
1029
  misc: { color: "", lockedBg: 0.12, caret: 0.45 },
1019
1030
  /* 运行中呼吸:呼吸的是行底色(底板)。
@@ -1043,8 +1054,18 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1043
1054
  return clampNum(value, 0, 1, fallback);
1044
1055
  }
1045
1056
  function clampWidth(value, fallback) {
1046
- /* 1–8px:侧栏竖线最粗可以到 8(用户 2026-11-09 要求更宽,原来卡在 4)。 */
1047
- return Math.round(clampNum(value, 1, 8, fallback));
1057
+ /* 1–8px,0.5px 一档(2026-11-10 竖线粗细改成无级滑轨,允许小数)。 */
1058
+ return Math.round(clampNum(value, 1, 8, fallback) * 2) / 2;
1059
+ }
1060
+ /* 侧栏会话行竖线粗细:2026-11-10 起按「占行宽的百分比」存,最大 30%(用户要求)。 */
1061
+ function clampPct(value, fallback) {
1062
+ return Math.round(clampNum(value, 0.5, 30, fallback) * 2) / 2;
1063
+ }
1064
+ /* 老配置是 px(1–8),按 1% ≈ 2.6px 折算成百分比,升级只折算一次。 */
1065
+ function pctFromPx(px, fallback) {
1066
+ const n = Number(px);
1067
+ if (Number.isFinite(n) !== true) return fallback;
1068
+ return clampPct(n / 2.6, fallback);
1048
1069
  }
1049
1070
 
1050
1071
  /* ── 设置的导入 / 导出(2026-11-10 用户要求:备份 & 恢复)────────────
@@ -1068,6 +1089,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1068
1089
  lineOpacity: nearestOpacityId(appearance.divider.alpha),
1069
1090
  appearance,
1070
1091
  dblclickClose: state.dblclickClose !== false,
1092
+ ctrlWCloseTab: state.ctrlWCloseTab !== false,
1093
+ ctrlWCloseWindowOnLast: state.ctrlWCloseWindowOnLast !== false,
1071
1094
  viewBarPlacement: state.viewBarPlacement,
1072
1095
  viewBarOrder: cleanIdList(state.viewBarOrder),
1073
1096
  viewBarHidden: cleanIdList(state.viewBarHidden),
@@ -1139,7 +1162,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1139
1162
  const keys = Object.keys(src).filter((k) => ignore.indexOf(k) < 0);
1140
1163
  if (keys.length === 0) throw new Error(t("文件里没有可识别的设置项"));
1141
1164
  /* 只接受已知字段,其余忽略:别让陌生键混进 state。 */
1142
- const known = ["enabled", "showInSidebar", "titlebarDrag", "lineColor", "lineWidth", "lineOpacity", "appearance", "dblclickClose", "viewBarPlacement", "viewBarOrder", "viewBarHidden", "hostBar"];
1165
+ const known = ["enabled", "showInSidebar", "titlebarDrag", "lineColor", "lineWidth", "lineOpacity", "appearance", "dblclickClose", "ctrlWCloseTab", "ctrlWCloseWindowOnLast", "viewBarPlacement", "viewBarOrder", "viewBarHidden", "hostBar"];
1143
1166
  const patch = {};
1144
1167
  let applied = 0;
1145
1168
  for (const k of keys) {
@@ -1219,6 +1242,18 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1219
1242
  if (typeof group.bold === "boolean") target.bold = group.bold;
1220
1243
  if (typeof group.hiddenBar === "boolean") target.hiddenBar = group.hiddenBar;
1221
1244
  }
1245
+ /* 竖线粗细 2026-11-10 起按「占会话行宽度的百分比」存(上限 30%)。
1246
+ 老配置里这两个值是 px(1–8),这里折算一次并打上 pct 标记,之后不再重复折算。 */
1247
+ const srow = src.siderow !== void 0 && src.siderow !== null && typeof src.siderow === "object" ? src.siderow : null;
1248
+ if (srow !== null && srow.widthUnit === "pct") {
1249
+ base.siderow.widthFocus = clampPct(srow.widthFocus, base.siderow.widthFocus);
1250
+ base.siderow.widthOpen = clampPct(srow.widthOpen, base.siderow.widthOpen);
1251
+ base.siderow.widthUnit = "pct";
1252
+ } else if (srow !== null) {
1253
+ base.siderow.widthFocus = pctFromPx(srow.widthFocus, base.siderow.widthFocus);
1254
+ base.siderow.widthOpen = pctFromPx(srow.widthOpen, base.siderow.widthOpen);
1255
+ base.siderow.widthUnit = "pct";
1256
+ }
1222
1257
  return base;
1223
1258
  }
1224
1259
 
@@ -1259,6 +1294,10 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1259
1294
  lineOpacity: DEFAULT_LINE_OPACITY,
1260
1295
  appearance: DEFAULT_APPEARANCE(),
1261
1296
  dblclickClose: true,
1297
+ /* Ctrl+W 关标签(用户 2026-11-11 要求做成开关)。关掉后 Ctrl+W 完全交还宿主。 */
1298
+ ctrlWCloseTab: true,
1299
+ /* 只剩最后一个标签时,Ctrl+W 是否关整个窗口。仅上一个开关打开时有效。 */
1300
+ ctrlWCloseWindowOnLast: true,
1262
1301
  viewBarPlacement: DEFAULT_VIEWBAR_PLACEMENT,
1263
1302
  viewBarOrder: [],
1264
1303
  viewBarHidden: [],
@@ -1302,7 +1341,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1302
1341
  lineOpacity: LINE_OPACITY_IDS.indexOf(parsed?.lineOpacity) >= 0 ? parsed.lineOpacity : DEFAULT_LINE_OPACITY,
1303
1342
  /* 外观分组:老数据没有这一项 → 用 lineOpacity / lineWidth 还原分隔条,升级不跳变。 */
1304
1343
  appearance: normalizeAppearance(parsed?.appearance, parsed),
1305
- dblclickClose: parsed?.dblclickClose !== false,
1344
+ dblclickClose: parsed?.dblclickClose !== false,
1345
+ ctrlWCloseTab: parsed?.ctrlWCloseTab !== false,
1346
+ ctrlWCloseWindowOnLast: parsed?.ctrlWCloseWindowOnLast !== false,
1306
1347
  viewBarPlacement: VIEWBAR_PLACEMENTS.indexOf(parsed?.viewBarPlacement) >= 0 ? parsed.viewBarPlacement : DEFAULT_VIEWBAR_PLACEMENT,
1307
1348
  viewBarOrder: cleanIdList(parsed?.viewBarOrder),
1308
1349
  viewBarHidden: cleanIdList(parsed?.viewBarHidden),
@@ -1326,7 +1367,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1326
1367
  lineWidth: nearestWidthId(appearance.divider.width),
1327
1368
  lineOpacity: nearestOpacityId(appearance.divider.alpha),
1328
1369
  appearance,
1329
- dblclickClose: prefs.state.dblclickClose !== false,
1370
+ dblclickClose: prefs.state.dblclickClose !== false,
1371
+ ctrlWCloseTab: prefs.state.ctrlWCloseTab !== false,
1372
+ ctrlWCloseWindowOnLast: prefs.state.ctrlWCloseWindowOnLast !== false,
1330
1373
  viewBarPlacement: VIEWBAR_PLACEMENTS.indexOf(prefs.state.viewBarPlacement) >= 0 ? prefs.state.viewBarPlacement : DEFAULT_VIEWBAR_PLACEMENT,
1331
1374
  viewBarOrder: cleanIdList(prefs.state.viewBarOrder),
1332
1375
  viewBarHidden: cleanIdList(prefs.state.viewBarHidden),
@@ -1435,14 +1478,14 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
1435
1478
  set("--dsv-row-focus-bg", withAlpha(rowC, a.siderow.bgFocus));
1436
1479
  set("--dsv-row-open-a", withAlpha(rowC, a.siderow.barOpen));
1437
1480
  set("--dsv-row-open-bg", withAlpha(rowC, a.siderow.bgOpen));
1438
- set("--dsv-row-w-focus", `${a.siderow.widthFocus}px`);
1439
- set("--dsv-row-w-open", `${a.siderow.widthOpen}px`);
1481
+ set("--dsv-row-w-focus", `${a.siderow.widthFocus}%`);
1482
+ set("--dsv-row-w-open", `${a.siderow.widthOpen}%`);
1440
1483
  set("--dsv-row-fw", a.siderow.bold === true ? "600" : "400");
1441
1484
  /* 「打开但未显示」默认没有左竖线;这个开关打开才画(用渐变,能盖住宿主的透明左边框)。 */
1442
1485
  set(
1443
1486
  "--dsv-row-hidden-bar",
1444
1487
  a.siderow.hiddenBar === true
1445
- ? `linear-gradient(to right, ${withAlpha(rowC, a.siderow.barOpen)} 0, ${withAlpha(rowC, a.siderow.barOpen)} ${a.siderow.widthOpen}px, transparent ${a.siderow.widthOpen}px)`
1488
+ ? `linear-gradient(to right, ${withAlpha(rowC, a.siderow.barOpen)} 0, ${withAlpha(rowC, a.siderow.barOpen)} ${a.siderow.widthOpen}%, transparent ${a.siderow.widthOpen}%)`
1446
1489
  : "none"
1447
1490
  );
1448
1491
 
@@ -2331,7 +2374,10 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
2331
2374
  .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}
2332
2375
  .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}
2333
2376
  .dsv-switch[data-on="1"]{background:var(--dsh-accent-color,#4a8cf7);border-color:var(--dsh-accent-color,#4a8cf7)}
2334
- .dsv-switch[data-on="1"]::after{transform:translateX(18px);background:#fff;opacity:1}
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}
2380
+ .dsv-switch:disabled{cursor:not-allowed;opacity:.5}
2335
2381
  .dsv-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
2336
2382
  .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}
2337
2383
  .dsv-ghost{height:28px;padding:0 12px;border-radius:7px;border:1px solid var(--dsh-border-color,rgba(128,128,128,.35));background:transparent;color:inherit;font-size:12px;font-family:inherit;cursor:pointer}
@@ -3685,6 +3731,75 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
3685
3731
  return () => window.removeEventListener("keydown", onKey, true);
3686
3732
  }
3687
3733
 
3734
+ /**
3735
+ * Ctrl+W 关当前栏的当前标签(用户 2026-11-10 要求)。
3736
+ *
3737
+ * 宿主默认把 Ctrl+W 当成「关窗口」,用户要的是关标签。做法与 installTabCycling 一致:
3738
+ * 捕获阶段拦下来 preventDefault + stopPropagation,然后**点那颗真实的关闭按钮**
3739
+ * (不是自己调 reducer)—— 「关最后一个标签要换成新会话」那套逻辑只存在于按钮的 onClick 里,
3740
+ * 自己 apply 会把空白标签留下来。
3741
+ *
3742
+ * 设置页 / 插件停用时页面上没有 .dsv-pane,直接放行给宿主。
3743
+ */
3744
+ function installCloseTabShortcut() {
3745
+ const totalTabs = () => {
3746
+ const state = LIVE_STATE;
3747
+ if (state === null || state === void 0) return 0;
3748
+ let count = 0;
3749
+ for (const pane of state.panes ?? []) count += (pane.tabs ?? []).length;
3750
+ return count;
3751
+ };
3752
+ /* 关整个窗口。宿主把 Ctrl+W 交给插件之后,最后一个标签时必须由我们自己收尾:
3753
+ 优先走宿主的 desktop 键盘桥(它才带得上 revision);
3754
+ 桥不可用时退回 Electron 的 window.close()。 */
3755
+ /* 关整个窗口。
3756
+ 实测(2026-11-11):宿主的 shortcuts.closeWindow() 会 resolve 但窗口并不关
3757
+ (它只是把请求转给原生键盘桥,桥那边没有主动关窗的动作),
3758
+ 所以这里直接用 Electron 的 window.close() —— 实测进程归零、窗口真的关掉。 */
3759
+ const closeWindow = () => {
3760
+ try {
3761
+ window.close();
3762
+ } catch (error) {
3763
+ console.warn("[split-view] window.close 失败:", error);
3764
+ }
3765
+ };
3766
+ const onKey = (event) => {
3767
+ if (event.key !== "w" && event.key !== "W") return;
3768
+ if (event.ctrlKey !== true || event.shiftKey === true || event.altKey === true || event.metaKey === true) return;
3769
+ if (prefs.state.enabled !== true) return;
3770
+ /* 开关一(Ctrl+W 关标签)关着 → 交还宿主默认行为。
3771
+ 注意:宿主的 page.close 绑定已被我们清空(不清空的话原生层会先吃掉按键、
3772
+ 插件根本收不到),所以「默认行为」只能由这里代为执行 —— 直接关窗口。 */
3773
+ if (prefs.state.ctrlWCloseTab === false) {
3774
+ event.preventDefault();
3775
+ event.stopPropagation();
3776
+ closeWindow();
3777
+ return;
3778
+ }
3779
+ const active = document.activeElement;
3780
+ const focusedPane =
3781
+ active !== null && active !== void 0 && typeof active.closest === "function" ? active.closest(".dsv-pane") : null;
3782
+ const paneEl = focusedPane ?? document.querySelector('.dsv-pane[data-focus="1"]');
3783
+ if (paneEl === null || paneEl === void 0) return;
3784
+ event.preventDefault();
3785
+ event.stopPropagation();
3786
+ /* 只剩最后一个标签:关窗口(用户 2026-11-11 要求)。
3787
+ 不能再去点关闭按钮 —— 那条路径是「关掉最后一个标签就开个新会话」,
3788
+ 看起来像「按了没反应」。 */
3789
+ if (totalTabs() <= 1) {
3790
+ /* 开关二(最后一个标签关窗口)关着 → 什么都不做,标签留着。 */
3791
+ if (prefs.state.ctrlWCloseWindowOnLast === false) return;
3792
+ closeWindow();
3793
+ return;
3794
+ }
3795
+ const closeBtn = paneEl.querySelector('.dsv-tab[data-active="1"] .dsv-tab-close');
3796
+ if (closeBtn === null || closeBtn === void 0) return;
3797
+ closeBtn.click();
3798
+ };
3799
+ window.addEventListener("keydown", onKey, true);
3800
+ return () => window.removeEventListener("keydown", onKey, true);
3801
+ }
3802
+
3688
3803
  /**
3689
3804
  * 宿主 `conversation.input.attachments` 槽位的替代实现。
3690
3805
  *
@@ -6054,9 +6169,13 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
6054
6169
 
6055
6170
  /** 粗细:默认 1–4px 四个档;传 max 可以放宽(侧栏竖线用 8 档)。 */
6056
6171
  function AppearanceWidth(props) {
6057
- const max = typeof props.max === "number" ? props.max : 4;
6058
- const options = [];
6059
- for (let px = 1; px <= max; px += 1) options.push(px);
6172
+ /* 2026-11-10 用户要求:竖线粗细改成**无级**调节(原来是 1..8 的 8 个胶囊按钮)。
6173
+ 用原生 range 滑轨,0.5px 一档;持久化值与 CSS 都允许小数(clampWidth 已放宽到 0.5 步进)。 */
6174
+ const min = typeof props.min === "number" ? props.min : 1;
6175
+ const max = typeof props.max === "number" ? props.max : 8;
6176
+ const step = typeof props.step === "number" ? props.step : 0.5;
6177
+ const unit = typeof props.unit === "string" ? props.unit : "px";
6178
+ const value = Math.round(clampNum(Number(props.value), min, max, max) * 10) / 10;
6060
6179
  return h(
6061
6180
  "div",
6062
6181
  { className: "dsv-ctl" },
@@ -6064,28 +6183,18 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
6064
6183
  "div",
6065
6184
  { className: "dsv-ctl-head" },
6066
6185
  h("span", { className: "dsv-ctl-label" }, props.label),
6067
- h("span", { className: "dsv-ctl-value" }, `${props.value}px`)
6068
- ),
6069
- h(
6070
- "div",
6071
- { className: "dsv-width-row", role: "radiogroup", "aria-label": props.label },
6072
- options.map((px) =>
6073
- h(
6074
- "button",
6075
- {
6076
- key: px,
6077
- type: "button",
6078
- className: "dsv-width-chip",
6079
- role: "radio",
6080
- "aria-checked": props.value === px ? "true" : "false",
6081
- "data-on": props.value === px ? "1" : "0",
6082
- onClick: () => props.onChange(px)
6083
- },
6084
- h("span", { className: "dsv-width-dot", style: { height: `${px}px` }, "aria-hidden": "true" }),
6085
- `${px}px`
6086
- )
6087
- )
6186
+ h("span", { className: "dsv-ctl-value" }, `${value}${unit}`)
6088
6187
  ),
6188
+ h("input", {
6189
+ type: "range",
6190
+ className: "dsv-range",
6191
+ min: String(min),
6192
+ max: String(max),
6193
+ step: String(step),
6194
+ value: String(value),
6195
+ "aria-label": props.label,
6196
+ onChange: (event) => props.onChange(Number(event.target.value))
6197
+ }),
6089
6198
  props.hint !== void 0 ? h("div", { className: "dsv-ctl-hint" }, props.hint) : null
6090
6199
  );
6091
6200
  }
@@ -6633,8 +6742,10 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
6633
6742
  h(AppearanceWidth, {
6634
6743
  key: "wf",
6635
6744
  label: t("焦点行竖线粗细"),
6636
- hint: t("最粗 8px;调这里最直观"),
6637
- max: 8,
6745
+ hint: t("拖动滑轨,0.5% 一档,最大 30%(占会话行宽度)"),
6746
+ min: 0.5,
6747
+ max: 30,
6748
+ unit: "%",
6638
6749
  value: a.siderow.widthFocus,
6639
6750
  onChange: (value) => setGroup("siderow", { widthFocus: value })
6640
6751
  }),
@@ -6664,7 +6775,10 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
6664
6775
  h(AppearanceWidth, {
6665
6776
  key: "wo",
6666
6777
  label: t("打开行竖线粗细"),
6667
- max: 8,
6778
+ hint: t("拖动滑轨,0.5% 一档,最大 30%(占会话行宽度)"),
6779
+ min: 0.5,
6780
+ max: 30,
6781
+ unit: "%",
6668
6782
  value: a.siderow.widthOpen,
6669
6783
  onChange: (value) => setGroup("siderow", { widthOpen: value })
6670
6784
  }),
@@ -7467,6 +7581,66 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
7467
7581
  onClick: () => prefs.update({ dblclickClose: p.dblclickClose === false })
7468
7582
  })
7469
7583
  ),
7584
+ /* ── Ctrl+W 两个开关(用户 2026-11-11 要求)──
7585
+ 开关一:Ctrl+W 关标签(总开关)
7586
+ 开关二:只剩最后一个标签时,Ctrl+W 关整个窗口(依赖开关一) */
7587
+ h(
7588
+ "div",
7589
+ { className: "dsv-card", key: "ctrlw-tab" },
7590
+ h(
7591
+ "div",
7592
+ { className: "dsv-card-text" },
7593
+ h("div", { className: "dsv-card-title" }, t("Ctrl+W 关闭标签")),
7594
+ h(
7595
+ "div",
7596
+ { className: "dsv-card-desc" },
7597
+ p.ctrlWCloseTab === false
7598
+ ? t("已关闭:Ctrl+W 按应用默认行为处理(关闭窗口)。")
7599
+ : t("已开启:Ctrl+W 关闭当前栏的当前标签。")
7600
+ )
7601
+ ),
7602
+ h("button", {
7603
+ type: "button",
7604
+ className: "dsv-switch",
7605
+ "data-on": p.ctrlWCloseTab === false ? "0" : "1",
7606
+ role: "switch",
7607
+ "aria-checked": p.ctrlWCloseTab === false ? "false" : "true",
7608
+ "aria-label": t("Ctrl+W 关闭标签"),
7609
+ onClick: () => prefs.update({ ctrlWCloseTab: p.ctrlWCloseTab === false })
7610
+ })
7611
+ ),
7612
+ h(
7613
+ "div",
7614
+ { className: "dsv-card", key: "ctrlw-window", "data-muted": p.ctrlWCloseTab === false ? "1" : "0" },
7615
+ h(
7616
+ "div",
7617
+ { className: "dsv-card-text" },
7618
+ h("div", { className: "dsv-card-title" }, t("最后一个标签时关闭窗口")),
7619
+ h(
7620
+ "div",
7621
+ { className: "dsv-card-desc" },
7622
+ p.ctrlWCloseTab === false
7623
+ ? t("需要先打开上面的「Ctrl+W 关闭标签」。")
7624
+ : p.ctrlWCloseWindowOnLast === false
7625
+ ? t("已关闭:只剩一个标签时 Ctrl+W 不动作,标签保留。")
7626
+ : t("已开启:只剩一个标签时再按 Ctrl+W 直接关闭窗口。")
7627
+ )
7628
+ ),
7629
+ h("button", {
7630
+ type: "button",
7631
+ className: "dsv-switch",
7632
+ "data-on": p.ctrlWCloseTab === false ? "0" : p.ctrlWCloseWindowOnLast === false ? "0" : "1",
7633
+ role: "switch",
7634
+ "aria-checked": p.ctrlWCloseTab === false ? "false" : p.ctrlWCloseWindowOnLast === false ? "false" : "true",
7635
+ disabled: p.ctrlWCloseTab === false,
7636
+ "aria-disabled": p.ctrlWCloseTab === false ? "true" : "false",
7637
+ "aria-label": t("最后一个标签时关闭窗口"),
7638
+ onClick: () => {
7639
+ if (p.ctrlWCloseTab === false) return;
7640
+ prefs.update({ ctrlWCloseWindowOnLast: p.ctrlWCloseWindowOnLast === false });
7641
+ }
7642
+ })
7643
+ ),
7470
7644
  /* 侧边栏入口开关:默认显示。关掉后侧栏不再出现本插件入口,
7471
7645
  但设置页仍在(从宿主设置里进来),不会把自己锁死。 */
7472
7646
  h(
@@ -7508,6 +7682,18 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
7508
7682
  t("鼠标移到任一组上,上方预览会高亮对应元素;每组可单独换色,也可全部跟随全局色。")
7509
7683
  ),
7510
7684
  ...AppearanceControls({ prefs: p }),
7685
+ /* ── 交互说明(2026-11-10):只加一条备注,不改任何逻辑 ──
7686
+ 呼吸/骨架/转圈这些动效都由 CSS 动画驱动,而 CSS 动画是否播放跟着 Windows 的
7687
+ 「动画效果」系统设置走(prefers-reduced-motion)。系统关掉动画时本应用会
7688
+ 自动静止 —— 这是设计行为,不是坏了,所以在这里跟用户说明白。 */
7689
+ h(
7690
+ "div",
7691
+ { className: "dsv-section-head", key: "sec-motion", style: { marginTop: "16px" } },
7692
+ h("span", { className: "dsv-section-bar", "aria-hidden": "true" }),
7693
+ h("span", { className: "dsv-section-name" }, t("交互")),
7694
+ h("span", { className: "dsv-section-desc" }, t("动效说明"))
7695
+ ),
7696
+ h("p", { className: "dsv-hint", key: "sec-motion-hint" }, t("动效依赖系统动画设置,系统关闭动画时 DSH 会自动静止,属设计行为。")),
7511
7697
  /* 用法提示收进虚线框,避免正文里散落一堆长句(纯排版) */
7512
7698
  h(
7513
7699
  "div",
@@ -8511,6 +8697,10 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
8511
8697
  function Divider(props) {
8512
8698
  const { index, narrow, dragging, preview, onDropAt, onResize, onHover, startLeft, pairWeight } = props;
8513
8699
  const [active, setActive] = react.useState(false);
8700
+ /* 拖动标签时的「落区」高亮只给鼠标真正指着的那一条分割线。
8701
+ 2026-11-10 用户反馈:以前用 dragging 直接点亮全部 split 线,拖标签时所有栏间线一起亮,
8702
+ 看着像整排都被选中。改成由 onDragOver / onDragLeave 自己维护。 */
8703
+ const [dropHover, setDropHover] = react.useState(false);
8514
8704
  const ref = react.useRef(null);
8515
8705
 
8516
8706
  const onPointerDown = react.useCallback(
@@ -8545,7 +8735,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
8545
8735
  className: "dsv-divider",
8546
8736
  ref,
8547
8737
  "data-dragging": active ? "1" : "0",
8548
- "data-drop": dragging ? "1" : "0",
8738
+ "data-drop": dropHover ? "1" : "0",
8549
8739
  "data-preview": preview ? "1" : "0",
8550
8740
  role: "separator",
8551
8741
  "aria-orientation": narrow ? "horizontal" : "vertical",
@@ -8554,14 +8744,17 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
8554
8744
  if (!dragging) return;
8555
8745
  event.preventDefault();
8556
8746
  event.stopPropagation();
8747
+ if (dropHover !== true) setDropHover(true);
8557
8748
  onHover?.({ index, kind: "divider" });
8558
8749
  },
8559
8750
  onDragLeave: () => {
8751
+ if (dropHover === true) setDropHover(false);
8560
8752
  onHover?.(null);
8561
8753
  },
8562
8754
  onDrop: (event) => {
8563
8755
  event.preventDefault();
8564
8756
  event.stopPropagation();
8757
+ if (dropHover === true) setDropHover(false);
8565
8758
  onHover?.(null);
8566
8759
  onDropAt(index);
8567
8760
  }
@@ -9150,6 +9343,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
9150
9343
 
9151
9344
  /* 栏内标签切换:Ctrl+Tab / Ctrl+Shift+Tab。设置页没有 .dsv-pane,自然不会触发。 */
9152
9345
  ctx.effect(() => installTabCycling(), "dsh-split-view: tab cycling shortcut");
9346
+ ctx.effect(() => installCloseTabShortcut(), "dsh-split-view: ctrl+w closes the tab");
9153
9347
 
9154
9348
  /* 把「锁定标签」作为一项贡献进宿主的**会话右键菜单**。
9155
9349
  标签上右键 → 打开的就是宿主这份菜单(open 见 TabItem),所以标签右键与侧栏会话行右键
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-multipane",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
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": {