dsh-client-auto-continue 0.17.1 → 0.17.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 +28 -0
- package/README.md +6 -4
- package/README.zh.md +8 -4
- package/docs/releases/v0.17.2.md +42 -0
- package/docs/releases/v0.17.3.md +43 -0
- package/docs/screenshots/README.md +25 -0
- package/docs/screenshots/issue-72-584-after.png +0 -0
- package/docs/screenshots/issue-72-584-before.png +0 -0
- package/lib/client.js +10 -6
- package/lib/client.js.map +2 -2
- package/lib/index.js +7 -4
- package/lib/types/shared/core.d.ts +3 -2
- package/package.json +1 -1
- package/src/client/index.ts +4 -3
- package/src/client/settings-notifications.ts +2 -1
- package/src/client/styles.ts +1 -1
- package/src/index.ts +1 -1
- package/src/shared/core.ts +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.17.3](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.17.3) — 2026-11-02
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Extend the compact composer viewport fallback from 460px to 640px, covering the 584px DS-Bot / dsh-pocket layout when its query container is removed ([#72](https://github.com/HsiangNianian/dsh-auto-continue/issues/72), thanks @jasoneri)
|
|
8
|
+
- Keep the icon, switch and mode arrow available, with pause/error text below the controls
|
|
9
|
+
|
|
10
|
+
### Documentation
|
|
11
|
+
|
|
12
|
+
- Add measured 584px before/after screenshots and document restart/reload steps in both READMEs
|
|
13
|
+
|
|
14
|
+
[Upgrade instructions, screenshots and validation](docs/releases/v0.17.3.md) · [Full changes](https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.2...v0.17.3)
|
|
15
|
+
|
|
16
|
+
## [0.17.2](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.17.2) — 2026-11-02
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Use English for missing or unsupported locales, while preserving Chinese for `zh` and `zh-*`, across host prompts, browser locale synchronization and settings-save notifications ([#73](https://github.com/HsiangNianian/dsh-auto-continue/pull/73), thanks @kesha4)
|
|
21
|
+
- Keep host prompts in English when an older tab writes a raw locale such as `ru` after the browser's bounded synchronization attempts are exhausted
|
|
22
|
+
- Preserve custom prompt text and the three-write limit per active browser locale
|
|
23
|
+
|
|
24
|
+
### Maintenance
|
|
25
|
+
|
|
26
|
+
- Rebuild source maps with LF source content and enforce LF text checkouts for consistent builds across platforms
|
|
27
|
+
- Add regression coverage for missing and unsupported locales, Chinese regional tags, mixed client versions and localized save notifications
|
|
28
|
+
|
|
29
|
+
[Upgrade instructions, validation and known limits](docs/releases/v0.17.2.md) · [Full changes](https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.1...v0.17.2)
|
|
30
|
+
|
|
3
31
|
## [0.17.1](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.17.1) — 2026-10-30
|
|
4
32
|
|
|
5
33
|
### Fixed
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ Automatic recovery for [DeepSeek Harness](https://github.com/deepseek-ai/deepsee
|
|
|
47
47
|
- **Session modes** — switch auto-continue on or off beside the message input, for that conversation only. The mode menu next to the switch shows the current mode and opens Follow default, Off, Recovery only or Autonomous loop. Choices save on the host, survive restarts and sync across tabs; hiding the control does not change them
|
|
48
48
|
- **Error classification** — transient failures (network / timeout / 5xx / 429…) are auto-resumed; permanent ones are **skipped** and notified, because retrying them never helps. A failure counts as permanent when its HTTP status is 401/403 or its code/message matches auth, credential/API-key, balance/quota, unknown-model, or context-length/overflow keywords. Provider-specific exceptions can be opted into with literal custom retryable patterns; turn classification off to resume everything
|
|
49
49
|
- **Adaptive backoff** — consecutive failures wait longer each time (cooldown × factor: 20s → 40s → 80s…), capped at the max backoff, instead of hammering a broken upstream
|
|
50
|
-
- **English / Chinese localization** — the settings card
|
|
50
|
+
- **English / Chinese localization** — the settings card uses DSH's locale service. Built-in resume / guard / loop text and browser notifications use Chinese for `zh` and `zh-*` (case-insensitive), and English for every other or unset locale. Switching languages updates built-in defaults without overwriting custom text
|
|
51
51
|
- **Templated continue text** — `continueText` supports `{code}` `{message}` `{status}` `{tool}` `{turn}` `{errorCount}` `{elapsed}` placeholders, so the resume message can carry the failure context ("Continue ({tool} failed: {code})"); a **separate template** fires on `max-tokens` (e.g. "Continue the output without repeating anything already generated")
|
|
52
52
|
- **Idempotency guard** — before resuming, the plugin inspects the last tool call: if its result is unconfirmed (the turn died mid-tool, e.g. a `git push` that may have gone through), the resume message tells the model to check state first and not to rerun; if the tool is confirmed done, it says so and asks not to repeat it; a failed tool gets no guard (retrying it is the point). Both guard texts are configurable (`{tool}` / `{result}` placeholders)
|
|
53
53
|
- **Silent turn resume** — recover an observed model step or reasoning-only response that completes without visible output. A no-op turn with no model activity is left alone. Text, tool calls, images and extension blocks count as visible, including streamed output. Unobserved turns are not guessed to be silent. Explicit `no-visible-output` markers also recover after restart. Disabling **Resume silent turns** cancels queued silent sends; silent turns never reset the retry cap, even while the option is off.
|
|
@@ -100,8 +100,8 @@ DSH plugins install into a **profile** (`dsh web` → `web` profile). The comman
|
|
|
100
100
|
|
|
101
101
|
| DSH runtime | Plugin version | Configuration entry point |
|
|
102
102
|
| --- | --- | --- |
|
|
103
|
-
| **0.2.1-rc.2** | **0.17.
|
|
104
|
-
| **0.2.1-alpha.1** | **0.17.
|
|
103
|
+
| **0.2.1-rc.2** | **0.17.3 verified** | **Plugins → dsh-client-auto-continue** |
|
|
104
|
+
| **0.2.1-alpha.1** | **0.17.2 verified** | **Plugins → dsh-client-auto-continue** |
|
|
105
105
|
| **0.2.0-rc.1** | **0.12.1 or newer** | **Plugins → dsh-client-auto-continue** |
|
|
106
106
|
| **0.1.7-rc.2** | **0.11.9 or newer** | Same Plugins page |
|
|
107
107
|
| Older hosts with the legacy settings API | Legacy UI retained | **Settings → Plugins → Plugin configuration** |
|
|
@@ -223,6 +223,8 @@ The notification's **Pause this session 1h** still temporarily suspends one conv
|
|
|
223
223
|
|
|
224
224
|
To hide the controls, open **Plugins → dsh-client-auto-continue → General**, turn off **Show auto-continue switch in the composer**, then **Save**. This only changes visibility (`showComposerToggle`, default `true`). Hosts without the composer slot retain the settings card. A failed save surfaces as a DSH toast instead of inline red text, and a host that stays unavailable for three seconds announces itself once without flashing on a normal load. The switch and mode menu stay disabled while the host bridge or writable settings service is unavailable. When the composer row narrows, the same container query used by the native permission picker collapses the label to its icon and the mode menu to its arrow, keeping the switch and menu on one line.
|
|
225
225
|
|
|
226
|
+
For DS-Bot / dsh-pocket layouts that remove the query container, screens up to **640 CSS pixels** use the same icon + switch + arrow layout, with pause/error text below. After updating the plugin, restart DSH and reload the remote page to pick up the new styles.
|
|
227
|
+
|
|
226
228
|
## Configuration
|
|
227
229
|
|
|
228
230
|
On **DSH 0.1.7 / 0.2**, open **Plugins** from the main sidebar, choose **dsh-client-auto-continue**, then select a settings category. This is separate from **Settings → Built-in plugins**, which only lists component status. Older DSH versions use **Settings → Plugins → Plugin configuration**.
|
|
@@ -241,7 +243,7 @@ DSH 0.1.7 / 0.2 stores these values in the `auto-continue` entry's config in the
|
|
|
241
243
|
|
|
242
244
|
Startup recovery polls every three seconds for sessions that load late, up to `freshMs` after the engine starts. Each settled session history is inspected once. `scanLimit` limits eligible recoveries per pass, so healthy or permanent-error sessions cannot crowd out interrupted ones. Pausing suspends recovery within the same window; unloading cancels the poller.
|
|
243
245
|
|
|
244
|
-
The browser mirrors DSH's active language into the internal `locale` field.
|
|
246
|
+
The browser mirrors DSH's active language into the internal `locale` field: `zh` and `zh-*` (case-insensitive) are stored as `zh`; every other or unset locale uses `en`. The host applies the same rule when reading settings, including values such as `ru` written by an older tab, so built-in prompts stay English even if the browser's bounded sync attempts are exhausted. The stored value may remain `ru`; refreshing all tabs allows it to converge to `en`. This requires the updated host plugin to be loaded. Leave localized text fields empty or omit them to follow that language automatically; any non-empty value is treated as your own template and is never rewritten when the language changes:
|
|
245
247
|
|
|
246
248
|
```yaml
|
|
247
249
|
- id: auto-continue
|
package/README.zh.md
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
- **会话模式** — 在输入框旁用开关控制当前会话的自动继续,旁边显示当前模式的菜单可选择跟随默认、仅故障恢复或自主循环。选择保存在宿主配置里,重启后保留,并同步到其他标签页。隐藏控件不会改变模式
|
|
48
48
|
- **错误分类** — 临时性错误(网络 / 超时 / 5xx / 429 等)自动续跑; 永久性错误跳过并通知, 因为重试也没用。判定为永久性的条件: HTTP 状态码 401/403, 或 code/message 命中认证、凭据/API Key、余额/配额、模型不存在、上下文长度/超限等关键词。provider 专属例外可由用户显式填写普通文本匹配; 关闭分类后则全部自动继续
|
|
49
49
|
- **自适应退避** — 连续失败时等待时间递增(冷却 × 系数: 20s → 40s → 80s…), 有上限, 不再对故障上游狂轰滥炸
|
|
50
|
-
- **中英文本地化** —
|
|
50
|
+
- **中英文本地化** — 设置卡片使用 DSH 的语言服务。内置续跑 / 护栏 / 循环文案以及浏览器通知在 `zh` 和 `zh-*` 时使用中文(不区分大小写),其他语言或未设置语言时使用英文。切换语言只会替换内置默认值,不会覆盖用户自定义文本
|
|
51
51
|
- **模板化继续文本** — `continueText` 支持 `{code}` `{message}` `{status}` `{tool}` `{turn}` `{errorCount}` `{elapsed}` 占位符, 续跑消息可携带失败上下文(如「继续 (git push 失败: UPSTREAM)」); 达到 `max-tokens` 时使用**另一套模板**(如「继续输出, 不要重复已生成的内容」)
|
|
52
52
|
- **幂等护栏** — 续跑前检查上一步工具调用: 结果未确认(回合在工具执行中途夭折, 如 `git push` 可能已经推上去了)时, 续跑消息会提示模型先确认状态、不要重复执行; 工具已确认成功时说明已完成、请勿重复; 工具失败则不加护栏(重试本来就是目的)。两段护栏文本都可配置(支持 `{tool}` / `{result}` 占位符)
|
|
53
53
|
- **无输出回合续跑** — 已观察到模型步骤或推理回复,但回合正常结束且没有可见输出时自动恢复。没有模型活动的空回合不会触发;文本、工具调用、图片、扩展块和已显示的流式内容均算可见输出。未观察到开始的回合不会被猜测为静默。启动后也能恢复显式的 `no-visible-output` 标记。关闭开关会取消排队中的静默续跑;即使开关关闭,静默回合也不会清零重试上限。
|
|
@@ -100,8 +100,8 @@ DSH 插件安装进 **profile**(`dsh web` 对应 `web` profile)。下面的命
|
|
|
100
100
|
|
|
101
101
|
| DSH 内核 | 插件版本 | 配置入口 |
|
|
102
102
|
| --- | --- | --- |
|
|
103
|
-
| **0.2.1-rc.2** | **已验证 0.17.
|
|
104
|
-
| **0.2.1-alpha.1** | **已验证 0.17.
|
|
103
|
+
| **0.2.1-rc.2** | **已验证 0.17.3** | **插件 → dsh-client-auto-continue** |
|
|
104
|
+
| **0.2.1-alpha.1** | **已验证 0.17.2** | **插件 → dsh-client-auto-continue** |
|
|
105
105
|
| **0.2.0-rc.1** | **0.12.1 或更新版本** | **插件 → dsh-client-auto-continue** |
|
|
106
106
|
| **0.1.7-rc.2** | **0.11.9 或更新版本** | 同上,从主侧栏的插件页进入 |
|
|
107
107
|
| 使用旧设置 API 的宿主 | 保留旧版设置界面兼容 | **设置 → 插件 → 插件配置** |
|
|
@@ -220,6 +220,8 @@ dsh web
|
|
|
220
220
|
|
|
221
221
|
想隐藏控件时,进入**插件 → dsh-client-auto-continue → 常规**,关闭**在会话区显示自动继续开关**,再点**保存**。这只改变显示(`showComposerToggle`,默认 `true`)。没有会话工具栏插槽的旧宿主仍可使用设置卡片。保存失败时通过 DSH 的 toast 通知提示,不再在输入框内显示红字;宿主持续不可用超过 3 秒也会提示一次,正常加载不会闪现。宿主桥接断开或设置不可写时,开关和模式菜单不可操作。输入框这一行变窄时,和「完全权限」等原生选择器用同一套容器查询:「自动继续」文字收成图标、模式菜单收成箭头,让开关和菜单保持在同一行。
|
|
222
222
|
|
|
223
|
+
DS-Bot / dsh-pocket 布局移除查询容器时,屏幕宽度不超过 **640 CSS 像素**也会显示紧凑的「图标 + 开关 + 箭头」,暂停和错误提示放在下方。更新插件后,重启 DSH 并刷新远程页面,才能加载新样式。
|
|
224
|
+
|
|
223
225
|
## 配置
|
|
224
226
|
|
|
225
227
|
在 **DSH 0.1.7 / 0.2** 中, 从主侧栏打开**插件**, 选择 **dsh-client-auto-continue**, 再选择设置类别。**设置 → 内置插件**是单独的组件状态列表, 不能在其中编辑配置。旧版 DSH 的入口仍为**设置 → 插件 → 插件配置**。
|
|
@@ -238,7 +240,7 @@ DSH 0.1.7 / 0.2 将这些值保存在当前 profile patch 的 `auto-continue`
|
|
|
238
240
|
|
|
239
241
|
启动恢复会每三秒等待一次延迟加载的会话,在引擎启动后的 `freshMs` 时间窗结束。每个已就绪会话的历史只检查一次,`scanLimit` 只限制每轮符合条件的恢复数量,正常会话或永久错误不会挤占名额。暂停会在同一时间窗内挂起恢复,卸载插件会取消轮询。
|
|
240
242
|
|
|
241
|
-
浏览器会把 DSH 当前语言同步到内部 `locale`
|
|
243
|
+
浏览器会把 DSH 当前语言同步到内部 `locale` 字段:`zh` 和 `zh-*`(不区分大小写)保存为 `zh`,其他语言或未设置语言时使用 `en`。宿主读取配置时也按同一规则解析,因此旧标签页即使写回 `ru`、浏览器同步次数已耗尽,内置提示仍使用英文。配置值可能暂时保留为 `ru`;刷新全部标签页后可收敛为 `en`。这需要宿主已加载新版插件。本地化文本字段保持留空或直接省略时,会自动跟随语言;任何非空值都视为用户自己的模板,切换语言时不会改写:
|
|
242
244
|
|
|
243
245
|
```yaml
|
|
244
246
|
- id: auto-continue
|
|
@@ -310,6 +312,8 @@ auto-continue:
|
|
|
310
312
|
|
|
311
313
|
</details>
|
|
312
314
|
|
|
315
|
+
下表中的中文文案对应 `locale: zh`;未设置语言时使用英文默认文案(如 `Continue`)。
|
|
316
|
+
|
|
313
317
|
| 字段 | 默认 | 说明 |
|
|
314
318
|
| --- | --- | --- |
|
|
315
319
|
| 暂停自动继续 | 关 | 全局暂停: 实时与扫描都不再自动发送, 已排队的待发送也会取消 |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
0.17.2 fixes the Chinese fallback seen with third-party UI languages such as Russian, thanks to @kesha4's contribution in [#73](https://github.com/HsiangNianian/dsh-auto-continue/pull/73)
|
|
2
|
+
|
|
3
|
+
## Language fallback
|
|
4
|
+
|
|
5
|
+
- Use Chinese for `zh` and `zh-*`, ignoring case, and English for every other or unset locale
|
|
6
|
+
- Apply the same rule to browser settings synchronization, host prompts and settings-save notifications
|
|
7
|
+
- Keep prompts in English even if an older tab writes `ru` back after the browser's three-write limit is exhausted
|
|
8
|
+
- Preserve custom prompt text and the existing limit on locale writes
|
|
9
|
+
- Rebuild the source map with LF line endings and enforce LF for text checkouts
|
|
10
|
+
|
|
11
|
+
## Upgrade
|
|
12
|
+
|
|
13
|
+
This is a stable patch release on `latest`
|
|
14
|
+
|
|
15
|
+
Let active work finish and stop DSH, then update the plugin in the profile you use
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
dsh plugin --profile web add dsh-client-auto-continue@0.17.2
|
|
19
|
+
dsh web
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For the desktop app, update the plugin from the app's Plugins page in its own profile, then restart the app
|
|
23
|
+
|
|
24
|
+
Reload all open browser tabs after restarting the host so they pick up the new client too
|
|
25
|
+
|
|
26
|
+
Existing custom prompt text is preserved, so clear any text override you want to follow the built-in language defaults
|
|
27
|
+
|
|
28
|
+
If an older tab has left `ru` in the stored settings, the updated host already treats it as English; the field does not have to be rewritten for the prompts to work
|
|
29
|
+
|
|
30
|
+
**Behavior change:** profiles without a locale now use English until a Chinese UI locale is mirrored; explicit `zh` settings stay Chinese
|
|
31
|
+
|
|
32
|
+
## Validation
|
|
33
|
+
|
|
34
|
+
- Type checking, build and full regression suite
|
|
35
|
+
- DSH runtime compatibility, profile settings, migration and startup recovery tests
|
|
36
|
+
- Twelve locale and missing-value cases, plus mixed old/new tabs exhausting their write budgets
|
|
37
|
+
- Settings-save notifications and unchanged custom prompts
|
|
38
|
+
- Repeated builds produce identical artifacts, with LF source-map content matching the source files
|
|
39
|
+
|
|
40
|
+
The reporter's exact third-party language pack and a real Windows browser have not been tested
|
|
41
|
+
|
|
42
|
+
**Full changes:** https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.1...v0.17.2
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
## Mobile composer layout
|
|
2
|
+
|
|
3
|
+
The compact viewport fallback now covers screens up to **640 CSS pixels**, fixing the remaining 461–640px gap reported in [#72](https://github.com/HsiangNianian/dsh-auto-continue/issues/72)
|
|
4
|
+
|
|
5
|
+
DS-Bot can remove the composer's size-query container with `display: contents`, so container queries cannot compact the controls in that view. Extending the existing media query from 460px to 640px also covers the reporter's 584px viewport
|
|
6
|
+
|
|
7
|
+
The icon, native switch and mode-menu arrow stay available, with pause and legacy error messages below. At larger viewport widths, the existing container-based behavior still applies
|
|
8
|
+
|
|
9
|
+
### Before and after at 584px
|
|
10
|
+
|
|
11
|
+
In our Chromium reproduction, the controls shrink from **194px to 77px** and the message input grows from **230px to 347px**
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
These screenshots use the real plugin component, DSH 0.2.1-rc.2's native switch/menu and the relevant DS-Bot 0.2.5 / dsh-pocket 2.12.0 styles in a minimal composer fixture
|
|
18
|
+
|
|
19
|
+
## Upgrade
|
|
20
|
+
|
|
21
|
+
Let current work finish, stop DSH, then update the profile you use
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
dsh plugin --profile web add dsh-client-auto-continue@0.17.3
|
|
25
|
+
dsh web
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Desktop app users should update through the app's Plugins page and restart the app, since it uses its own profile
|
|
29
|
+
|
|
30
|
+
Reload open remote/browser pages after restarting so they load the new CSS. If you added a local CSS workaround, remove it after updating before checking the new layout. The breakpoint is measured in CSS pixels, not physical screen pixels; the mode options are still behind the arrow
|
|
31
|
+
|
|
32
|
+
## Validation
|
|
33
|
+
|
|
34
|
+
- Typecheck, build, full regression suite and DSH runtime compatibility tests
|
|
35
|
+
- Chromium checks at 351, 440, 460, 461, 584, 640, 641, 768 and 1024px, including paused, failed-save, read-only, saving, English, light-theme and intact-container variants
|
|
36
|
+
- Native switch, mode selection and editable input interaction
|
|
37
|
+
- 584 × 740 CSS-pixel mobile emulation with DPR 3
|
|
38
|
+
|
|
39
|
+
The reporter's actual Android device and a complete DS-Bot/Pocket session have not been tested
|
|
40
|
+
|
|
41
|
+
Thanks @jasoneri for the detailed follow-up and breakpoint measurements
|
|
42
|
+
|
|
43
|
+
**Full changes:** https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.2...v0.17.3
|
|
@@ -38,3 +38,28 @@ Save; hiding it must not change `paused`. Restore both overrides to inherited
|
|
|
38
38
|
values. Verify that navigation preserves drafts, errors in hidden categories are
|
|
39
39
|
marked, and read-only settings cannot be edited. Also check light theme and a
|
|
40
40
|
393 × 852 viewport: the repository entry condenses and stays beside the introduction.
|
|
41
|
+
|
|
42
|
+
## Issue #72: 584px viewport fallback
|
|
43
|
+
|
|
44
|
+
Captured on 2026-11-02 in Chromium 153 at a **584 × 740 CSS-pixel** viewport,
|
|
45
|
+
cropped to 584 × 240 with device scale factor 1. These are browser reproduction
|
|
46
|
+
screenshots, not captures from the reporter's Android device or a running DS-Bot session.
|
|
47
|
+
|
|
48
|
+
| Version | Screenshot | Controls | Message input |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| 0.17.2 | [Before](issue-72-584-before.png) | 194px | 230px |
|
|
51
|
+
| 0.17.3 | [After](issue-72-584-after.png) | 77px | 347px |
|
|
52
|
+
|
|
53
|
+
The fixture renders the real `AutoContinueComposerToggle`, DSH 0.2.1-rc.2's
|
|
54
|
+
native switch/menu, and the composer rules from
|
|
55
|
+
[DS-Bot 0.2.5](https://github.com/Fei2411/DS-Bot/blob/v0.2.5/ds-bot/src/client/styles.js)
|
|
56
|
+
and [dsh-pocket 2.12.0](https://github.com/shaobeichen/dsh-pocket/blob/v2.12.0/client/mobile/mobile.css.ts).
|
|
57
|
+
The surrounding composer is a minimal HTML fixture with an editable input;
|
|
58
|
+
widths are measured from its DOM. Both captures use the same markup, text and
|
|
59
|
+
styles except for the plugin's viewport fallback changing from 460px to 640px.
|
|
60
|
+
|
|
61
|
+
Browser checks covered 351, 440, 460, 461, 584, 640, 641, 768 and 1024px,
|
|
62
|
+
including paused, failed-save, read-only, saving, English, light-theme and
|
|
63
|
+
intact-container variants. The compact controls keep their accessible names,
|
|
64
|
+
the switch and native mode menu remain interactive, and pause/error text wraps
|
|
65
|
+
below the controls through 640px.
|
|
Binary file
|
|
Binary file
|
package/lib/client.js
CHANGED
|
@@ -37,6 +37,9 @@ __export(index_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(index_exports);
|
|
38
38
|
|
|
39
39
|
// src/shared/core.ts
|
|
40
|
+
function resolveLocale(locale) {
|
|
41
|
+
return typeof locale === "string" && /^zh(?:-|$)/i.test(locale) ? "zh" : "en";
|
|
42
|
+
}
|
|
40
43
|
var isSessionMode = (value) => value === "default" || value === "off" || value === "recover" || value === "loop";
|
|
41
44
|
function sessionMode(modes, sessionId) {
|
|
42
45
|
return Object.prototype.hasOwnProperty.call(modes, sessionId) && isSessionMode(modes[sessionId]) ? modes[sessionId] : "default";
|
|
@@ -64,8 +67,8 @@ var LOCALIZED_TEXT_DEFAULTS = {
|
|
|
64
67
|
}
|
|
65
68
|
};
|
|
66
69
|
var DEFAULT_CONFIG = {
|
|
67
|
-
locale: "
|
|
68
|
-
...LOCALIZED_TEXT_DEFAULTS.
|
|
70
|
+
locale: "en",
|
|
71
|
+
...LOCALIZED_TEXT_DEFAULTS.en,
|
|
69
72
|
resumeSilentTurns: true,
|
|
70
73
|
resumeCompletedTurns: false,
|
|
71
74
|
continueTextLoop: "",
|
|
@@ -954,7 +957,7 @@ var css = `
|
|
|
954
957
|
.dshAcModeTriggerLabel { display: none; }
|
|
955
958
|
}
|
|
956
959
|
/* DS-Bot can remove the query container with display: contents. */
|
|
957
|
-
@media (max-width:
|
|
960
|
+
@media (max-width: 640px) {
|
|
958
961
|
.dshAcComposer { flex-direction: column; align-items: flex-start; width: min-content; }
|
|
959
962
|
.dshAcComposer > .dshAcComposerLabel { white-space: normal; }
|
|
960
963
|
.dshAcComposerCore { gap: 5px; }
|
|
@@ -996,7 +999,7 @@ function showSettingsNotification(notice, locale, permission) {
|
|
|
996
999
|
return permission === "unsupported" ? "notification.unsupported" : permission === "failed" ? "notification.failed" : "notification.blocked";
|
|
997
1000
|
}
|
|
998
1001
|
try {
|
|
999
|
-
const copy = locale
|
|
1002
|
+
const copy = resolveLocale(locale) === "zh" ? zh : en;
|
|
1000
1003
|
const notification = new Notification(copy["notification.title"], { body: copy[message] });
|
|
1001
1004
|
notification.onclick = () => {
|
|
1002
1005
|
try {
|
|
@@ -1762,16 +1765,17 @@ function mountSettings(ctx, scope) {
|
|
|
1762
1765
|
let mirrorAttempts = 0;
|
|
1763
1766
|
const syncLocale = () => {
|
|
1764
1767
|
const active = ctx.locale.getLocale().active;
|
|
1768
|
+
const target = resolveLocale(active);
|
|
1765
1769
|
const snapshot = scope.getSnapshot();
|
|
1766
1770
|
if (!canWriteSettings(snapshot)) return;
|
|
1767
1771
|
if (mirroredLocale !== active) {
|
|
1768
1772
|
mirroredLocale = active;
|
|
1769
1773
|
mirrorAttempts = 0;
|
|
1770
1774
|
}
|
|
1771
|
-
if (snapshot.value?.locale ===
|
|
1775
|
+
if (snapshot.value?.locale === target) return;
|
|
1772
1776
|
if (mirrorAttempts >= MAX_MIRROR_ATTEMPTS) return;
|
|
1773
1777
|
mirrorAttempts += 1;
|
|
1774
|
-
void scope.set("locale",
|
|
1778
|
+
void scope.set("locale", target);
|
|
1775
1779
|
};
|
|
1776
1780
|
ctx.effect(() => scope.subscribe(syncLocale), "auto-continue: locale settings sync");
|
|
1777
1781
|
ctx.on("locale/change", syncLocale);
|