dsh-mobile 0.8.0 → 0.8.1

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 CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  Notable changes are recorded here. GitHub Releases provide the downloadable packages and generated commit notes.
4
4
 
5
+ ## 0.8.1 - 2026-11-01
6
+
7
+ - Recognize the four-seat settings grid introduced in DSH 0.2.2-alpha.2. Preserve upstream navigation and grid placement while retaining Mobile's accessible close-button target; older two-column settings keep their existing mobile layout.
8
+ - Extend upstream compatibility checks to DSH 0.2.1-rc.5 and 0.2.2-alpha.2, including settings, directory selection, attachments, sidebar, compressed Workspace traffic and public push lifecycle checks. No Android App update is needed for this web-page adjustment.
9
+ - Give main-slot panels a coarse-pointer control-size floor, with a complete root opt-out and exclusions for switches, ranges and nested opted-out widgets. This changes control boxes, not invisible hit regions; fine-pointer geometry and scrolling are unchanged. Stop WebView font boosting from breaking plugin line boxes. Thanks @LUgABeEEE for [#319](https://github.com/saya-ch/dsh-mobile/pull/319).
10
+ - Add a bilingual **plugin mobile baseline** (L1/L2/L3 levels, number provenance, copy-paste stylesheet) as informative project guidance, not an official DSH standard. Thanks @LUgABeEEE for [#316](https://github.com/saya-ch/dsh-mobile/pull/316).
11
+ - Defer [#314](https://github.com/saya-ch/dsh-mobile/pull/314)'s native boot-batch cache pending request cancellation, durable-body consistency, clear-versus-download isolation and device benefit measurements. The candidate retains the published App's WebView-managed network/cache path and does not require an Android update.
12
+ - Local network: add **Change network** in the desktop LAN panel. Keep the existing CA paths, paired devices, enabled preference and additional trusted networks; update the interface and leaf certificate without rerunning first-time setup or firewall installation. Serialize changes with local control writes and shutdown, refresh addresses/QR data after success, and distinguish failed recovery from a restored configuration. [#317](https://github.com/saya-ch/dsh-mobile/issues/317)
13
+
5
14
  ## 0.8.0 - 2026-10-30
6
15
 
7
16
  - **iPhone / iPad Web Push:** add opt-in notifications for capable Safari Home Screen web apps on trusted HTTPS, targeting iOS/iPadOS 18.4+. Choose Questions, Plans, Approvals, Responses, Goals and Failures in **DSH Settings → General → Web push notifications**, and send a test without submitting a model request. No native iOS app, service worker or notification SaaS account is required. Thanks @chintoleung for [#297](https://github.com/saya-ch/dsh-mobile/pull/297).
package/README.en.md CHANGED
@@ -11,6 +11,7 @@
11
11
  <a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/dt/dsh-mobile?label=downloads&amp;color=2563EB" alt="total npm downloads"></a>
12
12
  <a href="https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml"><img src="https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
13
13
  <a href="https://github.com/saya-ch/dsh-mobile/releases"><img src="https://img.shields.io/badge/Android-10%2B-3DDC84?logo=android&amp;logoColor=white" alt="Android 10+"></a>
14
+ <a href="#iphone-and-ipad-home-screen-web-app-pwa"><img src="https://img.shields.io/badge/iOS%20%2F%20iPadOS-PWA-111111?logo=apple&amp;logoColor=white" alt="iOS / iPadOS Home Screen web app (PWA)"></a>
14
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-0F172A" alt="Apache-2.0"></a>
15
16
  <a href="https://github.com/awesome-dsh-plugin/awesome-dsh-plugin"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome DSH Plugin"></a>
16
17
  </p>
@@ -27,7 +28,7 @@
27
28
  <a href="#compatibility">Compatibility</a> ·
28
29
  <a href="docs/README.md">Documentation</a> ·
29
30
  <a href="#contributors">Contributors</a> ·
30
- <a href="https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.0">Release notes</a> ·
31
+ <a href="https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.1">Release notes</a> ·
31
32
  <a href="README.md">简体中文</a>
32
33
  </p>
33
34
 
@@ -35,7 +36,7 @@
35
36
  >
36
37
  > **Using an iPhone or iPad?** Use Safari or [add DSH Mobile to your Home Screen as a web app (PWA)](<#iphone-and-ipad-home-screen-web-app-pwa>)—no native iOS download needed.
37
38
  >
38
- > **Current stable release: 0.8.0**. Add **iPhone / iPad Home Screen setup and Web Push notifications**, with six categories for questions, plans, approvals, responses, goals and failures. Also improve sidebar position retention, attachment actions and slow-link transfers. [Plugin release notes and downloads](https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.0) · [Full changelog](CHANGELOG.md).
39
+ > **Current stable release: 0.8.1**. Support DSH's new settings layout, change the LAN network interface while preserving existing pairings, improve touch-control adaptation, and add mobile adaptation guidance for plugin authors. No Android app update is required. [Plugin release notes and downloads](https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.1) · [Full changelog](CHANGELOG.md).
39
40
  >
40
41
  > **Version policy**: since plugin **0.6.2**, the Android app and plugin use independent version numbers and releases. Their numbers do not need to match, and a plugin update does not imply an app update. [Compatibility notes](#compatibility).
41
42
 
@@ -444,6 +445,7 @@ On macOS, local network, cloudflared, self-hosted FRP and the own reverse proxy
444
445
 
445
446
  | DSH Mobile plugin | Verified DeepSeek Harness version |
446
447
  | --- | --- |
448
+ | `0.8.1` | Add packed boot, settings, directory selection, attachments, sidebar and compressed Workspace checks on `0.2.1-rc.5` and `0.2.2-alpha.2`; see [CI](https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml) for the complete version matrix |
447
449
  | `0.8.0` | Push public-contract, settings, encrypted-payload and tap-ownership checks are pinned to `0.2.1-rc.2 / rc.3`; see [CI](https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml) for the general boot/layout matrix. iOS device results accept contributor testing; browser checks do not establish every phone, plugin or public route |
448
450
 
449
451
  <details>
package/README.md CHANGED
@@ -11,6 +11,7 @@
11
11
  <a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/dt/dsh-mobile?label=downloads&color=2563EB" alt="npm 总下载量"></a>
12
12
  <a href="https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml"><img src="https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
13
13
  <a href="https://github.com/saya-ch/dsh-mobile/releases"><img src="https://img.shields.io/badge/Android-10%2B-3DDC84?logo=android&logoColor=white" alt="Android 10+"></a>
14
+ <a href="#iphone-与-ipad主屏幕-web-apppwa"><img src="https://img.shields.io/badge/iOS%20%2F%20iPadOS-PWA-111111?logo=apple&amp;logoColor=white" alt="iOS / iPadOS 主屏幕 Web App(PWA)"></a>
14
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-0F172A" alt="Apache-2.0"></a>
15
16
  <a href="https://github.com/awesome-dsh-plugin/awesome-dsh-plugin"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome DSH Plugin"></a>
16
17
  </p>
@@ -27,7 +28,7 @@
27
28
  <a href="#兼容性">兼容性</a> ·
28
29
  <a href="docs/README.md">文档</a> ·
29
30
  <a href="#贡献者">贡献者</a> ·
30
- <a href="https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.0">更新记录</a> ·
31
+ <a href="https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.1">更新记录</a> ·
31
32
  <a href="README.en.md">English</a>
32
33
  </p>
33
34
 
@@ -35,7 +36,7 @@
35
36
  >
36
37
  > **使用 iPhone 或 iPad?** 可以用 Safari 访问,或[添加到主屏幕作为 Web App(PWA)使用](<#iphone-与-ipad主屏幕-web-apppwa>),无需下载原生 iOS App。
37
38
  >
38
- > **当前正式版本:0.8.0**。新增 **iPhone / iPad 主屏幕 Web App 引导与网页推送通知**,支持问题、计划、审批、回复、目标和失败六类提醒;同时改善会话列表位置保持、附件操作和慢链路传输。[插件更新与下载](https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.0) · [完整更新记录](CHANGELOG.md)。
39
+ > **当前正式版本:0.8.1**。适配 DSH 新版设置布局,支持在局域网面板切换网卡并保留已有配对,改善触屏控件适配,并补充面向插件作者的移动适配指南。Android App 无需同步更新。[插件更新与下载](https://github.com/saya-ch/dsh-mobile/releases/tag/v0.8.1) · [完整更新记录](CHANGELOG.md)。
39
40
  >
40
41
  > **版本说明**:自插件 **0.6.2** 起,Android App 与插件独立编号、独立发布,版本号无需一致;插件升级不代表 App 需要同步升级。[兼容说明](#兼容性)。
41
42
 
@@ -147,6 +148,8 @@ dsh plugin --profile web add dshmarket
147
148
 
148
149
  局域网和 HTTPS 远程配对码会显示有效截止时间;超时后重新生成即可。生成新码会使旧码失效,**复制配对链接**复用当前有效码,不会另行作废二维码。电脑端的 **设备** 入口可查看和撤销局域网、远程两组授权;这与 App 中保存的电脑列表是不同的管理对象。
149
150
 
151
+ 局域网配置完成后,面板会显示 **更换网络**:重新扫描电脑当前网卡并确认后,插件保留私有 CA 与已配对设备,只重签服务器证书、更新监听地址与允许网段。局域网正在运行时切换会短暂断开已连接手机,需要用新的配对二维码重连;未运行时只保存配置,下次开启生效。
152
+
150
153
  侧栏底部有其他插件入口时,**移动访问**会收起为手机图标;悬停可查看名称,点击仍打开原面板。独占该区域时恢复文字显示。
151
154
 
152
155
  端口说明:`dsh web --port` 修改 DSH Web 上游端口(默认 3080),插件会自动跟随;`dsh-mobile setup --port` 修改 Mobile HTTPS 监听端口(默认 3443),配对二维码会包含实际端口。若 DSH Desktop 以 `--port 0` 随机端口启动,网关跟随的是**当前实际端口**,`mobile-access/setup.json` 里的 `upstreamOrigin` 只是首次配置的快照,插件启动时会把它更新为当前端口——排查时不要把它当成网关实际使用的上游。
@@ -444,6 +447,7 @@ macOS 上局域网、cloudflared、自建 FRP 与自有反向代理可用;Funn
444
447
 
445
448
  | DSH Mobile 插件 | 已验证的 DeepSeek Harness 版本与范围 |
446
449
  | --- | --- |
450
+ | `0.8.1` | 新增 `0.2.1-rc.5`、`0.2.2-alpha.2` 的打包启动与设置、目录选择、附件、侧栏、压缩 Workspace 连接检查;完整版本矩阵见 [CI](https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml) |
447
451
  | `0.8.0` | 网页推送的公共接口、设置、加密载荷与点击归属检查固定在 `0.2.1-rc.2 / rc.3`;通用启动与布局矩阵见 [CI](https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml)。iOS 真机结果采信贡献者实测;浏览器检查不代表所有手机、第三方插件或公网线路已验收 |
448
452
 
449
453
  <details>
@@ -2,6 +2,8 @@
2
2
 
3
3
  [中文](MOBILE_PLUGIN_ADAPTATION.md) · [Documentation index](README.md)
4
4
 
5
+ > The acceptance levels and where the numbers come from are in the [plugin mobile baseline](MOBILE_PLUGIN_BASELINE.en.md); this guide covers the techniques.
6
+
5
7
  This guide is for DSH plugin authors, aiming for **usable small screens without desktop regressions**. DSH Mobile provides connectivity, page layout and shared entry points; it does not rearrange every third-party plugin's internal controls. Start in a browser, then add device acceptance; an Android device is not required to begin.
6
8
 
7
9
  ## Identify where the panel is mounted
@@ -124,6 +126,22 @@ This is not a guarantee that every body child outranks every dialog. Negative va
124
126
 
125
127
  Verify actual visibility, focus and `document.elementFromPoint()` while the drawer, detail panel and settings are open, in narrow and wide layouts. The owned `smoke:plugin-portal-layers` fixture checks positive-z-index body menus and a top-layer dialog; it is not acceptance of every community plugin.
126
128
 
129
+ ## Host-provided touch floor
130
+
131
+ When a third-party panel is open in the main slot, the mobile layer provides three safety measures:
132
+
133
+ - on a coarse pointer, ordinary buttons, selects and text inputs get **44×44 CSS px minimum layout boxes**. This changes visual geometry; it is not an invisible hit-area extension. Switches, checkboxes and ranges keep their own geometry, and the panel owns multiline inputs;
134
+ - a panel root that is `width:100vw` or a fixed pixel width is capped to the available width instead of overflowing;
135
+ - the panel content can scroll and contain the gesture without also making the outer main pane a second scroll container; the plugin's own scroll container remains the first choice.
136
+
137
+ This is a **floor, not a substitute for adapting the plugin**. A panel that ships its own touch geometry opts out on its root:
138
+
139
+ ```html
140
+ <main data-dsh-adapt="off">…</main>
141
+ ```
142
+
143
+ Root opt-out also disables the sizing and outer-scroll overrides; nested groups can use the attribute to retain their own control sizes. These rules apply only to coarse pointers and leave fine-pointer geometry and scrolling unchanged. Plugin authors still own responsive adaptation; this is not a compatibility guarantee for arbitrary plugin combinations.
144
+
127
145
  ## Verification: what code checks, browsers and devices establish
128
146
 
129
147
  ### Structural checks
@@ -2,6 +2,8 @@
2
2
 
3
3
  [English](MOBILE_PLUGIN_ADAPTATION.en.md) · [返回文档索引](README.md)
4
4
 
5
+ > 验收级别与数字出处见[插件移动端基线](MOBILE_PLUGIN_BASELINE.md);本文负责做法与示例。
6
+
5
7
  这份指南面向 DSH 插件作者,目标是**小屏可用,桌面功能不回退**。DSH Mobile 提供连接、页面布局和公共入口,不会逐个重排第三方插件的内部控件。可以先用浏览器完成适配,再补充真机验证;没有 Android 设备并不妨碍开始。
6
8
 
7
9
  ## 先确认面板所在位置
@@ -124,6 +126,22 @@ h('button', { className: 'icon-button', 'aria-label': label }, h(Icon, { 'aria-h
124
126
 
125
127
  在窄屏与宽屏下,分别打开抽屉、详情和设置,检查实际可见性、焦点及 `document.elementFromPoint()` 命中。`smoke:plugin-portal-layers` 的受控场景检查正层级 body 菜单和浏览器顶层对话框,不代表所有社区插件均已验收。
126
128
 
129
+ ## 宿主兜底:触控命中区
130
+
131
+ 主槽打开第三方插件面板时,移动层会做三件兜底的事:
132
+
133
+ - 粗指针下,面板中的普通按钮、选择框和文本输入控件获得 **44×44 CSS px 的最小布局尺寸**。这会改变控件盒子及其视觉尺寸,不是不可见的命中区扩展;开关、复选框、范围滑块等控件保持自有几何,多行输入由面板自己处理;
134
+ - 面板根若是 `width:100vw` 或固定像素宽,会被收进可用宽度,不再横向溢出;
135
+ - 面板内容区可以滚动并阻止滚动链,不把整个主区也变成第二层滚动容器;插件自己的滚动容器仍是第一选择。
136
+
137
+ 这是**兜底**,不是替插件做适配。插件若自带一套触控几何、不希望被覆盖,在根节点加:
138
+
139
+ ```html
140
+ <main data-dsh-adapt="off">…</main>
141
+ ```
142
+
143
+ 根节点退出时,尺寸和外层滚动覆盖也一起退出;内部控件组也可以使用该属性保留自有控件尺寸。这些规则只在粗指针下生效,不修改细指针页面的布局或滚动。完整适配仍由插件作者按可用空间实现;这不是任意插件组合的兼容保证。
144
+
127
145
  ## 验证:代码检查、浏览器与真机分别证明什么
128
146
 
129
147
  ### 结构检查
@@ -0,0 +1,117 @@
1
+ # Plugin mobile baseline
2
+
3
+ [中文](MOBILE_PLUGIN_BASELINE.md) · [Documentation index](README.md) · [Adaptation guide (how to)](MOBILE_PLUGIN_ADAPTATION.en.md)
4
+
5
+ This document gives a plugin-owned Web panel in a browser or WebView a baseline that can be accepted or rejected: three levels, the source of every number, a stylesheet to copy, and how to prove it holds. It answers "how good is good enough"; **how** to get there is in the [adaptation guide](MOBILE_PLUGIN_ADAPTATION.en.md), and this project's own visual numbers live in the [design reference](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md).
6
+
7
+ It is an **informative adaptation guide** and does not change the existing boundary: the mobile layer owns connectivity and page layout, it does not rearrange a third-party plugin's internal controls, and a panel's small-screen usability is the plugin author's responsibility. The levels are not a release gate; they exist for issue checklists, PR self-review, or an agreement between an author and their users. Missing a level is not a defect — per the [contributing guide](https://github.com/saya-ch/dsh-mobile/blob/main/CONTRIBUTING.md), a compatibility request is not a guarantee for every third-party combination. **This baseline is this project's adaptation guidance, not an official DSH standard, and does not represent the DSH team's position.**
8
+
9
+ ## Three levels
10
+
11
+ | Level | Name | Requirement (must / should) | Typical evidence |
12
+ | --- | --- | --- | --- |
13
+ | L1 | Tappable | **Must**: main Web actions have a hit region of at least 44×44 CSS px (48px for a primary action where space allows); adjacent actions keep spacing; inputs and editable areas inherit at least 16px type; keyboard focus stays visible; no page-level horizontal overflow at 375px; collapsing width never hides the only entry point | Renders at 375px and 390px widths with hit-region measurements |
14
+ | L2 | Comfortable | **Should**: switch on the panel's **measured width** (600px or less suggested); horizontal chip/tab strips scroll sideways; inline text actions collapse to an icon with an accessible name; body text follows `--dsh-content-font-size`; edge-to-edge areas reserve `env(safe-area-inset-*)`; an independent scroll container sets `overscroll-behavior: contain`; forms collapse to one column in the narrow tier | The same panel in a narrow and a wide container |
15
+ | L3 | Regressible | **Should**: the static preview can render at a requested width; the structural assertions for L1/L2 are wired into the render check; the desktop render has a baseline to compare; device-only gaps are written down | Assertion output, screenshot baseline, PR notes |
16
+
17
+ L1 can be prechecked in a desktop browser at 390px; that does not cover a device's keyboard, text scaling or safe areas. L2 must be checked where the **panel width differs from the viewport width** (a narrow desktop column, a drawer). L3 pins the first two; it is not a new interaction requirement.
18
+
19
+ ## Where the numbers come from
20
+
21
+ Web, iOS and Android use different units and scopes. Project recommendations do not replace platform or accessibility requirements, and pt, dp and CSS px must not be treated as equivalent.
22
+
23
+ | Requirement | Source | Note |
24
+ | --- | --- | --- |
25
+ | 44×44 CSS px hit region | This project's [design reference](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md) (Web targets ≥44px, 48px for primary actions); [Apple HIG · Buttons](https://developer.apple.com/design/human-interface-guidelines/buttons) (hit region of at least 44×44 pt); [WCAG 2.2 SC 2.5.5](https://www.w3.org/WAI/WCAG22/Understanding/target-size-enhanced.html) (AAA, 44×44 CSS px) | pt, dp and CSS px are three different units; nothing is converted here, only the magnitude is shared |
26
+ | 24×24 CSS px | [WCAG 2.2 SC 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) (AA, with a spacing exception) | A minimum, not a target; this project uses 44 |
27
+ | 48dp | [Android minimum interactive component size](https://developer.android.com/reference/kotlin/androidx/compose/material/minimumInteractiveComponentSize.modifier) | Native controls only; do not convert it into a CSS px value for a Web panel |
28
+ | Input type ≥16px | [Design reference](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md) (the mobile shell already enforces it); iOS zooms the page when a focused form control's font size is below 16px | Do not shrink inputs below that to make a layout fit |
29
+ | `env(safe-area-inset-*)` | [MDN · env()](https://developer.mozilla.org/en-US/docs/Web/CSS/env) | Requires `viewport-fit=cover`; add it only where the content really reaches the edge and the shell has not already handled it |
30
+ | `@container` | [MDN · Container queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries) | Components lay out by container width; all major browsers have supported it since 2023, so keep a fluid fallback for older engines |
31
+ | `overscroll-behavior: contain` | [MDN · overscroll-behavior](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior) | Stops scroll chaining: reaching the panel's end must not drag the page behind it |
32
+ | `prefers-reduced-motion` | [MDN · prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) | Drop decorative animation; a loading indicator may stay |
33
+
34
+ ### Two common misuses of 44px
35
+
36
+ - **A hit region is not a visual size.** A round checkbox may stay visually 24px and use an associated label for its full click target; enlarging the whole card is not adaptation.
37
+ - **Do not grow hit areas by covering neighbours.** Expanded regions must not overlap adjacent controls or change wrapping and focus order; use spacing, not overlap.
38
+
39
+ ## A stylesheet to copy
40
+
41
+ Replace `plugin-panel` with your own root class. Enable `data-mobile="1"` only when the measured panel enters its narrow tier. Wide panels are unchanged; a narrow desktop column can also enable it. The switch itself (container query or measured width) is in the [adaptation guide](MOBILE_PLUGIN_ADAPTATION.en.md#adapt-to-available-space).
42
+
43
+ The attribute name is the plugin's own convention — the guide's script example uses `data-narrow`. The name does not matter; what matters is that the whole narrow tier hangs off **one** switch, and that wide panels omit it; the value names a width tier, not a device type.
44
+
45
+ ```css
46
+ /* Type follows the shell setting; without the variable it stays inherited, so the desktop is unchanged. */
47
+ .plugin-panel[data-mobile="1"] { font-size: var(--dsh-content-font-size, inherit); }
48
+
49
+ /* Apply these classes to ordinary actions/text fields, not native switches or ranges. Layout boxes change. */
50
+ .plugin-panel[data-mobile="1"] :is(.action, .icon-button, .primary-action, .text-input, select) { min-width: 44px; min-height: 44px; }
51
+ .plugin-panel[data-mobile="1"] .icon-button { min-width: 44px; }
52
+ .plugin-panel[data-mobile="1"] .primary-action { min-height: 48px; }
53
+
54
+ /* Use <label class="check-label"><input type="checkbox">Name</label>, without covering adjacent controls. */
55
+ .plugin-panel[data-mobile="1"] .check-label { display: inline-flex; align-items: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 10px; box-sizing: border-box; }
56
+ .plugin-panel[data-mobile="1"] .check-label input { width: 24px; height: 24px; margin: 0; }
57
+
58
+ /* Horizontal chip strips scroll sideways; a 1px divider would hang alone in a scrolling row. */
59
+ .plugin-panel[data-mobile="1"] .chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
60
+ .plugin-panel[data-mobile="1"] .chips::-webkit-scrollbar { display: none; }
61
+ .plugin-panel[data-mobile="1"] .chip { flex: 0 0 auto; min-height: 44px; }
62
+ .plugin-panel[data-mobile="1"] .chips .divider { display: none; }
63
+
64
+ /* Inline text actions collapse to icons; the text stays in the menu or detail view, and the accessible name must stay. */
65
+ .plugin-panel[data-mobile="1"] .action-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
66
+ .plugin-panel[data-mobile="1"] .row-action { min-width: 44px; padding: 0; justify-content: center; }
67
+
68
+ /* Hide only repeated decorative shortcuts, not the sole operating instructions. */
69
+ .plugin-panel[data-mobile="1"] .kbd { display: none; }
70
+
71
+ /* Edge-to-edge areas reserve the safe area; the panel's own scroll container stops chaining. */
72
+ .plugin-panel[data-mobile="1"] .content { padding-bottom: max(28px, calc(14px + env(safe-area-inset-bottom))); }
73
+ .plugin-panel[data-mobile="1"] .scroll-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
74
+
75
+ /* Forms collapse to one column; a multi-line input keeps a usable height. */
76
+ .plugin-panel[data-mobile="1"] .form-row { grid-template-columns: minmax(0, 1fr); }
77
+ .plugin-panel[data-mobile="1"] textarea { min-height: 96px; }
78
+
79
+ /* Collapse decorative/repeated copy only, never essential operating instructions. */
80
+ .plugin-panel[data-mobile="1"] .title { font-size: 1.2em; line-height: 1.4; }
81
+ .plugin-panel[data-mobile="1"] .subtitle { display: none; }
82
+
83
+ @media (prefers-reduced-motion: reduce) {
84
+ .plugin-panel[data-mobile="1"] .chips { scroll-behavior: auto; }
85
+ }
86
+ ```
87
+
88
+ ## How to prove it
89
+
90
+ | Level | Evidence | Note |
91
+ | --- | --- | --- |
92
+ | L1 | A 390×844 render plus hit-region measurements | Measure the layout box, not the CSS declaration; a `min-height` can still be compressed, clipped or covered |
93
+ | L2 | One render in a narrow container and one in a wide container | The narrow container means a ≤600px panel, not a shrunken viewport — that is exactly what the measured width or container query is for |
94
+ | L3 | Structural assertions + a desktop baseline | Assert at least: the narrow marker appears, the 44px rule exists, the safe-area and type rules exist, every narrow rule is scoped to the same switch, and collapsed actions keep an accessible name; compare the desktop baseline in a fixed browser/font/viewport environment and explain expected differences; string-presence assertions do not replace geometry or interaction checks |
95
+
96
+ Static checks establish only the declarations they inspect. Geometry and hit testing need a browser, and the following additionally need device evidence with explicit coverage:
97
+
98
+ - the visible area and focus scrolling after the soft keyboard opens;
99
+ - the real `env(safe-area-inset-*)` values;
100
+ - momentum scrolling and rebound;
101
+ - wrapping and truncation at a larger system font size.
102
+
103
+ ## How this sits with the other documents
104
+
105
+ | Document | Question it answers |
106
+ | --- | --- |
107
+ | [Adaptation guide](MOBILE_PLUGIN_ADAPTATION.en.md) | How: host behavior, example code, item-by-item technique, overlay layering |
108
+ | This document | What counts as done: levels, number provenance, baseline stylesheet, acceptance evidence |
109
+ | [Design reference](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md) | This project's visual and numeric rules (color, type, radius, hit region) |
110
+ | [Contributing guide](https://github.com/saya-ch/dsh-mobile/blob/main/CONTRIBUTING.md) | How to submit, which checks to run, the boundary of compatibility requests |
111
+
112
+ ## Boundaries
113
+
114
+ - It covers plugin-owned Web panels only; background services and plugins that depend on native windows are out of scope.
115
+ - It does not ask for a redesign and does not justify a second component tree per platform; lists and details should stay one implementation.
116
+ - The mobile layer must not inject third-party CSS by class name: a renamed class breaks the rule and the desktop at the same time.
117
+ - Do not use a user agent or `pointer: coarse` alone instead of a measured width; hybrid input (touch laptops, tablets with a mouse) makes both signals wrong.
@@ -0,0 +1,117 @@
1
+ # 插件移动端基线
2
+
3
+ [English](MOBILE_PLUGIN_BASELINE.en.md) · [返回文档索引](README.md) · [适配指南(做法与示例)](MOBILE_PLUGIN_ADAPTATION.md)
4
+
5
+ 这份文档给**插件自有的网页面板(浏览器或 WebView)**定一个可验收的基线:三级要求、每条数字的出处、一份可直接复制的样式,以及怎么证明它成立。它回答「做到什么程度算过」;怎么做见[适配指南](MOBILE_PLUGIN_ADAPTATION.md),本项目自己的视觉与数值口径见[设计参考](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md)。
6
+
7
+ 这是**说明性适配指南**,不改变既有边界:移动层负责连接与页面布局,不重排第三方插件的内部控件;面板在小屏上是否好用由插件作者负责。级别不是发布门槛,用于 issue 勾选、PR 自检,或作者与用户之间的约定。未达标不等于缺陷——按[贡献指南](https://github.com/saya-ch/dsh-mobile/blob/main/CONTRIBUTING.md)的口径,兼容请求不构成对任意第三方组合的承诺。**本基线是本项目的适配建议,不是 DSH 官方标准,也不代表 DSH 官方立场。**
8
+
9
+ ## 三个级别
10
+
11
+ | 级别 | 名称 | 要求(必须 / 应当) | 典型证据 |
12
+ | --- | --- | --- | --- |
13
+ | L1 | 可点 | **必须**:主要 Web 操作命中区至少 44×44 CSS px(主操作有空间时 48px);相邻操作保留间距;输入/可编辑区域继承不小于 16px 的字号;键盘焦点可见;375px 宽下没有页面级横向溢出;不因收窄而隐藏唯一入口 | 375px 与 390px 宽度的截图,附命中区尺寸 |
14
+ | L2 | 顺手 | **应当**:按面板**实测宽度**切档(建议 ≤600px);横向 chip/标签条可横滑;行内文字动作收成图标并保留可访问名称;正文跟随 `--dsh-content-font-size`;贴边区域让出 `env(safe-area-inset-*)`;独立滚动容器设 `overscroll-behavior: contain`;表单在窄档收成单列 | 同一面板在窄容器与宽容器各一张 |
15
+ | L3 | 可回归 | **应当**:静态预览能指定渲染宽度;把 L1/L2 的结构断言接进渲染检查;桌面渲染有基线可对比;真机未验证项写明 | 断言输出、截图基线、PR 说明 |
16
+
17
+ L1 可以先在 390px 桌面浏览器预检,但这不覆盖真机键盘、字体缩放和安全区;L2 必须在**面板宽度不等于视口宽度**的场合验(桌面窄栏、抽屉);L3 是把前两级钉住的手段,不是新的交互要求。
18
+
19
+ ## 数字与出处的对照
20
+
21
+ Web、iOS 和 Android 的单位与适用范围不同。项目建议不代替平台规范或无障碍要求,也不能把 pt、dp 与 CSS px 直接等同。
22
+
23
+ | 要求 | 出处 | 说明 |
24
+ | --- | --- | --- |
25
+ | 44×44 CSS px 命中区 | 本项目[设计参考](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md)(Web 目标 ≥44px,主操作 48px);[Apple HIG · Buttons](https://developer.apple.com/design/human-interface-guidelines/buttons)(命中区至少 44×44 pt);[WCAG 2.2 SC 2.5.5](https://www.w3.org/WAI/WCAG22/Understanding/target-size-enhanced.html)(AAA,44×44 CSS px) | pt、dp、CSS px 是三种单位,不做换算;这里只是沿用同一个数量级 |
26
+ | 24×24 CSS px | [WCAG 2.2 SC 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)(AA,含间距例外) | 这是最小值,不是目标;本项目取 44 |
27
+ | 48dp | [Android 交互组件最小尺寸](https://developer.android.com/reference/kotlin/androidx/compose/material/minimumInteractiveComponentSize.modifier) | 只适用于原生控件;不要换算成 CSS px 写进 Web 面板 |
28
+ | 输入字号 ≥16px | [设计参考](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md)(移动外壳已强制);iOS 在聚焦字号小于 16px 的表单控件时会自动放大页面 | 插件不要把输入框写成更小的固定字号来「塞进」布局 |
29
+ | `env(safe-area-inset-*)` | [MDN · env()](https://developer.mozilla.org/en-US/docs/Web/CSS/env) | 需要 `viewport-fit=cover`;只在确实贴边、且外壳未处理的区域追加,避免重复留白 |
30
+ | `@container` | [MDN · 容器查询](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries) | 组件按容器宽度排版;主流浏览器自 2023 年起支持,更旧的引擎要保留流式回退 |
31
+ | `overscroll-behavior: contain` | [MDN · overscroll-behavior](https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior) | 阻止滚动链:面板到底时不要把背后的页面带走 |
32
+ | `prefers-reduced-motion` | [MDN · prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) | 收起装饰性动画;加载指示可以保留 |
33
+
34
+ ### 关于 44px 的两点常见误用
35
+
36
+ - **命中区不是视觉尺寸**。圆形勾选框可以保持 24px 视觉,用关联的标签提供完整点击区域;把整张卡片放大不是适配。
37
+ - **不要把相邻操作「盖」大**。扩大的命中区不应覆盖邻居,也不应改变换行与焦点顺序;用间距而不是重叠来满足 44px。
38
+
39
+ ## 一份可复制的基线样式
40
+
41
+ 把 `plugin-panel` 换成你自己的根类名;`data-mobile="1"` 只在面板实测宽度进入窄档时启用,宽档不命中这些规则,桌面窄栏也可以启用。开关本身(容器查询或实测宽度)见[适配指南](MOBILE_PLUGIN_ADAPTATION.md#按可用空间适配)。
42
+
43
+ 属性名是插件自己的约定,指南的脚本示例用的是 `data-narrow`;叫什么不重要,重要的是**整档样式只挂在同一个开关上**,并且宽档不出现该值;它表示窄档,不是设备类型。
44
+
45
+ ```css
46
+ /* 字号跟随外壳设置;没有该变量时保持继承,不影响桌面。 */
47
+ .plugin-panel[data-mobile="1"] { font-size: var(--dsh-content-font-size, inherit); }
48
+
49
+ /* 给普通动作和文本输入加对应类;不要用于原生开关或范围滑块。这会改变布局尺寸。 */
50
+ .plugin-panel[data-mobile="1"] :is(.action, .icon-button, .primary-action, .text-input, select) { min-width: 44px; min-height: 44px; }
51
+ .plugin-panel[data-mobile="1"] .icon-button { min-width: 44px; }
52
+ .plugin-panel[data-mobile="1"] .primary-action { min-height: 48px; }
53
+
54
+ /* 使用 <label class="check-label"><input type="checkbox">名称</label>,不覆盖邻近控件。 */
55
+ .plugin-panel[data-mobile="1"] .check-label { display: inline-flex; align-items: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 10px; box-sizing: border-box; }
56
+ .plugin-panel[data-mobile="1"] .check-label input { width: 24px; height: 24px; margin: 0; }
57
+
58
+ /* 横向 chip 条改为可横滑;分隔条在横滑行里会挂成孤线。 */
59
+ .plugin-panel[data-mobile="1"] .chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
60
+ .plugin-panel[data-mobile="1"] .chips::-webkit-scrollbar { display: none; }
61
+ .plugin-panel[data-mobile="1"] .chip { flex: 0 0 auto; min-height: 44px; }
62
+ .plugin-panel[data-mobile="1"] .chips .divider { display: none; }
63
+
64
+ /* 行内文字动作收成图标;文字仍留在菜单/详情里,可访问名称不能丢。 */
65
+ .plugin-panel[data-mobile="1"] .action-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
66
+ .plugin-panel[data-mobile="1"] .row-action { min-width: 44px; padding: 0; justify-content: center; }
67
+
68
+ /* 仅隐藏重复的装饰性快捷键提示,唯一的操作说明应保留。 */
69
+ .plugin-panel[data-mobile="1"] .kbd { display: none; }
70
+
71
+ /* 贴边区域让出安全区;面板自己的滚动容器阻止滚动链。 */
72
+ .plugin-panel[data-mobile="1"] .content { padding-bottom: max(28px, calc(14px + env(safe-area-inset-bottom))); }
73
+ .plugin-panel[data-mobile="1"] .scroll-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
74
+
75
+ /* 表单收成单列,多行输入保留可用高度。 */
76
+ .plugin-panel[data-mobile="1"] .form-row { grid-template-columns: minmax(0, 1fr); }
77
+ .plugin-panel[data-mobile="1"] textarea { min-height: 96px; }
78
+
79
+ /* 仅对装饰性、重复文案使用收起规则,不隐藏必要操作说明。 */
80
+ .plugin-panel[data-mobile="1"] .title { font-size: 1.2em; line-height: 1.4; }
81
+ .plugin-panel[data-mobile="1"] .subtitle { display: none; }
82
+
83
+ @media (prefers-reduced-motion: reduce) {
84
+ .plugin-panel[data-mobile="1"] .chips { scroll-behavior: auto; }
85
+ }
86
+ ```
87
+
88
+ ## 怎么证明
89
+
90
+ | 级别 | 证据 | 说明 |
91
+ | --- | --- | --- |
92
+ | L1 | 390×844 渲染 + 命中区尺寸 | 用实际布局盒量,不要只读 CSS 声明;`min-height` 仍可能被压缩、裁切或遮挡 |
93
+ | L2 | 窄容器与宽容器各一张 | 窄容器指 ≤600px 的面板,不是把视口缩小;这正是实测宽度与容器查询要解决的问题 |
94
+ | L3 | 结构断言 + 桌面基线 | 断言至少覆盖:窄档标记出现、44px 规则存在、安全区与字号变量存在、窄档规则都挂在同一个开关下、被收起的动作仍有可访问名称;在固定浏览器、字体和尺寸下对比桌面基线,说明预期差异;字符串存在断言不代替几何和交互检查 |
95
+
96
+ 静态检查只能证明相应声明存在。几何和命中需要浏览器验证,以下项目还需真机验证并注明覆盖范围:
97
+
98
+ - 软键盘弹出后的可视区与焦点滚动;
99
+ - 真实的 `env(safe-area-inset-*)` 数值;
100
+ - 惯性滚动与回弹手感;
101
+ - 系统字号放大后的换行与截断。
102
+
103
+ ## 与既有文档的分工
104
+
105
+ | 文档 | 回答的问题 |
106
+ | --- | --- |
107
+ | [适配指南](MOBILE_PLUGIN_ADAPTATION.md) | 怎么做:宿主行为、示例代码、逐项做法、浮层层级 |
108
+ | 本文 | 做到什么算过:级别、数字出处、基线样式、验收口径 |
109
+ | [设计参考](https://github.com/saya-ch/dsh-mobile/blob/main/design-system/dsh-mobile/MASTER.md) | 本项目自己的视觉与数值口径(颜色、字号、圆角、命中区) |
110
+ | [贡献指南](https://github.com/saya-ch/dsh-mobile/blob/main/CONTRIBUTING.md) | 怎么提交、跑哪些检查、兼容请求的边界 |
111
+
112
+ ## 边界
113
+
114
+ - 只覆盖插件自有的网页面板(浏览器或 WebView);后台服务型、依赖原生窗口的插件不适用。
115
+ - 不要求重做交互,不要求复制一套移动端组件树;详情与列表仍应只有一份实现。
116
+ - 不在移动层按类名注入第三方 CSS:类名一变就碎,而且会同时影响桌面。
117
+ - 不以 UA 或单纯 `pointer: coarse` 代替实测宽度;混合输入设备(触屏笔记本、带鼠标的平板)会让这两类判断都失真。
package/docs/README.md CHANGED
@@ -43,6 +43,7 @@
43
43
  ## 开发与安全 / Development and security
44
44
 
45
45
  0.6.3 的 [扩展 Worker 指南](EXTENSION_WORKERS.md)/[Worker guide](EXTENSION_WORKERS.en.md) 介绍按扩展启用、预算与显式恢复;此功能不迁移普通 Cordis 插件,也不是权限沙箱。
46
+ [插件移动端基线](MOBILE_PLUGIN_BASELINE.md)/[Plugin mobile baseline](MOBILE_PLUGIN_BASELINE.en.md) 把「小屏可用、桌面不回退」拆成三级要求与验收证据;做法与示例见[适配指南](MOBILE_PLUGIN_ADAPTATION.md)/[guide](MOBILE_PLUGIN_ADAPTATION.en.md)。
46
47
 
47
48
  - [贡献指南](https://github.com/saya-ch/dsh-mobile/blob/main/CONTRIBUTING.md):本地检查、浏览器与 Android 验证、发布要求。
48
49
  - [安全说明](../SECURITY.md):配对授权、TLS、组件清理与私密漏洞反馈。