@alexsun-top/opencode-chat-room 0.3.3 → 0.5.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +44 -11
  3. package/README.zh-CN.md +40 -10
  4. package/package.json +4 -1
  5. package/plugin.ts +26 -10
  6. package/server/announcement-routes.ts +34 -0
  7. package/server/assets/MERMAID-LICENSE +21 -0
  8. package/server/assets/NOTICE.txt +2 -1
  9. package/server/assets/base.css +43 -27
  10. package/server/assets/chat/announcements.js +119 -0
  11. package/server/assets/chat/events.js +180 -6
  12. package/server/assets/chat/index.js +6 -0
  13. package/server/assets/chat/markdown.js +214 -11
  14. package/server/assets/chat/members.js +4 -1
  15. package/server/assets/chat/messages.js +57 -77
  16. package/server/assets/chat/questions.js +204 -0
  17. package/server/assets/chat/receipts.js +117 -0
  18. package/server/assets/chat/rooms.js +11 -6
  19. package/server/assets/chat/state.js +64 -18
  20. package/server/assets/conversation.css +58 -17
  21. package/server/assets/mermaid-11.12.2.min.js +2811 -0
  22. package/server/assets/responsive.css +47 -23
  23. package/server/chat-server.ts +41 -12
  24. package/server/chat.html +51 -10
  25. package/server/member-routes.ts +3 -0
  26. package/server/newrooms.ts +2 -0
  27. package/server/resource-routes.ts +65 -0
  28. package/server/wake.ts +2 -2
  29. package/skills/chatroom/SKILL.md +92 -0
  30. package/src/agent-receipts.ts +4 -4
  31. package/src/announcement-tool.ts +25 -0
  32. package/src/announcements.ts +16 -0
  33. package/src/center-client.ts +32 -2
  34. package/src/center-inbox.ts +9 -9
  35. package/src/chatroom-skill.ts +15 -0
  36. package/src/plugin-notifications.ts +7 -9
  37. package/src/resource-upload.ts +50 -0
  38. package/src/resources.ts +104 -0
  39. package/src/room-service.ts +5 -0
  40. package/src/sqlite-state.ts +83 -13
  41. package/src/store.ts +4 -11
  42. package/src/v1-plugin.ts +6 -1
  43. package/src/v2-plugin.ts +39 -8
@@ -7,7 +7,8 @@ export const app = {
7
7
  receiptObservation: null,
8
8
  memberApiUnavailable: new Set(), receiptApiUnavailable: new Set(),
9
9
  receipts: new Map(), acknowledgedMessages: new Map(), pendingAcknowledgements: new Map(),
10
- pendingAction: null, watcherTimer: 0, restored: false,
10
+ pendingAction: null, watcherTimer: 0, restored: false, resizeScrollAdjusting: false, layoutScrollAdjusting: false,
11
+ readAnchorGuard: null, userScrollIntentUntil: 0,
11
12
  },
12
13
  rendered: 0,
13
14
  firstMessageId: null,
@@ -145,6 +146,8 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
145
146
  set drafts(value) { writeSession("chat.drafts", JSON.stringify(value)); },
146
147
  get positions() { try { return JSON.parse(readSession("chat.positions") || "{}"); } catch { return {}; } },
147
148
  set positions(value) { writeSession("chat.positions", JSON.stringify(value)); },
149
+ get readTs() { try { return JSON.parse(readSession("chat.readTs") || "{}"); } catch { return {}; } },
150
+ set readTs(value) { writeSession("chat.readTs", JSON.stringify(value)); },
148
151
  get failedMessages() {
149
152
  try {
150
153
  const value = JSON.parse(readSession("chat.failedMessages") || "{}");
@@ -154,10 +157,10 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
154
157
  set failedMessages(value) { writeSession("chat.failedMessages", JSON.stringify(value)); },
155
158
  };
156
159
  const saveToken = (value) => { auth.token = String(value ?? "").trim(); return auth.token; };
157
- const api = async (url, options = {}) => {
160
+ const apiResponse = async (url, options = {}) => {
158
161
  assertIdentity();
159
162
  const headers = { ...options.headers };
160
- if (options.body) headers["Content-Type"] = "application/json";
163
+ if (typeof options.body === "string" && !headers["Content-Type"]) headers["Content-Type"] = "application/json";
161
164
  if (auth.token) headers.Authorization = `Bearer ${auth.token}`;
162
165
  let response;
163
166
  try { response = await (fetcher ?? globalThis.fetch)(url, { ...options, headers }); }
@@ -166,22 +169,31 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
166
169
  error.network = true;
167
170
  throw error;
168
171
  }
169
- const data = await response.json().catch(() => ({}));
170
172
  assertIdentity();
171
173
  if (!response.ok) {
174
+ const data = await response.clone().json().catch(() => ({}));
175
+ assertIdentity();
172
176
  const error = new Error(data.error || translate("requestFailed", { status: response.status }));
173
177
  error.status = response.status;
174
178
  throw error;
175
179
  }
176
- return data;
180
+ return response;
177
181
  };
178
- return { LS: auth, saveToken, api };
182
+ const api = async (url, options) => {
183
+ const response = await apiResponse(url, options), data = await response.json().catch(() => ({}));
184
+ assertIdentity(); return data;
185
+ };
186
+ const apiBlob = async (url, options) => {
187
+ const response = await apiResponse(url, options), blob = await response.blob();
188
+ assertIdentity(); return blob;
189
+ };
190
+ return { LS: auth, saveToken, api, apiBlob };
179
191
  }
180
192
 
181
193
  const messages = {
182
194
  en: {
183
- brand: "Casual Chat", documentTitle: "Casual Chat · Lightweight Chatroom",
184
- roomTitle: ({ name }) => `${name} · Casual Chat`,
195
+ brand: "OC Chat", documentTitle: "OC Chat",
196
+ roomTitle: ({ name }) => `${name} · OC Chat`,
185
197
  tagline: "A lightweight chat room. Enter a room ID to join, or create a new one.",
186
198
  languageLabel: "Language", roomIdLabel: "Room ID", roomIdPlaceholder: "Paste or enter a room ID",
187
199
  nameLabel: "Your name", namePlaceholder: "What should we call you?", joinRoom: "Join room",
@@ -192,7 +204,19 @@ const messages = {
192
204
  existingRooms: "Rooms", noRooms: "No rooms yet. Create one.", copyRoomId: "Copy room ID",
193
205
  newRoom: "Create a room",
194
206
  copyRoomIdTitle: ({ id }) => `Click to copy the full room ID: ${id}`, copied: "Copied",
195
- members: "Members", membersCount: ({ count }) => `Members (${count})`, noMembers: "No members yet.",
207
+ members: "Members", membersCount: ({ count }) => `Members (${count})`, noMembers: "No members yet.", profileMenu: "Your profile and settings",
208
+ questions: "Questions", pendingQuestions: "Pending questions", refreshQuestions: "Refresh",
209
+ announcements: "Announcements", announcementName: "Name", announcementContent: "Content",
210
+ diagramLoading: "Rendering diagram…", diagramRenderFailed: "Diagram unavailable; showing its source.", resourceLoading: "Loading file…", resourceFailed: "This file could not be loaded.", resourceDownload: "Download", resourcePreview: "Preview", resourceHide: "Hide preview",
211
+ announcementDelete: "Delete announcement",
212
+ announcementNew: "New announcement", announcementEmpty: "No announcements yet.", announcementLoading: "Loading announcements…",
213
+ announcementLoadFailed: "Could not load announcements. Your draft is still here.", announcementSaved: "Announcement saved.", announcementDeleted: "Announcement deleted.",
214
+ announcementDuplicate: "That name already exists. Select it to edit, or choose another name.", announcementDeleteConfirm: ({ name }) => `Delete “${name}”?`, announcementCount: ({ count }) => `${count} / 5000`, announcementInvalid: "Use a name of 1–64 characters and content up to 5000 characters.",
215
+ questionsLoading: "Loading questions…", questionsEmpty: "No unanswered questions.",
216
+ questionsFailed: "Could not load questions. Try again.", questionLabel: "Question",
217
+ answerQuestion: "Reply", answerPlaceholder: "Write a reply…", sendAnswer: "Send reply",
218
+ answerFailed: "Reply failed. Your draft is still here.", questionAlreadyAnswered: "This question was answered elsewhere.",
219
+ sendAsQuestion: "Send as a question",
196
220
  settings: "Settings", tokenRequired: "The server requires an access token (401).",
197
221
  leave: "Leave", reconnecting: "Connection lost. Retrying…", messageList: "Message list",
198
222
  noMessages: "No messages yet. Say something.", latestMessages: "Back to latest messages",
@@ -201,7 +225,7 @@ const messages = {
201
225
  joinArrow: "Join →", joinDirectTitle: "Click to join directly", mentionEmpty: "No matching members",
202
226
  joined: "Joined", joinAction: "Join room", unreadMessages: ({ count }) => `${count} unread`,
203
227
  mentionHint: "↑↓ Select · Enter to confirm · Esc to close", today: "Today", yesterday: "Yesterday",
204
- earlierMessages: "Earlier messages omitted", you: "You", saved: "Saved",
228
+ earlierMessages: "Earlier messages omitted", messagesBetweenOmitted: "Messages between this reading point and latest are omitted.", you: "You", saved: "Saved",
205
229
  savedMemory: "Saved for this tab only", copyFailed: ({ id }) => `Copy failed. Copy manually: ${id}`,
206
230
  copyCode: "Copy code", copiedCode: "Copied", copyCodeFailed: "Could not copy code. Select and copy it manually.",
207
231
  copyMessage: "Copy", copiedMessage: "Copied", copyMessageFailed: "Could not copy. Select and copy the message manually.",
@@ -217,6 +241,7 @@ const messages = {
217
241
  failedMessages: "Messages not sent", retryFailed: "Retry", discardFailed: "Discard",
218
242
  roomListError: "Unable to load rooms. You can enter a room ID directly.", guest: "Guest",
219
243
  roomsLabel: "Rooms", refreshRooms: "Refresh rooms", identityLabel: ({ name }) => `Chatting as ${name}`,
244
+ roomsMenu: "Open room list", closeRoomList: "Close room list",
220
245
  direct: "Direct", messagePrivately: "Message privately", removeMember: "Remove",
221
246
  kickConfirm: ({ name, id }) => `Remove ${name} (session ${id}) from this room?`,
222
247
  deleteRoom: "Delete room", deleteConfirm: ({ name }) => `Delete “${name}” and all its messages? This cannot be undone.`,
@@ -225,11 +250,11 @@ const messages = {
225
250
  systemJoined: ({ name }) => `${name} joined the room`, systemLeft: ({ name }) => `${name} left the room`, systemRemoved: ({ name }) => `${name} was removed from the room`,
226
251
  activity_working: "Working", activity_idle: "Foreground idle", activity_waiting: "Waiting", activity_unknown: "Status unknown", activity_offline: "Status stale",
227
252
  activityHint_working: "The agent reports active work.", activityHint_idle: "Foreground is idle; background work may continue.", activityHint_waiting: "The agent reports that it is waiting.", activityHint_unknown: "No activity report is available.", activityHint_offline: "The last status is stale; this does not prove the agent is offline.",
228
- receiptCount: ({ count }) => `Read by ${count}`, departedMember: "left",
253
+ receiptCount: ({ count }) => `Read by ${count}`, receiptNone: "No readers yet", receiptNotLoaded: "Read status not loaded", readerPanelTitle: "Message readers", close: "Close", departedMember: "left",
229
254
  receiptEvidence_displayed: "Shown on screen", receiptEvidence_tool: "Fetched with room tool", receiptEvidence_context: "Full message reached agent context preparation (not proof of understanding)",
230
255
  },
231
256
  "zh-CN": {
232
- brand: "闲叙", documentTitle: "闲叙 · 轻量聊天室", roomTitle: ({ name }) => `${name} · 闲叙`,
257
+ brand: "OC Chat", documentTitle: "OC Chat", roomTitle: ({ name }) => `${name} · OC Chat`,
233
258
  tagline: "一个轻量的聊天房间。输入房间 ID 加入,或直接新建一个。", languageLabel: "语言",
234
259
  roomIdLabel: "房间 ID", roomIdPlaceholder: "粘贴或输入房间 ID", nameLabel: "你的昵称",
235
260
  namePlaceholder: "怎么称呼你", joinRoom: "加入房间", or: "或", newRoomNameLabel: "新房间名称",
@@ -239,14 +264,26 @@ const messages = {
239
264
  noRooms: "还没有房间,创建一个吧。", copyRoomId: "复制房间 ID",
240
265
  newRoom: "创建房间",
241
266
  copyRoomIdTitle: ({ id }) => `点击复制完整房间 ID:${id}`, copied: "已复制", members: "成员",
242
- membersCount: ({ count }) => `成员 ${count}`, noMembers: "暂无成员", settings: "设置",
267
+ membersCount: ({ count }) => `成员 ${count}`, noMembers: "暂无成员", settings: "设置", profileMenu: "个人资料和设置",
268
+ questions: "提问", pendingQuestions: "待回答的问题", refreshQuestions: "刷新",
269
+ announcements: "公告栏", announcementName: "名称", announcementContent: "内容",
270
+ diagramLoading: "正在渲染图表…", diagramRenderFailed: "图表无法显示,以下为源代码。", resourceLoading: "正在加载文件…", resourceFailed: "无法加载此文件。", resourceDownload: "下载", resourcePreview: "预览", resourceHide: "收起预览",
271
+ announcementDelete: "删除公告",
272
+ announcementNew: "新建公告", announcementEmpty: "暂无公告。", announcementLoading: "正在加载公告…",
273
+ announcementLoadFailed: "无法加载公告,草稿仍已保留。", announcementSaved: "公告已保存。", announcementDeleted: "公告已删除。",
274
+ announcementDuplicate: "此名称已存在。请选择该公告进行编辑,或使用其他名称。", announcementDeleteConfirm: ({ name }) => `删除“${name}”?`, announcementCount: ({ count }) => `${count} / 5000`, announcementInvalid: "名称需为 1–64 个字符,内容不能超过 5000 个字符。",
275
+ questionsLoading: "正在加载问题…", questionsEmpty: "没有待回答的问题。",
276
+ questionsFailed: "无法加载问题,请重试。", questionLabel: "问题",
277
+ answerQuestion: "回复", answerPlaceholder: "写下回复…", sendAnswer: "发送回复",
278
+ answerFailed: "回复失败,草稿仍已保留。", questionAlreadyAnswered: "此问题已由其他人回答。",
279
+ sendAsQuestion: "作为问题发送",
243
280
  tokenRequired: "服务器要求访问令牌(401)。", leave: "离开", reconnecting: "连接中断,正在重试…",
244
281
  messageList: "消息列表", noMessages: "还没有消息,说点什么吧。", latestMessages: "回到最新消息",
245
282
  mentionMembers: "选择要提及的成员", messagePlaceholder: "输入消息,Enter 发送,Shift+Enter 换行",
246
283
  send: "发送", roomMeta: ({ members, count }) => `${members} 人 · ${count} 条消息`, joinArrow: "加入 →",
247
284
  joinDirectTitle: "点击直接加入", mentionEmpty: "没有匹配的成员", mentionHint: "↑↓ 选择 · Enter 确认 · Esc 关闭",
248
285
  joined: "已加入", joinAction: "加入房间", unreadMessages: ({ count }) => `${count} 条未读`,
249
- today: "今天", yesterday: "昨天", earlierMessages: "更早的消息已省略", you: "我", saved: "已保存",
286
+ today: "今天", yesterday: "昨天", earlierMessages: "更早的消息已省略", messagesBetweenOmitted: "此阅读位置与最新消息之间的部分消息已省略。", you: "我", saved: "已保存",
250
287
  savedMemory: "仅保存于当前标签页", copyFailed: ({ id }) => `复制失败,请手动复制:${id}`,
251
288
  copyCode: "复制代码", copiedCode: "已复制", copyCodeFailed: "复制失败,请手动选择并复制代码。",
252
289
  copyMessage: "复制", copiedMessage: "已复制", copyMessageFailed: "复制失败,请手动选择并复制消息。",
@@ -259,7 +296,7 @@ const messages = {
259
296
  sendNetwork: "发送失败,消息已保存在下方", sendFailed: ({ message }) => `发送失败:${message}`,
260
297
  failedMessages: "未发送的消息", retryFailed: "重试", discardFailed: "删除",
261
298
  roomListError: "无法加载房间列表,可直接输入房间 ID 加入。", guest: "访客", roomsLabel: "房间列表",
262
- refreshRooms: "刷新房间", identityLabel: ({ name }) => `当前昵称:${name}`, direct: "私聊",
299
+ refreshRooms: "刷新房间", identityLabel: ({ name }) => `当前昵称:${name}`, roomsMenu: "打开房间列表", closeRoomList: "关闭房间列表", direct: "私聊",
263
300
  messagePrivately: "私聊", removeMember: "移除", kickConfirm: ({ name, id }) => `确定将 ${name}(会话 ${id})移出此房间?`,
264
301
  deleteRoom: "删除房间", deleteConfirm: ({ name }) => `删除“${name}”及全部聊天记录?此操作无法撤销。`,
265
302
  allMembers: "所有人", messageCount: ({ count }) => `${count} / 2000`,
@@ -267,7 +304,7 @@ const messages = {
267
304
  systemJoined: ({ name }) => `${name} 加入了房间`, systemLeft: ({ name }) => `${name} 离开了房间`, systemRemoved: ({ name }) => `${name} 被移出了房间`,
268
305
  activity_working: "工作中", activity_idle: "前台空闲", activity_waiting: "等待中", activity_unknown: "状态未知", activity_offline: "状态已过期",
269
306
  activityHint_working: "Agent 正在报告工作状态。", activityHint_idle: "前台空闲;后台任务仍可能继续。", activityHint_waiting: "Agent 正在报告等待状态。", activityHint_unknown: "暂无活动状态报告。", activityHint_offline: "最近的状态已过期;这不能证明 Agent 已离线。",
270
- receiptCount: ({ count }) => `已读 ${count} 人`, departedMember: "已离开",
307
+ receiptCount: ({ count }) => `已读 ${count} 人`, receiptNone: "尚无人已读", receiptNotLoaded: "尚未加载已读状态", readerPanelTitle: "消息已读情况", close: "关闭", departedMember: "已离开",
271
308
  receiptEvidence_displayed: "已显示在屏幕上", receiptEvidence_tool: "通过房间工具读取", receiptEvidence_context: "完整消息已进入 Agent 上下文准备阶段(不代表已理解)",
272
309
  },
273
310
  };
@@ -277,14 +314,16 @@ app.t = (key, values = {}) => {
277
314
  const text = typeof entry === "function" ? entry(values) : entry;
278
315
  return String(text).replace(/\{(\w+)\}/g, (_, name) => values[name] ?? "");
279
316
  };
280
- export const { LS, saveToken, api } = createAuth(undefined, undefined, (key, values) => app.t(key, values));
317
+ export const { LS, saveToken, api, apiBlob } = createAuth(undefined, undefined, (key, values) => app.t(key, values));
281
318
  app.LS = LS;
282
319
  app.api = api;
320
+ app.apiBlob = apiBlob;
283
321
  app.setToken = saveToken;
284
322
  app.locale = LS.locale === "zh-CN" ? "zh-CN" : "en";
285
323
  app.state.joinedIds = new Set(LS.joinedRoomIds);
286
324
  app.state.drafts = new Map(Object.entries(LS.drafts));
287
- app.state.positions = new Map(Object.entries(LS.positions).map(([id, value]) => [id, Number(value) || 0]));
325
+ app.state.positions = new Map(Object.entries(LS.positions).map(([id, value]) => [id, value && typeof value === "object" ? value : Number(value) || 0]));
326
+ app.state.lastReadTs = new Map(Object.entries(LS.readTs).map(([id, value]) => [id, Number(value) || 0]));
288
327
  app.state.roomNames = new Map(Object.entries(LS.roomNames));
289
328
  app.state.failedMessages = new Map(Object.entries(LS.failedMessages).map(([id, items]) => [id, Array.isArray(items) ? items.filter((item) => item && typeof item.id === "string" && typeof item.text === "string") : []]));
290
329
  app.saveDraft = (roomId, text) => {
@@ -304,9 +343,15 @@ app.savePosition = (roomId, position) => {
304
343
  app.state.positions.set(roomId, position);
305
344
  LS.positions = Object.fromEntries(app.state.positions);
306
345
  };
346
+ app.saveReadTs = (roomId, timestamp) => {
347
+ app.state.lastReadTs.set(roomId, timestamp);
348
+ LS.readTs = Object.fromEntries(app.state.lastReadTs);
349
+ };
307
350
  app.clearPosition = (roomId) => {
308
351
  app.state.positions.delete(roomId);
309
352
  LS.positions = Object.fromEntries(app.state.positions);
353
+ app.state.lastReadTs.delete(roomId);
354
+ LS.readTs = Object.fromEntries(app.state.lastReadTs);
310
355
  };
311
356
  app.saveJoinedIds = () => { LS.joinedRoomIds = [...app.state.joinedIds]; };
312
357
  app.saveRoomNames = () => { LS.roomNames = Object.fromEntries(app.state.roomNames); };
@@ -328,6 +373,7 @@ app.applyLocale = () => {
328
373
  });
329
374
  }
330
375
  document.querySelectorAll(".locale-select").forEach((select) => { select.value = app.locale; });
376
+ app.autoGrow?.(app.$("#msgInput"));
331
377
  app.updateDraftCount?.();
332
378
  app.updateMentionList?.();
333
379
  app.renderFailedMessages?.();
@@ -8,8 +8,12 @@
8
8
  border-bottom: 1px solid var(--line);
9
9
  background: var(--surface);
10
10
  }
11
- .chat-head-main h1 { margin: 0; font-family: var(--font-serif); font-size: 19px; letter-spacing: .02em; }
12
- .room-meta { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); }
11
+ .chat-head-main h1 { margin: 0; font-family: var(--font-sans); font-size: 20px; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
12
+ .room-title-row { display: flex; align-items: center; min-width: 0; gap: 8px; }
13
+ .room-title-row h1 { flex: 1; min-width: 0; }
14
+ .rooms-drawer-trigger { display: none; }
15
+ .room-drawer-backdrop { position: fixed; inset: 0; z-index: 49; border: 0; background: rgb(9 16 22 / .38); }
16
+ .room-meta { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
13
17
  .mono { font-family: var(--font-mono); }
14
18
  .copy-id {
15
19
  appearance: none;
@@ -29,10 +33,25 @@
29
33
  .copy-id.copied .copy-ok { display: inline; color: var(--accent); }
30
34
 
31
35
  .chat-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
36
+ .question-panel { width: min(390px, calc(100vw - 32px)); max-height: min(70vh, 620px); overflow: auto; }
37
+ .questions-trigger { position: relative; }
38
+ .question-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
39
+ .question-panel-head h3 { margin-bottom: 0; }
40
+ .question-refresh { border: 0; padding: 4px 7px; color: var(--accent); background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
41
+ .question-list { list-style: none; max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 0; }
42
+ .question-item { width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; font: inherit; font-size: 13px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
43
+ .question-item:hover, .question-item[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }
44
+ .question-reply { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
45
+ .question-reply-quote { max-height: 72px; overflow: auto; margin: 0 0 8px; padding: 8px 10px; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--surface-2); font-size: 12px; overflow-wrap: anywhere; }
46
+ .question-reply-form { display: grid; gap: 8px; }
47
+ .question-reply-form textarea { min-height: 62px; resize: vertical; }
48
+ .question-reply-form .btn { justify-self: end; }
49
+ .question-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 5px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 10px; }
32
50
  .chip {
33
51
  appearance: none;
34
52
  font: inherit;
35
53
  font-size: 13px;
54
+ line-height: 1.25;
36
55
  font-weight: 600;
37
56
  color: var(--ink-2);
38
57
  background: var(--surface);
@@ -43,6 +62,8 @@
43
62
  transition: color .12s, border-color .12s, background .12s;
44
63
  }
45
64
  .chip:hover { color: var(--ink); border-color: var(--ink-3); }
65
+ .profile-trigger { display: grid; place-items: center; width: 36px; height: 36px; padding: 3px; border-radius: 50%; }
66
+ .profile-trigger .rail-avatar { width: 25px; height: 25px; font-size: 12px; font-weight: 700; }
46
67
  .chip.danger { color: var(--danger); }
47
68
  .chip.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
48
69
 
@@ -77,6 +98,7 @@
77
98
  #memberList .member-activity + .member-actions { grid-column: 2; grid-row: 2; }
78
99
  #memberList .member-action { white-space: normal; }
79
100
  #memberList li:last-child { border-bottom: none; }
101
+ #chatSettings [data-i18n="privacyNote"] { min-height: 63px; line-height: 21px; }
80
102
  .m-time { font-size: 11.5px; color: var(--ink-3); }
81
103
  .member-activity { flex: none; padding: 2px 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 10px; }
82
104
  .member-activity.working { color: var(--accent); background: var(--accent-soft); }
@@ -164,24 +186,27 @@
164
186
  .msg.own { align-items: flex-end; }
165
187
  .msg.repeat { margin-bottom: 8px; }
166
188
  .msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
167
- .msg-name { font-size: 13px; font-weight: 600; color: var(--ink); }
189
+ .msg-name { font-size: 14px; font-weight: 600; color: var(--ink); }
168
190
  .msg.own .msg-name { color: var(--accent); }
191
+ .question-mark { padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 10px; line-height: 1.5; }
169
192
  .msg.repeat .msg-name { display: none; }
170
- .msg-time { font-size: 11.5px; color: var(--ink-3); }
193
+ .msg-time { font-size: 12px; color: var(--ink-2); }
171
194
  .msg-text {
172
195
  display: inline-block;
196
+ width: max-content;
173
197
  max-width: min(86%, 540px);
174
198
  padding: 8px 12px;
175
199
  border-radius: 14px;
176
200
  background: var(--surface-2);
177
201
  border-bottom-left-radius: 4px;
178
- font-size: 15px;
179
- line-height: 1.65;
202
+ font-size: 16px;
203
+ line-height: 1.6;
180
204
  white-space: normal;
181
205
  overflow-wrap: anywhere;
182
206
  }
183
207
  .msg.own .msg-text { background: var(--accent-soft); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
184
- .msg-content { position: relative; display: flex; align-items: flex-end; gap: 6px; width: fit-content; max-width: 100%; }
208
+ .msg.own .msg-text ::selection { color: var(--accent-ink); background: var(--accent); }
209
+ .msg-content { position: relative; display: flex; align-items: flex-end; gap: 6px; width: 100%; max-width: 100%; }
185
210
  .msg.own .msg-content { flex-direction: row-reverse; }
186
211
  .message-copy {
187
212
  align-self: flex-start;
@@ -198,15 +223,29 @@
198
223
  .msg.own .message-copy { align-self: flex-end; margin-right: 4px; }
199
224
  .message-copy:hover, .message-copy:focus-visible { color: var(--ink); background: var(--surface-2); }
200
225
  .message-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
201
- .message-readers { position: static; flex: 0 0 22px; margin: 0 0 4px; color: var(--ink-3); font-size: 11px; }
202
- .message-readers summary { display: grid; place-items: center; width: 22px; height: 22px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; list-style: none; }
203
- .message-readers summary::-webkit-details-marker { display: none; }
204
- .message-readers summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
205
- .receipt-reader-list { position: absolute; z-index: 5; left: 0; top: 100%; min-width: min(210px, calc(100vw - 32px)); max-width: calc(100vw - 24px); box-sizing: border-box; margin: 4px 0 0; padding: 5px 8px; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
206
- .msg.own .receipt-reader-list { right: 0; left: auto; }
226
+ .message-readers { flex: 0 0 22px; align-self: flex-end; margin: 0 0 4px; padding: 0; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-3); background: var(--surface); font: inherit; font-size: 10px; cursor: pointer; }
227
+ .message-readers[data-reader-state="empty"], .message-readers[data-reader-state="unknown"] { background: var(--surface-2); }
228
+ .message-readers:hover, .message-readers[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
229
+ .message-readers:focus-visible, .reader-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
230
+ .receipt-reader-list { margin: 0; padding: 0; list-style: none; }
207
231
  .receipt-reader-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
208
232
  .receipt-reader-list li + li { margin-top: 4px; }
209
233
  .receipt-reader-list li span:last-child { color: var(--ink-3); }
234
+ .reader-panel { position: fixed; z-index: 40; width: min(320px, calc(100vw - 24px)); min-width: 0; max-height: calc(100dvh - 24px); overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
235
+ .reader-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
236
+ .reader-panel-head h2 { margin: 0; font-family: var(--font-sans); font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
237
+ .reader-panel-head .hint { margin: 0 0 4px; }
238
+ .reader-close { flex: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); background: var(--surface); font: inherit; font-size: 21px; cursor: pointer; }
239
+ .reader-excerpt { max-height: 110px; overflow: auto; margin: 16px 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
240
+ .reader-panel .receipt-reader-list li { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
241
+ .chat-resource { display: grid; gap: 8px; min-width: 0; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
242
+ .resource-info, .resource-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
243
+ .resource-name { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
244
+ .resource-size, .resource-status { color: var(--ink-3); font-size: 12px; }
245
+ .resource-status { margin: 0; }
246
+ .resource-button { min-height: 34px; }
247
+ .chat-resource img, .chat-resource video { display: block; max-width: 100%; max-height: 420px; border-radius: 7px; }
248
+ .chat-resource audio { width: min(100%, 420px); }
210
249
 
211
250
  /* Markdown content */
212
251
  .msg-text p, .msg-text pre, .msg-text blockquote, .msg-text ul, .msg-text ol { margin: 0; }
@@ -366,19 +405,21 @@
366
405
  background: var(--surface);
367
406
  }
368
407
  .composer-row { display: flex; gap: 10px; align-items: flex-end; }
408
+ .composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(940px, 100%); min-width: 0; margin: -2px auto 0; }
409
+ .question-toggle { min-width: 0; margin: 0; color: var(--ink-2); font-size: 12px; }
410
+ .question-toggle input { accent-color: var(--accent); vertical-align: -1px; }
369
411
  .composer .input { flex: 1; }
370
412
  .composer .input:disabled { opacity: .5; }
371
413
  #msgInput {
372
- min-height: 46px;
373
- max-height: 132px;
414
+ min-height: 0;
374
415
  padding: 12px 13px;
375
416
  line-height: 1.5;
376
417
  resize: none;
377
- overflow-y: auto;
418
+ overflow-y: hidden;
378
419
  }
379
420
  #btnSend { padding: 12px 22px; }
380
421
  .send-error { margin: 0; font-size: 12.5px; color: var(--danger); }
381
- .draft-count { width: min(940px, 100%); margin: -3px auto 0; color: var(--ink-3); text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
422
+ .draft-count { flex: none; margin: 0; color: var(--ink-3); text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
382
423
  .failed-messages { max-height: 150px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--danger-soft); border-radius: 10px; background: var(--danger-soft); }
383
424
  .failed-messages h3 { margin: 0 0 5px; color: var(--danger); font-size: 12px; }
384
425
  .failed-message { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }