dsh-declutter 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.en.md +81 -0
- package/README.md +259 -2
- package/cordis.patch.yml +3 -0
- package/icon.svg +8 -0
- package/locale/en.json +5 -0
- package/locale/zh.json +5 -0
- package/package.json +52 -4
- package/src/client.js +1689 -0
- package/src/index.js +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DDDMUC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# dsh-declutter
|
|
2
|
+
|
|
3
|
+
English | [中文](README.md)
|
|
4
|
+
|
|
5
|
+
Declutters the DSH interface: hides the brand row, the New session button and the three “More” launchers behind individual switches, lays the panel list out two per row (or packed by width), reorders panels by dragging, and hides any session-menu row you tick. It injects stylesheets and a few DOM attributes only — no source edits, no session data touched, and disabling or removing the bundle restores everything.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Open **Plugins → Add** in DSH and paste the package name or this repository:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# npm (preferred)
|
|
13
|
+
dsh plugin install dsh-declutter
|
|
14
|
+
|
|
15
|
+
# or straight from the repo
|
|
16
|
+
dsh plugin install https://github.com/DDDMUC/dsh-declutter
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then open **Plugins → Installed → dsh-declutter** and use the configure arrow on that bundle's row.
|
|
20
|
+
|
|
21
|
+
## Defaults
|
|
22
|
+
|
|
23
|
+
- Hidden: the brand row, the New session button, the sidebar panel list's More, and the right column's More
|
|
24
|
+
- Layout: two panels per row (drag the `⠿` grip in **Panels** to reorder; **Reset** restores the registration order)
|
|
25
|
+
- Session menu: nothing hidden until you tick it
|
|
26
|
+
- The Session header View row's `⋯` is **not** hidden by default
|
|
27
|
+
|
|
28
|
+
## What it targets
|
|
29
|
+
|
|
30
|
+
Each surface is rendered directly into the layout by a shipped package, so none of them is a slot registration and no config switch exists for any of them:
|
|
31
|
+
|
|
32
|
+
| Surface | Package | Selector |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| Brand row | `dsh-client-ui-sidebar` | `_logoRow` (guarded by `:has([data-sidebar-toggle])`) |
|
|
35
|
+
| New session button | `dsh-client-ui-sidebar` | `button[class*="_newSession"]` |
|
|
36
|
+
| Sidebar More | `dsh-client-ui-sidebar` | `_panelList > _moreAnchor` |
|
|
37
|
+
| Right column More | `dsh-client-ui-sidebar-right` | `[data-sidebar-right-guide] _moreAnchor` |
|
|
38
|
+
| View row More | `dsh-client-ui-conversation` | `_viewsMore` |
|
|
39
|
+
|
|
40
|
+
Selectors key on CSS-module **local suffixes** (`_newSession`), never on the build-hashed prefix (`kB3qhq_`), because the prefix changes on every build while the local name follows the source.
|
|
41
|
+
|
|
42
|
+
## Panel order
|
|
43
|
+
|
|
44
|
+
Every row in the settings page's **Panels** block has a `⠿` grip: drag it onto another row to reorder. Clicking the row body still toggles the checkbox.
|
|
45
|
+
|
|
46
|
+
- The order is stored as `panelOrder` (array of ids); panels never arranged keep their registration order behind it
|
|
47
|
+
- It is applied as `data-dsh-panel` + `order`, so all three layout modes honour it
|
|
48
|
+
- **Reset** clears `panelOrder` and restores the registration order
|
|
49
|
+
- The More launcher always trails the panels
|
|
50
|
+
|
|
51
|
+
## Session menu rows
|
|
52
|
+
|
|
53
|
+
The **Session menu** block lists the rows of a Session's context menu; tick one to hide it, untick to bring it back.
|
|
54
|
+
|
|
55
|
+
- The shipped rows are listed up front (rename / archive / unarchive / pin / unpin) — nothing has to be opened first
|
|
56
|
+
- Anything else is discovered from a real menu open and appended under “community”
|
|
57
|
+
- Rows are matched by label prefix (Chinese and English); rows carrying an accelerator also get an `[aria-keyshortcuts]` rule injected up front, so they never paint before being hidden
|
|
58
|
+
- Sweeps only run within 400 ms of a click that came **from a Session row**, are grouped per menu, and that group must contain a shipped action — the system “open with” list is never read or recorded
|
|
59
|
+
- Only `display:none`: no node removal, and no keyboard shortcut is touched
|
|
60
|
+
- State lives in `localStorage["dsh-declutter.menu"]`, tagged `version: 2`
|
|
61
|
+
|
|
62
|
+
## Layout modes
|
|
63
|
+
|
|
64
|
+
`panelLayout` is a single choice, not three independent switches — two layout rules enabled at once would fight over the same element.
|
|
65
|
+
|
|
66
|
+
| Value | Effect |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `stack` | One per row, exactly as shipped |
|
|
69
|
+
| `two` (default) | Fixed two-column grid; long names truncate with an ellipsis |
|
|
70
|
+
| `wrap` | Content-sized chips that wrap greedily; short names pack three or four per row and nothing truncates |
|
|
71
|
+
|
|
72
|
+
## Caveats
|
|
73
|
+
|
|
74
|
+
- The brand row carries the sidebar collapse toggle on Windows and Linux. The rule hides the whole row only where it has no `[data-sidebar-toggle]`, and otherwise hides just the brand, so the toggle always survives.
|
|
75
|
+
- Where the row does hold the toggle, the plugin gives back the row's **height, not the button**: height and padding drop to 0 with `overflow: visible`, the button stays where it was and is drawn above the panel list (`z-index: 2`), and the collapsed rail restores a 28px row so the sidebar can be expanded again. Pure CSS — no JS, no timer, no forced layout.
|
|
76
|
+
- Preferences are stored in `localStorage`. Its scope is the page origin, which includes the port; if the app picks a new port on restart, the switches fall back to these defaults.
|
|
77
|
+
- Hiding the sidebar's More also retires pin/unpin: that menu is the only place a panel can be pinned or unpinned.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,3 +1,260 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-declutter
|
|
2
|
+
|
|
3
|
+
[English](README.en.md) | 中文
|
|
4
|
+
|
|
5
|
+
DSH 侧栏整理插件:按开关收起顶部品牌行、「新会话」按钮和三处「更多」入口,并把面板列表改成一行两个(或自动紧凑排布)。纯样式注入,**不改源码、不动会话数据**,禁用或卸载即完全还原。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
在 DSH 的**插件**页 → 安装 → 填入包名或仓库地址:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# npm(推荐)
|
|
13
|
+
dsh plugin install dsh-declutter
|
|
14
|
+
|
|
15
|
+
# 或直接从仓库
|
|
16
|
+
dsh plugin install https://github.com/DDDMUC/dsh-declutter
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
装好后打开 **插件 → 已安装 → dsh-declutter**,点该 bundle 下面那一行的配置箭头即可调整。
|
|
20
|
+
|
|
21
|
+
## 默认设置
|
|
22
|
+
|
|
23
|
+
- 隐藏:品牌行、「新会话」按钮、左栏「更多」、右侧栏「更多」
|
|
24
|
+
- 排布:一行两个
|
|
25
|
+
- 会话头部 View 行的 `⋯` 默认**不**隐藏
|
|
26
|
+
|
|
27
|
+
## 设置页
|
|
28
|
+
|
|
29
|
+
注册在 `plugins.row.config`,key 是 `<包名>#<patch 行 id>` = `dsh-declutter#hide-rows`。打开路径:**插件 → 已安装 → dsh-declutter → 该 bundle 下面那行的配置箭头**。行摘要会直接显示「已隐藏:…」。
|
|
30
|
+
|
|
31
|
+
开关分两组,改动立即生效,不重启插件、不重载页面:
|
|
32
|
+
|
|
33
|
+
**左栏**
|
|
34
|
+
|
|
35
|
+
| 键 | 默认 | 收起的面 |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `brand` | 开 | 顶部品牌行(deepseek HARNESS) |
|
|
38
|
+
| `newSession` | 开 | 侧栏「新会话」按钮 |
|
|
39
|
+
| `sidebarMore` | 开 | 左栏面板列表的「更多」 |
|
|
40
|
+
| `hiddenPanels` | 空 | 勾掉列表里的任意面板(自动枚举,见下) |
|
|
41
|
+
|
|
42
|
+
**其它位置**
|
|
43
|
+
|
|
44
|
+
| 键 | 默认 | 收起的面 |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| `rightMore` | 开 | 右侧栏起始页的「更多」 |
|
|
47
|
+
| `headerMore` | 关 | 会话头部 View 行的 `⋯` |
|
|
48
|
+
| `panelOrder` | 空 | 面板显示顺序(设置页拖动 `⠿` 手柄调整,可一键还原) |
|
|
49
|
+
| `menuState` | 空 | 会话菜单里要隐藏的条目,单独存在 `localStorage["dsh-declutter.menu"]` |
|
|
50
|
+
|
|
51
|
+
**排布**
|
|
52
|
+
|
|
53
|
+
| 键 | 默认 | 作用 |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `panelLayout` | `two` | 面板列表排布:`stack` / `two` / `wrap` 三选一 |
|
|
56
|
+
|
|
57
|
+
> 点选隐藏(自由隐藏)与「收起 / 展开面板列表」两个功能已移除,代码备份在 `backup/`,Git 标签 `archive/pick-and-collapse`。
|
|
58
|
+
|
|
59
|
+
行摘要只汇总「隐藏」组,不会把排布选项算成「已隐藏」。
|
|
60
|
+
|
|
61
|
+
旧版本存的是布尔值 `panelGrid`:`true` 迁移为 `two`(该键最初就是「一行两个」的意思),`false` 迁移为 `stack`。存储值非法时回落到默认。
|
|
62
|
+
|
|
63
|
+
值存在浏览器 `localStorage["dsh-declutter"]`,不写 profile 配置:因此这个 bundle 不需要 Host 侧 Config schema,改一个开关也不会重启插件。代价是偏好跟着浏览器走,换浏览器或清站点数据会回到默认。
|
|
64
|
+
|
|
65
|
+
## 收起 / 展开面板列表
|
|
66
|
+
|
|
67
|
+
侧栏底部、设置按钮上方的动作按钮,注册在官方 list slot `sidebar.footer.action`——由侧栏自己渲染,不会被重渲染移除。
|
|
68
|
+
|
|
69
|
+
- 驱动独立的一层 `collapsedAll`:收起时隐藏全部面板行与「更多」
|
|
70
|
+
- **不动手工勾选**:展开后,之前勾掉的面板仍然隐藏
|
|
71
|
+
- 折叠状态不持久化,刷新后一定是展开
|
|
72
|
+
- 窄栏(rail)时缩成图标
|
|
73
|
+
|
|
74
|
+
## 按 id 隐藏面板
|
|
75
|
+
|
|
76
|
+
侧栏每一行渲染后会被打上 `data-dsh-panel="<注册 id>"`,隐藏规则优先用它:
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
button[data-dsh-panel="fishpond"]{display:none!important}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
名字只在**唯一**时作为首帧兜底(那时属性还没打上)。因此两个插件面板取同名也不会互相牵连。
|
|
83
|
+
|
|
84
|
+
打标只写属性,不插入、不移动任何节点;打标失败的方向是安全的——什么都不会被隐藏。
|
|
85
|
+
|
|
86
|
+
## 拖动排序面板
|
|
2
87
|
|
|
3
|
-
|
|
88
|
+
设置页「面板」一节每行左侧有 `⠿` 手柄:按住拖到目标行即可换位,点行主体仍然是勾选 / 取消,两者互不干扰。
|
|
89
|
+
|
|
90
|
+
- 顺序存进 `panelOrder`(id 数组);没排过的面板按注册顺序排在后面,不会丢
|
|
91
|
+
- 落点是 `data-dsh-panel` 属性 + `order`,所以 `stack` / `two` / `wrap` 三种排布都吃这个顺序
|
|
92
|
+
- 「还原默认」清空 `panelOrder`,回到面板注册时的顺序
|
|
93
|
+
- 「更多」固定排在所有面板之后,不参与排序
|
|
94
|
+
|
|
95
|
+
## 自由隐藏(点选 → 勾选)
|
|
96
|
+
|
|
97
|
+
点「开始点选」,再点界面上任意一个元素。**它不会立刻消失**,而是作为一个条目加入下面这个列表,勾上才隐藏。
|
|
98
|
+
|
|
99
|
+
- 每条显示名字 + 选择器,可单独勾选 / 取消,右侧「移除」把它从列表里删掉
|
|
100
|
+
- 「清空列表」一次清掉全部条目
|
|
101
|
+
- 受保护的目标点不进去:设置入口所在行、以及覆盖视口 40% 以上的容器(误点主区域不会整页消失)
|
|
102
|
+
|
|
103
|
+
选择器生成顺序:`id` → 普通类名 → CSS Module 本地名后缀(`[class*="_xxx"]`)→ `data-*` → `:nth-child` 路径。
|
|
104
|
+
|
|
105
|
+
## 会话菜单:自由隐藏
|
|
106
|
+
|
|
107
|
+
设置页「会话菜单」一节列出会话行右键菜单里的条目,勾上即隐藏,取消即恢复。
|
|
108
|
+
|
|
109
|
+
- **官方条目先列出来**(重命名 / 归档会话 / 取消归档 / 置顶会话 / 取消置顶),不用先打开菜单
|
|
110
|
+
- 其它条目(其它插件加的)在打开过一次菜单后自动补进「社区(插件添加)」组
|
|
111
|
+
- 认行按标签文本的**前缀**匹配,中英双语都能命中;带快捷键的行另外注入一条
|
|
112
|
+
`[aria-keyshortcuts="..."]` 规则——菜单还没画出来就已不显示,不会闪一下
|
|
113
|
+
- 扫描只在**从会话行发起**的点击 / 右键后 400ms 内进行,并且按菜单分组、该组必须含官方动作:
|
|
114
|
+
系统「打开方式」那类列表既不会被读取,也不会被记录
|
|
115
|
+
- 只设 `display:none`,不删节点,不碰快捷键
|
|
116
|
+
- 状态存在 `localStorage["dsh-declutter.menu"]`,格式带 `version: 2`,旧版记录读取时丢弃
|
|
117
|
+
|
|
118
|
+
## 排布:三选一
|
|
119
|
+
|
|
120
|
+
`panelLayout` 是单选值,不是三个独立开关——同时启用两套布局规则会互相覆盖,所以设计成一个 `<fieldset>` + 共享 `name` 的 radio 组,浏览器层面就保证只能选一个。
|
|
121
|
+
|
|
122
|
+
| 值 | 界面 | 规则 |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| `stack` | 一列,界面原样 | 不注入任何排布规则 |
|
|
125
|
+
| `two` | 固定两列,左右对齐(默认) | `display:grid;grid-template-columns:1fr 1fr` |
|
|
126
|
+
| `wrap` | 按宽度自动换行 | `flex-direction:row;flex-wrap:wrap` + 内容定宽 |
|
|
127
|
+
|
|
128
|
+
默认 `two`(两列)。
|
|
129
|
+
|
|
130
|
+
### 两种并排的区别
|
|
131
|
+
|
|
132
|
+
- `two`:所有列共享同一宽度,行尾对齐成整齐的表格;代价是长名字被省略号截断(`自动化…`)。
|
|
133
|
+
- `wrap`:每个按钮按内容定宽,短名字一行能放三四个、长名字完整显示;代价是行尾参差,不再对齐。
|
|
134
|
+
|
|
135
|
+
### 两列(`two`)
|
|
136
|
+
|
|
137
|
+
```css
|
|
138
|
+
[class*="_root"]:not([class*="_collapsed"]) [class*="_panelList"]{
|
|
139
|
+
display:grid!important; grid-template-columns:1fr 1fr; gap:2px
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 自动紧凑(`wrap`)
|
|
144
|
+
|
|
145
|
+
```css
|
|
146
|
+
[class*="_root"]:not([class*="_collapsed"]) [class*="_panelList"]{
|
|
147
|
+
flex-direction:row!important; flex-wrap:wrap!important;
|
|
148
|
+
column-gap:6px!important; row-gap:2px!important
|
|
149
|
+
}
|
|
150
|
+
[class*="_panelList"] > [class*="_panelRow"]{
|
|
151
|
+
flex:0 0 auto!important; width:auto!important; max-width:100%
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
顺带解决了截断:按钮按内容定宽,`自动化任务`、`上下文洞察` 都能完整显示。
|
|
156
|
+
|
|
157
|
+
### 「更多」的位置
|
|
158
|
+
|
|
159
|
+
`flex-wrap` 只向前填:一个放不下的项不会回头去看上一行有没有空位。「更多」是 DOM 里的最后一个子项,轮到它时上一行早就填满了,所以它必定独占一行——哪怕第一行还空着大半个。
|
|
160
|
+
|
|
161
|
+
目标排法:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
插件 鱼塘 更多
|
|
165
|
+
自动化任务 上下文洞察
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
做法是按位置固定排序,而不是测量装箱:
|
|
169
|
+
|
|
170
|
+
```css
|
|
171
|
+
[class*="_panelList"] > button:nth-of-type(n+3){order:1}
|
|
172
|
+
[class*="_panelList"] > [class*="_moreAnchor"]{order:0}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`panelList` 的直接 `button` 子元素只有面板行——「更多」的触发按钮嵌在 `_moreAnchor` 那个 `span` 里面(Menu 原语的根节点),所以 `:nth-of-type(n+3)` 就是「第三个面板及以后」,它们的 `order:1` 排到了「更多」后面。
|
|
176
|
+
|
|
177
|
+
若第一行塞不下,`更多` 自然换行落到面板下方,规则优雅降级,不会和别的项重叠。这两条只属于 `wrap` 模式;`two` 模式下网格自己就消化了「更多」。
|
|
178
|
+
|
|
179
|
+
`:not([class*="_collapsed"])` 是必需的:侧栏收起时官方样式本来就把整个面板列表设成 `display:none`,一条不带作用域的 `!important` 会把它强行显示出来。
|
|
180
|
+
|
|
181
|
+
## 为什么不做「可折叠卡片」
|
|
182
|
+
|
|
183
|
+
折叠需要一个可点击的表头和一个开合状态,而 `panelList` 是 sidebar 自己渲染的,没有对应的 slot。只能往 DOM 里插节点再挂 MutationObserver 看住 React 的重渲染——side bar 每次状态变化都可能把外来节点冲掉。省下的高度和「一行两个」差不多,风险却高一个数量级,所以这个插件只做纯 CSS 的那一半。
|
|
184
|
+
|
|
185
|
+
## 品牌行的坑
|
|
186
|
+
|
|
187
|
+
`logoRow` 是列的 flex 子项,整行 `display:none` 才会连空隙一起收掉。但它在 **Windows / Linux** 上还装着侧栏折叠按钮——整行藏掉会把按钮一起藏了,就再也展不开侧栏。所以规则用 `:has()` 分流:
|
|
188
|
+
|
|
189
|
+
```css
|
|
190
|
+
[class*="_logoRow"]:not(:has([data-sidebar-toggle])) { display: none !important }
|
|
191
|
+
[class*="_logoRow"]:has([data-sidebar-toggle]) [class*="_brand"] { display: none !important }
|
|
192
|
+
[class*="_root"]:not([class*="_collapsed"]) [class*="_logoRow"]:has([data-sidebar-toggle]) {
|
|
193
|
+
height: 0 !important; min-height: 0 !important; padding: 0 !important;
|
|
194
|
+
overflow: visible !important; align-items: flex-start !important;
|
|
195
|
+
justify-content: flex-end !important;
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
macOS 桌面端品牌行只有装饰用的 span(折叠按钮在上方那条 `topStrip` 里),所以整行隐藏。其它平台那一行里确实装着折叠按钮,藏掉就再也展不开侧栏,于是改成**只交还高度、不交还按钮**:
|
|
200
|
+
|
|
201
|
+
- 行高和内边距压成 0,`overflow: visible` 让按钮画在外面;
|
|
202
|
+
- **web 端**没有窗口标题栏,按钮放到侧栏右缘外的边沟里(`left: calc(var(--dsh-sidebar-width) + 8px)`,跟随侧栏拖宽;`position: fixed` 也让它不受侧栏列 `overflow: hidden` 裁剪);
|
|
203
|
+
- **Windows 桌面端**的按钮由外壳固定在标题栏(`[data-windows-titlebar] .toggle { position: fixed; left: 12px }`),本条选择器特异性更高,所以用 `html:not([data-windows-titlebar])` 把它排除在外,桌面端该按钮仍在标题栏原位;
|
|
204
|
+
- 侧栏折叠成窄条时恢复 28px 行高,否则收起来就展不开了。
|
|
205
|
+
|
|
206
|
+
全程纯 CSS:**没有 JS、没有定时器、没有强制布局**,也不依赖外壳配合。`data-sidebar-toggle` 是侧栏自己的属性,比 CSS Module 类名稳定。
|
|
207
|
+
|
|
208
|
+
## 藏了什么
|
|
209
|
+
|
|
210
|
+
1. **顶部品牌行** —— deepseek HARNESS 那一行。
|
|
211
|
+
2. **「新会话」按钮** —— 品牌行下面那一行。
|
|
212
|
+
3. **面板列表里的「更多」** —— `插件 / 自动化任务 / 上下文洞察 / 更多` 的最后一行。
|
|
213
|
+
|
|
214
|
+
三条都由 `@deepseek-ai/dsh-client-ui-sidebar` 直接渲染进列,不是 slot 注册项,该插件行也没有 Config,所以没有「卸载」钩子和配置开关。
|
|
215
|
+
|
|
216
|
+
品牌行里那个标志本身是个 slot(`sidebar.brand.mark`,没注册时回落到 FishLogo)。隐藏品牌行等于让这个 slot 看不见——目前没人往里注册东西,但如果你以后装了换 logo 的插件,它会跟着一起不可见。
|
|
217
|
+
|
|
218
|
+
## 为什么直接藏是安全的
|
|
219
|
+
|
|
220
|
+
它们和下面的面板列表是同一列的正常流式兄弟节点,外面没有包裹元素(「新会话」的 Tooltip 是 cloneElement,不产生包裹层),因此 `display:none` 会把它们连同外边距一起从布局里拿掉,下面的内容整体上移。
|
|
221
|
+
|
|
222
|
+
新建会话本身不受影响:快捷键和工作区那行的 `+` 都还在。
|
|
223
|
+
|
|
224
|
+
## 「更多」一共三处,但只有两处写着这两个字
|
|
225
|
+
|
|
226
|
+
同一个来源(`@deepseek-ai/dsh-client-ui-entry-customization`,插件页里叫「界面自定义」)注册进三个 slot:
|
|
227
|
+
|
|
228
|
+
| 位置 | 长相 | 本插件 |
|
|
229
|
+
|---|---|---|
|
|
230
|
+
| 左栏面板列表 | 文字「更多」 | 隐藏 |
|
|
231
|
+
| 右侧栏起始页 | 文字「更多」 | 保留 |
|
|
232
|
+
| 会话头部 View 标签行 | 只有 `⋯` 图标(aria-label 才是「更多」) | 保留 |
|
|
233
|
+
|
|
234
|
+
两条规则都限定在 `_panelList` 内:右侧栏那份用了同名的 `_moreAnchor` 类(`F6Huca_moreAnchor`),不加作用域会把它一起藏掉——这正是第一版犯过的错。会话头部那个是 `_viewsMore` 图标按钮,从未被影响。
|
|
235
|
+
|
|
236
|
+
## 「更多」的取舍
|
|
237
|
+
|
|
238
|
+
「更多」只在 `sidebar.panellist.actions` 有注册项时才渲染(今天只有一项,来自 `@deepseek-ai/dsh-client-ui-entry-customization`)。它不是折叠箭头,菜单里是**面板的固定 / 取消固定**,以及插件浏览和创造模式草稿——而固定/取消固定**只有这个菜单里有**。所以藏掉它,就等于以后面板一律保持列在侧栏(目前三个面板都已固定,现状不变)。
|
|
239
|
+
|
|
240
|
+
官方更彻底的做法是在 profile 里禁用那一行:
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
- id: entry-customization
|
|
244
|
+
disabled: true
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
它由 `@deepseek-ai/dsh-web-app` 的 patch 插入。官方 README 写明:三个区域只在 actions slot 有注册项时显示「更多」,卸载本包会移除三个按钮——也就是左栏、会话 View 标签、右侧栏起始页一起没。它和 CSS 隐藏丢的是同一个控制权,却多影响两个区域,所以这里选了只藏一处的做法。
|
|
248
|
+
|
|
249
|
+
## 实现
|
|
250
|
+
|
|
251
|
+
- 注入一条样式:
|
|
252
|
+
- `button[class*="_newSession"] { display: none !important }`
|
|
253
|
+
- `[class*="_panelList"] [class*="_moreAnchor"]`, `[class*="_panelList"] button[aria-haspopup="menu"]` → `display: none !important`
|
|
254
|
+
- 选择器锚在 CSS Module 的**本地名后缀**上,不用构建哈希前缀(前缀每次构建都变,本地名跟随源码);「更多」另有一条纯结构选择器兜底
|
|
255
|
+
- 样式表带 `data-dsh-declutter` 标记,重复执行会就地重写而不是叠加
|
|
256
|
+
- 2 秒后自检:侧栏已渲染(存在 `_panelList`)但仍匹配不到按钮时,控制台 `console.warn` 提示选择器可能已随版本变化——不会静默失效
|
|
257
|
+
|
|
258
|
+
## 还原
|
|
259
|
+
|
|
260
|
+
在插件页面禁用或卸载本 bundle,样式表随之移除,两行立刻回来;已固定的面板不会被改动。
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
|
2
|
+
<rect x="6" y="6" width="52" height="52" rx="14" fill="#EEF4FD"/>
|
|
3
|
+
<rect x="14" y="14" width="36" height="36" rx="8" fill="#FFFFFF" stroke="#BBD3EE" stroke-width="2"/>
|
|
4
|
+
<rect x="19" y="19" width="26" height="8" rx="4" fill="#9FC0E6"/>
|
|
5
|
+
<path d="M41 18 21 38" stroke="#2C7BE5" stroke-width="4" stroke-linecap="round"/>
|
|
6
|
+
<rect x="19" y="33" width="18" height="4" rx="2" fill="#C3D8EF"/>
|
|
7
|
+
<rect x="19" y="41" width="22" height="4" rx="2" fill="#C3D8EF"/>
|
|
8
|
+
</svg>
|
package/locale/en.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-declutter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.js",
|
|
8
|
+
"./client": "./src/client.js",
|
|
9
|
+
"./locale/*.json": "./locale/*.json",
|
|
10
|
+
"./icon": "./icon.svg",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"src",
|
|
15
|
+
"cordis.patch.yml",
|
|
16
|
+
"locale/*.json",
|
|
17
|
+
"icon.svg",
|
|
18
|
+
"README.md",
|
|
19
|
+
"README.en.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"deepseek-harness",
|
|
24
|
+
"dsh",
|
|
25
|
+
"dsh-plugin",
|
|
26
|
+
"sidebar"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dsh": {
|
|
30
|
+
"bundle": {
|
|
31
|
+
"patch": "./cordis.patch.yml"
|
|
32
|
+
},
|
|
33
|
+
"client": {
|
|
34
|
+
"platform": "web",
|
|
35
|
+
"immediately": true,
|
|
36
|
+
"inject": [
|
|
37
|
+
"@deepseek-ai/dsh-client-ui-sidebar"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"author": {
|
|
42
|
+
"name": "DDDMUC",
|
|
43
|
+
"email": "175344510+DDDMUC@users.noreply.github.com"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/DDDMUC/dsh-declutter.git"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/DDDMUC/dsh-declutter#readme",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/DDDMUC/dsh-declutter/issues"
|
|
52
|
+
},
|
|
53
|
+
"description": "隐藏侧栏与会话菜单行,按 id 管理面板,可拖动排序。纯样式注入,卸载即还原。"
|
|
54
|
+
}
|