@alexsun-top/opencode-chat-room 0.7.6 → 0.7.8

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -5
  3. package/README.zh-CN.md +5 -5
  4. package/dist/cli.js +815 -192
  5. package/package.json +3 -2
  6. package/plugin.ts +15 -3
  7. package/server/assets/base.css +0 -2
  8. package/server/assets/chat/announcements.js +5 -2
  9. package/server/assets/chat/clipboard.js +30 -0
  10. package/server/assets/chat/copy-action.js +48 -0
  11. package/server/assets/chat/diagram-viewer.js +253 -0
  12. package/server/assets/chat/doc-preview.js +160 -13
  13. package/server/assets/chat/editor.js +10 -7
  14. package/server/assets/chat/events.js +26 -5
  15. package/server/assets/chat/files.js +26 -5
  16. package/server/assets/chat/history-loader.js +3 -1
  17. package/server/assets/chat/index.js +11 -1
  18. package/server/assets/chat/join-requests.js +6 -3
  19. package/server/assets/chat/locales/de.js +20 -2
  20. package/server/assets/chat/locales/es.js +20 -2
  21. package/server/assets/chat/locales/fr.js +20 -2
  22. package/server/assets/chat/locales/it.js +20 -2
  23. package/server/assets/chat/locales/ja.js +20 -2
  24. package/server/assets/chat/locales/ko.js +20 -2
  25. package/server/assets/chat/markdown.js +75 -86
  26. package/server/assets/chat/messages.js +7 -3
  27. package/server/assets/chat/palette.js +40 -18
  28. package/server/assets/chat/pwa.js +2 -0
  29. package/server/assets/chat/questions.js +6 -0
  30. package/server/assets/chat/resource-format.js +74 -0
  31. package/server/assets/chat/rooms.js +9 -1
  32. package/server/assets/chat/shortcuts.js +14 -3
  33. package/server/assets/chat/side-pane.js +136 -0
  34. package/server/assets/chat/state.js +85 -8
  35. package/server/assets/chat/system-messages.js +3 -1
  36. package/server/assets/chat/task-form.js +197 -0
  37. package/server/assets/chat/task-row.js +170 -0
  38. package/server/assets/chat/tasks.js +521 -0
  39. package/server/assets/chat/viewport.js +5 -0
  40. package/server/assets/conversation.css +25 -1
  41. package/server/assets/diagram-viewer.css +141 -0
  42. package/server/assets/doc-preview.css +24 -5
  43. package/server/assets/responsive.css +108 -14
  44. package/server/assets/tasks.css +419 -0
  45. package/server/chat-server.ts +9 -4
  46. package/server/chat.html +120 -21
  47. package/server/member-routes.ts +3 -0
  48. package/server/resource-routes.ts +3 -1
  49. package/server/sw.js +247 -4
  50. package/server/task-routes.ts +53 -0
  51. package/skills/chatroom/SKILL.md +3 -1
  52. package/src/README.md +3 -3
  53. package/src/agent/chatroom-skill.ts +8 -2
  54. package/src/agent/task-tool.ts +155 -0
  55. package/src/center/center-client.ts +44 -0
  56. package/src/rooms/resources.ts +2 -2
  57. package/src/rooms/tasks.ts +246 -0
  58. package/src/runtime/v2-plugin.ts +11 -2
  59. package/src/runtime/watch.ts +38 -5
  60. package/src/state/sqlite-state.ts +93 -8
  61. package/src/state/store.ts +2 -2
  62. package/src/tui/app.mjs +14 -4
  63. package/src/tui/http.mjs +2 -2
  64. package/src/tui/info-app.mjs +24 -15
  65. package/src/tui/join-app.mjs +3 -3
  66. package/src/tui/main.mjs +4 -4
  67. package/src/tui/markdown.mjs +31 -5
  68. package/src/tui/mentions.mjs +218 -0
  69. package/src/tui/message-app.mjs +15 -11
  70. package/src/tui/palette-app.mjs +19 -9
  71. package/src/tui/reminder-app.mjs +14 -10
  72. package/src/tui/ui-content.mjs +12 -3
  73. package/src/tui/ui-mentions.mjs +44 -0
  74. package/src/tui/ui-suggest-view.mjs +63 -0
  75. package/src/tui/ui-suggest.mjs +197 -0
  76. package/src/tui/ui-theme.mjs +2 -1
  77. package/src/tui/ui-view.mjs +2 -0
  78. package/src/tui/ui.mjs +17 -9
@@ -0,0 +1,419 @@
1
+ /* Room tasks: a compact task board that stays inside the dialog. */
2
+ #btnTasks { display: flex; align-items: center; gap: 8px; }
3
+ #btnTasks svg {
4
+ width: 15px;
5
+ height: 15px;
6
+ flex: none;
7
+ }
8
+
9
+ #tasksDialog {
10
+ width: min(860px, calc(100vw - 24px));
11
+ max-width: none;
12
+ height: fit-content;
13
+ max-height: min(760px, 86dvh);
14
+ margin: auto;
15
+ padding: 0;
16
+ overflow: hidden;
17
+ border-radius: 22px;
18
+ }
19
+ #tasksDialog[open] { display: flex; flex-direction: column; animation: tasks-in .18s ease-out both; }
20
+ @keyframes tasks-in { from { opacity: 0; transform: translateY(8px); } }
21
+ #tasksDialog::backdrop { background: rgb(9 22 18 / .52); backdrop-filter: blur(4px); }
22
+ /* Wide windows keep the board beside the conversation instead of over it.
23
+ Keep this query in sync with PANE_QUERY in tasks.js. */
24
+ #tasksDialog.is-pane {
25
+ position: relative;
26
+ inset: auto;
27
+ grid-column: 4;
28
+ grid-row: 1 / -1;
29
+ width: auto;
30
+ height: auto;
31
+ min-width: 0;
32
+ min-height: 0;
33
+ max-height: none;
34
+ margin: 0;
35
+ border: 0;
36
+ border-left: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
37
+ border-radius: 0;
38
+ background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 84%, var(--accent-soft)), var(--surface) 32%);
39
+ box-shadow: none;
40
+ animation: none;
41
+ }
42
+ /* Markdown preview takes the third column while it is open; the task pane stays
43
+ open underneath and comes back when the document closes. */
44
+ #chatView.has-doc #tasksDialog.is-pane { display: none; }
45
+ #tasksDialog.is-pane .tasks-scroll { flex: 1 1 auto; }
46
+ #tasksDialog.is-pane .tasks-head { padding: 16px 12px 10px 18px; }
47
+ #tasksDialog.is-pane .tasks-toolbar { padding: 0 14px 8px 18px; }
48
+ #tasksDialog.is-pane .tasks-scroll { padding: 0 14px 18px 18px; scrollbar-gutter: stable; }
49
+ /* A narrow pane stacks the row actions so the title and steps get the full width. */
50
+ #tasksDialog.is-pane .task-row { grid-template-columns: minmax(0, 1fr); }
51
+ #tasksDialog.is-pane .task-row-actions { grid-column: 1; justify-content: flex-end; }
52
+ /* The pane is narrow: give every form field its own row, including the date input. */
53
+ #tasksDialog.is-pane .task-create-form,
54
+ #tasksDialog.is-pane .task-edit-form { grid-template-columns: minmax(0, 1fr); }
55
+ #tasksDialog.is-pane .task-create-due, #tasksDialog.is-pane .task-create-assignee,
56
+ #tasksDialog.is-pane .task-edit-due-field, #tasksDialog.is-pane .task-edit-assignee-field { grid-column: 1; }
57
+
58
+ .tasks-head {
59
+ display: flex;
60
+ flex: none;
61
+ align-items: flex-start;
62
+ justify-content: space-between;
63
+ gap: 12px;
64
+ padding: 18px 20px 12px;
65
+ }
66
+ .tasks-heading { min-width: 0; }
67
+ .tasks-eyebrow {
68
+ display: flex;
69
+ align-items: baseline;
70
+ min-width: 0;
71
+ margin: 0 0 2px;
72
+ color: var(--accent);
73
+ font: 700 10px/1.3 var(--font-mono);
74
+ letter-spacing: .1em;
75
+ text-transform: uppercase;
76
+ }
77
+ .tasks-heading h2 {
78
+ margin: 0;
79
+ font-family: var(--font-display);
80
+ font-size: 23px;
81
+ font-weight: 600;
82
+ letter-spacing: -.02em;
83
+ overflow-wrap: anywhere;
84
+ }
85
+ .tasks-room-name {
86
+ min-width: 0;
87
+ overflow: hidden;
88
+ color: var(--ink-3);
89
+ font-weight: 500;
90
+ text-overflow: ellipsis;
91
+ white-space: nowrap;
92
+ }
93
+ .tasks-eyebrow > span:first-child { flex: none; white-space: nowrap; }
94
+ .tasks-head-actions { display: flex; flex: none; align-items: center; gap: 4px; }
95
+ .tasks-menu-anchor { position: relative; display: flex; }
96
+ .tasks-menu {
97
+ position: absolute;
98
+ top: calc(100% + 4px);
99
+ right: 0;
100
+ z-index: 6;
101
+ min-width: 186px;
102
+ padding: 4px;
103
+ border: 1px solid var(--line);
104
+ border-radius: 10px;
105
+ background: var(--surface);
106
+ box-shadow: 0 12px 32px rgb(10 25 20 / .16);
107
+ }
108
+ .tasks-menu[hidden] { display: none; }
109
+ .tasks-menu .menu-action { padding: 8px 9px; font-size: 12.5px; }
110
+ .tasks-menu .menu-action:disabled { color: var(--ink-3); background: transparent; cursor: default; opacity: .55; }
111
+
112
+ .tasks-toolbar {
113
+ display: flex;
114
+ flex: none;
115
+ flex-wrap: wrap;
116
+ align-items: center;
117
+ justify-content: space-between;
118
+ gap: 8px 12px;
119
+ padding: 0 20px 10px;
120
+ }
121
+ .tasks-filter { display: flex; align-items: center; gap: 8px; min-width: 0; }
122
+ .tasks-filter-label { color: var(--ink-3); font-size: 11px; font-weight: 600; white-space: nowrap; }
123
+ .tasks-select {
124
+ min-width: 150px;
125
+ max-width: 250px;
126
+ min-height: 34px;
127
+ padding: 4px 28px 4px 9px;
128
+ font-size: 12px;
129
+ }
130
+ .tasks-summary { margin: 0 0 0 auto; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; }
131
+
132
+ .tasks-error {
133
+ display: flex;
134
+ flex: none;
135
+ align-items: center;
136
+ justify-content: space-between;
137
+ gap: 10px;
138
+ margin: 0 20px 8px;
139
+ padding: 8px 10px;
140
+ }
141
+ .tasks-error .btn { flex: none; }
142
+
143
+ .tasks-scroll {
144
+ flex: 0 1 auto;
145
+ min-height: 0;
146
+ padding: 0 20px 16px;
147
+ overflow-x: hidden;
148
+ overflow-y: auto;
149
+ overscroll-behavior: contain;
150
+ scrollbar-gutter: stable;
151
+ }
152
+
153
+ .task-create {
154
+ margin: 0 0 12px;
155
+ border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--line));
156
+ border-radius: 12px;
157
+ background: color-mix(in srgb, var(--accent-soft) 24%, var(--surface));
158
+ }
159
+ .task-create[open] { border-style: solid; }
160
+ .task-create-summary {
161
+ display: flex;
162
+ align-items: center;
163
+ gap: 7px;
164
+ padding: 9px 12px;
165
+ color: var(--accent);
166
+ font-size: 12.5px;
167
+ font-weight: 650;
168
+ cursor: pointer;
169
+ list-style: none;
170
+ }
171
+ .task-create-summary::-webkit-details-marker { display: none; }
172
+ .task-create-summary::before {
173
+ content: "+";
174
+ display: grid;
175
+ flex: none;
176
+ place-items: center;
177
+ width: 18px;
178
+ height: 18px;
179
+ border: 1px solid currentColor;
180
+ border-radius: 6px;
181
+ font: 700 13px/1 var(--font-mono);
182
+ }
183
+ .task-create[open] .task-create-summary::before { content: "−"; }
184
+ .task-create-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
185
+
186
+ .task-create-form {
187
+ display: grid;
188
+ grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
189
+ gap: 8px 10px;
190
+ padding: 0 12px 12px;
191
+ }
192
+ .task-create-title, .task-create-description,
193
+ .task-create-participants, .task-create-steps, .task-create-conclusion { grid-column: 1 / -1; }
194
+ .task-create-due { grid-column: 1; }
195
+ .task-create-assignee { grid-column: 2; }
196
+ .task-create-actions { grid-column: 1 / -1; display: flex; align-items: end; justify-content: flex-end; }
197
+ .task-field { margin: 0; gap: 4px; min-width: 0; }
198
+ .task-field .field-label { font-size: 11px; }
199
+ .task-field .input { min-height: 36px; font-size: 12.5px; }
200
+ .task-create-form textarea { min-height: 52px; resize: vertical; }
201
+
202
+ .task-people-field, .task-steps-field { padding: 0; border: 0; }
203
+ .task-people {
204
+ display: flex;
205
+ flex-wrap: wrap;
206
+ gap: 4px 12px;
207
+ max-height: 112px;
208
+ padding: 6px 9px;
209
+ overflow: auto;
210
+ border: 1px solid var(--line);
211
+ border-radius: 10px;
212
+ background: var(--surface);
213
+ }
214
+ .task-person { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--ink-2); font-size: 12px; cursor: pointer; }
215
+ .task-person input, .task-step-done { flex: none; width: 15px; height: 15px; accent-color: var(--accent); }
216
+ .task-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
217
+ .task-steps-editor { display: grid; gap: 6px; margin-bottom: 6px; }
218
+ .task-step-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
219
+ .task-step-row .input { min-height: 34px; padding: 5px 9px; font-size: 12.5px; }
220
+ .task-step-remove { width: 28px; height: 28px; }
221
+ .task-add-step { padding: 4px 9px; }
222
+ .task-steps-hint { margin: 4px 0 0; font-size: 10.5px; line-height: 1.4; }
223
+
224
+ .task-groups { display: grid; gap: 16px; }
225
+ .task-group-title {
226
+ display: flex;
227
+ align-items: center;
228
+ gap: 7px;
229
+ margin: 0 0 6px;
230
+ color: var(--ink-2);
231
+ font-size: 11px;
232
+ font-weight: 700;
233
+ letter-spacing: .08em;
234
+ line-height: 1.4;
235
+ text-transform: uppercase;
236
+ }
237
+ .task-group-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
238
+ .task-group-dot[data-status="doing"] { background: var(--warning); }
239
+ .task-group-dot[data-status="done"] { background: var(--accent); }
240
+ .task-group-count {
241
+ margin-left: auto;
242
+ padding: 1px 7px;
243
+ border-radius: 999px;
244
+ color: var(--ink-3);
245
+ background: var(--surface-2);
246
+ font-size: 10px;
247
+ letter-spacing: 0;
248
+ }
249
+ .task-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
250
+
251
+ .task-row {
252
+ display: grid;
253
+ grid-template-columns: minmax(0, 1fr) auto;
254
+ align-items: start;
255
+ gap: 8px 10px;
256
+ min-width: 0;
257
+ padding: 10px 12px;
258
+ border: 1px solid var(--line);
259
+ border-radius: 12px;
260
+ background: var(--surface);
261
+ box-shadow: 0 1px 2px rgb(20 40 32 / .035);
262
+ animation: task-row-in .16s ease both;
263
+ animation-delay: calc(var(--task-i, 0) * 14ms);
264
+ }
265
+ .task-row[data-status="done"] { background: color-mix(in srgb, var(--surface-2) 42%, var(--surface)); }
266
+ .task-row-editing { display: block; }
267
+ @keyframes task-row-in { from { opacity: 0; transform: translateY(3px); } }
268
+
269
+ .task-main { min-width: 0; }
270
+ .task-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
271
+ .task-title {
272
+ margin: 0;
273
+ overflow-wrap: anywhere;
274
+ color: var(--ink);
275
+ font-size: 13.5px;
276
+ font-weight: 650;
277
+ line-height: 1.4;
278
+ }
279
+ .task-row[data-status="done"] .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 55%, transparent); }
280
+ .task-status {
281
+ flex: none;
282
+ padding: 2px 7px;
283
+ border: 1px solid var(--line);
284
+ border-radius: 999px;
285
+ color: var(--ink-3);
286
+ background: var(--surface-2);
287
+ font-size: 10px;
288
+ font-weight: 700;
289
+ letter-spacing: .03em;
290
+ line-height: 1.5;
291
+ }
292
+ .task-status[data-status="doing"] { border-color: color-mix(in srgb, var(--warning) 34%, var(--line)); color: var(--warning); background: color-mix(in srgb, var(--warning) 11%, var(--surface)); }
293
+ .task-status[data-status="done"] { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
294
+
295
+ .task-description {
296
+ margin: 3px 0 0;
297
+ color: var(--ink-2);
298
+ font-size: 12px;
299
+ line-height: 1.5;
300
+ overflow-wrap: anywhere;
301
+ white-space: pre-wrap;
302
+ }
303
+ .task-meta {
304
+ display: grid;
305
+ grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
306
+ gap: 2px 10px;
307
+ min-width: 0;
308
+ margin: 6px 0 0;
309
+ color: var(--ink-3);
310
+ font-size: 10.5px;
311
+ line-height: 1.5;
312
+ }
313
+ .task-assignee {
314
+ display: inline-flex;
315
+ align-items: flex-start;
316
+ gap: 3px;
317
+ min-width: 0;
318
+ color: var(--ink-2);
319
+ font-weight: 600;
320
+ overflow-wrap: anywhere;
321
+ }
322
+ .task-assignee svg { flex: none; width: 12px; height: 12px; margin-top: 2px; }
323
+ .task-assignee.is-unassigned { color: var(--ink-3); font-style: italic; font-weight: 500; }
324
+ .task-assignee > span { min-width: 0; overflow-wrap: anywhere; }
325
+ .task-created,
326
+ .task-creator,
327
+ .task-updated { overflow-wrap: anywhere; }
328
+ .task-updated { font-family: var(--font-mono); font-size: 10px; }
329
+ .task-due { color: var(--ink-2); font-weight: 600; }
330
+ .task-due.is-overdue { color: var(--danger); }
331
+ .task-participants { min-width: 0; overflow-wrap: anywhere; }
332
+
333
+ .task-progress { margin: 6px 0 0; }
334
+ .task-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 10.5px; line-height: 1.4; }
335
+ .task-progress-track { height: 4px; margin-top: 3px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
336
+ .task-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
337
+ .task-steps { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; list-style: none; }
338
+ .task-step { display: flex; align-items: flex-start; gap: 6px; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
339
+ .task-step-toggle { flex: none; width: 14px; height: 14px; margin: 3px 0 0; accent-color: var(--accent); }
340
+ .task-step-toggle:disabled { cursor: default; opacity: .7; }
341
+ .task-step.is-done .task-step-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 55%, transparent); }
342
+ .task-step-text { min-width: 0; overflow-wrap: anywhere; }
343
+
344
+ .task-conclusion { margin: 7px 0 0; padding: 5px 9px; border-left: 2px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 0 8px 8px 0; color: var(--ink-2); background: color-mix(in srgb, var(--surface-2) 52%, transparent); font-size: 11.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
345
+ .task-conclusion-label { display: block; margin-bottom: 2px; color: var(--ink-3); font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
346
+
347
+ .task-row-actions { display: flex; align-items: center; gap: 4px; }
348
+ .task-status-select {
349
+ width: 104px;
350
+ min-height: 30px;
351
+ padding: 2px 24px 2px 8px;
352
+ font-size: 11.5px;
353
+ }
354
+ .task-action {
355
+ display: grid;
356
+ flex: none;
357
+ place-items: center;
358
+ width: 30px;
359
+ height: 30px;
360
+ padding: 0;
361
+ border: 1px solid transparent;
362
+ border-radius: 8px;
363
+ color: var(--ink-3);
364
+ background: transparent;
365
+ cursor: pointer;
366
+ transition: color .12s, border-color .12s, background .12s;
367
+ }
368
+ .task-action svg { width: 15px; height: 15px; }
369
+ .task-action:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 24%, transparent); background: var(--accent-soft); }
370
+ .task-action-delete:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); background: var(--danger-soft); }
371
+ .task-action:focus-visible, .task-status-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
372
+
373
+ .task-edit-form {
374
+ display: grid;
375
+ grid-template-columns: minmax(0, 1fr) minmax(150px, 200px);
376
+ gap: 8px 10px;
377
+ }
378
+ .task-edit-title-field, .task-edit-description-field,
379
+ .task-edit-participants-field, .task-edit-steps-field, .task-edit-conclusion-field { grid-column: 1 / -1; }
380
+ .task-edit-due-field { grid-column: 1; }
381
+ .task-edit-assignee-field { grid-column: 2; }
382
+ .task-edit-form textarea { min-height: 52px; resize: vertical; }
383
+ .task-edit-actions { grid-column: 1 / -1; display: flex; align-items: end; justify-content: flex-end; gap: 6px; }
384
+
385
+ .tasks-empty { margin: 0; padding: 28px 12px 32px; color: var(--ink-3); font-size: 12.5px; text-align: center; }
386
+
387
+ @media (max-width: 620px) {
388
+ #tasksDialog { width: calc(100vw - 12px); height: calc(100dvh - 16px); max-height: none; border-radius: 16px; }
389
+ .tasks-head { padding: 13px 13px 8px; }
390
+ .tasks-heading h2 { font-size: 19px; }
391
+ .tasks-toolbar { padding: 0 13px 8px; align-items: flex-start; }
392
+ .tasks-filter { flex-wrap: wrap; gap: 4px 8px; }
393
+ .tasks-select { min-width: 140px; max-width: calc(100vw - 60px); }
394
+ .tasks-summary { flex-basis: 100%; margin: 0; }
395
+ .tasks-error { margin: 0 13px 8px; }
396
+ .tasks-scroll { padding: 0 8px 12px; scrollbar-gutter: auto; }
397
+ .task-create { margin-bottom: 10px; }
398
+ .task-row { grid-template-columns: minmax(0, 1fr); padding: 9px; }
399
+ .task-row-actions { grid-column: 1; justify-content: flex-end; flex-wrap: wrap; }
400
+ .task-status-select { width: 112px; }
401
+ .task-create-form, .task-edit-form { grid-template-columns: minmax(0, 1fr); }
402
+ .task-create-title, .task-create-description, .task-create-due, .task-create-assignee,
403
+ .task-create-participants, .task-create-steps, .task-create-conclusion, .task-create-actions,
404
+ .task-edit-title-field, .task-edit-description-field, .task-edit-due-field, .task-edit-assignee-field,
405
+ .task-edit-participants-field, .task-edit-steps-field, .task-edit-conclusion-field, .task-edit-actions { grid-column: 1; }
406
+ .task-create-actions, .task-edit-actions { justify-content: stretch; }
407
+ .task-create-actions .btn, .task-edit-actions .btn { flex: 1; }
408
+ .task-people { max-height: 96px; }
409
+ }
410
+
411
+ @media (max-width: 380px) {
412
+ .tasks-head { padding: 12px 11px 7px; }
413
+ .task-row-actions { justify-content: flex-start; }
414
+ .task-status-select { flex: 1 1 120px; width: auto; }
415
+ }
416
+
417
+ @media (prefers-reduced-motion: reduce) {
418
+ #tasksDialog[open], .task-row { animation: none; }
419
+ }
@@ -445,8 +445,13 @@ async function handle(req: Request): Promise<Response> {
445
445
  }
446
446
  const replyTo = (body as Record<string, unknown>).replyToMessageID;
447
447
  if (replyTo !== undefined && (typeof replyTo !== "string" || !replyTo)) return json({ error: "replyToMessageID must be a non-empty message ID" }, 400);
448
+ // Optional retry key: a lost response may be retried without creating a twin.
449
+ const clientMessageID = (body as Record<string, unknown>).clientMessageID;
450
+ if (clientMessageID !== undefined && (typeof clientMessageID !== "string" || !clientMessageID || clientMessageID.length > 100)) {
451
+ return json({ error: "clientMessageID must be a non-empty string (max 100)" }, 400);
452
+ }
448
453
  if (replyTo !== undefined) {
449
- const result = await sendReply(roomId, replyTo, sessionID, text);
454
+ const result = await sendReply(roomId, replyTo, sessionID, text, clientMessageID);
450
455
  if (result.status !== "ok") {
451
456
  if (result.status === "missing") return json({ error: "room not found" }, 404);
452
457
  if (result.status === "target") return json({ error: "reply target not found in room" }, 404);
@@ -455,10 +460,10 @@ async function handle(req: Request): Promise<Response> {
455
460
  }
456
461
  touchActive(sessionID);
457
462
  const room = await read((svc) => svc.getRoom(roomId));
458
- void wakeMentionedSessions(serveWakeUrl, roomId, room.name, text, sessionID, result.message);
463
+ if (!result.duplicate) void wakeMentionedSessions(serveWakeUrl, roomId, room.name, text, sessionID, result.message);
459
464
  return json(await roomPayload(room), 201);
460
465
  }
461
- const result = await appendRoomMessage(roomId, sessionID, text, isQuestion === true);
466
+ const result = await appendRoomMessage(roomId, sessionID, text, isQuestion === true, clientMessageID);
462
467
  if (result.status !== "ok") {
463
468
  if (result.status === "missing") return json({ error: "room not found" }, 404);
464
469
  return json({ error: "session is not a room member" }, 409);
@@ -466,7 +471,7 @@ async function handle(req: Request): Promise<Response> {
466
471
  touchActive(sessionID); // 发送者活跃
467
472
  const room = await read((svc) => svc.getRoom(roomId));
468
473
  // ponytail: 即时唤起——仅 @ 点名成员时(核心需求)
469
- void wakeMentionedSessions(serveWakeUrl, roomId, room.name, text, sessionID, result.message);
474
+ if (!result.duplicate) void wakeMentionedSessions(serveWakeUrl, roomId, room.name, text, sessionID, result.message);
470
475
  return json(await roomPayload(room), 201);
471
476
  }
472
477
  }