dsh-quick-phrases 0.4.0 → 0.6.0

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
@@ -18,7 +18,8 @@
18
18
  - **一排短语按钮**:显示名称与发送内容分离,默认四条:继续 / 提交 / 推送 / 发版。
19
19
  - **点按行为可选**:默认「直接发送」——输入框为空时一次点按就发出;输入框里已有文字或附件时,任何模式都改为插到光标处,不会覆盖正在写的内容。
20
20
  - **显示位置可选**:输入框下方(默认)、输入框上方、工具行右侧,切换即时生效。
21
- - **可以收起**:行尾一个「收起」动作;也可以让输入框一有内容就自动收起(默认),整排缩成一个小胶囊,点一下临时展开,不挡住正在写的字。
21
+ - **整排三态可选**:设置里的「短语行显示」一档搞定——**显示整排**常驻;**收成胶囊**只留一个小胶囊,点开可临时展开;**彻底隐藏**则把整排从界面完全移除(连胶囊都不留),只能回到 **设置 → 快捷短语** 恢复。
22
+ - **管理入口可换**:行尾的「管理」可以保持文字按钮、换成齿轮图标,或直接隐藏;隐藏后管理页仍从 **设置 → 快捷短语** 进入。
22
23
  - **单条短语可隐藏**:管理页每张卡片有一个眼睛开关,隐藏后这条按钮从短语行消失,卡片仍留在管理页并标注「已隐藏」。
23
24
  - **管理页**:拖动手柄排序、直接在卡片上改名、实时按钮预览与字数、两步确认删除、一键恢复默认。
24
25
  - **零依赖**:纯前端一个 `client.js`,不联网、不读写文件、不引入 npm 包,数据只存在本机 `localStorage`。
@@ -65,7 +66,7 @@ Plugins → Add plugin → 选择本仓库目录;或让 DSH 里的 agent 执
65
66
 
66
67
  ### 管理页
67
68
 
68
- 设置 → **快捷短语**:上面四项决定位置、点按行为、短语行是否显示、以及输入框有内容时怎么收起;下面一条短语一张卡片。
69
+ 设置 → **快捷短语**:上面五项决定位置、点按行为、短语行的显示形态、管理入口样式、以及输入框有内容时怎么收起;下面一条短语一张卡片。
69
70
 
70
71
  ![管理页(示意图 · 深色)](docs/images/manager-dark.png)
71
72
 
@@ -73,6 +74,8 @@ Plugins → Add plugin → 选择本仓库目录;或让 DSH 里的 agent 执
73
74
  - 卡片顶部那行是**显示名称**,直接点进去改;下面大框是**发送内容**。
74
75
  - 卡片底部实时显示按钮预览和字数,名称太长一眼就能看出来。
75
76
  - 每张卡片右上角的**眼睛**开关这条短语的显隐:关掉后按钮从短语行消失,卡片留在管理页并标上「已隐藏」,再点一次恢复。
77
+ - 页面上方的**短语行显示**下拉:**显示整排** / **收成胶囊** / **彻底隐藏**。选「彻底隐藏」时界面里什么都不渲染(连胶囊都没有),下拉旁标出「整排已隐藏」;改回前两项即可恢复,不必重启。选「显示整排」会顺带清掉之前「收起」留下的折叠状态。
78
+ - **管理入口**下拉:行尾的「管理」可以是**文字按钮**、**齿轮图标**(无障碍名称仍是「管理」),或**隐藏**。隐藏后行尾不再出现管理按钮,但短语行照常可用,管理页仍可从 **设置 → 快捷短语** 进入。
76
79
  - `✕` 第一次只进入「确认」态(4 秒后自动撤回),再点一次才真正删除。
77
80
  - **新增短语**会追加空卡片并聚焦名称;**恢复默认**在左侧,点一次进入确认态,再点一次恢复内置四条。
78
81
 
@@ -80,7 +83,7 @@ Plugins → Add plugin → 选择本仓库目录;或让 DSH 里的 agent 执
80
83
 
81
84
  ### 收起与隐藏
82
85
 
83
- 短语行占地方,但不该挡着打字。两种收起方式:
86
+ 短语行占地方,但不该挡着打字。可以临时收起,也可以在设置里选它常驻的形态:
84
87
 
85
88
  - 点行尾的 **收起**(`收起 ▾`)—— 立刻收成一个小胶囊,再点胶囊临时展开;
86
89
  - 设置里把「输入框有内容时」保持默认的 **自动收起**:输入框里一有文字或附件,整排自动缩成胶囊;也可以改成「保持显示」。
@@ -89,11 +92,19 @@ Plugins → Add plugin → 选择本仓库目录;或让 DSH 里的 agent 执
89
92
 
90
93
  ![输入框有草稿时自动收起(示意图)](docs/images/folded-dark.png)
91
94
 
92
- 想彻底不看见整排,把设置里的「显示短语行」开关关掉即可,效果和收起一样;单条短语则在管理页用眼睛开关隐藏,短语行的从左到右顺序与卡片顺序保持一致。
95
+ 设置里的 **短语行显示** 把整排的形态收成一个三态下拉:
96
+
97
+ - **显示整排**:常驻一整排,行尾「收起」还能临时折叠;
98
+ - **收成胶囊**:整排只留一个小胶囊,胶囊就在输入框旁,点一下展开;
99
+ - **彻底隐藏**:整排从界面完全消失,连胶囊都不留,界面上什么都不显示。恢复只能回到 **设置 → 快捷短语** 把下拉改回前两项。
100
+
101
+ 行尾「收起 ▾」等价于选「收成胶囊」;下拉选「显示整排」时会顺带清掉折叠状态,直接回到整排。「短语行显示」没有单独的状态键,读写的就是下面表里的 `hidden` 与 `collapsed` 两个键。
102
+
103
+ 单条短语则在管理页用眼睛开关隐藏;短语行的从左到右顺序与卡片顺序保持一致。
93
104
 
94
105
  ## 数据与隐私
95
106
 
96
- 短语、位置、点按行为、收起状态与自动收起选项分别存在 `localStorage` 的五个键里:
107
+ 短语、位置、点按行为、收起状态、自动收起选项、整排彻底隐藏状态与管理入口样式分别存在 `localStorage` 的七个键里:
97
108
 
98
109
  | 键 | 内容 |
99
110
  | --- | --- |
@@ -102,6 +113,10 @@ Plugins → Add plugin → 选择本仓库目录;或让 DSH 里的 agent 执
102
113
  | `dsh.quick-phrases.click.v1` | 点按行为 |
103
114
  | `dsh.quick-phrases.collapsed.v1` | 整排是否收起(`1` / `0`) |
104
115
  | `dsh.quick-phrases.autohide.v1` | 输入框有内容时收起还是保持显示 |
116
+ | `dsh.quick-phrases.hidden.v1` | 整排是否彻底隐藏(`1` / `0`,`1` 时什么都不渲染) |
117
+ | `dsh.quick-phrases.manage.v1` | 管理入口样式(`text` / `icon` / `hidden`,缺省 `text`) |
118
+
119
+ 「短语行显示」下拉不占新键:它读取上面 `hidden` 与 `collapsed` 两个键,选**彻底隐藏**写 `hidden='1'`,选**收成胶囊**写 `hidden='0'`、`collapsed='1'`,选**显示整排**两个都写 `'0'`。
105
120
 
106
121
  按 DSH Web 端的站点存储隔离;换机器或清空站点数据会丢。插件没有网络请求、没有 `eval`、不读写文件,也不向 Host 注册任何服务。
107
122
 
package/client.js CHANGED
@@ -29,6 +29,8 @@ window.__ModuleLoader__.load({
29
29
  var CLICK_KEY = 'dsh.quick-phrases.click.v1'
30
30
  var COLLAPSE_KEY = 'dsh.quick-phrases.collapsed.v1'
31
31
  var AUTOHIDE_KEY = 'dsh.quick-phrases.autohide.v1'
32
+ var HIDDEN_KEY = 'dsh.quick-phrases.hidden.v1'
33
+ var MANAGE_KEY = 'dsh.quick-phrases.manage.v1'
32
34
  var SECTION_ID = 'quick-phrases'
33
35
  var DOCK_ORDER = 5
34
36
  var SECTION_ORDER = 26
@@ -65,6 +67,21 @@ window.__ModuleLoader__.load({
65
67
  var AUTO_HIDE_MODES = ['fold', 'keep']
66
68
  var DEFAULT_AUTO_HIDE = 'fold'
67
69
 
70
+ /**
71
+ * What the end of the row shows for opening the manager: the original text
72
+ * chip, a gear icon keeping the same accessible name, or nothing at all
73
+ * (Settings → Quick phrases is still reachable).
74
+ */
75
+ var MANAGE_MODES = ['text', 'icon', 'hidden']
76
+ var DEFAULT_MANAGE = 'text'
77
+
78
+ /**
79
+ * The settings dropdown that exposes the row's two visibility toggles as one
80
+ * three-way choice. There is deliberately no storage key of its own: the
81
+ * value is derived from `hidden` (wins) and `collapsed`.
82
+ */
83
+ var ROW_MODES = ['full', 'pill', 'hidden']
84
+
68
85
  var DICTS = {
69
86
  zh: {
70
87
  'section.title': '快捷短语',
@@ -99,8 +116,18 @@ window.__ModuleLoader__.load({
99
116
  'manager.clickSend': '直接发送',
100
117
  'manager.clickInsert': '填入输入框',
101
118
  'manager.clickHint': '「直接发送」在输入框为空时一次点按就发出这条短语;输入框里已有文字或附件时会改为插到光标处,不会覆盖你正在写的内容。',
102
- 'manager.visible': '显示短语行',
103
- 'manager.visibleHint': '关掉后输入框旁只留一个小胶囊,点一下就能重新展开。',
119
+ 'manager.rowMode': '短语行显示',
120
+ 'manager.rowModeFull': '显示整排',
121
+ 'manager.rowModePill': '收成胶囊',
122
+ 'manager.rowModeHidden': '彻底隐藏',
123
+ 'manager.rowModeHint': '控制短语行出现的形态:「收成胶囊」只留一个可展开的小胶囊;「彻底隐藏」把整排从界面移除,连胶囊都不留。输入框有内容时是否自动收起由下面一项决定。',
124
+ 'manager.rowModeHintOff': '整排已完全隐藏,界面里不再显示任何按钮或胶囊。把这一项改回「显示整排」或「收成胶囊」即可恢复,不必重启。',
125
+ 'manager.rowHiddenBadge': '整排已隐藏',
126
+ 'manager.manageEntry': '管理入口',
127
+ 'manager.manageText': '文字按钮',
128
+ 'manager.manageIcon': '齿轮图标',
129
+ 'manager.manageHidden': '隐藏入口',
130
+ 'manager.manageHint': '短语行末尾的「管理」可以保持文字、换成齿轮图标,或直接隐藏;隐藏后只能从「设置 → 快捷短语」进入管理。',
104
131
  'manager.autoHide': '输入框有内容时',
105
132
  'manager.autoHideFold': '自动收起',
106
133
  'manager.autoHideKeep': '保持显示',
@@ -158,8 +185,18 @@ window.__ModuleLoader__.load({
158
185
  'manager.clickSend': 'Send right away',
159
186
  'manager.clickInsert': 'Fill the composer',
160
187
  'manager.clickHint': '“Send right away” fires the phrase with one click while the composer is empty; when it already holds text or attachments the phrase is inserted at the caret instead, so nothing you were writing is lost.',
161
- 'manager.visible': 'Show the phrase row',
162
- 'manager.visibleHint': 'When off, only a small pill stays next to the composer; click it to bring the row back.',
188
+ 'manager.rowMode': 'Phrase row',
189
+ 'manager.rowModeFull': 'Show the full row',
190
+ 'manager.rowModePill': 'Fold into a pill',
191
+ 'manager.rowModeHidden': 'Hide completely',
192
+ 'manager.rowModeHint': 'Controls the shape of the row: “Fold into a pill” leaves one expandable pill, while “Hide completely” removes the whole row, pill included. The option below still decides whether a draft folds it automatically.',
193
+ 'manager.rowModeHintOff': 'The whole row is completely hidden: no chips and no pill are rendered anywhere. Switch this back to “Show the full row” or “Fold into a pill” to restore it — no restart needed.',
194
+ 'manager.rowHiddenBadge': 'Row hidden',
195
+ 'manager.manageEntry': 'Manage button',
196
+ 'manager.manageText': 'Text button',
197
+ 'manager.manageIcon': 'Gear icon',
198
+ 'manager.manageHidden': 'Hidden',
199
+ 'manager.manageHint': 'The “Manage” chip at the end of the row can stay text, become a gear icon, or be left out entirely; once hidden it can only be reached in Settings → Quick phrases.',
163
200
  'manager.autoHide': 'When the composer has text',
164
201
  'manager.autoHideFold': 'Fold automatically',
165
202
  'manager.autoHideKeep': 'Keep it visible',
@@ -471,7 +508,8 @@ window.__ModuleLoader__.load({
471
508
  }
472
509
 
473
510
  /* ------------------------------------------------------------------ *
474
- * Visibility: the row folds into a pill, and the manager can turn it off.
511
+ * Visibility: the row folds into a pill, and the manager can hide it
512
+ * entirely (no pill, nothing rendered; only Settings brings it back).
475
513
  * ------------------------------------------------------------------ */
476
514
 
477
515
  /**
@@ -540,6 +578,8 @@ window.__ModuleLoader__.load({
540
578
 
541
579
  var collapseStore = makeEnumStore(COLLAPSE_KEY, ['0', '1'], '0', 'collapsed state')
542
580
  var autoHideStore = makeEnumStore(AUTOHIDE_KEY, AUTO_HIDE_MODES, DEFAULT_AUTO_HIDE, 'auto-hide mode')
581
+ var hiddenStore = makeEnumStore(HIDDEN_KEY, ['0', '1'], '0', 'row hidden state')
582
+ var manageStore = makeEnumStore(MANAGE_KEY, MANAGE_MODES, DEFAULT_MANAGE, 'manage entry mode')
543
583
 
544
584
  function useCollapsed() {
545
585
  return collapseStore.use() === '1'
@@ -557,6 +597,51 @@ window.__ModuleLoader__.load({
557
597
  autoHideStore.set(value)
558
598
  }
559
599
 
600
+ /** `true` while the manager keeps the whole row out of the UI. */
601
+ function useHidden() {
602
+ return hiddenStore.use() === '1'
603
+ }
604
+
605
+ function setHidden(value) {
606
+ hiddenStore.set(value ? '1' : '0')
607
+ }
608
+
609
+ /** `text` | `icon` | `hidden`, default `text`. */
610
+ function useManageEntry() {
611
+ return manageStore.use()
612
+ }
613
+
614
+ function setManageEntry(value) {
615
+ manageStore.set(value)
616
+ }
617
+
618
+ /** Derives the settings dropdown value: hidden wins over a leftover fold. */
619
+ function rowModeOf(hidden, collapsed) {
620
+ if (hidden) return 'hidden'
621
+ if (collapsed) return 'pill'
622
+ return 'full'
623
+ }
624
+
625
+ /**
626
+ * Writes the two existing keys instead of adding a third. `full` and `pill`
627
+ * clear the hidden flag first; `hidden` leaves the collapsed value alone so
628
+ * a folded row cannot reappear as a pill while it is hidden.
629
+ */
630
+ function setRowMode(mode) {
631
+ if (mode === 'hidden') {
632
+ setHidden(true)
633
+ return
634
+ }
635
+ if (mode === 'pill') {
636
+ setHidden(false)
637
+ setCollapsed(true)
638
+ return
639
+ }
640
+ if (mode !== 'full') return
641
+ setHidden(false)
642
+ setCollapsed(false)
643
+ }
644
+
560
645
  /* ------------------------------------------------------------------ *
561
646
  * Styles: local to each component, removed on unmount.
562
647
  * ------------------------------------------------------------------ */
@@ -582,6 +667,8 @@ window.__ModuleLoader__.load({
582
667
  '.dqp-chip:active{background:var(--dsw-alias-interactive-bg-hover-solid,rgba(255,255,255,.12))}' +
583
668
  '.dqp-chip:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-brand-primary,#4c6fff));outline-offset:2px}' +
584
669
  '.dqp-chip-manage{color:var(--dsw-alias-label-tertiary,#9a9a9a);border-style:dashed;background:transparent}' +
670
+ '.dqp-chip-manage-icon{padding:0 7px}' +
671
+ '.dqp-chip-manage svg{display:block}' +
585
672
  '.dqp-chip-collapse{color:var(--dsw-alias-label-caption,#7d7d7d);border-style:dashed;background:transparent}' +
586
673
  '.dqp-chip-collapse:hover{color:var(--dsw-alias-label-secondary,#b9b9b9)}' +
587
674
  '.dqp-pill{gap:4px;color:var(--dsw-alias-label-tertiary,#9a9a9a);border-style:dashed;background:transparent}' +
@@ -615,19 +702,13 @@ window.__ModuleLoader__.load({
615
702
  'color:var(--dsw-alias-label-primary,#eee);font:inherit;font-size:12px;line-height:1;appearance:none;-webkit-appearance:none;cursor:pointer}' +
616
703
  '.dqp-select:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}' +
617
704
  '.dqp-select:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-brand-primary,#4c6fff));outline-offset:1px}' +
618
- '.dqp-switch{box-sizing:border-box;position:relative;flex:0 0 auto;width:36px;height:20px;padding:0;border:.5px solid var(--dsw-alias-border-l2,#494949);' +
619
- 'border-radius:999px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.06));cursor:pointer;' +
620
- 'transition:background-color .15s ease,border-color .15s ease}' +
621
- '.dqp-switch:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.1))}' +
622
- '.dqp-switch:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-brand-primary,#4c6fff));outline-offset:2px}' +
623
- '.dqp-switch-thumb{position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;' +
624
- 'background:var(--dsw-alias-label-tertiary,#9a9a9a);transition:transform .15s ease,background-color .15s ease}' +
625
- '.dqp-switch-on{border-color:transparent;background:var(--dsw-alias-button-primary-fill,#4c6fff)}' +
626
- '.dqp-switch-on:hover{background:var(--dsw-alias-button-primary-hover,#3f5fe0)}' +
627
- '.dqp-switch-on .dqp-switch-thumb{transform:translateX(16px);background:var(--dsw-alias-label-primary-foreground,#fff)}' +
628
705
  '.dqp-row-muted .dqp-body{opacity:.55}' +
629
706
  '.dqp-badge-hidden{margin-left:2px;border:.5px solid var(--dsw-alias-border-l2,#494949);' +
630
707
  'background:transparent;color:var(--dsw-alias-label-secondary,#b9b9b9)}' +
708
+ '.dqp-option-label-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px}' +
709
+ '.dqp-badge-row-hidden{margin-left:0;padding:0 7px;border:.5px solid var(--dsw-alias-border-l2,#494949);' +
710
+ 'background:transparent;color:var(--dsw-alias-label-secondary,#b9b9b9)}' +
711
+ '.dqp-option-hint-warn{color:var(--dsw-alias-state-warn-primary,#e0a33a)}' +
631
712
  '.dqp-eye-off{color:var(--dsw-alias-label-caption,#7d7d7d)}' +
632
713
  '.dqp-eye-off:hover:not(:disabled){color:var(--dsw-alias-label-primary,#eee)}' +
633
714
  '.dqp-section{display:flex;flex-direction:column;gap:10px}' +
@@ -756,6 +837,8 @@ window.__ModuleLoader__.load({
756
837
  var attachments = typeof props.useInput === 'function' ? props.useInput(attachmentCountOf) : 0
757
838
  var collapsed = useCollapsed()
758
839
  var autoHide = useAutoHide()
840
+ var hidden = useHidden()
841
+ var manageEntry = useManageEntry()
759
842
  var peekState = React.useState(false)
760
843
  var peeked = peekState[0]
761
844
  var setPeeked = peekState[1]
@@ -782,6 +865,11 @@ window.__ModuleLoader__.load({
782
865
 
783
866
  if (current !== spec.value) return null
784
867
 
868
+ // A completely hidden row leaves nothing on screen — no chips, no pill,
869
+ // not even an empty wrapper. It wins over the folded state, so a row the
870
+ // user hid while folded cannot come back as a pill on the next render.
871
+ if (hidden) return null
872
+
785
873
  function insertIntoCaret(phrase) {
786
874
  if (typeof inputActions.captureInsertion === 'function' && typeof inputActions.insertText === 'function') {
787
875
  try {
@@ -882,12 +970,23 @@ window.__ModuleLoader__.load({
882
970
  },
883
971
  t('dock.collapse'),
884
972
  h('span', { className: 'dqp-caret', 'aria-hidden': true }, '\u25be')),
885
- h('button', {
973
+ manageEntry === 'hidden' ? null : h('button', {
886
974
  key: 'manage',
887
975
  type: 'button',
888
- className: 'dqp-chip dqp-chip-manage',
976
+ className: 'dqp-chip dqp-chip-manage' + (manageEntry === 'icon' ? ' dqp-chip-manage-icon' : ''),
977
+ title: t('dock.manage'),
978
+ 'aria-label': t('dock.manage'),
889
979
  onClick: handleManage,
890
- }, t('dock.manage')),
980
+ }, manageEntry === 'icon'
981
+ ? h('svg', { width: 14, height: 14, viewBox: '0 0 24 24', fill: 'none', 'aria-hidden': true },
982
+ h('circle', { cx: 12, cy: 12, r: 3, stroke: 'currentColor', strokeWidth: 1.6 }),
983
+ h('path', {
984
+ d: 'M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1Z',
985
+ stroke: 'currentColor',
986
+ strokeWidth: 1.4,
987
+ strokeLinejoin: 'round',
988
+ }))
989
+ : t('dock.manage')),
891
990
  ))
892
991
  }
893
992
  if (showHint[0]) {
@@ -906,7 +1005,10 @@ window.__ModuleLoader__.load({
906
1005
  var phrases = usePhrases(t)
907
1006
  var placementNow = usePlacement()
908
1007
  var clickNow = useClickMode()
909
- var collapsed = useCollapsed()
1008
+ var rowHidden = useHidden()
1009
+ var rowFolded = useCollapsed()
1010
+ var rowMode = rowModeOf(rowHidden, rowFolded)
1011
+ var manageNow = useManageEntry()
910
1012
  var autoHideNow = useAutoHide()
911
1013
 
912
1014
  var resetState = React.useState(false)
@@ -1134,20 +1236,51 @@ window.__ModuleLoader__.load({
1134
1236
  ),
1135
1237
  )
1136
1238
 
1137
- var visibleOption = h('div', { className: 'dqp-option' },
1239
+ var rowModeOption = h('div', { className: 'dqp-option' },
1240
+ h('div', { className: 'dqp-option-text' },
1241
+ h('div', { className: 'dqp-option-label-row' },
1242
+ h('label', { className: 'dqp-option-label', htmlFor: 'dqp-rowmode' }, t('manager.rowMode')),
1243
+ rowHidden
1244
+ ? h('span', { className: 'dqp-badge dqp-badge-row-hidden' }, t('manager.rowHiddenBadge'))
1245
+ : null,
1246
+ ),
1247
+ h('span', {
1248
+ className: 'dqp-option-hint' + (rowHidden ? ' dqp-option-hint-warn' : ''),
1249
+ }, rowHidden ? t('manager.rowModeHintOff') : t('manager.rowModeHint')),
1250
+ ),
1251
+ h('div', { className: 'dqp-select-wrap' },
1252
+ h('select', {
1253
+ id: 'dqp-rowmode',
1254
+ className: 'dqp-select',
1255
+ value: rowMode,
1256
+ onChange: function (event) { setRowMode(event.target.value) },
1257
+ },
1258
+ ROW_MODES.map(function (value) {
1259
+ return h('option', { key: value, value: value },
1260
+ t(value === 'full' ? 'manager.rowModeFull' : value === 'pill' ? 'manager.rowModePill' : 'manager.rowModeHidden'))
1261
+ }),
1262
+ ),
1263
+ ),
1264
+ )
1265
+
1266
+ var manageOption = h('div', { className: 'dqp-option' },
1138
1267
  h('div', { className: 'dqp-option-text' },
1139
- h('span', { className: 'dqp-option-label', id: 'dqp-visible-label' }, t('manager.visible')),
1140
- h('span', { className: 'dqp-option-hint' }, t('manager.visibleHint')),
1268
+ h('label', { className: 'dqp-option-label', htmlFor: 'dqp-manage' }, t('manager.manageEntry')),
1269
+ h('span', { className: 'dqp-option-hint' }, t('manager.manageHint')),
1270
+ ),
1271
+ h('div', { className: 'dqp-select-wrap' },
1272
+ h('select', {
1273
+ id: 'dqp-manage',
1274
+ className: 'dqp-select',
1275
+ value: manageNow,
1276
+ onChange: function (event) { setManageEntry(event.target.value) },
1277
+ },
1278
+ MANAGE_MODES.map(function (value) {
1279
+ return h('option', { key: value, value: value },
1280
+ t(value === 'text' ? 'manager.manageText' : value === 'icon' ? 'manager.manageIcon' : 'manager.manageHidden'))
1281
+ }),
1282
+ ),
1141
1283
  ),
1142
- h('button', {
1143
- type: 'button',
1144
- id: 'dqp-visible',
1145
- className: 'dqp-switch' + (collapsed ? '' : ' dqp-switch-on'),
1146
- role: 'switch',
1147
- 'aria-checked': !collapsed,
1148
- 'aria-labelledby': 'dqp-visible-label',
1149
- onClick: function () { setCollapsed(!collapsed) },
1150
- }, h('span', { className: 'dqp-switch-thumb' })),
1151
1284
  )
1152
1285
 
1153
1286
  var autoHideOption = h('div', { className: 'dqp-option' },
@@ -1179,7 +1312,7 @@ window.__ModuleLoader__.load({
1179
1312
  ),
1180
1313
  h('span', { className: 'dqp-badge' }, t('manager.count').replace('{n}', String(phrases.length))),
1181
1314
  ),
1182
- h('div', { className: 'dqp-options' }, placementOption, clickOption, visibleOption, autoHideOption),
1315
+ h('div', { className: 'dqp-options' }, placementOption, clickOption, rowModeOption, manageOption, autoHideOption),
1183
1316
  h('div', { className: 'dqp-section' },
1184
1317
  h('div', { className: 'dqp-section-head' },
1185
1318
  h('h3', { className: 'dqp-section-title' }, t('manager.phrases')),
@@ -52,7 +52,7 @@ return {
52
52
 
53
53
  ## 数据层
54
54
 
55
- 五个 store 都是模块级状态 + `localStorage`,不经过 Host:
55
+ 七个 store 都是模块级状态 + `localStorage`,不经过 Host:
56
56
 
57
57
  | store | 存储键 | 读写 |
58
58
  | --- | --- | --- |
@@ -61,20 +61,30 @@ return {
61
61
  | 点按行为 | `dsh.quick-phrases.click.v1` | 同上 |
62
62
  | 整排收起 | `dsh.quick-phrases.collapsed.v1` | `'1'` / `'0'`,缺省 `'0'` |
63
63
  | 自动收起选项 | `dsh.quick-phrases.autohide.v1` | `'fold'` / `'keep'`,缺省 `'fold'` |
64
+ | 整排彻底隐藏 | `dsh.quick-phrases.hidden.v1` | `'1'` / `'0'`,缺省 `'0'`;`'1'` 时三个位置都不渲染 |
65
+ | 管理入口 | `dsh.quick-phrases.manage.v1` | `'text'` / `'icon'` / `'hidden'`,缺省 `'text'`;`hidden` 时行尾不渲染管理按钮 |
64
66
 
65
- 后三个用同一个工厂 `makeEnumStore(key, values, fallback, label)` 造出来:读取时白名单外的值一律回落 fallback,写入前也做同样校验,所以旧版本留下的脏值或手改的 `localStorage` 不会让界面进入未定义状态。新增一个类似开关时优先复用它,不要再手写第六份 read/ensure/set/use。
67
+ 整排收起 / 自动收起 / 整排彻底隐藏 / 管理入口这四个都用同一个工厂 `makeEnumStore(key, values, fallback, label)` 造出来:读取时白名单外的值一律回落 fallback,写入前也做同样校验,所以旧版本留下的脏值或手改的 `localStorage` 不会让界面进入未定义状态。新增一个类似开关时优先复用它,不要再手写第三份 read/ensure/set/use(显示位置 / 点按行为两处仍是手写实现)。
66
68
 
67
- `usePhrases()` / `usePlacement()` / `useClickMode()` / `useCollapsed()` / `useAutoHide()` 是 `useState` + `subscribe` 的小包装,同时监听 `storage` 事件,多窗口之间也能同步。首次使用时按当前界面语言写入四条默认短语。
69
+ 设置页的「短语行显示」下拉**没有自己的存储键**:`rowModeOf(hidden, collapsed)` 按 `hidden → 'hidden'`、`collapsed → 'pill'`、否则 `'full'` 推导当前值;`setRowMode(mode)` 组合写两个既有键(`hidden` 优先,选 `full` / `pill` 时先清 `hidden`),所以旧版本、多窗口和「收起」chip 写下的状态始终是同一份真相。
70
+
71
+ `usePhrases()` / `usePlacement()` / `useClickMode()` / `useCollapsed()` / `useAutoHide()` / `useHidden()` / `useManageEntry()` 是 `useState` + `subscribe` 的小包装,同时监听 `storage` 事件,多窗口之间也能同步。首次使用时按当前界面语言写入四条默认短语。
68
72
 
69
73
  短语条目里除了 `id` / `label` / `text` 还有一个 `hidden` 布尔值(`normalize()` 缺成 `false`)。短语行渲染前会滤掉 `hidden === true` 的条目,管理页则照常渲染并用 `dqp-row-muted` 变暗、加「已隐藏」徽标。
70
74
 
71
- 收起逻辑也在 `DockChips` 里,先于渲染决定这次画整排还是画一个胶囊:
75
+ 可见性判断也在 `DockChips` 里,顺序固定:先把 hook 全部跑完(数量不随状态变化),再依次判断位置、彻底隐藏、折叠:
72
76
 
73
77
  ```
78
+ if (current !== spec.value) return null // 只有选中位置的那一行渲染
79
+ if (hidden) return null // 彻底隐藏:什么都不渲染,连胶囊都不留
74
80
  hasDraft = draft.trim() !== '' || attachments > 0
75
81
  folded = collapsed || (autoHide === 'fold' && hasDraft && !peeked)
76
82
  ```
77
83
 
84
+ `hidden` 优先于折叠:即使之前用「收起」写过 `collapsed='1'`,隐藏后也不会冒出胶囊。设置页下拉选「显示整排」时同时 `setHidden(false)` 与 `setCollapsed(false)`,直接回到整排;选「收成胶囊」写 `hidden='0'`、`collapsed='1'`;选「彻底隐藏」只写 `hidden='1'`。
85
+
86
+ 管理入口在同一个 `DockChips` 里按 `manage.v1` 渲染:`text` 是原来的「管理」文字 chip,`icon` 是同样点击行为的齿轮 `svg`(`aria-label` 仍取 `dock.manage`),`hidden` 连按钮都不渲染。三种模式都不影响短语 chips、「收起」chip 和管理页本身。
87
+
78
88
  `peeked` 是组件内部的临时状态:点胶囊时置 `true` 并同时展开(`setCollapsed(false)`),这样"临时看一眼"不会写进 `localStorage`,草稿清空后 `useEffect` 会把它清掉。手动收起(`setCollapsed(true)`)是持久状态,跨会话保留。
79
89
 
80
90
  点按逻辑在 `DockChips` 里:
@@ -108,9 +118,9 @@ margin: 0 auto;
108
118
 
109
119
  `test/smoke.mjs` 把真实的 `client.js` 放进 `vm` 沙箱,用最小假 React(按组件名分配 hook 单元)和假 ModuleLoader 跑起来,直接调组件自己的 `onClick` / `onChange`,断言落在 `localStorage` 和渲染树上的结果。改行为时先改这里——它是唯一能在没有宿主的情况下验证「显示与发送分离」「位置切换」「拖动排序」「收起与隐藏」是否还成立的护栏。
110
120
 
111
- 与收起/隐藏相关的断言:点「收起」写入 `collapsed.v1='1'` 且只剩 `.dqp-pill`;点胶囊回到 `'0'` 并恢复六个 chip;草稿出现时默认折成胶囊、展开后点第二条仍插到光标处;`autohide` 切到 `keep` 后草稿不再折叠;`#dqp-visible` 开关往返;隐藏一条后短语行少一个 chip、管理页仍是四张卡片且第一张带 `dqp-row-muted`。
121
+ 与收起/隐藏相关的断言:点「收起」写入 `collapsed.v1='1'` 且只剩 `.dqp-pill`;点胶囊回到 `'0'` 并恢复六个 chip;草稿出现时默认折成胶囊、展开后点第二条仍插到光标处;`autohide` 切到 `keep` 后草稿不再折叠;`#dqp-rowmode` 默认 `full`、选 `pill` 写 `collapsed='1'` 且 dock 只剩一个 `.dqp-pill`、选 `hidden` 写 `hidden='1'` 且整排组件返回 `null`(连胶囊都没有)、hidden 时改选 `pill` 会清掉 `hidden` 并折回胶囊、再选 `full` 把两个键都写成 `'0'` 并恢复六个 chip;管理页在 hidden 时显示「整排已隐藏」徽标与恢复提示。`#dqp-manage` 默认 `text`(显示「管理」chip)、`icon` 渲染含 `svg` 且无文字、`aria-label` 仍是「管理」、`hidden` 时行尾没有管理 chip 但短语 chips 照常渲染,且三态分别持久化到 `manage.v1`。隐藏一条后短语行少一个 chip、管理页仍是四张卡片且第一张带 `dqp-row-muted`;字典还有一条 zh/en 键集合完全对称的断言。
112
122
 
113
- `test/preview.mjs` 把组件渲染成静态 HTML,拼上宿主主题 CSS,可用无头 Chromium 截图,用来肉眼核对深浅两套主题。`docs/images/` 下的图就是它产出的**界面示意图**(图内带「界面示意图」标题),不是真机截屏。
123
+ `test/preview.mjs` 把组件渲染成静态 HTML,拼上宿主主题 CSS,可用无头 Chromium 截图,用来肉眼核对深浅两套主题;它还会渲染「整排完全隐藏」的管理页状态和三态短语行 / 三态管理入口的状态页(`/tmp/dqp-modes-*.html`),并断言隐藏时短语行序列化出来是空字符串。`docs/images/` 下的图就是它产出的**界面示意图**(图内带「界面示意图」标题),不是真机截屏。
114
124
 
115
125
  ## 兼容性注意
116
126
 
package/docs/DETAIL.en.md CHANGED
@@ -25,24 +25,33 @@ All three rows stay registered, but only the selected one renders — switching
25
25
 
26
26
  ## Folding and hiding
27
27
 
28
- The row should never get in the way of typing, so it can fold in two ways:
28
+ The row should never get in the way of typing, so it can fold on demand and its resting shape is a setting:
29
29
 
30
30
  - **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
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.
32
32
 
33
33
  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
34
 
35
- 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. The "Show the phrase row" switch in Settings hides the whole row.
35
+ The **Phrase row** dropdown in Settings turns the resting shape into a three-way choice:
36
+
37
+ - **Show the full row**: the whole row stays, and the fold chip still folds it temporarily;
38
+ - **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.
40
+
41
+ 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
+
43
+ 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.
36
44
 
37
45
  ## Managing phrases
38
46
 
39
- Open **Settings → Quick phrases**. The page has two layers: behaviour options on top, the phrase list below.
47
+ Open **Settings → Quick phrases**. The page has two layers: five behaviour options on top, the phrase list below.
40
48
 
41
49
  **Behaviour options** (applied on selection):
42
50
 
43
51
  - **Position**: switch between the three positions above.
44
52
  - **On click**: pick "Send right away" or "Fill the composer"; the default is sending right away.
45
- - **Show the phrase row**: switch the whole row on or off. When off, a single small pill remains beside the composer; click it to expand.
53
+ - **Phrase row**: a three-way dropdown. **Show the full row** keeps the whole row; **Fold into a pill** leaves only the small expandable pill; **Hide completely** removes the row from the UI entirely (not even the pill), and only this page can bring it back; picking "Show the full row" also clears the folded state.
54
+ - **Manage button**: the style of the "Manage" chip at the end of the row. **Text button** is the current look; **Gear icon** swaps in a settings icon (its accessible name stays "Manage" and clicking behaves the same); **Hidden** renders no manage button while the phrase row keeps working, and this page stays reachable.
46
55
  - **When the composer has text**: pick "Fold automatically" (default) or "Keep it visible" to decide whether the row folds into the pill while a draft or attachments exist.
47
56
 
48
57
  **Phrase list** (one card per phrase):
@@ -55,11 +64,11 @@ Open **Settings → Quick phrases**. The page has two layers: behaviour options
55
64
  - **✕**: the first click only arms the delete ("Confirm"), a second click within four seconds removes the phrase.
56
65
  - **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.
57
66
 
58
- 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`), scoped to the DSH Web origin — a different machine or cleared site data loses it.
67
+ 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`.
59
68
 
60
69
  ## Opening it from the composer
61
70
 
62
- The **Manage** chip at the end of the row jumps to the same settings page (expand the pill first when the row is folded). If the settings entry is not mounted in this UI yet, it says "请在『设置 — 快捷短语』中管理" instead.
71
+ 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.
63
72
 
64
73
  ## Styling
65
74
 
package/docs/DETAIL.md CHANGED
@@ -25,24 +25,33 @@
25
25
 
26
26
  ## 收起与隐藏
27
27
 
28
- 短语行不该挡着打字,所以有两种收起方式:
28
+ 短语行不该挡着打字,所以可以临时收起,也可以在设置里选它常驻的形态:
29
29
 
30
30
  - **手动收起**:点行尾的 `收起 ▾`,整排缩成一个小胶囊 `▸ 快捷短语`;点胶囊临时展开,再点「收起」收回去。
31
31
  - **自动收起**(默认):设置里「输入框有内容时」选「自动收起」——输入框里一有文字或附件就缩成胶囊,草稿清空后自动展开;也可以选「保持显示」,让整排常驻。
32
32
 
33
33
  收起状态下点开胶囊再点短语,行为和展开时完全一样:输入框里已有内容时仍然插到光标处,不会覆盖草稿。
34
34
 
35
- 单条短语可以在管理页用每张卡片右上角的**眼睛**开关隐藏:隐藏后这条按钮不再出现在短语行,卡片仍留在管理页并标注「已隐藏」,再点一次恢复显示。也可以直接用设置里的「显示短语行」开关把整排关掉。
35
+ 设置里的 **短语行显示** 把整排的形态收成一个三态下拉:
36
+
37
+ - **显示整排**:常驻一整排,行尾「收起」仍可临时折叠;
38
+ - **收成胶囊**:整排只留一个小胶囊,胶囊仍在输入框旁,点一下就能展开;
39
+ - **彻底隐藏**:整排从界面完全消失,**连胶囊都不留**,界面上什么都不显示。之后只能回到 **设置 → 快捷短语** 把下拉改回前两项(选「彻底隐藏」时旁边会标出「整排已隐藏」);改回「显示整排」时会顺带清掉折叠状态,直接回到整排。
40
+
41
+ 行尾「收起 ▾」等价于选「收成胶囊」。这个三态下拉不另存状态键:它由 `dsh.quick-phrases.hidden.v1`(优先)与 `dsh.quick-phrases.collapsed.v1` 推出,切换时组合写这两个既有键。
42
+
43
+ 单条短语可以在管理页用每张卡片右上角的**眼睛**开关隐藏:隐藏后这条按钮不再出现在短语行,卡片仍留在管理页并标注「已隐藏」,再点一次恢复显示。
36
44
 
37
45
  ## 管理短语
38
46
 
39
- 打开 **设置 → 快捷短语**。页面分两层:上面是四项行为设置,下面是短语列表。
47
+ 打开 **设置 → 快捷短语**。页面分两层:上面是五项行为设置,下面是短语列表。
40
48
 
41
49
  **行为设置**(选中或点一下即生效):
42
50
 
43
51
  - **显示位置**:在上面三个位置之间切换。
44
52
  - **点按短语时**:选择「直接发送」或「填入输入框」。默认直接发送。
45
- - **显示短语行**:开关整排的显示。关掉后输入框旁只留一个小胶囊,点一下就能重新展开。
53
+ - **短语行显示**:三态下拉。**显示整排**常驻一整排;**收成胶囊**只留一个小胶囊,点开可临时展开;**彻底隐藏**则整排从界面完全消失(连胶囊都没有),只能回到本页改回前两项;选「显示整排」时会同时清掉折叠状态。
54
+ - **管理入口**:行尾「管理」的样式。**文字按钮**为现状;**齿轮图标**换成设置图标(无障碍名称仍是「管理」,点击行为不变);**隐藏入口**则行尾不再渲染管理按钮,但短语行照常使用,管理页仍可从本页进入。
46
55
  - **输入框有内容时**:选「自动收起」(默认)或「保持显示」,决定草稿/附件出现时整排是否缩成胶囊。
47
56
 
48
57
  **短语列表**(一条短语一张卡片):
@@ -55,11 +64,11 @@
55
64
  - **✕**:第一次点击只是把按钮变成「确认」,4 秒内再点一次才真正删除,避免误删。
56
65
  - **新增短语**:追加一条空卡片并自动把光标放到名称上;**恢复默认**点一次进入确认态,再点一次恢复为内置的四条短语。
57
66
 
58
- 改动即时保存、即时生效,无需重启。短语保存在本机浏览器存储里(`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 的 Web 端存储隔离,换机器或清空站点数据会丢失。
67
+ 改动即时保存、即时生效,无需重启。短语保存在本机浏览器存储里(`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`。
59
68
 
60
69
  ## 在输入框旁直接打开
61
70
 
62
- 短语行最右侧的 **管理** 会跳到同一页设置(收起成胶囊时,先点胶囊展开)。如果当前界面还没装上设置入口,会提示「请在『设置 — 快捷短语』中管理」。
71
+ 短语行最右侧的 **管理** 会跳到同一页设置(收起成胶囊时,先点胶囊展开)。管理入口可以在设置里换成齿轮图标或隐藏;隐藏后行尾不再出现管理按钮,从 **设置 → 快捷短语** 进入即可。如果当前界面还没装上设置入口,会提示「请在『设置 — 快捷短语』中管理」。
63
72
 
64
73
  ## 样式
65
74
 
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-quick-phrases",
3
- "version": "0.4.0",
4
- "description": "DSH 快捷短语:输入框旁一排短语按钮,点按即发送;输入框有内容时自动收起成小胶囊,单条短语可隐藏;管理页可增删改、拖动排序,显示名称与发送内容分离,显示位置可选。",
3
+ "version": "0.6.0",
4
+ "description": "DSH 快捷短语:输入框旁一排短语按钮,点按即发送;短语行支持显示整排 / 收成胶囊 / 彻底隐藏三态,管理入口可换齿轮图标或隐藏,输入框有内容时自动收起,单条短语可隐藏;管理页可增删改、拖动排序,显示名称与发送内容分离,显示位置可选。",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "pengtang1024",