dsh-width-tiers 1.0.7 → 1.0.9
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.md +69 -82
- package/README.zh.md +54 -62
- package/lib/client.js +599 -138
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">dsh-width-tiers</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">Chat content-width tiers for the DeepSeek Harness Web GUI.</p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
width
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-width-tiers"><img alt="npm" src="https://img.shields.io/npm/v/dsh-width-tiers?style=flat-square"></a>
|
|
7
|
+
<a href="https://github.com/aaronlei/dsh-width-tiers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/aaronlei/dsh-width-tiers?style=flat-square"></a>
|
|
8
|
+
<a href="LICENSE"><img alt="MIT" src="https://img.shields.io/badge/license-MIT-yellow?style=flat-square"></a>
|
|
9
|
+
<a href="#compatibility"><img alt="DSH 0.1.7+" src="https://img.shields.io/badge/DSH-0.1.7%2B-blue?style=flat-square"></a>
|
|
10
|
+
</p>
|
|
9
11
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
The DSH Web app caps the message column — and every table inside it — at
|
|
13
|
-
`--dsh-chat-content-width` (0.1.7–0.2.0 default `clamp(680px, column × 0.64,
|
|
14
|
-
920px)`), no matter how wide your window is, so wide tables always need
|
|
15
|
-
horizontal scrolling.
|
|
16
|
-
|
|
17
|
-
This plugin sets the width per tier through the app's **native width axis**
|
|
18
|
-
(`--dsh-chat-user-width` + the app's `dsh.conversation.contentWidth`
|
|
19
|
-
preference), letting the app clamp every value to "column − 176px handle
|
|
20
|
-
budget" — so the built-in drag handles keep working:
|
|
12
|
+
## Tiers
|
|
21
13
|
|
|
22
14
|
| Tier | Content width | Sidebar |
|
|
23
|
-
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| Standard 标准 | App default: `max(680px, min(column × 0.64, 920px))` | unchanged |
|
|
17
|
+
| Medium 中等 | 1120px | unchanged |
|
|
18
|
+
| Wide 宽 | 1280px | unchanged |
|
|
19
|
+
| Ultra 超宽 | 1400px | unchanged |
|
|
20
|
+
| Full 全宽 | `max(640px, column − 176px)` | collapsed to icon rail |
|
|
21
|
+
| Custom 自定义 | width recorded from a native drag | unchanged |
|
|
22
|
+
|
|
23
|
+
Fixed and custom widths are clamped by the app to
|
|
24
|
+
`max(640px, column − 176px)`; the standard tier follows the app default
|
|
25
|
+
(680–920px). On a narrow window a wider fixed tier therefore behaves like
|
|
26
|
+
`full`.
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- Uses the app's native width axis (`--dsh-chat-user-width` and
|
|
31
|
+
`dsh.conversation.contentWidth`), so the built-in drag handles keep working.
|
|
32
|
+
- Persists the selected tier and restores it on the next visit.
|
|
33
|
+
- Follows **Settings → Language** (中文 / English).
|
|
34
|
+
- Menu supports ArrowUp/Down, Home/End, Escape and Tab, with focus restoration.
|
|
35
|
+
- Tier changes sync across tabs.
|
|
36
|
+
- Respects `prefers-reduced-motion`.
|
|
37
|
+
- Never touches the right panel. Only `full` collapses the left sidebar, and
|
|
38
|
+
you can expand it again at any time.
|
|
43
39
|
|
|
44
40
|
## Install
|
|
45
41
|
|
|
@@ -47,66 +43,57 @@ drags.
|
|
|
47
43
|
dsh plugin --profile web add dsh-width-tiers
|
|
48
44
|
```
|
|
49
45
|
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
Restart `dsh web`, then hard-refresh the page. A six-bar picker appears at the
|
|
47
|
+
bottom-right.
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
(Ctrl+Shift+R). A round button with five bars appears at the bottom-right.
|
|
49
|
+
For a local checkout:
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
> plugin source, re-sync the copy (e.g. `rsync -a --delete --exclude .git
|
|
60
|
-
> /path/to/dsh-width-tiers/ ~/.dsh/profiles/web/node_modules/dsh-width-tiers/`)
|
|
61
|
-
> or re-install after removing it, then restart `dsh web` and hard-refresh.
|
|
51
|
+
```bash
|
|
52
|
+
dsh plugin --profile web add link:/path/to/dsh-width-tiers
|
|
53
|
+
```
|
|
62
54
|
|
|
63
55
|
## Usage
|
|
64
56
|
|
|
65
|
-
- Click the
|
|
66
|
-
- `
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## Language
|
|
74
|
-
|
|
75
|
-
All picker copy (tier labels, button `aria-label` and title) follows the
|
|
76
|
-
app's **Settings → Language** (中文 / English), through the app's own locale
|
|
77
|
-
service. Switching the language re-renders the button and menu immediately;
|
|
78
|
-
when no explicit language is chosen the app falls back to the browser's
|
|
79
|
-
language, and Chinese is the last resort. No plugin-side setting needed.
|
|
57
|
+
- Click the picker and choose a tier.
|
|
58
|
+
- Picking `Custom` before the first drag opens a guide at the right edge; drag
|
|
59
|
+
a native handle to record a width.
|
|
60
|
+
- Dragging any native handle switches to `Custom`; the plugin steps aside while
|
|
61
|
+
you drag.
|
|
62
|
+
- `Standard` clears the width preference and returns to the app default.
|
|
63
|
+
- `Full` collapses the left sidebar; the icon rail stays available.
|
|
80
64
|
|
|
81
65
|
## How it works
|
|
82
66
|
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- Dictionaries are registered with the app's **locale service**
|
|
92
|
-
(`ctx.locale.register` / `bind`) and re-rendered through its change
|
|
93
|
-
subscription, so the copy always matches the app's active language.
|
|
67
|
+
- Locates the conversation body that declares `--dsh-chat-content-width`
|
|
68
|
+
(prefers `[data-conversation-content]`, skips the right sidebar's embedded
|
|
69
|
+
conversation), then writes `--dsh-chat-user-width` on its parent.
|
|
70
|
+
- Stores the configured target in the app preference; only the inline width is
|
|
71
|
+
clamped to `max(640px, column − 176px)`.
|
|
72
|
+
- Watches the column with `ResizeObserver` so `full` follows sidebar, rightbar
|
|
73
|
+
and window changes.
|
|
74
|
+
- Drives panels through `ctx.layout` and registers copy through `ctx.locale`.
|
|
94
75
|
|
|
95
|
-
##
|
|
76
|
+
## Compatibility
|
|
96
77
|
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
- Requires the DSH Web client plugin system (dsh ≥ 0.1.0-rc.x with a `web`
|
|
101
|
-
profile). Verified on dsh 0.1.7-alpha.1 and 0.2.0-rc.2.
|
|
78
|
+
- DSH Web 0.1.7+ with a `web` profile.
|
|
79
|
+
- Width axis checked against DSH 0.2.1-rc.2: 640px floor, 176px handle budget,
|
|
80
|
+
`--dsh-chat-*` variables, `data-width-handle`, layout/locale services.
|
|
102
81
|
|
|
103
|
-
##
|
|
82
|
+
## Development
|
|
104
83
|
|
|
105
84
|
```bash
|
|
106
|
-
|
|
85
|
+
npm test
|
|
107
86
|
```
|
|
108
87
|
|
|
109
|
-
|
|
88
|
+
The test loads the shipped `lib/client.js` bundle through a DOM stub; no live
|
|
89
|
+
DSH instance is required. The package ships prebuilt `lib/` and does not
|
|
90
|
+
include a `src/` tree.
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
- Wider fixed tiers are clamped on narrow windows.
|
|
95
|
+
- A custom width dragged on a narrow window is clamped by the app before it is
|
|
96
|
+
recorded.
|
|
110
97
|
|
|
111
98
|
## License
|
|
112
99
|
|
package/README.zh.md
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">dsh-width-tiers</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">DeepSeek Harness Web GUI 的对话区内容宽度档位插件。</p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-width-tiers"><img alt="npm" src="https://img.shields.io/npm/v/dsh-width-tiers?style=flat-square"></a>
|
|
7
|
+
<a href="https://github.com/aaronlei/dsh-width-tiers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/aaronlei/dsh-width-tiers?style=flat-square"></a>
|
|
8
|
+
<a href="LICENSE"><img alt="MIT" src="https://img.shields.io/badge/license-MIT-yellow?style=flat-square"></a>
|
|
9
|
+
<a href="#兼容性"><img alt="DSH 0.1.7+" src="https://img.shields.io/badge/DSH-0.1.7%2B-blue?style=flat-square"></a>
|
|
10
|
+
</p>
|
|
8
11
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
DSH Web 把消息列——包括里面的所有表格——的宽度限制在
|
|
12
|
-
`--dsh-chat-content-width`(0.1.7–0.2.0 默认
|
|
13
|
-
`clamp(680px, 列宽 × 0.64, 920px)`),不管窗口多宽都不变,宽表格只能横向滚动。
|
|
14
|
-
|
|
15
|
-
本插件通过应用自身的**原生宽度通道**(`--dsh-chat-user-width` +
|
|
16
|
-
`dsh.conversation.contentWidth` 偏好)按档位设定宽度,由应用自身钳制到
|
|
17
|
-
「列宽 − 176px 手柄预留」,因此自带的原生拖拽手柄始终可用:
|
|
12
|
+
## 档位
|
|
18
13
|
|
|
19
14
|
| 档位 | 内容宽度 | 侧边栏 |
|
|
20
|
-
|
|
21
|
-
| 标准 |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| 标准 | 应用默认:`max(680px, min(列宽 × 0.64, 920px))` | 不动 |
|
|
22
17
|
| 中等 | 1120px | 不动 |
|
|
23
18
|
| 宽 | 1280px | 不动 |
|
|
24
19
|
| 超宽 | 1400px | 不动 |
|
|
25
|
-
| 全宽 |
|
|
26
|
-
| 自定义 |
|
|
20
|
+
| 全宽 | `max(640px, 列宽 − 176px)` | 收起为图标轨道 |
|
|
21
|
+
| 自定义 | 原生拖拽记录的宽度 | 不动 |
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
固定档和自定义宽度会被应用钳制到 `max(640px, 列宽 − 176px)`;标准档
|
|
24
|
+
使用应用默认的 680–920px。窄窗口下较宽的固定档等同「全宽」。
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
## 特性
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
- 走应用原生宽度通道(`--dsh-chat-user-width` 与
|
|
29
|
+
`dsh.conversation.contentWidth`),自带拖拽手柄始终可用。
|
|
30
|
+
- 记住当前档位,下次打开自动恢复。
|
|
31
|
+
- 跟随 **设置 → 语言**(中文 / English)。
|
|
32
|
+
- 菜单支持方向键、Home/End、Esc、Tab,并恢复焦点。
|
|
33
|
+
- 档位选择跨标签页同步。
|
|
34
|
+
- 支持 `prefers-reduced-motion`。
|
|
35
|
+
- 不碰右侧面板;只有「全宽」会收起左侧栏,随时可以再展开。
|
|
36
36
|
|
|
37
37
|
## 安装
|
|
38
38
|
|
|
@@ -40,59 +40,51 @@ DSH Web 把消息列——包括里面的所有表格——的宽度限制在
|
|
|
40
40
|
dsh plugin --profile web add dsh-width-tiers
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
`cordis.patch.yml`。
|
|
43
|
+
重启 `dsh web` 并硬刷新页面。右下角会出现六条横条的圆形按钮。
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
右下角会出现五条横条的圆形按钮。
|
|
45
|
+
本地目录:
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
> --exclude .git /path/to/dsh-width-tiers/
|
|
53
|
-
> ~/.dsh/profiles/web/node_modules/dsh-width-tiers/`)或先 remove 再 add,
|
|
54
|
-
> 然后重启 `dsh web` 并硬刷新。
|
|
47
|
+
```bash
|
|
48
|
+
dsh plugin --profile web add link:/path/to/dsh-width-tiers
|
|
49
|
+
```
|
|
55
50
|
|
|
56
51
|
## 使用
|
|
57
52
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## 多语言
|
|
65
|
-
|
|
66
|
-
选择器里的所有文案(档位名、按钮的 `aria-label` 和标题)跟随应用的
|
|
67
|
-
**设置 → 语言**(中文 / English),通过应用自身的 locale 服务实现。切换
|
|
68
|
-
语言后按钮和菜单会立即重渲染;未显式选择语言时,应用会回退到浏览器语言,
|
|
69
|
-
最后兜底中文。无需插件侧单独设置。
|
|
53
|
+
- 点击圆形按钮选择档位。
|
|
54
|
+
- 首次选择「自定义」会在右侧边缘显示引导;拖动原生手柄记录宽度。
|
|
55
|
+
- 拖动任意原生手柄都会切换到「自定义」;拖拽期间插件让位于应用。
|
|
56
|
+
- 「标准」清除宽度偏好,回到应用默认宽度。
|
|
57
|
+
- 「全宽」收起左侧栏,图标轨道仍可随时展开。
|
|
70
58
|
|
|
71
59
|
## 原理
|
|
72
60
|
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
订阅其变更事件重渲染,文案始终与应用的当前语言一致。
|
|
61
|
+
- 定位声明 `--dsh-chat-content-width` 的对话 body(优先
|
|
62
|
+
`[data-conversation-content]`,跳过右侧栏的 embedded 对话),在它的
|
|
63
|
+
父级写入 `--dsh-chat-user-width`。
|
|
64
|
+
- 应用偏好保存设定值,只有行内宽度按 `max(640px, 列宽 − 176px)` 钳制。
|
|
65
|
+
- 用 `ResizeObserver` 观察列宽,让「全宽」跟随左右栏与窗口变化。
|
|
66
|
+
- 面板操作走 `ctx.layout`,文案注册走 `ctx.locale`。
|
|
80
67
|
|
|
81
|
-
##
|
|
68
|
+
## 兼容性
|
|
82
69
|
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
已在 dsh 0.1.7-alpha.1 与 0.2.0-rc.2 上验证。
|
|
70
|
+
- DSH Web 0.1.7+,带 `web` profile。
|
|
71
|
+
- 宽度轴已按 DSH 0.2.1-rc.2 对照:640px 下限、176px 手柄预留、
|
|
72
|
+
`--dsh-chat-*` 变量、`data-width-handle`、layout/locale 服务。
|
|
87
73
|
|
|
88
|
-
##
|
|
74
|
+
## 开发
|
|
89
75
|
|
|
90
76
|
```bash
|
|
91
|
-
|
|
77
|
+
npm test
|
|
92
78
|
```
|
|
93
79
|
|
|
94
|
-
|
|
80
|
+
测试通过 DOM stub 加载已发布的 `lib/client.js`,不需要启动真实 DSH。包内
|
|
81
|
+
直接发布预构建的 `lib/`,不包含 `src/`。
|
|
82
|
+
|
|
83
|
+
## 注意
|
|
84
|
+
|
|
85
|
+
- 窄窗口下较宽的固定档位会被应用钳制。
|
|
86
|
+
- 窄窗口下拖出的自定义宽度会先被应用钳制,再被记录。
|
|
95
87
|
|
|
96
88
|
## 许可证
|
|
97
89
|
|
|
98
|
-
MIT
|
|
90
|
+
MIT — 见 [LICENSE](LICENSE)。Copyright (c) 2026 aaronlei。
|