dsh-nav-fold 0.3.1 → 0.3.3
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/CHANGELOG.md +15 -0
- package/README.md +8 -3
- package/lib/client.js +96 -55
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3 — 2026-11-16
|
|
4
|
+
|
|
5
|
+
- 固定顶部区域不再"先滑一段再钉住":sticky 的 top 改为按实测内容偏移(nav 8px / 标题行 110px),滚动全程位置不变、行间间隙不再被吃掉
|
|
6
|
+
- 设置页按档位分组:「图标档」「收起档」两个分组标题,行标签统一为「固定顶部区域」(小号),不再出现两个同名大标题
|
|
7
|
+
|
|
8
|
+
## 0.3.2 — 2026-11-16
|
|
9
|
+
|
|
10
|
+
修复 0.3.1 固定方式带来的三个问题(K1–K3)。
|
|
11
|
+
|
|
12
|
+
- **改回原生滚动 + 双层 sticky**:不再重排外层布局,滚动仍由外壳负责 → 滚动条位置不变、侧栏宽度与自适应列数不再跳变
|
|
13
|
+
- 图标排与工作区标题行一起固定在顶部,只有文件夹与会话列表滚动
|
|
14
|
+
- 分隔线改为绝对定位满宽(图标档是 grid、收起档是 flex,之前 grid 下只占第一列)
|
|
15
|
+
- 找不到工作区标题行时降级为「仅固定导航」,侧栏不可见时挂起,均不影响布局
|
|
16
|
+
- 诊断区显示固定状态(已应用 / 仅固定导航 / 待定 / 未启用)与底色
|
|
17
|
+
|
|
3
18
|
## 0.3.1 — 2026-11-16
|
|
4
19
|
|
|
5
20
|
修正 0.3.0 的固定方式(0.3.0 未公开发布,仅内部迭代)。
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## 为什么要它
|
|
10
10
|
|
|
11
|
-
侧栏顶部那串入口(Plugins / 自动化任务 / 上下文洞察 / …)是官方 `sidebar.panellist` 列表,每装一个带主面板的插件就多一行(36px)。实测 264px 宽的一列里 8 行占 **340px**,其下工作区/会话区只剩 **170px
|
|
11
|
+
侧栏顶部那串入口(Plugins / 自动化任务 / 上下文洞察 / …)是官方 `sidebar.panellist` 列表,每装一个带主面板的插件就多一行(36px)。实测 264px 宽的一列里 8 行占 **340px**,其下工作区/会话区只剩 **170px**;手机抽屉里更惨,旧版 DSH(0.2.2-rc.1 及更早)这块还不能滚动;新版官方已改为随侧栏一起滚动,本插件在此基础上提供「固定 / 跟随」开关,并额外支持三态折叠。
|
|
12
12
|
|
|
13
13
|
## 三种形态
|
|
14
14
|
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
| 图标网格 `compact` | 图标网格、隐文字(保留无障碍名)、行高 32px | **92px** |
|
|
19
19
|
| 收起 `hidden` | 只留「收起时保留」勾选的行(默认第一行)+「更多」锚点 | **100px** |
|
|
20
20
|
|
|
21
|
+
> 实测高度随列数与窗口宽度变化(下表是 264px 侧栏、7 列时的值)。
|
|
22
|
+
|
|
21
23
|
## 控制条在哪
|
|
22
24
|
|
|
23
25
|
挂在**被折叠那一组的末尾**(「更多」下面一行)——它的作用对象就是上面那几行,不是会话列表,也不是设置区:
|
|
@@ -45,8 +47,9 @@
|
|
|
45
47
|
| `cycle` | 一个按钮,**一次只显示当前档那一个图标**,点了换成下一档 |
|
|
46
48
|
| `header` | **标题行**:整组收成一行 `⌃ 功能入口 8`(位于入口列表最上方),点标题展开/收起;只有"文字行 / 收起"两态,图标网格档不可用。被外壳挪位会自动拉回,连续 3 次失败退回 `segmented` |
|
|
47
49
|
|
|
48
|
-
## 固定顶部区域与列数(0.3.
|
|
50
|
+
## 固定顶部区域与列数(0.3.2)
|
|
49
51
|
|
|
52
|
+
- **官方行为**:整栏一起滚动。开启「固定顶部区域」后,图标排与工作区标题固定、只有文件夹与会话列表滚动;关闭则完全跟随官方。
|
|
50
53
|
- **固定顶部区域**:图标档默认开启——图标排 + 工作区标题(含搜索/视图/新建)一起固定在顶部,**只有文件夹与会话列表滚动**;收起档可选(默认关);文字档不提供(行数多,固定会把会话区挤没)
|
|
51
54
|
- **底色**:固定区背景在运行时取自外壳侧栏颜色,不写死白底,浅色/深色都不会出现色块
|
|
52
55
|
- **每行几个**:自适应(默认,手机上最多 6 列)/ 8 / 7 / 6 / 5 / 4;写死 7、8 列时按侧栏实际宽度提示是否过挤,可一键切回自适应
|
|
@@ -98,6 +101,8 @@ dsh plugin --profile web add dsh-nav-fold
|
|
|
98
101
|
sudo systemctl restart dsh-web # 首次安装需要重启 Host 才会加载浏览器半
|
|
99
102
|
```
|
|
100
103
|
|
|
104
|
+
> 若你的 npm 源指向镜像(如 npmmirror),可能拉不到最新版本,可加 `--registry=https://registry.npmjs.org`。
|
|
105
|
+
|
|
101
106
|
### 从源码(开发/二次修改)
|
|
102
107
|
|
|
103
108
|
```bash
|
|
@@ -124,7 +129,7 @@ node --test test/*.test.mjs # 14 项,直接测上线产物 lib/client.js(v
|
|
|
124
129
|
|
|
125
130
|
## 版本契约(升级 DSH 后看这里)
|
|
126
131
|
|
|
127
|
-
- 支持 **DSH >= 0.2.2-rc.1 < 0.3.0**(实测 rc.1 / rc.3
|
|
132
|
+
- 支持 **DSH >= 0.2.2-rc.1 < 0.3.0**(实测 rc.1 / rc.2 / rc.3;rc.2 起入口行多一层 `div.panelEntry`)
|
|
128
133
|
- 侧栏入口行两种结构都适配:
|
|
129
134
|
- rc.1 及更早:`nav > button.panelRow`
|
|
130
135
|
- rc.2 起:`nav > div.panelEntry > button.panelRow`(行内可能还有「取消固定」按钮)
|
package/lib/client.js
CHANGED
|
@@ -29,7 +29,7 @@ const react = require("react");
|
|
|
29
29
|
/** 插件名(cordis 插件标识) */
|
|
30
30
|
const name = "nav-fold";
|
|
31
31
|
/** 版本号:必须与 package.json.version 一致(有单测守着) */
|
|
32
|
-
const PLUGIN_VERSION = "0.3.
|
|
32
|
+
const PLUGIN_VERSION = "0.3.3";
|
|
33
33
|
/** 设置分区 / 控制条占用者 id */
|
|
34
34
|
const ENTRY_ID = "nav-fold";
|
|
35
35
|
/** 注入样式表的幂等标记 */
|
|
@@ -58,12 +58,8 @@ const STORAGE_SHELL_MORE = "dsh-nav-fold/v1/shell-more";
|
|
|
58
58
|
const COLS_OPTIONS = ["auto", "8", "7", "6", "5", "4"];
|
|
59
59
|
/** 每列可用的最小像素(图标 18px + 内边距),低于它判定为“挤” */
|
|
60
60
|
const COL_MIN_PX = 32;
|
|
61
|
-
/**
|
|
62
|
-
const
|
|
63
|
-
const PIN_ATTR_REGION = "data-navfold-region";
|
|
64
|
-
const PIN_ATTR_STACK = "data-navfold-stack";
|
|
65
|
-
const PIN_ATTR_HEAD = "data-navfold-head";
|
|
66
|
-
const PIN_ATTR_LIST = "data-navfold-list";
|
|
61
|
+
/** 工作区标题行的标记属性(只用来挂 sticky,不重排布局) */
|
|
62
|
+
const PIN_ATTR_HEAD = "data-navfold-pin-head";
|
|
67
63
|
/** 命中导航元素的标记属性,三态值写在这个属性上 */
|
|
68
64
|
const NAV_ATTR = "data-navfold";
|
|
69
65
|
/** 自有控制条的标记属性 */
|
|
@@ -133,6 +129,8 @@ const DICT = {
|
|
|
133
129
|
"settings.restore": "恢复默认",
|
|
134
130
|
"settings.restore.confirm": "再点一次确认",
|
|
135
131
|
"settings.resetModel": "只重置控件样式",
|
|
132
|
+
"settings.group.icon": "图标档",
|
|
133
|
+
"settings.group.hidden": "收起档",
|
|
136
134
|
"settings.cells.title": "每行几个",
|
|
137
135
|
"settings.cells.auto": "自适应",
|
|
138
136
|
"settings.cells.desc": "只影响图标档。自适应按侧栏宽度排版(手机上最多 6 列);写死列数在窄侧栏或手机上可能挤压。",
|
|
@@ -203,6 +201,8 @@ const DICT = {
|
|
|
203
201
|
"settings.restore": "Restore defaults",
|
|
204
202
|
"settings.restore.confirm": "Click again to confirm",
|
|
205
203
|
"settings.resetModel": "Reset control style only",
|
|
204
|
+
"settings.group.icon": "Icon grid",
|
|
205
|
+
"settings.group.hidden": "Collapsed",
|
|
206
206
|
"settings.cells.title": "Icons per row",
|
|
207
207
|
"settings.cells.auto": "Auto",
|
|
208
208
|
"settings.cells.desc": "Only affects the icon grid. Auto follows the sidebar width (6 columns max on phones); a fixed count may feel cramped on narrow sidebars.",
|
|
@@ -327,17 +327,11 @@ const CSS_TEXT = [
|
|
|
327
327
|
'@media (max-width:767px){nav[data-navfold="compact"][data-navfold-cols="auto"]{grid-template-columns:repeat(6,minmax(0,1fr))!important}}',
|
|
328
328
|
'nav[data-navfold="compact"][data-navfold-cols="8"]>button,nav[data-navfold="compact"][data-navfold-cols="8"]>div>button{height:30px!important;min-height:30px!important}',
|
|
329
329
|
'nav[data-navfold="compact"][data-navfold-cols="5"]>button,nav[data-navfold="compact"][data-navfold-cols="5"]>div>button,nav[data-navfold="compact"][data-navfold-cols="4"]>button,nav[data-navfold="compact"][data-navfold-cols="4"]>div>button{height:36px!important;min-height:36px!important}',
|
|
330
|
-
//
|
|
331
|
-
'[data-navfold-
|
|
332
|
-
'[data-navfold-
|
|
333
|
-
|
|
334
|
-
'[data-navfold-
|
|
335
|
-
'[data-navfold-list]{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding-bottom:8px}',
|
|
336
|
-
'nav[data-navfold-pinned="on"]{position:static!important;background:var(--navfold-pin-bg,transparent)!important}',
|
|
337
|
-
'nav[data-navfold-pinned="on"]::after{content:"";display:block;height:1px;margin-top:6px;background:linear-gradient(to right,transparent 0%,var(--dsw-alias-border-l1,rgba(0,0,0,.14)) 22%,var(--dsw-alias-border-l1,rgba(0,0,0,.14)) 78%,transparent 100%)}',
|
|
338
|
-
// 回退路径:结构不符时才退回粘性导航(底色同样对齐外壳,不制造色块)
|
|
339
|
-
'nav[data-navfold-pinned="fallback"]{position:sticky!important;top:0!important;z-index:4!important;background:var(--navfold-pin-bg,transparent)!important}',
|
|
340
|
-
'nav[data-navfold-pinned="fallback"]::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;pointer-events:none;background:linear-gradient(to right,transparent 0%,var(--dsw-alias-border-l1,rgba(0,0,0,.14)) 22%,var(--dsw-alias-border-l1,rgba(0,0,0,.14)) 78%,transparent 100%)}',
|
|
330
|
+
// 顶部固定区:原生滚动不变,nav 与工作区标题行用 sticky 贴在滚动口(不重排布局 → 宽度/列数不变)
|
|
331
|
+
'nav[data-navfold-pinned="on"],nav[data-navfold-pinned="nav-only"]{position:sticky!important;top:var(--navfold-pin-top,0px)!important;z-index:4!important;background:var(--navfold-pin-bg,transparent)!important}',
|
|
332
|
+
'[data-navfold-pin-head]{position:sticky!important;top:var(--navfold-pin-head-top,92px)!important;z-index:3!important;background:var(--navfold-pin-bg,transparent)!important}',
|
|
333
|
+
// 分隔线用绝对定位:grid(图标档)与 flex(收起档)下都满宽
|
|
334
|
+
'nav[data-navfold-pinned="on"]::after,nav[data-navfold-pinned="nav-only"]::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;pointer-events:none;background:linear-gradient(to right,transparent 0%,var(--dsw-alias-border-l1,rgba(0,0,0,.14)) 22%,var(--dsw-alias-border-l1,rgba(0,0,0,.14)) 78%,transparent 100%)}',
|
|
341
335
|
// 设置面板:列数/吸附选中态沿用控件样式那套,提示用状态色
|
|
342
336
|
'[data-navfold-cols-btn][aria-checked="true"]{background:var(--dsw-alias-bg-layer-1,#fff);color:var(--dsw-alias-label-primary,#111);border-color:var(--dsw-alias-label-tertiary,rgba(0,0,0,.28));font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.06)}',
|
|
343
337
|
'[data-navfold-warn]{margin:0;font-size:12px;line-height:1.5;color:var(--dsw-alias-state-warning-primary,#b26a00)}',
|
|
@@ -420,6 +414,8 @@ const runtime = {
|
|
|
420
414
|
pinRetry: 0,
|
|
421
415
|
pinNodes: null,
|
|
422
416
|
pinBg: "",
|
|
417
|
+
pinTop: 0,
|
|
418
|
+
pinHeadTop: 0,
|
|
423
419
|
anomalies: []
|
|
424
420
|
};
|
|
425
421
|
|
|
@@ -544,9 +540,10 @@ function findStack(node, depth) {
|
|
|
544
540
|
}
|
|
545
541
|
|
|
546
542
|
/**
|
|
547
|
-
* 探测顶部固定区需要的节点:滚动区
|
|
543
|
+
* 探测顶部固定区需要的节点:滚动区 + 工作区标题行。
|
|
544
|
+
* 只用来给标题行打标,不改布局(0.3.1 的布局重排已废弃)。
|
|
548
545
|
* @param nav - 命中的 nav。
|
|
549
|
-
* @returns { area,
|
|
546
|
+
* @returns { area, head } 或 null。
|
|
550
547
|
*/
|
|
551
548
|
function findPinTargets(nav) {
|
|
552
549
|
const area = nav && (nav.parentElement || nav.parentNode);
|
|
@@ -561,7 +558,7 @@ function findPinTargets(nav) {
|
|
|
561
558
|
if (!region) return null;
|
|
562
559
|
const stack = findStack(region, 0);
|
|
563
560
|
if (!stack || !stack.children || stack.children.length < 2) return null;
|
|
564
|
-
return { area: area,
|
|
561
|
+
return { area: area, head: stack.children[0] };
|
|
565
562
|
}
|
|
566
563
|
|
|
567
564
|
/**
|
|
@@ -590,21 +587,57 @@ function noteAnomaly(kind) {
|
|
|
590
587
|
runtime.lastWarnAt = runtime.anomalies[0].at;
|
|
591
588
|
}
|
|
592
589
|
|
|
593
|
-
/**
|
|
590
|
+
/** 清掉固定区标记(只摘标题行标记,不动外壳布局)。 */
|
|
594
591
|
function clearPin() {
|
|
595
592
|
const nodes = runtime.pinNodes;
|
|
596
|
-
if (nodes) {
|
|
597
|
-
|
|
598
|
-
const keys = Object.keys(map);
|
|
599
|
-
for (let i = 0; i < keys.length; i += 1) {
|
|
600
|
-
const el = nodes[keys[i]];
|
|
601
|
-
if (el && typeof el.removeAttribute === "function") el.removeAttribute(map[keys[i]]);
|
|
602
|
-
}
|
|
593
|
+
if (nodes && nodes.head && typeof nodes.head.removeAttribute === "function") {
|
|
594
|
+
nodes.head.removeAttribute(PIN_ATTR_HEAD);
|
|
603
595
|
}
|
|
604
596
|
runtime.pinNodes = null;
|
|
605
597
|
runtime.pinBg = "";
|
|
606
598
|
}
|
|
607
599
|
|
|
600
|
+
/**
|
|
601
|
+
* 元素在滚动内容里的偏移(与当前滚动位置无关)。
|
|
602
|
+
* @param area - 滚动区。
|
|
603
|
+
* @param el - 目标元素。
|
|
604
|
+
* @returns 像素偏移,取不到返回 0。
|
|
605
|
+
*/
|
|
606
|
+
function contentOffset(area, el) {
|
|
607
|
+
if (!area || !el || typeof area.getBoundingClientRect !== "function" || typeof el.getBoundingClientRect !== "function") return 0;
|
|
608
|
+
try {
|
|
609
|
+
const ar = area.getBoundingClientRect();
|
|
610
|
+
const er = el.getBoundingClientRect();
|
|
611
|
+
const scroll = typeof area.scrollTop === "number" ? area.scrollTop : 0;
|
|
612
|
+
return Math.max(0, Math.round(er.top - ar.top + scroll));
|
|
613
|
+
} catch (err) {
|
|
614
|
+
return 0;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* 把 nav 高度与两个 sticky 偏移写进滚动区的 CSS 变量。
|
|
620
|
+
* 用内容偏移而不是写死 0:这样滚动时顶部不动、也不吃掉行间空隙。
|
|
621
|
+
* @param area - 滚动区。
|
|
622
|
+
* @param nav - 命中的 nav。
|
|
623
|
+
* @param head - 工作区标题行(可能为 null)。
|
|
624
|
+
*/
|
|
625
|
+
function syncPinOffsets(area, nav, head) {
|
|
626
|
+
if (!area || !area.style || typeof area.style.setProperty !== "function") return;
|
|
627
|
+
const height = Math.round(rectHeight(nav));
|
|
628
|
+
const navTop = contentOffset(area, nav);
|
|
629
|
+
const headTop = head ? contentOffset(area, head) : navTop + (height || 0);
|
|
630
|
+
runtime.pinTop = navTop;
|
|
631
|
+
runtime.pinHeadTop = headTop;
|
|
632
|
+
try {
|
|
633
|
+
if (height) area.style.setProperty("--navfold-nav-h", height + "px");
|
|
634
|
+
area.style.setProperty("--navfold-pin-top", navTop + "px");
|
|
635
|
+
area.style.setProperty("--navfold-pin-head-top", headTop + "px");
|
|
636
|
+
} catch (err) {
|
|
637
|
+
/* 设不上就退回 CSS 默认值 */
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
608
641
|
/**
|
|
609
642
|
* 应用 / 撤销顶部固定区。
|
|
610
643
|
* @param nav - 命中的 nav。
|
|
@@ -623,28 +656,30 @@ function applyPin(nav) {
|
|
|
623
656
|
runtime.pinState = "pending";
|
|
624
657
|
return "pending";
|
|
625
658
|
}
|
|
659
|
+
// 底色与导航高度都挂在滚动区上:nav 与标题行共用
|
|
660
|
+
runtime.pinBg = readPanelBg(areaNode);
|
|
661
|
+
try {
|
|
662
|
+
if (areaNode.style && typeof areaNode.style.setProperty === "function") {
|
|
663
|
+
areaNode.style.setProperty("--navfold-pin-bg", runtime.pinBg);
|
|
664
|
+
}
|
|
665
|
+
} catch (err) {
|
|
666
|
+
/* 设不上就退回 transparent */
|
|
667
|
+
}
|
|
626
668
|
const targets = findPinTargets(nav);
|
|
669
|
+
syncPinOffsets(areaNode, nav, targets ? targets.head : null);
|
|
627
670
|
if (!targets) {
|
|
671
|
+
// 找不到工作区标题行:只固定导航(等价 0.3.0 行为),不记异常以外的副作用
|
|
628
672
|
clearPin();
|
|
629
|
-
runtime.
|
|
630
|
-
|
|
673
|
+
runtime.pinNodes = { area: areaNode, head: null };
|
|
674
|
+
runtime.pinState = "nav-only";
|
|
675
|
+
return "nav-only";
|
|
631
676
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
for (let i = 0; i < keys.length; i += 1) {
|
|
635
|
-
const el = targets[keys[i]];
|
|
636
|
-
if (el && typeof el.setAttribute === "function") el.setAttribute(map[keys[i]], "");
|
|
677
|
+
if (runtime.pinNodes && runtime.pinNodes.head && runtime.pinNodes.head !== targets.head) {
|
|
678
|
+
if (typeof runtime.pinNodes.head.removeAttribute === "function") runtime.pinNodes.head.removeAttribute(PIN_ATTR_HEAD);
|
|
637
679
|
}
|
|
680
|
+
if (typeof targets.head.setAttribute === "function") targets.head.setAttribute(PIN_ATTR_HEAD, "");
|
|
638
681
|
runtime.pinNodes = targets;
|
|
639
682
|
runtime.pinState = "applied";
|
|
640
|
-
runtime.pinBg = readPanelBg(targets.area);
|
|
641
|
-
try {
|
|
642
|
-
if (targets.area.style && typeof targets.area.style.setProperty === "function") {
|
|
643
|
-
targets.area.style.setProperty("--navfold-pin-bg", runtime.pinBg);
|
|
644
|
-
}
|
|
645
|
-
} catch (err) {
|
|
646
|
-
/* 设不上就退回 transparent */
|
|
647
|
-
}
|
|
648
683
|
return "applied";
|
|
649
684
|
}
|
|
650
685
|
|
|
@@ -1181,7 +1216,7 @@ function paintNav() {
|
|
|
1181
1216
|
nav.setAttribute("data-navfold-cols", runtime.cols);
|
|
1182
1217
|
const before = runtime.pinState;
|
|
1183
1218
|
const state = applyPin(nav);
|
|
1184
|
-
nav.setAttribute("data-navfold-pinned", state === "applied" ? "on" : state === "
|
|
1219
|
+
nav.setAttribute("data-navfold-pinned", state === "applied" ? "on" : state === "nav-only" ? "nav-only" : "off");
|
|
1185
1220
|
// 挂起态在下一帧再试一次(抽屉展开动画结束时高度才会非 0)
|
|
1186
1221
|
if (state === "pending" && typeof window.setTimeout === "function" && !runtime.pinRetry) {
|
|
1187
1222
|
runtime.pinRetry = window.setTimeout(() => {
|
|
@@ -1189,8 +1224,8 @@ function paintNav() {
|
|
|
1189
1224
|
paintNav();
|
|
1190
1225
|
}, 350);
|
|
1191
1226
|
}
|
|
1192
|
-
//
|
|
1193
|
-
if (state === "
|
|
1227
|
+
// 找不到工作区标题行时只固定导航:记一次,避免每次重扫刷屏
|
|
1228
|
+
if (state === "nav-only" && before !== "nav-only") noteAnomaly("未找到工作区标题行,仅固定导航区");
|
|
1194
1229
|
} catch (err) {
|
|
1195
1230
|
warn("写入档位失败", err);
|
|
1196
1231
|
}
|
|
@@ -1413,8 +1448,8 @@ function diagnosticsText() {
|
|
|
1413
1448
|
const pinText =
|
|
1414
1449
|
runtime.pinState === "applied"
|
|
1415
1450
|
? "已应用(" + runtime.mode + "档)· 底色 " + (runtime.pinBg || "transparent")
|
|
1416
|
-
: runtime.pinState === "
|
|
1417
|
-
? "
|
|
1451
|
+
: runtime.pinState === "nav-only"
|
|
1452
|
+
? "仅固定导航(未找到工作区标题行)· 底色 " + (runtime.pinBg || "transparent")
|
|
1418
1453
|
: runtime.pinState === "pending"
|
|
1419
1454
|
? "待定(侧栏当前不可见,展开后自动固定)"
|
|
1420
1455
|
: "未启用";
|
|
@@ -2046,7 +2081,9 @@ const PANEL_CSS = {
|
|
|
2046
2081
|
fontSize: 12,
|
|
2047
2082
|
cursor: "pointer"
|
|
2048
2083
|
},
|
|
2049
|
-
diag: { margin: 0 }
|
|
2084
|
+
diag: { margin: 0 },
|
|
2085
|
+
groupHead: { display: "flex", alignItems: "center", gap: 6 },
|
|
2086
|
+
rowLabel: { fontSize: 12, color: "var(--dsw-alias-label-secondary,#666)" }
|
|
2050
2087
|
};
|
|
2051
2088
|
|
|
2052
2089
|
/**
|
|
@@ -2092,6 +2129,8 @@ function NavFoldSettings() {
|
|
|
2092
2129
|
const shellMore = react.useSyncExternalStore(subscribe, getHideAllWhenShellMore, getHideAllWhenShellMore);
|
|
2093
2130
|
const diagOpen = react.useSyncExternalStore(subscribe, getDiagOpen, getDiagOpen);
|
|
2094
2131
|
const cellsTitleId = uid + "-cells";
|
|
2132
|
+
const iconGroupId = uid + "-grp-icon";
|
|
2133
|
+
const hiddenGroupId = uid + "-grp-hidden";
|
|
2095
2134
|
const iconStickId = uid + "-stick-icon";
|
|
2096
2135
|
const hiddenStickId = uid + "-stick-hidden";
|
|
2097
2136
|
const shellId = uid + "-shell";
|
|
@@ -2261,11 +2300,12 @@ function NavFoldSettings() {
|
|
|
2261
2300
|
// 图标档:每行几个 + 吸附
|
|
2262
2301
|
el(
|
|
2263
2302
|
"section",
|
|
2264
|
-
{ style: PANEL_CSS.group, role: "group", "aria-labelledby":
|
|
2303
|
+
{ style: PANEL_CSS.group, role: "group", "aria-labelledby": iconGroupId },
|
|
2304
|
+
el("div", { style: PANEL_CSS.groupHead }, el("span", { id: iconGroupId, style: PANEL_CSS.title }, t("settings.group.icon"))),
|
|
2265
2305
|
el(
|
|
2266
2306
|
"div",
|
|
2267
2307
|
{ style: PANEL_CSS.row },
|
|
2268
|
-
el("span", { id: cellsTitleId, style: PANEL_CSS.
|
|
2308
|
+
el("span", { id: cellsTitleId, style: PANEL_CSS.rowLabel, key: "t" }, t("settings.cells.title")),
|
|
2269
2309
|
el(
|
|
2270
2310
|
"div",
|
|
2271
2311
|
{ style: PANEL_CSS.seg, role: "radiogroup", "aria-labelledby": cellsTitleId, key: "g" },
|
|
@@ -2291,7 +2331,7 @@ function NavFoldSettings() {
|
|
|
2291
2331
|
el(
|
|
2292
2332
|
"div",
|
|
2293
2333
|
{ style: PANEL_CSS.row },
|
|
2294
|
-
el("span", { id: iconStickId, style: PANEL_CSS.
|
|
2334
|
+
el("span", { id: iconStickId, style: PANEL_CSS.rowLabel, key: "t2" }, t("settings.stick.title")),
|
|
2295
2335
|
switchOf(stickCompact, iconStickId, () => setStickCompact(!stickCompact), { "data-navfold-stick": "compact" })
|
|
2296
2336
|
),
|
|
2297
2337
|
el("p", { style: PANEL_CSS.desc }, t("settings.stick.compact.desc"))
|
|
@@ -2299,11 +2339,12 @@ function NavFoldSettings() {
|
|
|
2299
2339
|
// 收起档:吸附(默认关)
|
|
2300
2340
|
el(
|
|
2301
2341
|
"section",
|
|
2302
|
-
{ style: PANEL_CSS.group, role: "group", "aria-labelledby":
|
|
2342
|
+
{ style: PANEL_CSS.group, role: "group", "aria-labelledby": hiddenGroupId },
|
|
2343
|
+
el("div", { style: PANEL_CSS.groupHead }, el("span", { id: hiddenGroupId, style: PANEL_CSS.title }, t("settings.group.hidden"))),
|
|
2303
2344
|
el(
|
|
2304
2345
|
"div",
|
|
2305
2346
|
{ style: PANEL_CSS.row },
|
|
2306
|
-
el("span", { id: hiddenStickId, style: PANEL_CSS.
|
|
2347
|
+
el("span", { id: hiddenStickId, style: PANEL_CSS.rowLabel, key: "t" }, t("settings.stick.title")),
|
|
2307
2348
|
switchOf(stickHidden, hiddenStickId, () => setStickHidden(!stickHidden), { "data-navfold-stick": "hidden" })
|
|
2308
2349
|
),
|
|
2309
2350
|
el("p", { style: PANEL_CSS.desc }, t("settings.stick.hidden.desc"))
|