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

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 (63) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +6 -6
  3. package/README.zh-CN.md +6 -6
  4. package/cli.ts +20 -0
  5. package/dist/cli.js +18 -0
  6. package/package.json +1 -1
  7. package/server/assets/FLUENT-ICONS-LICENSE +25 -0
  8. package/server/assets/NOTICE.txt +2 -1
  9. package/server/assets/attachments.css +1 -1
  10. package/server/assets/base.css +29 -7
  11. package/server/assets/chat/doc-preview.js +113 -0
  12. package/server/assets/chat/events.js +6 -0
  13. package/server/assets/chat/files.js +25 -16
  14. package/server/assets/chat/history-loader.js +36 -26
  15. package/server/assets/chat/icons.js +15 -0
  16. package/server/assets/chat/index.js +3 -1
  17. package/server/assets/chat/locales/de.js +6 -5
  18. package/server/assets/chat/locales/es.js +6 -5
  19. package/server/assets/chat/locales/fr.js +6 -5
  20. package/server/assets/chat/locales/it.js +6 -5
  21. package/server/assets/chat/locales/ja.js +6 -5
  22. package/server/assets/chat/locales/ko.js +6 -5
  23. package/server/assets/chat/markdown.js +17 -37
  24. package/server/assets/chat/messages.js +4 -9
  25. package/server/assets/chat/palette.js +50 -34
  26. package/server/assets/chat/pwa.js +67 -9
  27. package/server/assets/chat/recall.js +3 -2
  28. package/server/assets/chat/replies.js +2 -1
  29. package/server/assets/chat/rooms.js +12 -4
  30. package/server/assets/chat/shortcuts.js +1 -1
  31. package/server/assets/chat/state.js +12 -10
  32. package/server/assets/chat/system-messages.js +7 -1
  33. package/server/assets/code-highlight.css +0 -5
  34. package/server/assets/conversation.css +5 -4
  35. package/server/assets/doc-preview.css +158 -0
  36. package/server/assets/edit-room.css +8 -0
  37. package/server/assets/files.css +0 -15
  38. package/server/assets/fluent-icons.svg +42 -0
  39. package/server/assets/icons.css +9 -0
  40. package/server/assets/palette.css +1 -15
  41. package/server/assets/recall.css +2 -2
  42. package/server/assets/responsive.css +4 -4
  43. package/server/assets/room-create.css +1 -1
  44. package/server/assets/settings.css +13 -6
  45. package/server/chat.html +93 -57
  46. package/server/sw.js +10 -1
  47. package/src/tui/app.mjs +16 -1
  48. package/src/tui/http.mjs +109 -10
  49. package/src/tui/info-app.mjs +435 -0
  50. package/src/tui/info-content.mjs +198 -0
  51. package/src/tui/join-app.mjs +71 -0
  52. package/src/tui/main.mjs +23 -4
  53. package/src/tui/markdown.mjs +269 -0
  54. package/src/tui/message-app.mjs +177 -0
  55. package/src/tui/message-view.mjs +128 -0
  56. package/src/tui/palette-app.mjs +85 -9
  57. package/src/tui/palette.mjs +17 -2
  58. package/src/tui/reminder-app.mjs +189 -0
  59. package/src/tui/room-settings-app.mjs +249 -0
  60. package/src/tui/ui-content.mjs +136 -93
  61. package/src/tui/ui-overlay-view.mjs +255 -0
  62. package/src/tui/ui-view.mjs +2 -190
  63. package/src/tui/ui.mjs +103 -1
package/server/chat.html CHANGED
@@ -18,6 +18,7 @@
18
18
  </script>
19
19
  <meta name="mobile-web-app-capable" content="yes">
20
20
  <meta name="apple-mobile-web-app-capable" content="yes">
21
+ <link rel="stylesheet" href="/assets/icons.css">
21
22
  <link rel="stylesheet" href="/assets/base.css">
22
23
  <link rel="stylesheet" href="/assets/settings.css">
23
24
 
@@ -30,6 +31,7 @@
30
31
  <link rel="stylesheet" href="/assets/edit-room.css">
31
32
  <link rel="stylesheet" href="/assets/palette.css">
32
33
  <link rel="stylesheet" href="/assets/files.css">
34
+ <link rel="stylesheet" href="/assets/doc-preview.css">
33
35
  </head>
34
36
  <body>
35
37
 
@@ -46,7 +48,7 @@
46
48
  <header class="join-head">
47
49
  <div class="wordmark-row"><span class="brand-mark" aria-hidden="true">OC</span><p class="wordmark" data-i18n="brand">OC Chat</p><span class="version-tag">{{version}}</span></div>
48
50
  <button id="btnJoinSettings" class="join-settings" type="button" aria-haspopup="dialog" aria-controls="chatSettings" aria-expanded="false">
49
- <svg aria-hidden="true" viewBox="0 0 24 24"><path d="M4 7h9M17 7h3M4 17h3M11 17h9"/><circle cx="15" cy="7" r="2"/><circle cx="9" cy="17" r="2"/></svg>
51
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-options-24"></use></svg>
50
52
  <span data-i18n="settings">Settings</span>
51
53
  </button>
52
54
  <p class="tagline" data-i18n="tagline">A lightweight chat room. Enter a room ID to join, or create a new one.</p>
@@ -94,7 +96,7 @@
94
96
  <div id="joinError" class="alert" role="alert" hidden></div>
95
97
  </div>
96
98
  <section id="joinPending" class="join-pending" hidden aria-labelledby="joinPendingTitle">
97
- <span class="join-pending-mark" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>
99
+ <span class="join-pending-mark" aria-hidden="true"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-lock_closed-24"></use></svg></span>
98
100
  <div class="join-pending-copy">
99
101
  <h2 id="joinPendingTitle" tabindex="-1" data-i18n="joinPendingTitle">Waiting for approval</h2>
100
102
  <p id="joinPendingBody" role="status" aria-live="polite"></p>
@@ -136,20 +138,20 @@
136
138
  <h2 id="settingsHeading" tabindex="-1" data-i18n="settings">Settings</h2>
137
139
  <p class="settings-lead" data-i18n="settingsLocalHint">Language, theme, transition, and scrolling preferences are saved in this browser.</p>
138
140
  </div>
139
- <button id="btnCloseSettings" class="reader-close settings-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
141
+ <button id="btnCloseSettings" class="reader-close settings-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
140
142
  </header>
141
143
  <div class="settings-body">
142
144
  <nav class="settings-nav" role="tablist" aria-label="Settings sections" data-i18n-aria-label="settingsSections">
143
145
  <button id="settingsTabGeneral" class="settings-tab" type="button" role="tab" aria-selected="true" aria-controls="settingsPanelGeneral" data-settings-tab="general">
144
- <svg aria-hidden="true" viewBox="0 0 24 24"><path d="M4 7h9M17 7h3M4 17h3M11 17h9"/><circle cx="15" cy="7" r="2"/><circle cx="9" cy="17" r="2"/></svg>
146
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-options-24"></use></svg>
145
147
  <span data-i18n="settingsGeneral">General</span>
146
148
  </button>
147
149
  <button id="settingsTabAppearance" class="settings-tab" type="button" role="tab" aria-selected="false" aria-controls="settingsPanelAppearance" tabindex="-1" data-settings-tab="appearance">
148
- <svg aria-hidden="true" viewBox="0 0 24 24"><circle cx="12" cy="12" r="8"/><path d="M12 4v16"/><path d="M12 4a8 8 0 0 1 0 16" fill="currentColor" stroke="none"/></svg>
150
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-circle_half_fill-24"></use></svg>
149
151
  <span data-i18n="settingsAppearance">Appearance</span>
150
152
  </button>
151
153
  <button id="settingsTabConnection" class="settings-tab" type="button" role="tab" aria-selected="false" aria-controls="settingsPanelConnection" tabindex="-1" data-settings-tab="connection">
152
- <svg aria-hidden="true" viewBox="0 0 24 24"><circle cx="8" cy="12" r="3"/><path d="M11 12h9M17 12v3M20 12v2"/></svg>
154
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-plug_connected-24"></use></svg>
153
155
  <span data-i18n="settingsConnection">Connection</span>
154
156
  </button>
155
157
  </nav>
@@ -158,7 +160,7 @@
158
160
  <div class="settings-row">
159
161
  <div class="settings-copy">
160
162
  <label class="settings-label locale-label" for="localeSelectSettings">
161
- <svg class="locale-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9S14.5 18.3 12 21M12 3C9.5 5.7 8.2 8.7 8.2 12s1.3 6.3 3.8 9"/></svg>
163
+ <svg class="fluent-icon locale-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-local_language-24"></use></svg>
162
164
  <span data-i18n="languageLabel">Language</span>
163
165
  </label>
164
166
  <p class="settings-hint" data-i18n="settingsLanguageHint">Applies right away and is saved in this browser.</p>
@@ -176,14 +178,14 @@
176
178
  </div>
177
179
  <div class="settings-row">
178
180
  <div class="settings-copy">
179
- <label class="settings-label" for="inContentTransition" data-i18n="contentTransition">Room content transition</label>
181
+ <label class="settings-label" for="inContentTransition"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_swap-24"></use></svg><span data-i18n="contentTransition">Room content transition</span></label>
180
182
  <p id="contentTransitionHint" class="settings-hint" data-i18n="contentTransitionHint">Slide messages in when switching rooms with Alt+Arrow. Off by default.</p>
181
183
  </div>
182
184
  <input id="inContentTransition" class="settings-switch" type="checkbox" role="switch" aria-describedby="contentTransitionHint">
183
185
  </div>
184
186
  <div class="settings-row settings-step-row">
185
187
  <div class="settings-copy">
186
- <label class="settings-label" for="inPageStep" data-i18n="pageStep">Page scroll distance</label>
188
+ <label class="settings-label" for="inPageStep"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_down-24"></use></svg><span data-i18n="pageStep">Page scroll distance</span></label>
187
189
  <p id="pageStepHint" class="settings-hint" data-i18n="pageStepHint">How far PageUp and PageDown move per press, as a percentage of the conversation height. Default 90%.</p>
188
190
  </div>
189
191
  <div class="settings-range"><input id="inPageStep" type="range" min="20" max="200" step="5" value="90" aria-describedby="pageStepHint"><output id="pageStepValue" class="settings-range-value" for="inPageStep">90%</output></div>
@@ -191,7 +193,7 @@
191
193
  </section>
192
194
  <section id="settingsPanelAppearance" class="settings-panel" role="tabpanel" aria-labelledby="settingsTabAppearance" hidden>
193
195
  <fieldset class="settings-block">
194
- <legend class="settings-label" data-i18n="themeLabel">Theme</legend>
196
+ <legend class="settings-label"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-circle_half_fill-24"></use></svg><span data-i18n="themeLabel">Theme</span></legend>
195
197
  <p class="settings-hint" data-i18n="settingsThemeHint">Saved in this browser. System follows your device.</p>
196
198
  <div class="theme-grid">
197
199
  <label class="theme-option" data-theme-choice="system">
@@ -225,16 +227,16 @@
225
227
  <section id="settingsPanelConnection" class="settings-panel" role="tabpanel" aria-labelledby="settingsTabConnection" hidden>
226
228
  <div class="settings-row settings-row-stack">
227
229
  <div class="settings-copy">
228
- <label class="settings-label" for="inTokenChat" data-i18n="tokenOptional">Access token (optional)</label>
230
+ <label class="settings-label" for="inTokenChat"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-key-24"></use></svg><span data-i18n="tokenOptional">Access token (optional)</span></label>
229
231
  <p class="settings-hint" data-i18n="settingsTokenHint">Stored only in this browser. Needed only when the server asks for it.</p>
230
- <p id="tokenHint" class="settings-hint settings-warning" data-i18n="tokenRequired" hidden>The server requires an access token (401).</p>
232
+ <p id="tokenHint" class="settings-hint settings-warning settings-icon-hint" hidden><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-alert-24"></use></svg><span data-i18n="tokenRequired">The server requires an access token (401).</span></p>
231
233
  </div>
232
234
  <div class="settings-token-control">
233
235
  <input id="inTokenChat" class="input" type="password" placeholder="Enter if the server requires it" data-i18n-placeholder="tokenPlaceholder" autocomplete="off" spellcheck="false" aria-describedby="tokenHint">
234
236
  <button class="btn ghost small" type="button" data-token-save="inTokenChat" data-i18n="save">Save</button>
235
237
  </div>
236
238
  </div>
237
- <p class="settings-note" data-i18n="privacyNote">Anyone with the shared token can read direct messages and manage rooms; the server can read them too.</p>
239
+ <p class="settings-note"><svg class="fluent-icon settings-note-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-lock_closed-24"></use></svg><span data-i18n="privacyNote">Anyone with the shared token can read direct messages and manage rooms; the server can read them too.</span></p>
238
240
  </section>
239
241
  </div>
240
242
  </div>
@@ -244,30 +246,30 @@
244
246
  <section id="chatView" class="view" hidden>
245
247
  <aside id="roomRail" class="room-rail" aria-label="Rooms" data-i18n-aria-label="roomsLabel">
246
248
  <div class="rail-brand"><span class="brand-mark">OC</span><span data-i18n="brand">OC Chat</span><span class="version-tag">{{version}}</span></div>
247
- <div class="rail-label"><span data-i18n="existingRooms">Rooms</span><span class="rail-tools"><button id="btnNewRoom" class="icon-btn" type="button" aria-label="Create a room" data-i18n-aria-label="newRoom" aria-haspopup="dialog" aria-controls="createRoomDialog" aria-expanded="false"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></svg></button><button id="btnRefreshRooms" class="icon-btn" type="button" aria-label="Refresh rooms" data-i18n-aria-label="refreshRooms"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 7v5h-5M4 17v-5h5"/><path d="M5.6 9a7 7 0 0 1 11.8-2L20 12M4 12l2.6 5a7 7 0 0 0 11.8-2"/></svg></button></span></div>
249
+ <div class="rail-label"><span data-i18n="existingRooms">Rooms</span><span class="rail-tools"><button id="btnNewRoom" class="icon-btn" type="button" aria-label="Create a room" data-i18n-aria-label="newRoom" aria-haspopup="dialog" aria-controls="createRoomDialog" aria-expanded="false"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-add-24"></use></svg></button><button id="btnRefreshRooms" class="icon-btn" type="button" aria-label="Refresh rooms" data-i18n-aria-label="refreshRooms"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_sync-24"></use></svg></button></span></div>
248
250
  <ul id="roomListChat" class="rail-rooms"></ul>
249
251
  <p id="roomListChatEmpty" class="hint" data-i18n="noRooms" hidden></p>
250
252
 
251
253
  <div id="railInstall" class="rail-install" hidden>
252
- <button id="btnRailInstall" class="btn ghost small rail-install-btn" type="button"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M12 4v10M8 10l4 4 4-4M5 19h14"/></svg><span data-i18n="installAction">Install</span></button>
254
+ <button id="btnRailInstall" class="btn ghost small rail-install-btn" type="button"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_download-24"></use></svg><span data-i18n="installAction">Install</span></button>
253
255
  <p id="railInstallGuide" class="hint" data-i18n="installIosGuide" hidden>Tap Share, then Add to Home Screen.</p>
254
256
  </div>
255
257
  <div class="rail-foot">
256
258
  <div class="anchor user-menu-anchor">
257
259
  <button id="btnSettings" class="user-menu-trigger" type="button" aria-label="Your profile and settings" data-i18n-aria-label="profileMenu" aria-haspopup="dialog" aria-controls="chatSettings" aria-expanded="false">
258
- <span id="profileAvatar" class="rail-avatar" aria-hidden="true">?</span><span id="railIdentity"></span><span class="user-menu-caret" aria-hidden="true">⌃</span>
260
+ <span id="profileAvatar" class="rail-avatar" aria-hidden="true">?</span><span id="railIdentity"></span><svg class="fluent-icon user-menu-caret" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-chevron_up-24"></use></svg>
259
261
  </button>
260
262
  </div>
261
263
  </div>
262
264
  </aside>
263
265
  <dialog id="createRoomDialog" class="admin-dialog create-room-dialog" aria-labelledby="createRoomHeading" aria-describedby="createRoomHint">
264
266
  <header class="create-room-head">
265
- <span class="create-room-mark" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></svg></span>
267
+ <span class="create-room-mark" aria-hidden="true"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-add-24"></use></svg></span>
266
268
  <div class="create-room-heading">
267
269
  <p class="create-room-eyebrow" data-i18n="existingRooms">Rooms</p>
268
270
  <h2 id="createRoomHeading" data-i18n="createRoomTitle">Create a room</h2>
269
271
  </div>
270
- <button id="btnCloseCreateRoom" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
272
+ <button id="btnCloseCreateRoom" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
271
273
  </header>
272
274
  <p id="createRoomHint" class="create-room-hint" data-i18n="createRoomHint">Start a new room and invite people with its ID.</p>
273
275
  <form id="railRoomForm" class="create-room-form" novalidate>
@@ -292,51 +294,51 @@
292
294
  <dialog id="editRoomDialog" class="admin-dialog edit-room-dialog" aria-labelledby="editRoomHeading">
293
295
  <header class="admin-dialog-head edit-room-head">
294
296
  <h2 id="editRoomHeading" tabindex="-1" data-i18n="editRoom">Edit room</h2>
295
- <div class="admin-dialog-actions"><button id="btnCloseEditRoom" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div>
297
+ <div class="admin-dialog-actions"><button id="btnCloseEditRoom" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button></div>
296
298
  </header>
297
299
  <form id="editRoomForm" class="edit-room-form" novalidate>
298
300
  <div class="edit-room-body">
299
301
  <nav class="settings-nav edit-room-nav" role="tablist" aria-label="Edit room sections" data-i18n-aria-label="editRoomSections">
300
302
  <button id="editRoomTabDetails" class="settings-tab" type="button" role="tab" aria-selected="true" aria-controls="editRoomPanelDetails" data-edit-room-tab="details">
301
- <svg aria-hidden="true" viewBox="0 0 24 24"><path d="M5 4h9l5 5v11H5z"/><path d="M14 4v5h5"/></svg>
303
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-document-24"></use></svg>
302
304
  <span data-i18n="editRoomDetails">Room details</span>
303
305
  </button>
304
306
  <button id="editRoomTabJoining" class="settings-tab" type="button" role="tab" aria-selected="false" aria-controls="editRoomPanelJoining" tabindex="-1" data-edit-room-tab="joining">
305
- <svg aria-hidden="true" viewBox="0 0 24 24"><path d="M12 3l7 3v6c0 4.2-2.9 6.7-7 8-4.1-1.3-7-3.8-7-8V6z"/><path d="m9 12 2 2 4-4"/></svg>
307
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-shield_checkmark-24"></use></svg>
306
308
  <span data-i18n="editRoomJoining">Joining &amp; approval</span>
307
309
  </button>
308
310
  <button id="editRoomTabMembers" class="settings-tab" type="button" role="tab" aria-selected="false" aria-controls="editRoomPanelMembers" tabindex="-1" data-edit-room-tab="members">
309
- <svg aria-hidden="true" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3"/><path d="M3.5 19a5.5 5.5 0 0 1 11 0"/><path d="M16 5.7a3 3 0 0 1 0 4.6"/><path d="M18 15.2a5.4 5.4 0 0 1 2.5 3.8"/></svg>
311
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-people-24"></use></svg>
310
312
  <span data-i18n="editRoomMembers">Members &amp; roles</span>
311
313
  </button>
312
314
  <button id="editRoomTabOwnership" class="settings-tab" type="button" role="tab" aria-selected="false" aria-controls="editRoomPanelOwnership" tabindex="-1" data-edit-room-tab="ownership">
313
- <svg aria-hidden="true" viewBox="0 0 24 24"><circle cx="8" cy="15" r="4"/><path d="m11 12 8-8M16 4h4v4"/></svg>
315
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-key-24"></use></svg>
314
316
  <span data-i18n="editRoomOwnership">Ownership</span>
315
317
  </button>
316
318
  </nav>
317
319
  <div class="settings-content edit-room-content">
318
320
  <section id="editRoomPanelDetails" class="settings-panel edit-room-panel" role="tabpanel" aria-labelledby="editRoomTabDetails">
319
- <label class="field"><span class="field-label" data-i18n="roomNameLabel">Room name</span><input id="editRoomName" class="input" maxlength="64" autocomplete="off" required></label>
320
- <label class="field"><span class="field-label" data-i18n="roomDescriptionLabel">Description</span><textarea id="editRoomDescription" class="input" rows="3" maxlength="2000"></textarea></label>
321
+ <label class="field"><span class="field-label"><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-edit-24"></use></svg><span data-i18n="roomNameLabel">Room name</span></span><input id="editRoomName" class="input" maxlength="64" autocomplete="off" required></label>
322
+ <label class="field"><span class="field-label"><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-document-24"></use></svg><span data-i18n="roomDescriptionLabel">Description</span></span><textarea id="editRoomDescription" class="input" rows="3" maxlength="2000"></textarea></label>
321
323
  </section>
322
324
  <section id="editRoomPanelJoining" class="settings-panel edit-room-panel" role="tabpanel" aria-labelledby="editRoomTabJoining" hidden>
323
325
  <div class="join-policy admin-join-policy">
324
326
  <input id="editRoomJoinPolicy" type="checkbox" role="switch" aria-describedby="editRoomJoinPolicyHint">
325
- <label for="editRoomJoinPolicy" class="join-policy-label" data-i18n="requireApproval">Require approval to join</label>
327
+ <label for="editRoomJoinPolicy" class="join-policy-label"><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-shield_checkmark-24"></use></svg><span data-i18n="requireApproval">Require approval to join</span></label>
326
328
  </div>
327
329
  <p id="editRoomJoinPolicyHint" class="hint join-policy-hint" data-i18n="joinPolicyEditHint">New members need a human administrator's approval. Turning this off clears all pending requests.</p>
328
330
  </section>
329
331
  <section id="editRoomPanelMembers" class="settings-panel edit-room-panel" role="tabpanel" aria-labelledby="editRoomTabMembers" hidden>
330
- <fieldset class="admin-fieldset"><legend class="field-label" data-i18n="adminIdsLabel">Human administrators</legend><div id="editRoomAdminIds" class="admin-checklist"></div><p id="editRoomAdminIdsEmpty" class="hint" data-i18n="adminIdsEmpty" hidden>No other members are in this room yet.</p><p class="hint" data-i18n="adminIdsHint">These members can edit room details, manage members, delete files, and choose a successor. The owner always has the same powers.</p></fieldset>
331
- <label class="field"><span class="field-label" data-i18n="successorLabel">Successor if the owner leaves</span><select id="editRoomSuccessor" class="admin-select"></select></label>
332
+ <fieldset class="admin-fieldset"><legend class="field-label"><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-people-24"></use></svg><span data-i18n="adminIdsLabel">Human administrators</span></legend><div id="editRoomAdminIds" class="admin-checklist"></div><p id="editRoomAdminIdsEmpty" class="hint" data-i18n="adminIdsEmpty" hidden>No other members are in this room yet.</p><p class="hint" data-i18n="adminIdsHint">These members can edit room details, manage members, delete files, and choose a successor. The owner always has the same powers.</p></fieldset>
333
+ <label class="field"><span class="field-label"><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_swap-24"></use></svg><span data-i18n="successorLabel">Successor if the owner leaves</span></span><select id="editRoomSuccessor" class="admin-select"></select></label>
332
334
  <p class="hint edit-room-hint" data-i18n="successorHint">If the owner leaves, this person becomes owner. If an administrator leaves, this person takes that role. Leave empty to use the longest-present member.</p>
333
- <p id="editRoomOwnerOnlyNote" class="hint edit-room-owner-note" data-i18n="ownerOnlySettingsNote" hidden>Only the owner can change the administrator agent or hand off the room.</p>
335
+ <p id="editRoomOwnerOnlyNote" class="hint edit-room-owner-note" hidden><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-lock_closed-24"></use></svg><span data-i18n="ownerOnlySettingsNote">Only the owner can change the administrator agent or hand off the room.</span></p>
334
336
  </section>
335
337
  <section id="editRoomPanelOwnership" class="settings-panel edit-room-panel" role="tabpanel" aria-labelledby="editRoomTabOwnership" hidden>
336
338
  <div id="editRoomOwnerOnly">
337
- <label class="field"><span class="field-label" data-i18n="adminAgentLabel">Administrator agent</span><select id="editRoomAdmin" class="admin-select"></select></label>
339
+ <label class="field"><span class="field-label"><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-options-24"></use></svg><span data-i18n="adminAgentLabel">Administrator agent</span></span><select id="editRoomAdmin" class="admin-select"></select></label>
338
340
  <p class="hint edit-room-hint" data-i18n="adminAgentHint">The designated agent can use the admin tool to inspect this room and its history. Only the owner can change this; leave empty for none.</p>
339
- <label class="field"><span class="field-label" data-i18n="newOwnerLabel">New owner</span><select id="editRoomOwner" class="admin-select"></select></label>
341
+ <label class="field"><span class="field-label"><svg class="fluent-icon field-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-key-24"></use></svg><span data-i18n="newOwnerLabel">New owner</span></span><select id="editRoomOwner" class="admin-select"></select></label>
340
342
  <p class="hint edit-room-hint" data-i18n="newOwnerHint">Hand the room to another person who is in it. Only the owner can do this; agents cannot own a room.</p>
341
343
  </div>
342
344
  </section>
@@ -358,8 +360,8 @@
358
360
  <h2 id="filesHeading" tabindex="-1"><span data-i18n="filesTitle">Files</span><span id="filesRoomName" class="files-room-name"></span></h2>
359
361
  </div>
360
362
  <div class="files-head-actions">
361
- <button id="btnRefreshFiles" class="icon-btn" type="button" aria-label="Refresh files" data-i18n-aria-label="filesRefresh"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 7v5h-5M4 17v-5h5"/><path d="M5.6 9a7 7 0 0 1 11.8-2L20 12M4 12l2.6 5a7 7 0 0 0 11.8-2"/></svg></button>
362
- <button id="btnCloseFiles" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
363
+ <button id="btnRefreshFiles" class="icon-btn" type="button" aria-label="Refresh files" data-i18n-aria-label="filesRefresh"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_sync-24"></use></svg></button>
364
+ <button id="btnCloseFiles" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
363
365
  </div>
364
366
  </header>
365
367
  <div class="files-toolbar">
@@ -380,7 +382,7 @@
380
382
  </footer>
381
383
  </dialog>
382
384
  <dialog id="reminderDialog" class="admin-dialog reminder-dialog" aria-labelledby="reminderDialogHeading">
383
- <header class="admin-dialog-head"><h2 id="reminderDialogHeading" data-i18n="reminderCreate">Create reminder</h2><div class="admin-dialog-actions"><button id="btnCloseReminder" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></header>
385
+ <header class="admin-dialog-head"><h2 id="reminderDialogHeading" data-i18n="reminderCreate">Create reminder</h2><div class="admin-dialog-actions"><button id="btnCloseReminder" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button></div></header>
384
386
  <form id="reminderForm" class="admin-guide reminder-form">
385
387
  <label class="field"><span class="field-label" data-i18n="reminderSchedule">Schedule</span><select id="reminderType" class="input"><option value="once" data-i18n="reminderOnce">One time</option><option value="cron">CRON</option></select></label>
386
388
  <label class="field" id="reminderOnceField"><span class="field-label" data-i18n="reminderDate">Date and time</span><input id="reminderAt" class="input" type="datetime-local" required></label>
@@ -394,7 +396,7 @@
394
396
  </form>
395
397
  </dialog>
396
398
  <dialog id="announcementDialog" class="admin-dialog announcement-dialog" aria-labelledby="announcementDialogHeading">
397
- <header class="admin-dialog-head"><h2 id="announcementDialogHeading" data-i18n="announcementNew">New announcement</h2><div class="admin-dialog-actions"><button id="btnCloseAnnouncement" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></header>
399
+ <header class="admin-dialog-head"><h2 id="announcementDialogHeading" data-i18n="announcementNew">New announcement</h2><div class="admin-dialog-actions"><button id="btnCloseAnnouncement" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button></div></header>
398
400
  <form id="announcementForm" class="admin-guide announcement-form">
399
401
  <label class="field"><span class="field-label" data-i18n="announcementName">Name</span><input id="announcementName" class="input" maxlength="64" autocomplete="off" required></label>
400
402
  <label class="field"><span class="field-label" data-i18n="announcementContent">Content</span><textarea id="announcementContent" class="input" rows="4" maxlength="5000" aria-describedby="announcementCount"></textarea></label>
@@ -406,7 +408,7 @@
406
408
  <button id="roomDrawerBackdrop" class="room-drawer-backdrop" type="button" aria-label="Close room list" data-i18n-aria-label="closeRoomList" hidden></button>
407
409
  <header class="chat-head">
408
410
  <div class="chat-head-main">
409
- <div class="room-title-row"><button id="btnRoomsDrawer" class="chip rooms-drawer-trigger" type="button" aria-label="Open room list" data-i18n-aria-label="roomsMenu" aria-controls="roomRail" aria-expanded="false"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M4 6h16M4 12h16M4 18h16"/></svg><span class="action-label">Rooms</span></button><h1 id="roomName"></h1></div>
411
+ <div class="room-title-row"><button id="btnRoomsDrawer" class="chip rooms-drawer-trigger" type="button" aria-label="Open room list" data-i18n-aria-label="roomsMenu" aria-controls="roomRail" aria-expanded="false"><svg class="fluent-icon action-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-navigation-24"></use></svg><span class="action-label">Rooms</span></button><h1 id="roomName"></h1></div>
410
412
  <p class="room-meta">
411
413
  <button type="button" id="btnCopyId" class="copy-id" aria-label="Copy room ID" data-i18n-aria-label="copyRoomId" title="Click to copy the full room ID" data-i18n-title="copyRoomIdTitle">
412
414
  <span class="mono" id="roomIdShort"></span><span class="copy-ok" data-i18n="copied">Copied</span>
@@ -418,7 +420,7 @@
418
420
  <div class="chat-head-actions">
419
421
  <div class="anchor questions-anchor">
420
422
  <button class="chip questions-trigger" type="button" id="btnQuestions" aria-haspopup="true" aria-expanded="false" aria-controls="questionPanel">
421
- <svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M9.5 9a2.5 2.5 0 1 1 4.6 1.4c-.7.9-2.1 1.3-2.1 2.8M12 17.5h.01"/><circle cx="12" cy="12" r="9"/></svg><span class="action-label" data-i18n="questions">Questions</span><span id="questionBadge" class="question-badge" hidden></span>
423
+ <svg class="fluent-icon action-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-question_circle-24"></use></svg><span class="action-label" data-i18n="questions">Questions</span><span id="questionBadge" class="question-badge" hidden></span>
422
424
  </button>
423
425
  <section class="panel question-panel" id="questionPanel" aria-labelledby="questionHeading" hidden>
424
426
  <div class="question-panel-head"><h3 id="questionHeading" tabindex="-1" data-i18n="pendingQuestions">Pending questions</h3>
@@ -429,14 +431,14 @@
429
431
  </section>
430
432
  </div>
431
433
  <div class="anchor">
432
- <button class="chip" type="button" id="btnReminders" aria-haspopup="true" aria-expanded="false" aria-controls="reminderPanel"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M18 8a6 6 0 1 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9"/><path d="M10 21a2 2 0 0 0 4 0"/></svg><span class="action-label" data-i18n="reminders">Reminders</span></button>
434
+ <button class="chip" type="button" id="btnReminders" aria-haspopup="true" aria-expanded="false" aria-controls="reminderPanel"><svg class="fluent-icon action-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-alert-24"></use></svg><span class="action-label" data-i18n="reminders">Reminders</span></button>
433
435
  <section class="panel reminder-panel" id="reminderPanel" aria-labelledby="reminderHeading" hidden>
434
436
  <div class="announcement-head"><h3 id="reminderHeading" tabindex="-1" data-i18n="reminders">Reminders</h3><div class="reminder-tools"><button type="button" id="btnNewReminder" class="btn primary small" data-i18n="reminderCreate">Create reminder</button><button type="button" id="btnRefreshReminders" class="question-refresh" data-i18n="refreshQuestions">Refresh</button></div></div>
435
437
  <p id="reminderStatus" class="hint" role="status" aria-live="polite"></p><ul id="reminderList" class="reminder-list"></ul>
436
438
  </section>
437
439
  </div>
438
440
  <div class="anchor">
439
- <button class="chip" type="button" id="btnMembers" aria-label="Members" data-i18n-aria-label="members" aria-haspopup="true" aria-expanded="false"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3"/><path d="M3.5 19v-1.5a5.5 5.5 0 0 1 11 0V19zM16 5.5a3 3 0 0 1 0 5.8M17 14a4.5 4.5 0 0 1 3.5 4.4V19h-3"/></svg><span class="action-label" data-i18n="members">Members</span><span id="joinRequestBadge" class="question-badge join-request-badge" aria-hidden="true" hidden><span id="joinRequestBadgeCount"></span></span></button>
441
+ <button class="chip" type="button" id="btnMembers" aria-label="Members" data-i18n-aria-label="members" aria-haspopup="true" aria-expanded="false"><svg class="fluent-icon action-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-people-24"></use></svg><span class="action-label" data-i18n="members">Members</span><span id="joinRequestBadge" class="question-badge join-request-badge" aria-hidden="true" hidden><span id="joinRequestBadgeCount"></span></span></button>
440
442
  <div class="panel" id="memberPanel" hidden>
441
443
  <h3 data-i18n="members">Members</h3>
442
444
  <section id="joinRequests" class="join-requests" hidden aria-labelledby="joinRequestsTitle">
@@ -454,13 +456,13 @@
454
456
  </div>
455
457
  </div>
456
458
  <div class="anchor room-options-anchor">
457
- <button class="chip" type="button" id="btnRoomOptions" aria-haspopup="true" aria-expanded="false" aria-controls="roomOptions"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></svg><span class="action-label" data-i18n="roomOptions">Options</span></button>
459
+ <button class="chip" type="button" id="btnRoomOptions" aria-haspopup="true" aria-expanded="false" aria-controls="roomOptions"><svg class="fluent-icon action-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-more_horizontal-24"></use></svg><span class="action-label" data-i18n="roomOptions">Options</span></button>
458
460
  <div class="panel room-options-panel" id="roomOptions" hidden>
459
- <button class="menu-action" type="button" id="btnAnnouncements" aria-controls="announcementPanel"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M5 4h14v16H5zM8 8h8M8 12h8M8 16h5"/></svg><span data-i18n="announcements">Announcements</span></button>
460
- <button class="menu-action files-menu-action" type="button" id="btnFiles"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/></svg><span data-i18n="filesTitle">Files</span></button>
461
- <button class="menu-action" type="button" id="btnEditRoom" data-i18n="editRoom">Edit room</button>
462
- <button class="menu-action" type="button" id="btnLeave" data-i18n="leave">Leave room</button>
463
- <button class="menu-action danger-text" type="button" id="btnDeleteRoom" data-i18n="deleteRoom">Delete room</button>
461
+ <button class="menu-action" type="button" id="btnAnnouncements" aria-controls="announcementPanel"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-megaphone-24"></use></svg><span data-i18n="announcements">Announcements</span></button>
462
+ <button class="menu-action files-menu-action" type="button" id="btnFiles"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-folder-24"></use></svg><span data-i18n="filesTitle">Files</span></button>
463
+ <button class="menu-action" type="button" id="btnEditRoom"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-edit-24"></use></svg><span data-i18n="editRoom">Edit room</span></button>
464
+ <button class="menu-action" type="button" id="btnLeave"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_exit-24"></use></svg><span data-i18n="leave">Leave room</span></button>
465
+ <button class="menu-action danger-text" type="button" id="btnDeleteRoom"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-delete-24"></use></svg><span data-i18n="deleteRoom">Delete room</span></button>
464
466
  </div>
465
467
  <section class="panel announcement-panel" id="announcementPanel" aria-labelledby="announcementHeading" hidden>
466
468
  <div class="announcement-head"><h3 id="announcementHeading" tabindex="-1" data-i18n="announcements">Announcements</h3><div class="announcement-tools"><button type="button" id="btnNewAnnouncement" class="btn primary small" aria-haspopup="dialog" data-i18n="announcementNew">New announcement</button><button type="button" id="btnRefreshAnnouncements" class="question-refresh" data-i18n="refreshQuestions">Refresh</button></div></div>
@@ -482,14 +484,14 @@
482
484
  <p id="msgEmpty" class="chat-empty" data-i18n="noMessages">No messages yet. Say something.</p>
483
485
  </div>
484
486
  <button type="button" id="btnJump" class="jump" aria-label="Back to latest messages" data-i18n-aria-label="latestMessages" hidden>
485
- <span aria-hidden="true">↓</span><span class="badge" id="jumpBadge" hidden></span>
487
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_down-24"></use></svg><span class="badge" id="jumpBadge" hidden></span>
486
488
  </button>
487
489
  </div>
488
490
 
489
491
  <aside id="readerPanel" class="reader-panel" role="dialog" aria-modal="false" aria-labelledby="readerHeading" hidden>
490
492
  <div class="reader-panel-head">
491
493
  <div><p id="readerCount" class="hint"></p><h2 id="readerHeading" tabindex="-1" data-i18n="readerPanelTitle">Message readers</h2></div>
492
- <button type="button" id="btnCloseReaders" class="reader-close" data-i18n-aria-label="close" aria-label="Close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
494
+ <button type="button" id="btnCloseReaders" class="reader-close" data-i18n-aria-label="close" aria-label="Close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
493
495
  </div>
494
496
  <ul id="readerList" class="receipt-reader-list" aria-label="Message readers" data-i18n-aria-label="readerPanelTitle"></ul>
495
497
  </aside>
@@ -511,7 +513,7 @@
511
513
  <p id="attachmentStatus" class="attachment-status" role="status" aria-live="polite"></p>
512
514
  </section>
513
515
  <div class="composer-row">
514
- <button class="attachment-button" type="button" id="btnAddAttachments" aria-label="Add files" data-i18n-aria-label="addFiles" aria-controls="attachmentPicker" disabled><svg aria-hidden="true" viewBox="0 0 24 24"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.82-2.83l8.49-8.48"/></svg></button>
516
+ <button class="attachment-button" type="button" id="btnAddAttachments" aria-label="Add files" data-i18n-aria-label="addFiles" aria-controls="attachmentPicker" disabled><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-attach-24"></use></svg></button>
515
517
  <input id="attachmentPicker" type="file" multiple hidden>
516
518
  <div id="msgInput" class="input message-editor" data-empty="true" role="textbox" aria-multiline="true" aria-label="Message" data-i18n-aria-label="messagePlaceholder" aria-placeholder="Type a message, Enter to send, Shift+Enter for a new line" data-i18n-aria-placeholder="messagePlaceholder" aria-autocomplete="list" aria-controls="mentionPicker" aria-expanded="false" aria-keyshortcuts="Enter Shift+Enter" enterkeyhint="send" autocapitalize="sentences" spellcheck="true" contenteditable="false" aria-disabled="true" tabindex="-1"></div>
517
519
  <button class="btn primary" type="button" id="btnSend" data-i18n="send" disabled>Send</button>
@@ -524,23 +526,40 @@
524
526
  <p id="draftCount" class="draft-count">0 / 5000</p>
525
527
  </div>
526
528
  </footer>
529
+ <dialog id="docPreview" class="doc-preview" aria-labelledby="docPreviewTitle">
530
+ <header class="doc-preview-head">
531
+ <div class="doc-preview-heading">
532
+ <p class="doc-preview-eyebrow"><svg class="fluent-icon doc-preview-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-document-24"></use></svg><span data-i18n="docPreviewEyebrow">Markdown preview</span></p>
533
+ <h2 id="docPreviewTitle" tabindex="-1"></h2>
534
+ <p class="doc-preview-meta"><span id="docPreviewSize"></span><span id="docPreviewStatus" role="status" aria-live="polite"></span></p>
535
+ </div>
536
+ <div class="doc-preview-actions">
537
+ <button id="btnDocPreviewDownload" class="btn ghost small doc-preview-download" type="button" data-i18n="resourceDownload">Download</button>
538
+ <button id="btnCloseDocPreview" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
539
+ </div>
540
+ </header>
541
+ <div class="doc-preview-scroll">
542
+ <article id="docPreviewBody" class="doc-preview-body msg-text"></article>
543
+ <p id="docPreviewEmpty" class="hint doc-preview-empty" data-i18n="docPreviewEmpty" hidden>This document is empty.</p>
544
+ </div>
545
+ </dialog>
527
546
  <div id="attachmentDropOverlay" class="attachment-drop-overlay" role="status" aria-live="polite" data-i18n="dropFilesHere" hidden></div>
528
547
  </section>
529
548
 
530
549
  <!-- Full-screen view of an image already loaded in the message list. -->
531
550
  <dialog id="imageDialog" class="image-dialog" aria-label="Image preview" data-i18n-aria-label="imagePreviewTitle">
532
- <button id="btnCloseImage" class="image-dialog-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
551
+ <button id="btnCloseImage" class="image-dialog-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
533
552
  <div class="image-dialog-tools" role="group" aria-label="Image zoom" data-i18n-aria-label="imageZoomControls">
534
- <button id="btnZoomOut" class="image-dialog-tool" type="button" aria-label="Zoom out" data-i18n-aria-label="zoomOut">−</button>
553
+ <button id="btnZoomOut" class="image-dialog-tool" type="button" aria-label="Zoom out" data-i18n-aria-label="zoomOut"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-subtract-24"></use></svg></button>
535
554
  <button id="btnZoomReset" class="image-dialog-tool image-dialog-reset" type="button" aria-label="Reset zoom" data-i18n-aria-label="zoomReset"><span id="zoomLevel">100%</span></button>
536
- <button id="btnZoomIn" class="image-dialog-tool" type="button" aria-label="Zoom in" data-i18n-aria-label="zoomIn">+</button>
555
+ <button id="btnZoomIn" class="image-dialog-tool" type="button" aria-label="Zoom in" data-i18n-aria-label="zoomIn"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-add-24"></use></svg></button>
537
556
  </div>
538
557
  <img id="imageDialogImage" alt="">
539
558
  </dialog>
540
559
 
541
560
  <!-- Shown when someone who is not the room owner reaches for the settings. -->
542
561
  <dialog id="ownerOnlyDialog" class="admin-dialog" aria-labelledby="ownerOnlyHeading">
543
- <header class="admin-dialog-head"><h2 id="ownerOnlyHeading" data-i18n="roomOwnerOnlyTitle">Owner or administrator only</h2><div class="admin-dialog-actions"><button id="btnCloseOwnerOnly" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></header>
562
+ <header class="admin-dialog-head"><h2 id="ownerOnlyHeading" data-i18n="roomOwnerOnlyTitle">Owner or administrator only</h2><div class="admin-dialog-actions"><button id="btnCloseOwnerOnly" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button></div></header>
544
563
  <p id="ownerOnlyNote" class="hint"></p>
545
564
  <button id="btnOwnerOnlyOk" class="btn ghost small" type="button" data-i18n="close">Close</button>
546
565
  </dialog>
@@ -563,16 +582,16 @@
563
582
  </div>
564
583
  <div class="palette-head-actions">
565
584
  <button id="paletteScope" class="chip palette-scope" type="button" data-scope="room" aria-label="Search scope">
566
- <svg aria-hidden="true" viewBox="0 0 24 24"><path d="M4 11a8 8 0 0 1 13.7-5.7L20 7.6"/><path d="M20 4v4h-4"/><path d="M20 13a8 8 0 0 1-13.7 5.7L4 16.4"/><path d="M4 20v-4h4"/></svg>
585
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_swap-24"></use></svg>
567
586
  <span id="paletteScopeLabel">This room</span>
568
587
  <kbd class="keys-key" aria-hidden="true">Tab</kbd>
569
588
  </button>
570
- <button id="btnClosePalette" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
589
+ <button id="btnClosePalette" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
571
590
  </div>
572
591
  </header>
573
592
  <div class="palette-search">
574
- <svg aria-hidden="true" viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="m16 16 5 5"/></svg>
575
- <input id="paletteInput" class="input palette-input" type="text" role="combobox" aria-autocomplete="list" aria-expanded="true" aria-controls="paletteList" aria-describedby="paletteHint" aria-label="Search messages" data-i18n-aria-label="paletteSearchLabel" placeholder="Search messages, or type > for commands" data-i18n-placeholder="palettePlaceholder" autocomplete="off" autocapitalize="off" spellcheck="false" enterkeyhint="go">
593
+ <svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-search-24"></use></svg>
594
+ <input id="paletteInput" class="input palette-input" type="text" role="combobox" aria-autocomplete="list" aria-expanded="true" aria-controls="paletteList" aria-describedby="paletteHint" aria-label="Search messages" data-i18n-aria-label="paletteSearchLabel" placeholder="Search messages, or type / for commands" data-i18n-placeholder="palettePlaceholder" autocomplete="off" autocapitalize="off" spellcheck="false" enterkeyhint="go">
576
595
  <span id="paletteMode" class="palette-mode" aria-hidden="true">Search</span>
577
596
  </div>
578
597
  <p id="paletteStatus" class="hint palette-status" role="status" aria-live="polite"></p>
@@ -586,7 +605,7 @@
586
605
  <dialog id="shortcutsDialog" class="keys-dialog" aria-labelledby="shortcutsHeading">
587
606
  <header class="keys-dialog-head">
588
607
  <h2 id="shortcutsHeading" tabindex="-1" data-i18n="shortcutsTitle">Keyboard shortcuts</h2>
589
- <button id="btnCloseShortcuts" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
608
+ <button id="btnCloseShortcuts" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
590
609
  </header>
591
610
  <p id="shortcutsLead" class="keys-lead" data-i18n="shortcutsLead">ChatRoom shortcuts. Press Alt + / to open this list.</p>
592
611
 
@@ -598,6 +617,12 @@
598
617
  <li><span class="keys-combo"><kbd class="keys-key">↑</kbd><kbd class="keys-key">↓</kbd><span class="keys-sep">·</span><kbd class="keys-key">Enter</kbd></span><span data-i18n="shortcutsMention">Choose a member to mention</span></li>
599
618
  </ul>
600
619
  </section>
620
+ <section class="keys-section">
621
+ <h3 data-i18n="shortcutsSearch">Search and commands</h3>
622
+ <ul class="keys-list">
623
+ <li><span class="keys-combo"><kbd class="keys-key shortcut-mod">Alt</kbd><span class="keys-sep">+</span><kbd class="keys-key">Space</kbd></span><span data-i18n="shortcutsOpenPalette">Open search and commands</span></li>
624
+ </ul>
625
+ </section>
601
626
  <section class="keys-section">
602
627
  <h3 data-i18n="shortcutsRooms">Rooms</h3>
603
628
  <ul class="keys-list">
@@ -625,6 +650,17 @@
625
650
 
626
651
  </main>
627
652
 
653
+ <aside id="pwaUpdate" class="pwa-update" role="status" aria-live="polite" aria-labelledby="pwaUpdateTitle" hidden>
654
+ <div class="pwa-update-copy">
655
+ <strong id="pwaUpdateTitle" data-i18n="pwaUpdateTitle">Update available</strong>
656
+ <p data-i18n="pwaUpdateBody">A new version is ready. Reload now, or update the next time you open the app.</p>
657
+ </div>
658
+ <div class="pwa-update-actions">
659
+ <button id="btnPwaUpdate" class="btn primary small" type="button" data-i18n="pwaUpdateNow">Update now</button>
660
+ <button id="btnPwaLater" class="btn ghost small" type="button" data-i18n="pwaUpdateLater">Later</button>
661
+ </div>
662
+ </aside>
663
+
628
664
  <script src="/assets/marked-18.0.4.js"></script>
629
665
  <script src="/assets/dompurify-3.4.7.js"></script>
630
666
  <script src="/assets/highlight-10.7.3.min.js"></script>
package/server/sw.js CHANGED
@@ -4,6 +4,8 @@ const CACHE = `oc-chat-${VERSION}`;
4
4
  const SHELL = "/chat";
5
5
  const STATIC = [
6
6
  "/assets/base.css",
7
+ "/assets/icons.css",
8
+ "/assets/fluent-icons.svg",
7
9
  "/assets/settings.css",
8
10
  "/assets/conversation.css",
9
11
  "/assets/recall.css",
@@ -14,6 +16,7 @@ const STATIC = [
14
16
  "/assets/edit-room.css",
15
17
  "/assets/palette.css",
16
18
  "/assets/files.css",
19
+ "/assets/doc-preview.css",
17
20
  "/assets/highlight-10.7.3.min.js",
18
21
  "/assets/icons/icon-192.png",
19
22
  "/assets/icons/icon-512.png",
@@ -39,10 +42,16 @@ self.addEventListener("install", (event) => {
39
42
  pending.push(new URL(match[1], `https://chat.invalid${url}`).pathname);
40
43
  }
41
44
  }
42
- await self.skipWaiting();
45
+ // A first install should control immediately. A replacement waits until the page
46
+ // asks for it, so an open conversation is never reloaded without consent.
47
+ if (!self.registration.active) await self.skipWaiting();
43
48
  })());
44
49
  });
45
50
 
51
+ self.addEventListener("message", (event) => {
52
+ if (event.data?.type === "SKIP_WAITING") event.waitUntil(self.skipWaiting());
53
+ });
54
+
46
55
  self.addEventListener("activate", (event) => {
47
56
  event.waitUntil((async () => {
48
57
  for (const key of await caches.keys()) if (key !== CACHE) await caches.delete(key);
package/src/tui/app.mjs CHANGED
@@ -2,6 +2,11 @@
2
2
  // the reducer can be tested against a fake api. Palette methods are attached
3
3
  // from palette-app.mjs.
4
4
  import { attachPalette } from "./palette-app.mjs";
5
+ import { attachInfo } from "./info-app.mjs";
6
+ import { attachReminders } from "./reminder-app.mjs";
7
+ import { attachRoomSettings } from "./room-settings-app.mjs";
8
+ import { attachMessageActions } from "./message-app.mjs";
9
+ import { attachJoinRequests } from "./join-app.mjs";
5
10
  import { mergeMessages, messageStamp, oldestSeq } from "./messages.mjs";
6
11
 
7
12
  const BACKOFF_MS = [1000, 2000, 4000, 8000, 15000];
@@ -16,12 +21,16 @@ const normalizeRoom = (room) => ({
16
21
  });
17
22
 
18
23
  export class ChatApp {
19
- constructor({ api, sessionID, participant, host = "", autoPoll = true, schedule = (fn, ms) => setTimeout(fn, ms) }) {
24
+ constructor({ api, sessionID, participant, host = "", autoPoll = true, settings = {}, downloadDir = process.cwd(), schedule = (fn, ms) => setTimeout(fn, ms) }) {
20
25
  this.api = api;
21
26
  this.sessionID = sessionID;
22
27
  this.participant = participant;
23
28
  this.autoPoll = autoPoll;
24
29
  this.schedule = schedule;
30
+ this.settings = { ...settings };
31
+ this.token = this.settings.token ?? "";
32
+ delete this.settings.token;
33
+ this.downloadDir = downloadDir;
25
34
  this.closed = false;
26
35
  this.pollToken = 0;
27
36
  this.timers = new Set();
@@ -35,6 +44,7 @@ export class ChatApp {
35
44
  this.state = {
36
45
  host,
37
46
  participant,
47
+ theme: "dark",
38
48
  connection: "connecting",
39
49
  rooms: [],
40
50
  selected: 0,
@@ -411,6 +421,11 @@ export class ChatApp {
411
421
  }
412
422
 
413
423
  attachPalette(ChatApp);
424
+ attachInfo(ChatApp);
425
+ attachReminders(ChatApp);
426
+ attachRoomSettings(ChatApp);
427
+ attachMessageActions(ChatApp);
428
+ attachJoinRequests(ChatApp);
414
429
 
415
430
  export function createApp(options) {
416
431
  return new ChatApp(options);