dsh-quick-phrases 0.10.0 → 0.10.2

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 CHANGED
@@ -7,7 +7,9 @@
7
7
 
8
8
  语言:[简体中文](docs/DETAIL.md) · [English](docs/DETAIL.en.md) · [Español](docs/DETAIL.es.md) · [Français](docs/DETAIL.fr.md) · [Deutsch](docs/DETAIL.de.md) · [Русский](docs/DETAIL.ru.md) · [Português](docs/DETAIL.pt.md)
9
9
 
10
- 给 DeepSeek Harness(DSH)的输入框加一排快捷短语按钮:`继续`、`提交`、`推送`、`发版` 这类天天要打的字,点一下就送进输入框或直接发出。按钮上显示的**名称**和真正发出的**内容**分开编辑,所以按钮可以很短,话可以很长。
10
+ 给 DeepSeek Harness(DSH)的输入框加一排快捷短语按钮:`继续`、`提交`、`推送`、`发版` 这类天天要打的字,点一下就送进输入框或直接发出。
11
+
12
+ 按钮上显示的**名称**和真正发出的**内容**分开编辑,所以按钮可以很短,话可以很长。
11
13
 
12
14
  > Composer decoration for DeepSeek Harness: a row of quick-phrase chips whose captions and sent text are edited separately, plus a management page in Settings.
13
15
 
@@ -15,6 +17,21 @@
15
17
 
16
18
  > 文档里的截图都是**界面示意图**:由 `test/preview.mjs` 把真实组件套上宿主主题 token 渲染出来,不是真机截屏。实际观感以运行中的界面为准。
17
19
 
20
+ **目录**
21
+
22
+ - [功能](#功能)
23
+ - [安装](#安装)
24
+ - [使用](#使用)
25
+ - [放在哪里](#放在哪里)
26
+ - [管理页](#管理页)
27
+ - [收起与隐藏](#收起与隐藏)
28
+ - [窄屏自动舍弃](#窄屏自动舍弃)
29
+ - [数据与隐私](#数据与隐私)
30
+ - [开发](#开发)
31
+ - [文档](#文档)
32
+ - [许可证](#许可证)
33
+ - [支持本项目](#支持本项目)
34
+
18
35
  ## 功能
19
36
 
20
37
  - **一排短语按钮**:显示名称与发送内容分离,默认四条:继续 / 提交 / 推送 / 发版。
@@ -29,7 +46,9 @@
29
46
 
30
47
  ## 安装
31
48
 
32
- 前置:DSH 桌面端或 Web 端,支持版本 `^0.2.2-rc.3`(0.2.2-rc.3 起,不含 0.3.0 及以上)——与包内 `engines.dsh` 及市场索引 `versions[].engines.dsh` 一致。插件分类为**界面增强(UI Enhancements)**,与市场索引 `metadata.categories.ui` / `metadata.category: ui` 一致。插件没有运行时依赖,也没有构建步骤。
49
+ - 前置:DSH 桌面端或 Web 端,支持版本 `^0.2.2-rc.3`(0.2.2-rc.3 起,不含 0.3.0 及以上)——与包内 `engines.dsh` 及市场索引 `versions[].engines.dsh` 一致。
50
+ - 插件分类为**界面增强(UI Enhancements)**,与市场索引 `metadata.categories.ui` / `metadata.category: ui` 一致。
51
+ - 插件没有运行时依赖,也没有构建步骤。
33
52
 
34
53
  **方式 A(npm,推荐)**
35
54
 
@@ -43,7 +62,7 @@ dsh plugin --profile <你的 profile> add dsh-quick-phrases
43
62
 
44
63
  在 DSH 里打开 **Plugins → Discover → Index sources**,添加本仓库的索引地址:
45
64
 
46
- ```
65
+ ```text
47
66
  https://raw.githubusercontent.com/pengtang1024/dsh-quick-phrases/main/index.json
48
67
  ```
49
68
 
@@ -160,7 +179,7 @@ node test/preview.mjs --shot # 再用无头 Chromium 截图
160
179
 
161
180
  目录结构:
162
181
 
163
- ```
182
+ ```text
164
183
  client.js 客户端插件全部逻辑(ModuleLoader 工厂 + 三个插槽组件)
165
184
  index.js Host 侧空壳(export function apply() {})
166
185
  cordis.patch.yml bundle 插入行
@@ -2,6 +2,17 @@
2
2
 
3
3
  这份文档写给要继续改 `client.js` 的人:它怎么挂进 DSH、数据放在哪、以及哪些约束不能碰。
4
4
 
5
+ ## 目录
6
+
7
+ - [插件形态](#插件形态)
8
+ - [客户端入口](#客户端入口)
9
+ - [插槽](#插槽)
10
+ - [数据层](#数据层)
11
+ - [宽度降级(按实际宽度逐级舍弃)](#宽度降级按实际宽度逐级舍弃)
12
+ - [样式](#样式)
13
+ - [测试](#测试)
14
+ - [兼容性注意](#兼容性注意)
15
+
5
16
  ## 插件形态
6
17
 
7
18
  DSH 的插件是「bundle」:一个 npm 包 + 一行 Cordis patch。本仓库的 Host 侧是空壳,所有能力都在客户端:
@@ -15,7 +26,9 @@ DSH 的插件是「bundle」:一个 npm 包 + 一行 Cordis patch。本仓库
15
26
  | `icon.svg` | 插件列表图标 |
16
27
  | `index.json` | 插件市场索引(format 1),让 Discover 能搜到并安装本插件 |
17
28
 
18
- `package.json` 里声明 `dsh.client.platform = "web"`、`immediately: true`、`inject: ["@deepseek-ai/dsh-client-ui-conversation"]`;`dsh.bundle.patch` 指向 patch 文件。`engines.dsh` 声明兼容的 DSH 版本,市场索引与 `plugin_manager` 用它判断可装性。没有构建步骤,改完 `client.js` 让渲染进程重载即可。
29
+ `package.json` 里声明 `dsh.client.platform = "web"`、`immediately: true`、`inject: ["@deepseek-ai/dsh-client-ui-conversation"]`;`dsh.bundle.patch` 指向 patch 文件。`engines.dsh` 声明兼容的 DSH 版本,市场索引与 `plugin_manager` 用它判断可装性。
30
+
31
+ > 没有构建步骤,改完 `client.js` 让渲染进程重载即可。
19
32
 
20
33
  ## 客户端入口
21
34
 
@@ -34,7 +47,7 @@ return {
34
47
 
35
48
  - `require('react')` 取的是 DSH 浏览器端的 React,不需要打包。
36
49
  - 所有注册都放进 `apply`,用 `ctx.slots.inject` 等待插槽出现;插槽消失时框架会自动调用注册返回的清理函数。
37
- - 组件不能往 `document.body` 追加东西,也不能读别的插件的 DOM。
50
+ > 组件不能往 `document.body` 追加东西,也不能读别的插件的 DOM。
38
51
 
39
52
  ## 插槽
40
53
 
@@ -74,7 +87,7 @@ return {
74
87
 
75
88
  可见性判断也在 `DockChips` 里,顺序固定:先把 hook 全部跑完(数量不随状态变化),再依次判断位置、彻底隐藏、折叠、宽度降级:
76
89
 
77
- ```
90
+ ```js
78
91
  if (current !== spec.value) return null // 只有选中位置的那一行渲染
79
92
  if (hidden) return null // 彻底隐藏:什么都不渲染,连胶囊都不留
80
93
  hasDraft = draft.trim() !== '' || attachments > 0
@@ -116,11 +129,15 @@ plan = fitRowToWidth(available, {...}) // 只在未折叠时按可用宽度
116
129
  - 主按钮:`--dsw-alias-button-primary-fill` + `--dsw-alias-label-primary-foreground`(与宿主 `Button` 的 primary 变体一致,深浅主题都对得上)
117
130
  - 焦点:`--dsw-focus-ring-width` / `--dsw-focus-ring-color`
118
131
 
119
- 不要写死颜色,也不要用 `prefers-color-scheme` 判断主题——DSH 用 `data-ds-dark-theme` 切换,硬编码会两边都对不上。
132
+ > 不要写死颜色,也不要用 `prefers-color-scheme` 判断主题——DSH 用 `data-ds-dark-theme` 切换,硬编码会两边都对不上。
120
133
 
121
134
  短语行的宽度拟合相关样式:`DOCK_CSS` 里 `.dqp-dock` 用 `display:flex; flex-wrap:wrap; gap:6px; min-width:0`,`.dqp-chip` 是 `flex:0 0 auto` 并带 `max-width`(普通行 200px / 工具行 130px)——胶囊不收缩、超出就换行,实测宽度才稳定可缓存;`CHIP_GAP = 6` 与 CSS 的 `gap:6px` 保持一致,拟合计算才和实际占用对得上。工具行 `.dqp-dock-tool` 另有 `flex-wrap:nowrap; overflow-x:auto`,窄屏在滚动之上仍先按上述顺序舍弃控件。
122
135
 
123
- 设置 / 管理页(`MANAGER_CSS`)另有一套小屏排版优化, `@media (max-width:560px)` 段:选项标签与下拉同行(长标签自然换行)、每项说明完整保留在控件下方、所有按钮与图标触控目标 ≥36px、textarea 最小高度 52px、预览改为 `white-space:normal` 可换行不再省略号截断、区块标题与两个按钮平分一行、`.dqp-page` 页边距收紧到 `12px`,所有长文本加 `overflow-wrap:anywhere` 防溢出。**这套规则纯 CSS、只改排版,不删任何 DOM 元素、不改任何状态或功能。** 它与上面的短语行宽度降级是两套独立逻辑:`fitRowToWidth` 按实际宽度逐级舍弃控件(渲染层行为),而管理页小屏优化从不舍弃元素——二者不可混为一谈。
136
+ 设置 / 管理页(`MANAGER_CSS`)另有一套小屏排版优化, `@media (max-width:560px)` 段:选项标签与下拉同行(长标签自然换行)、每项说明完整保留在控件下方、所有按钮与图标触控目标 ≥36px、textarea 最小高度 52px、预览改为 `white-space:normal` 可换行不再省略号截断、区块标题与两个按钮平分一行、`.dqp-page` 页边距收紧到 `12px`,所有长文本加 `overflow-wrap:anywhere` 防溢出。
137
+
138
+ > **这套规则纯 CSS、只改排版,不删任何 DOM 元素、不改任何状态或功能。**
139
+
140
+ 它与上面的短语行宽度降级是两套独立逻辑:`fitRowToWidth` 按实际宽度逐级舍弃控件(渲染层行为),而管理页小屏优化从不舍弃元素——二者不可混为一谈。
124
141
 
125
142
  「输入框上方」的位置需要复制宿主 dock 的几何,否则会贴在会话栏左缘:
126
143
 
package/docs/DETAIL.de.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## Was es tut
4
4
 
5
- Fügt neben dem Eingabefeld eine Zeile mit Phrasen-Schaltflächen hinzu (`继续`, `提交`, `推送`, `发版` …). Ein Klick sendet den **Text** der Phrase direkt ab; die Schaltfläche zeigt nur ihre **Beschriftung**. Beides wird getrennt bearbeitet, sodass die Schaltfläche kurz bleiben kann, während die gesendete Nachricht ein vollständiger Satz ist.
5
+ Fügt neben dem Eingabefeld eine Zeile mit Phrasen-Schaltflächen hinzu (`继续`, `提交`, `推送`, `发版` …).
6
+
7
+ - **Beschriftung**: die Schaltfläche zeigt nur den kurzen Namen der Phrase.
8
+ - **Text**: ein Klick sendet den vollständigen Text der Phrase direkt ab.
9
+ - Beides wird getrennt bearbeitet, sodass die Schaltfläche kurz bleiben kann, während die gesendete Nachricht ein vollständiger Satz ist.
6
10
 
7
11
  **Das Klickverhalten ist konfigurierbar** (Standard: direkt senden):
8
12
 
@@ -28,7 +32,8 @@ Alle drei Zeilen sind registriert, aber nur die ausgewählte wird gerendert —
28
32
  Die Phrasenzeile soll beim Schreiben nicht im Weg sein: Sie kann bei Bedarf eingeklappt werden, und ihre dauerhafte Form ist eine Einstellung:
29
33
 
30
34
  - **Manuell einklappen**: Klicke auf `收起 ▾` am Ende der Zeile; die ganze Zeile schrumpft zu einer kleinen Pille `▸ 快捷短语`. Klicke auf die Pille, um sie vorübergehend auszuklappen, und erneut auf „收起", um sie wieder einzuklappen.
31
- - **Automatisch einklappen** (Standard): Wenn unter „Wenn das Eingabefeld Text enthält" die Option „Automatisch einklappen" gewählt ist, schrumpft die Zeile zur Pille, sobald Text oder Anhänge im Feld stehen, und klappt sich nach dem Leeren des Entwurfs wieder aus. Wähle „Sichtbar lassen", damit die ganze Zeile dauerhaft bleibt.
35
+ - **Automatisch einklappen** (Standard): Wenn unter „Wenn das Eingabefeld Text enthält" die Option „Automatisch einklappen" gewählt ist, schrumpft die Zeile zur Pille, sobald Text oder Anhänge im Feld stehen, und klappt sich nach dem Leeren des Entwurfs wieder aus.
36
+ - **Sichtbar lassen**: wähle diese Option, damit die ganze Zeile dauerhaft bleibt.
32
37
 
33
38
  Nach dem Ausklappen der Pille verhält sich ein Klick auf eine Phrase genau wie bei offener Zeile: Ist bereits Text im Eingabefeld, wird er an der Cursorposition eingefügt und der Entwurf nicht überschrieben.
34
39
 
@@ -36,13 +41,20 @@ Der Dropdown **Phrasenzeile anzeigen** in den Einstellungen fasst die dauerhafte
36
41
 
37
42
  - **Ganze Zeile anzeigen**: Die Zeile bleibt dauerhaft, und „收起" am Zeilenende kann sie weiterhin vorübergehend einklappen;
38
43
  - **Zur Pille einklappen**: Nur eine kleine Pille bleibt neben dem Eingabefeld; ein Klick darauf klappt sie aus;
39
- - **Vollständig verbergen**: Die Zeile verschwindet vollständig aus der Oberfläche, **ohne dass auch nur die Pille bleibt** — es wird nichts angezeigt. Der einzige Weg zurück führt zu **Einstellungen → Schnellphrasen**, wo der Dropdown auf eine der ersten beiden Optionen gesetzt wird (bei „Vollständig verbergen" steht daneben „整排已隐藏"). Die Rückkehr zu „Ganze Zeile anzeigen" löscht zugleich den Einklappzustand und stellt die ganze Zeile direkt wieder her.
44
+ - **Vollständig verbergen**: Die Zeile verschwindet vollständig aus der Oberfläche, **ohne dass auch nur die Pille bleibt** — es wird nichts angezeigt.
45
+ - Der einzige Weg zurück führt zu **Einstellungen → Schnellphrasen**, wo der Dropdown auf eine der ersten beiden Optionen gesetzt wird (bei „Vollständig verbergen" steht daneben „整排已隐藏").
46
+ - Die Rückkehr zu „Ganze Zeile anzeigen" löscht zugleich den Einklappzustand und stellt die ganze Zeile direkt wieder her.
40
47
 
41
48
  Die Schaltfläche `收起 ▾` am Zeilenende entspricht der Wahl von „Zur Pille einklappen". Dieser Dropdown speichert keinen eigenen Zustand: Sein Wert wird aus `dsh.quick-phrases.hidden.v1` (hat Vorrang) und `dsh.quick-phrases.collapsed.v1` abgeleitet; beim Umschalten werden diese beiden vorhandenen Schlüssel gemeinsam geschrieben.
42
49
 
50
+ > **Hinweis**: Beide Schlüssel sind bereits vorhanden; das Umschalten schreibt sie nur in Kombination neu — es wird kein neuer Speicherschlüssel angelegt.
51
+
43
52
  ### Automatisches Ausblenden auf schmalen Bildschirmen
44
53
 
45
- Wird das Fenster schmaler, gibt die Zeile ihre Elemente **nacheinander entsprechend der tatsächlich verfügbaren Breite** auf — ohne Einstellung und ohne festen Pixel-Schwellenwert (die Berechnung nutzt die gemessene Breite, sodass kurze und lange Beschriftungen gleichermaßen korrekt abgestuft werden):
54
+ Wird das Fenster schmaler, gibt die Zeile ihre Elemente **nacheinander entsprechend der tatsächlich verfügbaren Breite** auf:
55
+
56
+ - ohne Einstellung und ohne festen Pixel-Schwellenwert;
57
+ - die Berechnung nutzt die gemessene Breite, sodass kurze und lange Beschriftungen gleichermaßen korrekt abgestuft werden.
46
58
 
47
59
  1. zuerst die Schaltfläche **收起** (am wenigsten wichtig);
48
60
  2. dann der Zugang **Verwalten**;
@@ -50,7 +62,12 @@ Wird das Fenster schmaler, gibt die Zeile ihre Elemente **nacheinander entsprech
50
62
 
51
63
  Bei extrem geringer Breite **bleibt nur die erste verwendbare Phrase**; die Zeile wird nie leer, und ohne Phrasen bleiben Einklappen- und Verwalten-Zugang erreichbar. Beim Verbreitern des Fensters kommen die Elemente nach denselben Regeln zurück.
52
64
 
53
- Auch wenn die Einklappen-Schaltfläche auf schmalen Bildschirmen entfällt, lässt sich die Zeile weiter einklappen: ein Entwurf faltet sie mit „Automatisch einklappen" zur Pille, oder Sie wählen „Zur Pille einklappen" im Dropdown „Phrasenzeile anzeigen". Entfällt der Verwalten-Zugang, öffnet **Einstellungen → Schnellphrasen** weiterhin den Verwaltungsbereich. Die drei Zustände, das automatische Einklappen und das Verbergen einzelner Phrasen bleiben unverändert.
65
+ Auch wenn die Einklappen-Schaltfläche auf schmalen Bildschirmen entfällt, lässt sich die Zeile weiter einklappen:
66
+
67
+ - ein Entwurf faltet sie mit „Automatisch einklappen" zur Pille;
68
+ - oder Sie wählen „Zur Pille einklappen" im Dropdown „Phrasenzeile anzeigen".
69
+
70
+ Entfällt der Verwalten-Zugang, öffnet **Einstellungen → Schnellphrasen** weiterhin den Verwaltungsbereich. Die drei Zustände, das automatische Einklappen und das Verbergen einzelner Phrasen bleiben unverändert.
54
71
 
55
72
  Eine einzelne Phrase lässt sich im Verwaltungsbereich über den **Augen**-Schalter auf ihrer Karte verbergen: Danach erscheint ihre Schaltfläche nicht mehr in der Zeile, die Karte bleibt im Verwaltungsbereich und ist mit „已隐藏" markiert; ein weiterer Klick stellt sie wieder sichtbar.
56
73
 
@@ -80,15 +97,33 @@ Eine einzelne Phrase lässt sich im Verwaltungsbereich über den **Augen**-Schal
80
97
  - **✕**: Der erste Klick verwandelt die Schaltfläche nur in „Bestätigen"; erst ein zweiter Klick innerhalb von vier Sekunden löscht die Phrase wirklich und verhindert versehentliches Löschen.
81
98
  - **Phrase hinzufügen** fügt eine leere Karte an und setzt den Cursor auf die Beschriftung; **Standardwerte wiederherstellen** wechselt beim ersten Klick in den Bestätigungszustand und stellt beim zweiten die vier integrierten Phrasen wieder her.
82
99
 
83
- Änderungen werden sofort gespeichert und angewendet, ohne Neustart. Die Phrasen liegen im lokalen Browserspeicher (Schlüssel `localStorage` `dsh.quick-phrases.v1`; die Position in `dsh.quick-phrases.placement.v1`, das Klickverhalten in `dsh.quick-phrases.click.v1`, der Einklappzustand in `dsh.quick-phrases.collapsed.v1`, die Option für automatisches Einklappen in `dsh.quick-phrases.autohide.v1`, der Zustand des vollständigen Verbergens in `dsh.quick-phrases.hidden.v1` und die Form des Verwaltungszugangs in `dsh.quick-phrases.manage.v1`), entsprechend der Web-Speicher-Isolation von DSH — ein anderer Rechner oder gelöschte Websitedaten lassen sie verloren gehen. Der Dropdown „Phrasenzeile anzeigen" belegt keinen eigenen Schlüssel: Er liest und schreibt `hidden.v1` und `collapsed.v1`.
100
+ Änderungen werden sofort gespeichert und angewendet, ohne Neustart. Die Phrasen liegen im lokalen Browserspeicher (`localStorage`), entsprechend der Web-Speicher-Isolation von DSH — ein anderer Rechner oder gelöschte Websitedaten lassen sie verloren gehen. Jeder Zustand entspricht einem Schlüssel:
101
+
102
+ ```text
103
+ dsh.quick-phrases.v1 Phrasenliste
104
+ dsh.quick-phrases.placement.v1 Position
105
+ dsh.quick-phrases.click.v1 Klickverhalten
106
+ dsh.quick-phrases.collapsed.v1 Einklappzustand
107
+ dsh.quick-phrases.autohide.v1 Option für automatisches Einklappen
108
+ dsh.quick-phrases.hidden.v1 Zustand des vollständigen Verbergens
109
+ dsh.quick-phrases.manage.v1 Form des Verwaltungszugangs
110
+ ```
111
+
112
+ Der Dropdown „Phrasenzeile anzeigen" belegt keinen eigenen Schlüssel: Er liest und schreibt `hidden.v1` und `collapsed.v1`.
84
113
 
85
114
  ## Direkt aus dem Eingabefeld öffnen
86
115
 
87
- Die Schaltfläche **Verwalten** am Zeilenende führt zur selben Einstellungsseite (ist die Zeile zur Pille eingeklappt, zuerst ausklappen). Der Zugang lässt sich in den Einstellungen auf ein Zahnrad-Symbol umstellen oder verbergen; ist er verborgen, erscheint am Zeilenende keine Verwaltungsschaltfläche mehr und **Einstellungen → Schnellphrasen** ist der Zugangsweg. Falls der Einstieg in die Einstellungen in der aktuellen Oberfläche noch nicht eingebunden ist, erscheint stattdessen „请在『设置 — 快捷短语』中管理".
116
+ Die Schaltfläche **Verwalten** am Zeilenende führt zur selben Einstellungsseite (ist die Zeile zur Pille eingeklappt, zuerst ausklappen).
117
+
118
+ - Der Zugang lässt sich in den Einstellungen auf ein Zahnrad-Symbol umstellen oder verbergen.
119
+ - Ist er verborgen, erscheint am Zeilenende keine Verwaltungsschaltfläche mehr und **Einstellungen → Schnellphrasen** ist der Zugangsweg.
120
+ - Falls der Einstieg in die Einstellungen in der aktuellen Oberfläche noch nicht eingebunden ist, erscheint stattdessen „请在『设置 — 快捷短语』中管理".
88
121
 
89
122
  ## Gestaltung
90
123
 
91
- Schaltflächen, Felder und Karten verwenden die semantischen Tokens des Hosts (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) und folgen damit dem dunklen und hellen Design von DSH. Die Vordergrundfarbe der primären Schaltfläche nutzt `--dsw-alias-label-primary-foreground`, entsprechend der Primary-Variante der Host-Schaltfläche, damit der Kontrast in beiden Themen gewahrt bleibt.
124
+ Schaltflächen, Felder und Karten verwenden die semantischen Tokens des Hosts (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) und folgen damit dem dunklen und hellen Design von DSH.
125
+
126
+ Die Vordergrundfarbe der primären Schaltfläche nutzt `--dsw-alias-label-primary-foreground`, entsprechend der Primary-Variante der Host-Schaltfläche, damit der Kontrast in beiden Themen gewahrt bleibt.
92
127
 
93
128
  ## Grenzen
94
129
 
@@ -100,4 +135,4 @@ Schaltflächen, Felder und Karten verwenden die semantischen Tokens des Hosts (`
100
135
 
101
136
  - Implementierungsdetails (Slots, Datenschicht, Gestaltung, Tests): [docs/ARCHITECTURE.md](ARCHITECTURE.md)
102
137
  - Mitwirken: [CONTRIBUTING.md](../CONTRIBUTING.md)
103
- - Sicherheitsmeldungen: [SECURITY.md](../SECURITY.md)
138
+ - Sicherheitsmeldungen: [SECURITY.md](../SECURITY.md)
package/docs/DETAIL.en.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## What it does
4
4
 
5
- Adds a row of phrase buttons (`继续`, `提交`, `推送`, `发版` …) next to the composer. Clicking one sends that phrase's **text** right away; the button shows only its **label**. The two are edited separately, so a button can stay short while the message it sends is a full sentence.
5
+ Adds a row of phrase buttons (`继续`, `提交`, `推送`, `发版` …) next to the composer.
6
+
7
+ - **Label** — the button shows the phrase's short display name.
8
+ - **Text** — clicking sends the phrase's full text right away.
9
+ - The two are edited separately, so a button can stay short while the message it sends is a full sentence.
6
10
 
7
11
  **The click behaviour is configurable** (default: send right away):
8
12
 
@@ -28,7 +32,8 @@ All three rows stay registered, but only the selected one renders — switching
28
32
  The row should never get in the way of typing, so it can fold on demand and its resting shape is a setting:
29
33
 
30
34
  - **Fold by hand**: click `收起 ▾` at the end of the row and it collapses into a small `▸ 快捷短语` pill; click the pill to expand it temporarily, and 「收起」 to fold it again.
31
- - **Fold automatically** (default): with "When the composer has text" set to "Fold automatically", the row collapses into the pill as soon as the composer holds text or attachments, and expands again once the draft is cleared. Pick "Keep it visible" to keep the full row instead.
35
+ - **Fold automatically** (default): with "When the composer has text" set to "Fold automatically", the row collapses into the pill as soon as the composer holds text or attachments, and expands again once the draft is cleared.
36
+ - **Keep it visible**: pick this to keep the full row instead.
32
37
 
33
38
  Clicking a phrase after expanding the pill behaves exactly as before: when the composer already has content the text is inserted at the caret instead of replacing it.
34
39
 
@@ -36,13 +41,20 @@ The **Phrase row** dropdown in Settings turns the resting shape into a three-way
36
41
 
37
42
  - **Show the full row**: the whole row stays, and the fold chip still folds it temporarily;
38
43
  - **Fold into a pill**: only the small pill remains next to the composer; click it to expand;
39
- - **Hide completely**: the row leaves the UI entirely — **not even the pill stays**, nothing at all is rendered. The only way back is Settings → Quick phrases, where the dropdown is marked "Row hidden"; choosing "Show the full row" there also clears any leftover folded state and restores the full row.
44
+ - **Hide completely**: the row leaves the UI entirely — **not even the pill stays**, nothing at all is rendered.
45
+ - The only way back is Settings → Quick phrases, where the dropdown is marked "Row hidden".
46
+ - Choosing "Show the full row" there also clears any leftover folded state and restores the full row.
40
47
 
41
48
  The `收起 ▾` chip is equivalent to picking "Fold into a pill". This dropdown stores no state of its own: its value is derived from `dsh.quick-phrases.hidden.v1` (which wins) and `dsh.quick-phrases.collapsed.v1`, and switching composes writes to those two existing keys.
42
49
 
50
+ > **Tip**: both keys already exist; switching the dropdown only rewrites them in combination — no new storage key is added.
51
+
43
52
  ### Automatic shedding on narrow screens
44
53
 
45
- When the window or container gets narrow, the row sheds its controls **one by one by actual available width** — no setting to touch, and no fixed pixel breakpoint (the fit is computed from the real width, so short and long captions both degrade correctly):
54
+ When the window or container gets narrow, the row sheds its controls **one by one by actual available width**:
55
+
56
+ - no setting to touch, and no fixed pixel breakpoint;
57
+ - the fit is computed from the real width, so short and long captions both degrade correctly.
46
58
 
47
59
  1. The **Fold** chip at the end goes first (least important);
48
60
  2. then the **Manage** entry;
@@ -50,7 +62,12 @@ When the window or container gets narrow, the row sheds its controls **one by on
50
62
 
51
63
  At extreme narrowness **only the first usable phrase remains**; the row never empties, and with no phrases at all the fold and manage entries stay reachable. Widen the window and the controls come back under the same rules.
52
64
 
53
- Even when the Fold chip is shed on a narrow screen, the row can still be folded: a draft folds it into a pill under the default "Fold automatically", or you can pick "Fold into a pill" from the "Phrase row" dropdown in Settings. When the Manage entry is shed, Settings → Quick phrases still opens the manager. The three-way dropdown, automatic folding and single-phrase hiding are all unchanged.
65
+ Even when the Fold chip is shed on a narrow screen, the row can still be folded:
66
+
67
+ - a draft folds it into a pill under the default "Fold automatically";
68
+ - or you can pick "Fold into a pill" from the "Phrase row" dropdown in Settings.
69
+
70
+ When the Manage entry is shed, Settings → Quick phrases still opens the manager. The three-way dropdown, automatic folding and single-phrase hiding are all unchanged.
54
71
 
55
72
  A single phrase can be hidden with the **eye** toggle on its card in the manager: the chip disappears from the row while the card stays in the manager marked "Hidden"; click again to bring it back.
56
73
 
@@ -80,15 +97,33 @@ Open **Settings → Quick phrases**. The page has two layers: five behaviour opt
80
97
  - **✕**: the first click only arms the delete ("Confirm"), a second click within four seconds removes the phrase.
81
98
  - **Add phrase** appends an empty card and focuses its caption; **Restore defaults** arms on the first click and restores the four built-in phrases on the second.
82
99
 
83
- Changes save and apply immediately, no restart. The list lives in local browser storage (`localStorage` key `dsh.quick-phrases.v1`; the position is `dsh.quick-phrases.placement.v1`, the click behaviour `dsh.quick-phrases.click.v1`, the folded state `dsh.quick-phrases.collapsed.v1`, the auto-fold option `dsh.quick-phrases.autohide.v1`, the complete-hide state `dsh.quick-phrases.hidden.v1`, the manage-entry style `dsh.quick-phrases.manage.v1`), scoped to the DSH Web origin — a different machine or cleared site data loses it. The "Phrase row" dropdown adds no key of its own: it reads and writes `hidden.v1` and `collapsed.v1`.
100
+ Changes save and apply immediately, no restart. The list lives in local browser storage (`localStorage`), scoped to the DSH Web origin — a different machine or cleared site data loses it. Each state maps to a key:
101
+
102
+ ```text
103
+ dsh.quick-phrases.v1 phrase list
104
+ dsh.quick-phrases.placement.v1 position
105
+ dsh.quick-phrases.click.v1 click behaviour
106
+ dsh.quick-phrases.collapsed.v1 folded state
107
+ dsh.quick-phrases.autohide.v1 auto-fold option
108
+ dsh.quick-phrases.hidden.v1 complete-hide state
109
+ dsh.quick-phrases.manage.v1 manage-entry style
110
+ ```
111
+
112
+ The "Phrase row" dropdown adds no key of its own: it reads and writes `hidden.v1` and `collapsed.v1`.
84
113
 
85
114
  ## Opening it from the composer
86
115
 
87
- The **Manage** chip at the end of the row jumps to the same settings page (expand the pill first when the row is folded). It can be switched to a gear icon or hidden in Settings; once hidden the row shows no manage button and Settings → Quick phrases is the way in. If the settings entry is not mounted in this UI yet, it says "请在『设置 — 快捷短语』中管理" instead.
116
+ The **Manage** chip at the end of the row jumps to the same settings page (expand the pill first when the row is folded).
117
+
118
+ - It can be switched to a gear icon or hidden in Settings.
119
+ - Once hidden the row shows no manage button and Settings → Quick phrases is the way in.
120
+ - If the settings entry is not mounted in this UI yet, it says "请在『设置 — 快捷短语』中管理" instead.
88
121
 
89
122
  ## Styling
90
123
 
91
- Chips, fields and cards use the host's semantic tokens (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`), so they follow DSH's dark and light themes. The primary button's foreground uses `--dsw-alias-label-primary-foreground`, matching the host Button's primary variant, so contrast holds in both themes.
124
+ Chips, fields and cards use the host's semantic tokens (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`), so they follow DSH's dark and light themes.
125
+
126
+ The primary button's foreground uses `--dsw-alias-label-primary-foreground`, matching the host Button's primary variant, so contrast holds in both themes.
92
127
 
93
128
  ## Boundaries
94
129
 
@@ -100,4 +135,4 @@ Chips, fields and cards use the host's semantic tokens (`--dsw-alias-*`, `--dsw-
100
135
 
101
136
  - Implementation notes (slots, stores, styling, tests): [docs/ARCHITECTURE.md](ARCHITECTURE.md)
102
137
  - Contributing: [CONTRIBUTING.md](../CONTRIBUTING.md)
103
- - Security reports: [SECURITY.md](../SECURITY.md)
138
+ - Security reports: [SECURITY.md](../SECURITY.md)
package/docs/DETAIL.es.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## Qué hace
4
4
 
5
- Añade una fila de botones de frase (`继续`, `提交`, `推送`, `发版` …) junto al cuadro de entrada. Al hacer clic en un botón se envía directamente el **texto** de esa frase; el botón muestra solo su **etiqueta**. Ambas cosas se editan por separado, de modo que el botón puede ser corto mientras el mensaje enviado es una frase completa.
5
+ Añade una fila de botones de frase (`继续`, `提交`, `推送`, `发版` …) junto al cuadro de entrada.
6
+
7
+ - **Etiqueta**: el botón muestra solo el nombre corto de la frase.
8
+ - **Texto**: al hacer clic se envía directamente el texto completo de la frase.
9
+ - Ambas cosas se editan por separado, de modo que el botón puede ser corto mientras el mensaje enviado es una frase completa.
6
10
 
7
11
  **El comportamiento al hacer clic se puede cambiar** (por defecto: enviar directamente):
8
12
 
@@ -28,7 +32,8 @@ Las tres filas se registran, pero solo se renderiza la seleccionada; cambiar de
28
32
  La fila de frases no debe estorbar al escribir, así que se puede plegar temporalmente y su forma habitual es un ajuste:
29
33
 
30
34
  - **Plegar manualmente**: haz clic en `收起 ▾` al final de la fila y toda la fila se reduce a una pequeña píldora `▸ 快捷短语`; haz clic en la píldora para desplegarla temporalmente y de nuevo en «收起» para plegarla.
31
- - **Plegar automáticamente** (predeterminado): con «Cuando el cuadro de entrada tiene contenido» ajustado a «Plegar automáticamente», la fila se reduce a la píldora en cuanto hay texto o archivos adjuntos, y se despliega de nuevo al vaciar el borrador. Elige «Mantener visible» para que la fila completa permanezca.
35
+ - **Plegar automáticamente** (predeterminado): con «Cuando el cuadro de entrada tiene contenido» ajustado a «Plegar automáticamente», la fila se reduce a la píldora en cuanto hay texto o archivos adjuntos, y se despliega de nuevo al vaciar el borrador.
36
+ - **Mantener visible**: elige esta opción para que la fila completa permanezca.
32
37
 
33
38
  Desplegar la píldora y hacer clic en una frase se comporta igual que con la fila abierta: si el cuadro de entrada ya tiene contenido, el texto se inserta en el cursor y no sobrescribe el borrador.
34
39
 
@@ -36,13 +41,20 @@ El desplegable **Mostrar fila de frases** de los ajustes unifica la forma habitu
36
41
 
37
42
  - **Mostrar la fila completa**: la fila permanece visible y el botón «收起» del final sigue plegándola temporalmente;
38
43
  - **Plegar en una píldora**: solo queda una pequeña píldora junto al cuadro de entrada; haz clic en ella para desplegar;
39
- - **Ocultar por completo**: la fila desaparece por completo de la interfaz, **sin dejar siquiera la píldora**; no se muestra nada. Para recuperarla hay que volver a **Ajustes → Frases rápidas** y cambiar el desplegable a una de las dos primeras opciones (al elegir «Ocultar por completo» se indica «整排已隐藏» junto al desplegable). Al volver a «Mostrar la fila completa» se borra además el estado plegado y la fila completa reaparece directamente.
44
+ - **Ocultar por completo**: la fila desaparece por completo de la interfaz, **sin dejar siquiera la píldora**; no se muestra nada.
45
+ - Para recuperarla hay que volver a **Ajustes → Frases rápidas** y cambiar el desplegable a una de las dos primeras opciones (al elegir «Ocultar por completo» se indica «整排已隐藏» junto al desplegable).
46
+ - Al volver a «Mostrar la fila completa» se borra además el estado plegado y la fila completa reaparece directamente.
40
47
 
41
48
  El botón `收起 ▾` del final equivale a elegir «Plegar en una píldora». Este desplegable no guarda un estado propio: su valor se deriva de `dsh.quick-phrases.hidden.v1` (que tiene prioridad) y `dsh.quick-phrases.collapsed.v1`, y al cambiarlo se escriben ambas claves existentes.
42
49
 
50
+ > **Consejo**: ambas claves ya existen; cambiar el desplegable solo las reescribe en combinación, sin añadir ninguna clave nueva.
51
+
43
52
  ### Descarte automático en pantallas estrechas
44
53
 
45
- Al estrecharse la ventana, la fila descarta sus controles **uno por uno según el ancho real disponible**, sin ajustes y sin un punto fijo en píxeles (el cálculo usa el ancho medido, así que funciona igual con nombres cortos y largos):
54
+ Al estrecharse la ventana, la fila descarta sus controles **uno por uno según el ancho real disponible**:
55
+
56
+ - sin ajustes y sin un punto fijo en píxeles;
57
+ - el cálculo usa el ancho medido, así que funciona igual con nombres cortos y largos.
46
58
 
47
59
  1. primero el botón **收起** (el menos importante);
48
60
  2. después el acceso **Gestionar**;
@@ -50,7 +62,12 @@ Al estrecharse la ventana, la fila descarta sus controles **uno por uno según e
50
62
 
51
63
  En una extensión extrema **solo queda la primera frase útil**, la fila nunca se vacía y, si no hay frases, los accesos de plegar y gestionar siguen disponibles. Al ensanchar la ventana, los controles vuelven según las mismas reglas.
52
64
 
53
- Aunque el botón de plegar desaparezca en pantallas estrechas, la fila aún se puede plegar: un borrador la reduce a la píldora con «Plegar automáticamente», o puedes elegir «Plegar en una píldora» en el desplegable «Mostrar fila de frases». Si el acceso de gestión desaparece, **Ajustes → Frases rápidas** sigue abriendo el administrador. Los tres estados, el plegado automático y la ocultación de frases no cambian.
65
+ Aunque el botón de plegar desaparezca en pantallas estrechas, la fila aún se puede plegar:
66
+
67
+ - un borrador la reduce a la píldora con «Plegar automáticamente»;
68
+ - o puedes elegir «Plegar en una píldora» en el desplegable «Mostrar fila de frases».
69
+
70
+ Si el acceso de gestión desaparece, **Ajustes → Frases rápidas** sigue abriendo el administrador. Los tres estados, el plegado automático y la ocultación de frases no cambian.
54
71
 
55
72
  Una frase concreta se puede ocultar con el interruptor del **ojo** en su tarjeta del administrador: al ocultarla, su botón deja de aparecer en la fila, pero la tarjeta sigue en el administrador marcada como «已隐藏»; vuelve a hacer clic para mostrarla de nuevo.
56
73
 
@@ -80,15 +97,33 @@ Abre **Ajustes → Frases rápidas**. La página tiene dos partes: arriba, cinco
80
97
  - **✕**: el primer clic solo cambia el botón a «Confirmar»; hay que hacer clic de nuevo en menos de cuatro segundos para borrar de verdad y evitar borrados accidentales.
81
98
  - **Añadir frase**: agrega una tarjeta vacía y coloca el cursor en la etiqueta; **Restaurar valores predeterminados** entra en estado de confirmación con un clic y restaura las cuatro frases integradas con el segundo.
82
99
 
83
- Los cambios se guardan y aplican al instante, sin reiniciar. Las frases se guardan en el almacenamiento local del navegador (clave `localStorage` `dsh.quick-phrases.v1`; la posición en `dsh.quick-phrases.placement.v1`, el comportamiento al hacer clic en `dsh.quick-phrases.click.v1`, el estado plegado en `dsh.quick-phrases.collapsed.v1`, la opción de plegado automático en `dsh.quick-phrases.autohide.v1`, el estado de ocultación total en `dsh.quick-phrases.hidden.v1` y el estilo de la entrada de gestión en `dsh.quick-phrases.manage.v1`), con el aislamiento de almacenamiento web de DSH: al cambiar de equipo o borrar los datos del sitio se pierden. El desplegable «Mostrar fila de frases» no ocupa una clave nueva: lee y escribe `hidden.v1` y `collapsed.v1`.
100
+ Los cambios se guardan y aplican al instante, sin reiniciar. Las frases se guardan en el almacenamiento local del navegador (`localStorage`), con el aislamiento de almacenamiento web de DSH: al cambiar de equipo o borrar los datos del sitio se pierden. Cada estado corresponde a una clave:
101
+
102
+ ```text
103
+ dsh.quick-phrases.v1 lista de frases
104
+ dsh.quick-phrases.placement.v1 posición
105
+ dsh.quick-phrases.click.v1 comportamiento al hacer clic
106
+ dsh.quick-phrases.collapsed.v1 estado plegado
107
+ dsh.quick-phrases.autohide.v1 opción de plegado automático
108
+ dsh.quick-phrases.hidden.v1 estado de ocultación total
109
+ dsh.quick-phrases.manage.v1 estilo de la entrada de gestión
110
+ ```
111
+
112
+ El desplegable «Mostrar fila de frases» no ocupa una clave nueva: lee y escribe `hidden.v1` y `collapsed.v1`.
84
113
 
85
114
  ## Abrirlo desde el cuadro de entrada
86
115
 
87
- El botón **Gestionar** al final de la fila lleva a la misma página de ajustes (si la fila está plegada en una píldora, despliégrala primero). La entrada de gestión se puede cambiar a un icono de engranaje u ocultar en los ajustes; una vez oculta, la fila ya no muestra el botón y **Ajustes → Frases rápidas** es la forma de entrar. Si la interfaz actual aún no ha montado la entrada de ajustes, se muestra «请在『设置 — 快捷短语』中管理».
116
+ El botón **Gestionar** al final de la fila lleva a la misma página de ajustes (si la fila está plegada en una píldora, despliégrala primero).
117
+
118
+ - La entrada de gestión se puede cambiar a un icono de engranaje u ocultar en los ajustes.
119
+ - Una vez oculta, la fila ya no muestra el botón y **Ajustes → Frases rápidas** es la forma de entrar.
120
+ - Si la interfaz actual aún no ha montado la entrada de ajustes, se muestra «请在『设置 — 快捷短语』中管理».
88
121
 
89
122
  ## Estilo
90
123
 
91
- Botones, campos y tarjetas usan los tokens semánticos del anfitrión (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) y siguen los temas claro y oscuro de DSH. El color de primer plano del botón principal toma `--dsw-alias-label-primary-foreground`, igual que la variante primary del botón del anfitrión, para garantizar el contraste en ambos temas.
124
+ Botones, campos y tarjetas usan los tokens semánticos del anfitrión (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) y siguen los temas claro y oscuro de DSH.
125
+
126
+ El color de primer plano del botón principal toma `--dsw-alias-label-primary-foreground`, igual que la variante primary del botón del anfitrión, para garantizar el contraste en ambos temas.
92
127
 
93
128
  ## Límites
94
129
 
@@ -100,4 +135,4 @@ Botones, campos y tarjetas usan los tokens semánticos del anfitrión (`--dsw-al
100
135
 
101
136
  - Detalles de implementación (ranuras, capa de datos, estilos y pruebas): [docs/ARCHITECTURE.md](ARCHITECTURE.md)
102
137
  - Contribuir: [CONTRIBUTING.md](../CONTRIBUTING.md)
103
- - Informes de seguridad: [SECURITY.md](../SECURITY.md)
138
+ - Informes de seguridad: [SECURITY.md](../SECURITY.md)
package/docs/DETAIL.fr.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## Ce que fait l'extension
4
4
 
5
- Ajoute une rangée de boutons de phrase (`继续`, `提交`, `推送`, `发版` …) à côté du champ de saisie. Un clic envoie directement le **texte** de la phrase ; le bouton n'affiche que son **libellé**. Les deux se modifient séparément : le bouton peut rester court alors que le message envoyé est une phrase complète.
5
+ Ajoute une rangée de boutons de phrase (`继续`, `提交`, `推送`, `发版` …) à côté du champ de saisie.
6
+
7
+ - **Libellé** : le bouton n'affiche que le nom court de la phrase.
8
+ - **Texte** : un clic envoie directement le texte complet de la phrase.
9
+ - Les deux se modifient séparément : le bouton peut rester court alors que le message envoyé est une phrase complète.
6
10
 
7
11
  **Le comportement au clic est configurable** (par défaut : envoi direct) :
8
12
 
@@ -28,7 +32,8 @@ Les trois rangées sont enregistrées, mais seule la rangée choisie est affich
28
32
  La rangée ne doit pas gêner la saisie : elle peut être repliée à la demande et sa forme habituelle est un paramètre :
29
33
 
30
34
  - **Replier manuellement** : cliquez sur `收起 ▾` à la fin de la rangée ; elle se réduit alors en une petite pastille `▸ 快捷短语`. Cliquez sur la pastille pour la déplier temporairement, puis de nouveau sur «收起» pour la replier.
31
- - **Replier automatiquement** (par défaut) : avec «Quand le champ contient du texte» réglé sur «Replier automatiquement», la rangée se réduit en pastille dès que le champ contient du texte ou des pièces jointes, et se déplie quand le brouillon est vidé. Choisissez «Garder visible» pour que la rangée complète reste affichée.
35
+ - **Replier automatiquement** (par défaut) : avec «Quand le champ contient du texte» réglé sur «Replier automatiquement», la rangée se réduit en pastille dès que le champ contient du texte ou des pièces jointes, et se déplie quand le brouillon est vidé.
36
+ - **Garder visible** : choisissez cette option pour que la rangée complète reste affichée.
32
37
 
33
38
  Après avoir déplié la pastille, cliquer sur une phrase se comporte exactement comme avec la rangée ouverte : si le champ contient déjà du texte, celui-ci est inséré au curseur sans écraser le brouillon.
34
39
 
@@ -36,13 +41,20 @@ Le menu déroulant **Affichage de la rangée** des paramètres réduit la forme
36
41
 
37
42
  - **Afficher la rangée complète** : la rangée reste visible et le bouton «收起» à la fin permet toujours de la replier temporairement ;
38
43
  - **Replier en pastille** : il ne reste qu'une petite pastille à côté du champ ; cliquez dessus pour déplier ;
39
- - **Masquer entièrement** : la rangée disparaît complètement de l'interface, **sans laisser même la pastille** ; rien n'est affiché. Pour la récupérer, retournez dans **Paramètres → Phrases rapides** et remettez le menu sur l'une des deux premières options (quand «Masquer entièrement» est choisi, la mention «整排已隐藏» s'affiche à côté). Revenir à «Afficher la rangée complète» efface en même temps l'état replié et la rangée complète réapparaît directement.
44
+ - **Masquer entièrement** : la rangée disparaît complètement de l'interface, **sans laisser même la pastille** ; rien n'est affiché.
45
+ - Pour la récupérer, retournez dans **Paramètres → Phrases rapides** et remettez le menu sur l'une des deux premières options (quand «Masquer entièrement» est choisi, la mention «整排已隐藏» s'affiche à côté).
46
+ - Revenir à «Afficher la rangée complète» efface en même temps l'état replié et la rangée complète réapparaît directement.
40
47
 
41
48
  Le bouton `收起 ▾` à la fin équivaut à choisir «Replier en pastille». Ce menu déroulant ne stocke aucun état propre : sa valeur est dérivée de `dsh.quick-phrases.hidden.v1` (prioritaire) et de `dsh.quick-phrases.collapsed.v1` ; le changement écrit ces deux clés existantes.
42
49
 
50
+ > **Astuce** : ces deux clés existent déjà ; changer le menu ne fait que les réécrire en combinaison, sans ajouter de nouvelle clé.
51
+
43
52
  ### Suppression automatique sur écran étroit
44
53
 
45
- Quand la fenêtre se rétrécit, la rangée supprime ses contrôles **les uns après les autres selon la largeur réellement disponible**, sans réglage et sans seuil fixe en pixels (le calcul utilise la largeur mesurée : les libellés courts comme longs se dégradent correctement) :
54
+ Quand la fenêtre se rétrécit, la rangée supprime ses contrôles **les uns après les autres selon la largeur réellement disponible** :
55
+
56
+ - sans réglage et sans seuil fixe en pixels ;
57
+ - le calcul utilise la largeur mesurée : les libellés courts comme longs se dégradent correctement.
46
58
 
47
59
  1. d'abord le bouton **收起** (le moins important) ;
48
60
  2. puis l'accès **Gérer** ;
@@ -50,7 +62,12 @@ Quand la fenêtre se rétrécit, la rangée supprime ses contrôles **les uns ap
50
62
 
51
63
  À largeur extrême **seule la première phrase utilisable reste** ; la rangée ne se vide jamais et, sans aucune phrase, les accès Replier et Gérer restent disponibles. Élargir la fenêtre ramène les contrôles selon les mêmes règles.
52
64
 
53
- Même si le bouton Replier disparaît sur écran étroit, la rangée peut toujours être repliée : un brouillon la réduit en pastille avec «Replier automatiquement», ou vous pouvez choisir «Replier en pastille» dans le menu «Affichage de la rangée». Si l'accès Gérer disparaît, **Paramètres → Phrases rapides** ouvre toujours le gestionnaire. Les trois états, le repli automatique et le masquage d'une phrase restent inchangés.
65
+ Même si le bouton Replier disparaît sur écran étroit, la rangée peut toujours être repliée :
66
+
67
+ - un brouillon la réduit en pastille avec «Replier automatiquement» ;
68
+ - ou vous pouvez choisir «Replier en pastille» dans le menu «Affichage de la rangée».
69
+
70
+ Si l'accès Gérer disparaît, **Paramètres → Phrases rapides** ouvre toujours le gestionnaire. Les trois états, le repli automatique et le masquage d'une phrase restent inchangés.
54
71
 
55
72
  Une phrase précise peut être masquée avec l'interrupteur **œil** sur sa carte dans le gestionnaire : son bouton disparaît de la rangée, mais la carte reste dans le gestionnaire marquée «已隐藏» ; recliquez pour la réafficher.
56
73
 
@@ -80,15 +97,33 @@ Ouvrez **Paramètres → Phrases rapides**. La page comporte deux parties : cinq
80
97
  - **✕** : le premier clic transforme seulement le bouton en «Confirmer» ; un second clic dans les quatre secondes supprime vraiment la phrase, pour éviter une suppression accidentelle.
81
98
  - **Ajouter une phrase** : ajoute une carte vide et place le curseur sur le libellé ; **Restaurer les valeurs par défaut** passe en état de confirmation au premier clic et restaure les quatre phrases intégrées au second.
82
99
 
83
- Les modifications sont enregistrées et appliquées immédiatement, sans redémarrage. Les phrases sont conservées dans le stockage local du navigateur (clé `localStorage` `dsh.quick-phrases.v1` ; la position dans `dsh.quick-phrases.placement.v1`, le comportement au clic dans `dsh.quick-phrases.click.v1`, l'état replié dans `dsh.quick-phrases.collapsed.v1`, l'option de repli automatique dans `dsh.quick-phrases.autohide.v1`, l'état de masquage total dans `dsh.quick-phrases.hidden.v1` et le style de l'accès de gestion dans `dsh.quick-phrases.manage.v1`), avec l'isolation du stockage Web de DSH : changer de machine ou effacer les données du site les fait perdre. Le menu «Affichage de la rangée» n'utilise aucune clé supplémentaire : il lit et écrit `hidden.v1` et `collapsed.v1`.
100
+ Les modifications sont enregistrées et appliquées immédiatement, sans redémarrage. Les phrases sont conservées dans le stockage local du navigateur (`localStorage`), avec l'isolation du stockage Web de DSH : changer de machine ou effacer les données du site les fait perdre. Chaque état correspond à une clé :
101
+
102
+ ```text
103
+ dsh.quick-phrases.v1 liste des phrases
104
+ dsh.quick-phrases.placement.v1 position
105
+ dsh.quick-phrases.click.v1 comportement au clic
106
+ dsh.quick-phrases.collapsed.v1 état replié
107
+ dsh.quick-phrases.autohide.v1 option de repli automatique
108
+ dsh.quick-phrases.hidden.v1 état de masquage total
109
+ dsh.quick-phrases.manage.v1 style de l'accès de gestion
110
+ ```
111
+
112
+ Le menu «Affichage de la rangée» n'utilise aucune clé supplémentaire : il lit et écrit `hidden.v1` et `collapsed.v1`.
84
113
 
85
114
  ## Ouvrir depuis le champ de saisie
86
115
 
87
- Le bouton **Gérer** à la fin de la rangée mène à la même page de paramètres (si la rangée est repliée en pastille, dépliez-la d'abord). L'accès de gestion peut être remplacé par une icône engrenage ou masqué dans les paramètres ; une fois masqué, la rangée n'affiche plus de bouton de gestion et **Paramètres → Phrases rapides** est la voie d'accès. Si l'entrée des paramètres n'est pas encore montée dans l'interface actuelle, le message «请在『设置 — 快捷短语』中管理» s'affiche à la place.
116
+ Le bouton **Gérer** à la fin de la rangée mène à la même page de paramètres (si la rangée est repliée en pastille, dépliez-la d'abord).
117
+
118
+ - L'accès de gestion peut être remplacé par une icône engrenage ou masqué dans les paramètres.
119
+ - Une fois masqué, la rangée n'affiche plus de bouton de gestion et **Paramètres → Phrases rapides** est la voie d'accès.
120
+ - Si l'entrée des paramètres n'est pas encore montée dans l'interface actuelle, le message «请在『设置 — 快捷短语』中管理» s'affiche à la place.
88
121
 
89
122
  ## Style
90
123
 
91
- Boutons, champs et cartes utilisent les jetons sémantiques de l'hôte (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) et suivent les thèmes clair et sombre de DSH. La couleur de premier plan du bouton principal reprend `--dsw-alias-label-primary-foreground`, comme la variante primary du bouton de l'hôte, pour garantir le contraste dans les deux thèmes.
124
+ Boutons, champs et cartes utilisent les jetons sémantiques de l'hôte (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) et suivent les thèmes clair et sombre de DSH.
125
+
126
+ La couleur de premier plan du bouton principal reprend `--dsw-alias-label-primary-foreground`, comme la variante primary du bouton de l'hôte, pour garantir le contraste dans les deux thèmes.
92
127
 
93
128
  ## Limites
94
129
 
@@ -100,4 +135,4 @@ Boutons, champs et cartes utilisent les jetons sémantiques de l'hôte (`--dsw-a
100
135
 
101
136
  - Détails d'implémentation (emplacements, couche de données, styles et tests) : [docs/ARCHITECTURE.md](ARCHITECTURE.md)
102
137
  - Contribuer : [CONTRIBUTING.md](../CONTRIBUTING.md)
103
- - Signalements de sécurité : [SECURITY.md](../SECURITY.md)
138
+ - Signalements de sécurité : [SECURITY.md](../SECURITY.md)
package/docs/DETAIL.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## 它做什么
4
4
 
5
- 在会话输入框附近加一排短语按钮(`继续`、`提交`、`推送`、`发版` …)。点一下按钮就把这条短语的**发送内容**直接发出去;按钮上显示的是**显示名称**。两者分开,所以按钮可以很短,真正发出去的话可以很长。
5
+ 在会话输入框附近加一排短语按钮(`继续`、`提交`、`推送`、`发版` …)。
6
+
7
+ - **按钮文字**显示的是短语的「显示名称」,可以很短。
8
+ - **点按发送**的是这条短语的「发送内容」,可以是完整长句。
9
+ - 两者分开编辑,互不牵制。
6
10
 
7
11
  **点按行为可以改**(默认是「直接发送」):
8
12
 
@@ -28,7 +32,8 @@
28
32
  短语行不该挡着打字,所以可以临时收起,也可以在设置里选它常驻的形态:
29
33
 
30
34
  - **手动收起**:点行尾的 `收起 ▾`,整排缩成一个小胶囊 `▸ 快捷短语`;点胶囊临时展开,再点「收起」收回去。
31
- - **自动收起**(默认):设置里「输入框有内容时」选「自动收起」——输入框里一有文字或附件就缩成胶囊,草稿清空后自动展开;也可以选「保持显示」,让整排常驻。
35
+ - **自动收起**(默认):设置里「输入框有内容时」选「自动收起」,则输入框里一有文字或附件就缩成胶囊,草稿清空后自动展开。
36
+ - **保持显示**:也可以选「保持显示」,让整排常驻。
32
37
 
33
38
  收起状态下点开胶囊再点短语,行为和展开时完全一样:输入框里已有内容时仍然插到光标处,不会覆盖草稿。
34
39
 
@@ -36,13 +41,20 @@
36
41
 
37
42
  - **显示整排**:常驻一整排,行尾「收起」仍可临时折叠;
38
43
  - **收成胶囊**:整排只留一个小胶囊,胶囊仍在输入框旁,点一下就能展开;
39
- - **彻底隐藏**:整排从界面完全消失,**连胶囊都不留**,界面上什么都不显示。之后只能回到 **设置 → 快捷短语** 把下拉改回前两项(选「彻底隐藏」时旁边会标出「整排已隐藏」);改回「显示整排」时会顺带清掉折叠状态,直接回到整排。
44
+ - **彻底隐藏**:整排从界面完全消失,**连胶囊都不留**,界面上什么都不显示。
45
+ - 之后只能回到 **设置 → 快捷短语** 把下拉改回前两项(选「彻底隐藏」时旁边会标出「整排已隐藏」)。
46
+ - 改回「显示整排」时会顺带清掉折叠状态,直接回到整排。
40
47
 
41
48
  行尾「收起 ▾」等价于选「收成胶囊」。这个三态下拉不另存状态键:它由 `dsh.quick-phrases.hidden.v1`(优先)与 `dsh.quick-phrases.collapsed.v1` 推出,切换时组合写这两个既有键。
42
49
 
50
+ > **提示**:两个键都已存在,切换下拉只是按组合改写它们,不会新增存储项。
51
+
43
52
  ### 窄屏自动舍弃
44
53
 
45
- 窗口或容器变窄时,短语行会按**实际可用宽度**自动依次舍弃控件,不需要任何设置,也不是固定像素断点(按真实宽度计算,长短名称都能正确降级):
54
+ 窗口或容器变窄时,短语行会按**实际可用宽度**自动依次舍弃控件:
55
+
56
+ - 不需要任何设置,也不是固定像素断点;
57
+ - 按真实宽度计算,长短名称都能正确降级。
46
58
 
47
59
  1. 先丢行尾的 **收起**(最不重要);
48
60
  2. 再丢 **管理**入口;
@@ -50,7 +62,12 @@
50
62
 
51
63
  极窄时**只保留第一条可用短语**,不会丢光;一条短语都没有时收起与管理入口仍然可达。窗口变宽后,控件按同样的规则自动回来。
52
64
 
53
- 「收起」在窄屏被舍弃后仍可折叠整排:输入框有草稿时按默认的「自动收起」缩成胶囊,或在设置里把「短语行显示」选成「收成胶囊」。管理入口在窄屏不可见时,仍可从 **设置 → 快捷短语** 进入管理页。三态下拉、自动收起、单条隐藏等既有行为都不变。
65
+ 「收起」在窄屏被舍弃后仍可折叠整排:
66
+
67
+ - 输入框有草稿时按默认的「自动收起」缩成胶囊;
68
+ - 或在设置里把「短语行显示」选成「收成胶囊」。
69
+
70
+ 管理入口在窄屏不可见时,仍可从 **设置 → 快捷短语** 进入管理页。三态下拉、自动收起、单条隐藏等既有行为都不变。
54
71
 
55
72
  单条短语可以在管理页用每张卡片右上角的**眼睛**开关隐藏:隐藏后这条按钮不再出现在短语行,卡片仍留在管理页并标注「已隐藏」,再点一次恢复显示。
56
73
 
@@ -80,15 +97,33 @@
80
97
  - **✕**:第一次点击只是把按钮变成「确认」,4 秒内再点一次才真正删除,避免误删。
81
98
  - **新增短语**:追加一条空卡片并自动把光标放到名称上;**恢复默认**点一次进入确认态,再点一次恢复为内置的四条短语。
82
99
 
83
- 改动即时保存、即时生效,无需重启。短语保存在本机浏览器存储里(`localStorage` 键 `dsh.quick-phrases.v1`,位置存在 `dsh.quick-phrases.placement.v1`,点按行为存在 `dsh.quick-phrases.click.v1`,收起状态存在 `dsh.quick-phrases.collapsed.v1`,自动收起选项存在 `dsh.quick-phrases.autohide.v1`,整排彻底隐藏的状态存在 `dsh.quick-phrases.hidden.v1`,管理入口样式存在 `dsh.quick-phrases.manage.v1`),按 DSH 的 Web 端存储隔离,换机器或清空站点数据会丢失。「短语行显示」下拉不占新键,读写的就是 `hidden.v1` 与 `collapsed.v1`。
100
+ 改动即时保存、即时生效,无需重启。短语保存在本机浏览器存储里(`localStorage`),按 DSH 的 Web 端存储隔离,换机器或清空站点数据会丢失。各状态对应键如下:
101
+
102
+ ```text
103
+ dsh.quick-phrases.v1 短语列表
104
+ dsh.quick-phrases.placement.v1 显示位置
105
+ dsh.quick-phrases.click.v1 点按行为
106
+ dsh.quick-phrases.collapsed.v1 收起状态
107
+ dsh.quick-phrases.autohide.v1 自动收起选项
108
+ dsh.quick-phrases.hidden.v1 整排彻底隐藏状态
109
+ dsh.quick-phrases.manage.v1 管理入口样式
110
+ ```
111
+
112
+ 「短语行显示」下拉不占新键,读写的就是 `hidden.v1` 与 `collapsed.v1`。
84
113
 
85
114
  ## 在输入框旁直接打开
86
115
 
87
- 短语行最右侧的 **管理** 会跳到同一页设置(收起成胶囊时,先点胶囊展开)。管理入口可以在设置里换成齿轮图标或隐藏;隐藏后行尾不再出现管理按钮,从 **设置 → 快捷短语** 进入即可。如果当前界面还没装上设置入口,会提示「请在『设置 — 快捷短语』中管理」。
116
+ 短语行最右侧的 **管理** 会跳到同一页设置(收起成胶囊时,先点胶囊展开)。
117
+
118
+ - 管理入口可以在设置里换成齿轮图标或隐藏。
119
+ - 隐藏后行尾不再出现管理按钮,从 **设置 → 快捷短语** 进入即可。
120
+ - 如果当前界面还没装上设置入口,会提示「请在『设置 — 快捷短语』中管理」。
88
121
 
89
122
  ## 样式
90
123
 
91
- 按钮、输入框、卡片全部使用宿主的语义色 token(`--dsw-alias-*`、`--dsw-radius-*`、`--dsw-focus-*`),跟随 DSH 的深色 / 浅色主题;主按钮的前景色取 `--dsw-alias-label-primary-foreground`,与宿主 Button 的 primary 变体一致,两种主题下都保证对比度。
124
+ 按钮、输入框、卡片全部使用宿主的语义色 token(`--dsw-alias-*`、`--dsw-radius-*`、`--dsw-focus-*`),跟随 DSH 的深色 / 浅色主题。
125
+
126
+ 主按钮的前景色取 `--dsw-alias-label-primary-foreground`,与宿主 Button 的 primary 变体一致,两种主题下都保证对比度。
92
127
 
93
128
  ## 边界
94
129
 
@@ -100,4 +135,4 @@
100
135
 
101
136
  - 实现细节(插槽、数据层、样式与测试):[docs/ARCHITECTURE.md](ARCHITECTURE.md)
102
137
  - 参与开发:[CONTRIBUTING.md](../CONTRIBUTING.md)
103
- - 安全报告:[SECURITY.md](../SECURITY.md)
138
+ - 安全报告:[SECURITY.md](../SECURITY.md)
package/docs/DETAIL.pt.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## O que faz
4
4
 
5
- Adiciona uma linha de botões de frase (`继续`, `提交`, `推送`, `发版` …) ao lado do campo de entrada. Um clique envia diretamente o **texto** da frase; o botão mostra apenas o seu **rótulo**. Os dois são editados separadamente, de modo que o botão pode ser curto enquanto a mensagem enviada é uma frase completa.
5
+ Adiciona uma linha de botões de frase (`继续`, `提交`, `推送`, `发版` …) ao lado do campo de entrada.
6
+
7
+ - **Rótulo** — o botão mostra apenas o nome curto da frase.
8
+ - **Texto** — um clique envia diretamente o texto completo da frase.
9
+ - Os dois são editados separadamente, de modo que o botão pode ser curto enquanto a mensagem enviada é uma frase completa.
6
10
 
7
11
  **O comportamento ao clicar é configurável** (por padrão: enviar diretamente):
8
12
 
@@ -28,7 +32,8 @@ As três linhas são registradas, mas apenas a selecionada é renderizada — tr
28
32
  A linha de frases não deve atrapalhar a digitação, então pode ser recolhida temporariamente e sua forma habitual é uma configuração:
29
33
 
30
34
  - **Recolher manualmente**: clique em `收起 ▾` no fim da linha e ela se reduz a uma pequena pílula `▸ 快捷短语`; clique na pílula para expandi-la temporariamente e novamente em «收起» para recolhê-la.
31
- - **Recolher automaticamente** (padrão): com «Quando o campo de entrada tem texto» definido como «Recolher automaticamente», a linha se reduz à pílula assim que há texto ou anexos no campo, e se expande quando o rascunho é esvaziado. Escolha «Manter visível» para manter a linha completa.
35
+ - **Recolher automaticamente** (padrão): com «Quando o campo de entrada tem texto» definido como «Recolher automaticamente», a linha se reduz à pílula assim que há texto ou anexos no campo, e se expande quando o rascunho é esvaziado.
36
+ - **Manter visível** — escolha esta opção para manter a linha completa.
32
37
 
33
38
  Depois de expandir a pílula, clicar em uma frase funciona exatamente como com a linha aberta: se o campo já tiver conteúdo, o texto é inserido no cursor e o rascunho não é substituído.
34
39
 
@@ -36,13 +41,20 @@ O menu suspenso **Exibição da linha de frases** nas configurações resume a f
36
41
 
37
42
  - **Mostrar a linha completa**: a linha permanece visível e o «收起» no fim ainda pode recolhê-la temporariamente;
38
43
  - **Recolher em pílula**: resta apenas uma pequena pílula ao lado do campo de entrada; clique nela para expandir;
39
- - **Ocultar completamente**: a linha desaparece por inteiro da interface — **nem a pílula permanece**, nada é mostrado. A única volta é em **Configurações → Frases rápidas**, trocando o menu para uma das duas primeiras opções (ao escolher «Ocultar completamente», a indicação «整排已隐藏» aparece ao lado). Voltar para «Mostrar a linha completa» também limpa o estado recolhido e restaura a linha completa diretamente.
44
+ - **Ocultar completamente**: a linha desaparece por inteiro da interface — **nem a pílula permanece**, nada é mostrado.
45
+ - A única volta é em **Configurações → Frases rápidas**, trocando o menu para uma das duas primeiras opções (ao escolher «Ocultar completamente», a indicação «整排已隐藏» aparece ao lado).
46
+ - Voltar para «Mostrar a linha completa» também limpa o estado recolhido e restaura a linha completa diretamente.
40
47
 
41
48
  O botão `收起 ▾` no fim da linha equivale a escolher «Recolher em pílula». Esse menu não armazena estado próprio: seu valor é derivado de `dsh.quick-phrases.hidden.v1` (que tem prioridade) e `dsh.quick-phrases.collapsed.v1`, e a troca grava ambas as chaves existentes.
42
49
 
50
+ > **Dica**: ambas as chaves já existem; trocar o menu apenas as regrava em combinação — nenhuma chave nova é criada.
51
+
43
52
  ### Descarte automático em telas estreitas
44
53
 
45
- Ao estreitar a janela, a linha descarta seus controles **um por um conforme a largura realmente disponível**, sem configuração e sem um limite fixo em pixels (o cálculo usa a largura medida, então rótulos curtos e longos degradam corretamente):
54
+ Ao estreitar a janela, a linha descarta seus controles **um por um conforme a largura realmente disponível**:
55
+
56
+ - sem configuração e sem um limite fixo em pixels;
57
+ - o cálculo usa a largura medida, então rótulos curtos e longos degradam corretamente.
46
58
 
47
59
  1. primeiro o botão **收起** (o menos importante);
48
60
  2. depois o acesso **Gerenciar**;
@@ -50,7 +62,12 @@ Ao estreitar a janela, a linha descarta seus controles **um por um conforme a la
50
62
 
51
63
  Em largura extrema **apenas a primeira frase utilizável permanece** — a linha nunca fica vazia e, se não houver frases, os acessos recolher e gerenciar continuam disponíveis. Ao alargar a janela, os controles voltam pelas mesmas regras.
52
64
 
53
- Mesmo que o botão recolher desapareça em telas estreitas, a linha ainda pode ser recolhida: um rascunho a reduz à pílula com «Recolher automaticamente», ou você escolhe «Recolher em pílula» no menu «Exibição da linha de frases». Se o acesso de gerenciamento desaparecer, **Configurações → Frases rápidas** continua abrindo o gerenciador. Os três estados, o recolhimento automático e a ocultação de frases não mudam.
65
+ Mesmo que o botão recolher desapareça em telas estreitas, a linha ainda pode ser recolhida:
66
+
67
+ - um rascunho a reduz à pílula com «Recolher automaticamente»;
68
+ - ou você escolhe «Recolher em pílula» no menu «Exibição da linha de frases».
69
+
70
+ Se o acesso de gerenciamento desaparecer, **Configurações → Frases rápidas** continua abrindo o gerenciador. Os três estados, o recolhimento automático e a ocultação de frases não mudam.
54
71
 
55
72
  Uma frase específica pode ser ocultada pelo interruptor de **olho** em seu cartão no gerenciador: o botão desaparece da linha, mas o cartão permanece no gerenciador marcado como «已隐藏»; clique novamente para restaurá-la.
56
73
 
@@ -80,15 +97,33 @@ Abra **Configurações → Frases rápidas**. A página tem duas partes: cinco c
80
97
  - **✕**: o primeiro clique apenas transforma o botão em «Confirmar»; um segundo clique em até quatro segundos realmente exclui a frase, evitando exclusões acidentais.
81
98
  - **Adicionar frase** acrescenta um cartão vazio e coloca o cursor no rótulo; **Restaurar padrões** entra no estado de confirmação no primeiro clique e restaura as quatro frases integradas no segundo.
82
99
 
83
- As alterações são salvas e aplicadas imediatamente, sem reiniciar. As frases ficam no armazenamento local do navegador (chave `localStorage` `dsh.quick-phrases.v1`; a posição em `dsh.quick-phrases.placement.v1`, o comportamento de clique em `dsh.quick-phrases.click.v1`, o estado recolhido em `dsh.quick-phrases.collapsed.v1`, a opção de recolhimento automático em `dsh.quick-phrases.autohide.v1`, o estado de ocultação total em `dsh.quick-phrases.hidden.v1` e o estilo da entrada de gerenciamento em `dsh.quick-phrases.manage.v1`), com o isolamento de armazenamento web do DSH — trocar de máquina ou limpar os dados do site faz com que se percam. O menu «Exibição da linha de frases» não ocupa uma chave nova: ele lê e grava `hidden.v1` e `collapsed.v1`.
100
+ As alterações são salvas e aplicadas imediatamente, sem reiniciar. As frases ficam no armazenamento local do navegador (`localStorage`), com o isolamento de armazenamento web do DSH — trocar de máquina ou limpar os dados do site faz com que se percam. Cada estado corresponde a uma chave:
101
+
102
+ ```text
103
+ dsh.quick-phrases.v1 lista de frases
104
+ dsh.quick-phrases.placement.v1 posição
105
+ dsh.quick-phrases.click.v1 comportamento de clique
106
+ dsh.quick-phrases.collapsed.v1 estado recolhido
107
+ dsh.quick-phrases.autohide.v1 opção de recolhimento automático
108
+ dsh.quick-phrases.hidden.v1 estado de ocultação total
109
+ dsh.quick-phrases.manage.v1 estilo da entrada de gerenciamento
110
+ ```
111
+
112
+ O menu «Exibição da linha de frases» não ocupa uma chave nova: ele lê e grava `hidden.v1` e `collapsed.v1`.
84
113
 
85
114
  ## Abrir diretamente pelo campo de entrada
86
115
 
87
- O botão **Gerenciar** no fim da linha leva à mesma página de configurações (se a linha estiver recolhida na pílula, expanda-a primeiro). A entrada de gerenciamento pode ser trocada por um ícone de engrenagem ou oculta nas configurações; uma vez oculta, a linha não mostra mais o botão e **Configurações → Frases rápidas** é a forma de entrar. Se a entrada de configurações ainda não estiver montada na interface atual, a mensagem exibida é «请在『设置 — 快捷短语』中管理».
116
+ O botão **Gerenciar** no fim da linha leva à mesma página de configurações (se a linha estiver recolhida na pílula, expanda-a primeiro).
117
+
118
+ - A entrada de gerenciamento pode ser trocada por um ícone de engrenagem ou oculta nas configurações.
119
+ - Uma vez oculta, a linha não mostra mais o botão e **Configurações → Frases rápidas** é a forma de entrar.
120
+ - Se a entrada de configurações ainda não estiver montada na interface atual, a mensagem exibida é «请在『设置 — 快捷短语』中管理».
88
121
 
89
122
  ## Estilo
90
123
 
91
- Botões, campos e cartões usam os tokens semânticos do host (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) e seguem os temas escuro e claro do DSH. A cor de primeiro plano do botão principal vem de `--dsw-alias-label-primary-foreground`, igual à variante primary do botão do host, garantindo contraste nos dois temas.
124
+ Botões, campos e cartões usam os tokens semânticos do host (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) e seguem os temas escuro e claro do DSH.
125
+
126
+ A cor de primeiro plano do botão principal vem de `--dsw-alias-label-primary-foreground`, igual à variante primary do botão do host, garantindo contraste nos dois temas.
92
127
 
93
128
  ## Limites
94
129
 
@@ -100,4 +135,4 @@ Botões, campos e cartões usam os tokens semânticos do host (`--dsw-alias-*`,
100
135
 
101
136
  - Detalhes de implementação (slots, camada de dados, estilos e testes): [docs/ARCHITECTURE.md](ARCHITECTURE.md)
102
137
  - Contribuir: [CONTRIBUTING.md](../CONTRIBUTING.md)
103
- - Relatórios de segurança: [SECURITY.md](../SECURITY.md)
138
+ - Relatórios de segurança: [SECURITY.md](../SECURITY.md)
package/docs/DETAIL.ru.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## Что делает
4
4
 
5
- Добавляет рядом с полем ввода ряд кнопок с фразами (`继续`, `提交`, `推送`, `发版` …). Нажатие кнопки сразу отправляет **текст** фразы; на кнопке отображается только её **название**. Они редактируются отдельно, поэтому кнопка может быть короткой, а отправляемое сообщение — полным предложением.
5
+ Добавляет рядом с полем ввода ряд кнопок с фразами (`继续`, `提交`, `推送`, `发版` …).
6
+
7
+ - **Название** — кнопка показывает только короткое имя фразы.
8
+ - **Текст** — нажатие сразу отправляет полный текст фразы.
9
+ - Они редактируются отдельно, поэтому кнопка может быть короткой, а отправляемое сообщение — полным предложением.
6
10
 
7
11
  **Поведение при нажатии можно изменить** (по умолчанию: отправлять сразу):
8
12
 
@@ -28,7 +32,8 @@
28
32
  Ряд фраз не должен мешать набору текста, поэтому его можно временно свернуть, а его постоянный вид настраивается:
29
33
 
30
34
  - **Свернуть вручную**: нажмите `收起 ▾` в конце ряда — весь ряд сжимается в маленькую «пилюлю» `▸ 快捷短语`; нажмите на пилюлю, чтобы временно развернуть, и снова «收起», чтобы свернуть.
31
- - **Сворачивать автоматически** (по умолчанию): если для параметра «Когда в поле ввода есть текст» выбрано «Сворачивать автоматически», ряд сжимается в пилюлю, как только в поле появляется текст или вложения, и разворачивается снова после очистки черновика. Выберите «Оставлять видимым», чтобы ряд оставался полным.
35
+ - **Сворачивать автоматически** (по умолчанию): если для параметра «Когда в поле ввода есть текст» выбрано «Сворачивать автоматически», ряд сжимается в пилюлю, как только в поле появляется текст или вложения, и разворачивается снова после очистки черновика.
36
+ - **Оставлять видимым** — выберите этот вариант, чтобы ряд оставался полным.
32
37
 
33
38
  После разворачивания пилюли нажатие на фразу работает так же, как при раскрытом ряде: если в поле уже есть текст, он вставляется в курсор, а черновик не перезаписывается.
34
39
 
@@ -36,13 +41,20 @@
36
41
 
37
42
  - **Показывать весь ряд**: ряд постоянно виден, а «收起» в конце ряда по-прежнему позволяет временно его свернуть;
38
43
  - **Свернуть в пилюлю**: остаётся только маленькая пилюля рядом с полем ввода; нажмите на неё, чтобы развернуть;
39
- - **Скрыть полностью**: ряд полностью исчезает из интерфейса — **не остаётся даже пилюли**, ничего не отображается. Вернуть его можно только через **Настройки → Быстрые фразы**, переключив список на одну из первых двух опций (при выборе «Скрыть полностью» рядом указывается «整排已隐藏»). Возврат к «Показывать весь ряд» одновременно сбрасывает состояние свёрнутости и сразу восстанавливает полный ряд.
44
+ - **Скрыть полностью**: ряд полностью исчезает из интерфейса — **не остаётся даже пилюли**, ничего не отображается.
45
+ - Вернуть его можно только через **Настройки → Быстрые фразы**, переключив список на одну из первых двух опций (при выборе «Скрыть полностью» рядом указывается «整排已隐藏»).
46
+ - Возврат к «Показывать весь ряд» одновременно сбрасывает состояние свёрнутости и сразу восстанавливает полный ряд.
40
47
 
41
48
  Кнопка `收起 ▾` в конце ряда эквивалентна выбору «Свернуть в пилюлю». Этот список не хранит собственное состояние: его значение выводится из `dsh.quick-phrases.hidden.v1` (имеет приоритет) и `dsh.quick-phrases.collapsed.v1`, а при переключении оба этих существующих ключа записываются вместе.
42
49
 
50
+ > **Совет**: оба ключа уже существуют; переключение списка лишь перезаписывает их в комбинации — новый ключ не создаётся.
51
+
43
52
  ### Автоматическое удаление элементов на узком экране
44
53
 
45
- Когда окно сужается, ряд **по очереди убирает свои элементы по фактически доступной ширине** — без настроек и без фиксированного порога в пикселях (расчёт использует измеренную ширину, поэтому короткие и длинные подписи понижаются одинаково корректно):
54
+ Когда окно сужается, ряд **по очереди убирает свои элементы по фактически доступной ширине**:
55
+
56
+ - без настроек и без фиксированного порога в пикселях;
57
+ - расчёт использует измеренную ширину, поэтому короткие и длинные подписи понижаются одинаково корректно.
46
58
 
47
59
  1. сначала кнопка **收起** (самая неважная);
48
60
  2. затем доступ **Управление**;
@@ -50,7 +62,12 @@
50
62
 
51
63
  При крайней узости **остаётся только первая пригодная фраза** — ряд никогда не становится пустым, а если фраз нет, доступы свернуть и управлять всё равно доступны. При расширении окна элементы возвращаются по тем же правилам.
52
64
 
53
- Даже если на узком экране кнопка свернуть исчезла, ряд всё равно можно свернуть: черновик сворачивает его в пилюлю при «Сворачивать автоматически», либо выберите «Свернуть в пилюлю» в списке «Отображение ряда фраз». Если исчез доступ к управлению, **Настройки → Быстрые фразы** по-прежнему открывают менеджер. Три состояния, автосворачивание и скрытие отдельных фраз не меняются.
65
+ Даже если на узком экране кнопка свернуть исчезла, ряд всё равно можно свернуть:
66
+
67
+ - черновик сворачивает его в пилюлю при «Сворачивать автоматически»;
68
+ - либо выберите «Свернуть в пилюлю» в списке «Отображение ряда фраз».
69
+
70
+ Если исчез доступ к управлению, **Настройки → Быстрые фразы** по-прежнему открывают менеджер. Три состояния, автосворачивание и скрытие отдельных фраз не меняются.
54
71
 
55
72
  Отдельную фразу можно скрыть переключателем **глаза** на её карточке в менеджере: после скрытия её кнопка исчезает из ряда, но карточка остаётся в менеджере с пометкой «已隐藏»; повторный нажатие возвращает её.
56
73
 
@@ -80,15 +97,33 @@
80
97
  - **✕**: первое нажатие лишь превращает кнопку в «Подтвердить»; повторное нажатие в течение четырёх секунд действительно удаляет фразу — так исключается случайное удаление.
81
98
  - **Добавить фразу** добавляет пустую карточку и переводит курсор на название; **Восстановить по умолчанию** переходит в состояние подтверждения при первом нажатии и восстанавливает четыре встроенные фразы при втором.
82
99
 
83
- Изменения сохраняются и применяются сразу, без перезапуска. Фразы хранятся в локальном хранилище браузера (ключ `localStorage` `dsh.quick-phrases.v1`; положение — в `dsh.quick-phrases.placement.v1`, поведение при нажатии — в `dsh.quick-phrases.click.v1`, состояние свёрнутости — в `dsh.quick-phrases.collapsed.v1`, параметр автосворачивания — в `dsh.quick-phrases.autohide.v1`, состояние полного скрытия — в `dsh.quick-phrases.hidden.v1`, стиль входа в управление — в `dsh.quick-phrases.manage.v1`), с изоляцией веб-хранилища DSH: на другом компьютере или после очистки данных сайта они теряются. Список «Отображение ряда фраз» не занимает отдельный ключ: он читает и записывает `hidden.v1` и `collapsed.v1`.
100
+ Изменения сохраняются и применяются сразу, без перезапуска. Фразы хранятся в локальном хранилище браузера (`localStorage`), с изоляцией веб-хранилища DSH: на другом компьютере или после очистки данных сайта они теряются. Каждое состояние соответствует своему ключу:
101
+
102
+ ```text
103
+ dsh.quick-phrases.v1 список фраз
104
+ dsh.quick-phrases.placement.v1 положение
105
+ dsh.quick-phrases.click.v1 поведение при нажатии
106
+ dsh.quick-phrases.collapsed.v1 состояние свёрнутости
107
+ dsh.quick-phrases.autohide.v1 параметр автосворачивания
108
+ dsh.quick-phrases.hidden.v1 состояние полного скрытия
109
+ dsh.quick-phrases.manage.v1 стиль входа в управление
110
+ ```
111
+
112
+ Список «Отображение ряда фраз» не занимает отдельный ключ: он читает и записывает `hidden.v1` и `collapsed.v1`.
84
113
 
85
114
  ## Открытие прямо из поля ввода
86
115
 
87
- Кнопка **Управление** в конце ряда ведёт на ту же страницу настроек (если ряд свёрнут в пилюлю, сначала разверните её). Вход в управление можно заменить на значок шестерни или скрыть в настройках; после скрытия в конце ряда не появляется кнопка управления, и **Настройки → Быстрые фразы** остаётся способом входа. Если в текущем интерфейсе ещё не смонтирован вход в настройки, вместо этого отображается «请在『设置 — 快捷短语』中管理».
116
+ Кнопка **Управление** в конце ряда ведёт на ту же страницу настроек (если ряд свёрнут в пилюлю, сначала разверните её).
117
+
118
+ - Вход в управление можно заменить на значок шестерни или скрыть в настройках.
119
+ - После скрытия в конце ряда не появляется кнопка управления, и **Настройки → Быстрые фразы** остаётся способом входа.
120
+ - Если в текущем интерфейсе ещё не смонтирован вход в настройки, вместо этого отображается «请在『设置 — 快捷短语』中管理».
88
121
 
89
122
  ## Стиль
90
123
 
91
- Кнопки, поля и карточки используют семантические токены хоста (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) и следуют тёмной и светлой темам DSH. Цвет переднего плана основной кнопки берётся из `--dsw-alias-label-primary-foreground`, как у primary-варианта кнопки хоста, что гарантирует контраст в обеих темах.
124
+ Кнопки, поля и карточки используют семантические токены хоста (`--dsw-alias-*`, `--dsw-radius-*`, `--dsw-focus-*`) и следуют тёмной и светлой темам DSH.
125
+
126
+ Цвет переднего плана основной кнопки берётся из `--dsw-alias-label-primary-foreground`, как у primary-варианта кнопки хоста, что гарантирует контраст в обеих темах.
92
127
 
93
128
  ## Ограничения
94
129
 
@@ -100,4 +135,4 @@
100
135
 
101
136
  - Детали реализации (слоты, слой данных, стили и тесты): [docs/ARCHITECTURE.md](ARCHITECTURE.md)
102
137
  - Участие в разработке: [CONTRIBUTING.md](../CONTRIBUTING.md)
103
- - Сообщения о безопасности: [SECURITY.md](../SECURITY.md)
138
+ - Сообщения о безопасности: [SECURITY.md](../SECURITY.md)
@@ -2,7 +2,13 @@
2
2
 
3
3
  这里的图**全部是界面示意图**,由 `test/preview.mjs` 把插件真实组件渲染成静态 HTML、套上宿主主题 token、再用无头 Chromium 截出来,图内自带「界面示意图」标题。
4
4
 
5
- 生成方式:
5
+ ## 目录
6
+
7
+ - [生成方式](#生成方式)
8
+ - [为什么不用真机截图](#为什么不用真机截图)
9
+ - [需要真机图时](#需要真机图时)
10
+
11
+ ## 生成方式
6
12
 
7
13
  ```bash
8
14
  ELECTRON_RUN_AS_NODE=1 "/opt/DSH NEXT/dsh-desktop-next" test/preview.mjs --shot
@@ -23,7 +29,7 @@ ELECTRON_RUN_AS_NODE=1 "/opt/DSH NEXT/dsh-desktop-next" test/preview.mjs --shot
23
29
 
24
30
  ## 需要真机图时
25
31
 
26
- 确实需要真机观感时,按下面任一条做,**不要**直接 `agkit shot` 全窗截图就提交:
32
+ > 确实需要真机观感时,按下面任一条做,**不要**直接 `agkit shot` 全窗截图就提交:
27
33
 
28
34
  1. 裁剪到只有输入卡片 / 设置面板本体,去掉侧边栏、顶栏、状态行、账号区;
29
35
  2. 或者用一份干净的演示 profile(空白工作区、没有真实会话)来截;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-quick-phrases",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "DSH 快捷短语:输入框旁一排短语按钮,点按即发送;短语行支持显示整排 / 收成胶囊 / 彻底隐藏三态,管理入口可换齿轮图标或隐藏,输入框有内容时自动收起,单条短语可隐藏;管理页可增删改、拖动排序,显示名称与发送内容分离,显示位置可选。",
5
5
  "license": "MIT",
6
6
  "author": {