@alexsun-top/opencode-chat-room 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +8 -0
- package/README.zh-CN.md +8 -0
- package/docs/administrator-rooms.md +51 -0
- package/package.json +8 -1
- package/plugin.ts +10 -8
- package/server/admin-auth.ts +16 -0
- package/server/admin-plan-routes.ts +79 -0
- package/server/admin-routes.ts +154 -0
- package/server/admin-scheduler.ts +42 -0
- package/server/admin-state.ts +61 -0
- package/server/admin-task-routes.ts +182 -0
- package/server/assets/base.css +45 -43
- package/server/assets/chat/admin.js +196 -0
- package/server/assets/chat/attachments.js +240 -0
- package/server/assets/chat/events.js +27 -5
- package/server/assets/chat/index.js +4 -0
- package/server/assets/chat/markdown.js +1 -12
- package/server/assets/chat/members.js +1 -1
- package/server/assets/chat/messages.js +32 -6
- package/server/assets/chat/rooms.js +21 -4
- package/server/assets/chat/state.js +43 -11
- package/server/assets/conversation.css +82 -37
- package/server/assets/responsive.css +74 -25
- package/server/chat-server.ts +2 -4
- package/server/chat.html +63 -29
- package/server/newrooms.ts +27 -10
- package/server/resource-routes.ts +3 -0
- package/server/wake.ts +6 -13
- package/skills/chatroom/SKILL.md +12 -0
- package/src/admin-client.ts +130 -0
- package/src/admin-credentials.ts +58 -0
- package/src/center-client.ts +1 -1
- package/src/center-inbox.ts +2 -0
- package/src/sqlite-state.ts +46 -18
- package/src/supervision-inbox.ts +62 -0
- package/src/v1-plugin.ts +13 -3
- package/src/v2-plugin.ts +13 -2
|
@@ -132,6 +132,7 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
132
132
|
get name() { return ensureIdentity().name; },
|
|
133
133
|
set name(value) { ensureIdentity(); browserIdentity.name = String(value ?? "").slice(0, 64); writeSession("chat.name", browserIdentity.name || null); saveIdentity(); },
|
|
134
134
|
get token() { return read("chat.token") || ""; }, set token(value) { write("chat.token", value || null); },
|
|
135
|
+
get adminToken() { return readSession("chat.adminToken") || ""; }, set adminToken(value) { writeSession("chat.adminToken", value || null); },
|
|
135
136
|
get locale() { return read("chat.locale") || "en"; }, set locale(value) { write("chat.locale", value || null); },
|
|
136
137
|
get joinedRoomIds() {
|
|
137
138
|
try {
|
|
@@ -187,7 +188,13 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
187
188
|
const response = await apiResponse(url, options), blob = await response.blob();
|
|
188
189
|
assertIdentity(); return blob;
|
|
189
190
|
};
|
|
190
|
-
|
|
191
|
+
const adminApi = async (url, options = {}) => {
|
|
192
|
+
if (!url.startsWith("/admin/") || !auth.adminToken) throw new Error("Administration token is required");
|
|
193
|
+
const response = await apiResponse(url, { ...options, headers: { ...options.headers, "X-Chat-Admin-Token": auth.adminToken } });
|
|
194
|
+
const data = await response.json().catch(() => ({}));
|
|
195
|
+
assertIdentity(); return data;
|
|
196
|
+
};
|
|
197
|
+
return { LS: auth, saveToken, api, apiBlob, adminApi };
|
|
191
198
|
}
|
|
192
199
|
|
|
193
200
|
const messages = {
|
|
@@ -195,6 +202,7 @@ const messages = {
|
|
|
195
202
|
brand: "OC Chat", documentTitle: "OC Chat",
|
|
196
203
|
roomTitle: ({ name }) => `${name} · OC Chat`,
|
|
197
204
|
tagline: "A lightweight chat room. Enter a room ID to join, or create a new one.",
|
|
205
|
+
restoringSession: "Restoring your session…", retry: "Retry", roomOptions: "Options",
|
|
198
206
|
languageLabel: "Language", roomIdLabel: "Room ID", roomIdPlaceholder: "Paste or enter a room ID",
|
|
199
207
|
nameLabel: "Your name", namePlaceholder: "What should we call you?", joinRoom: "Join room",
|
|
200
208
|
or: "or", newRoomNameLabel: "New room name", newRoomNamePlaceholder: "e.g. Weekend movie night",
|
|
@@ -217,17 +225,22 @@ const messages = {
|
|
|
217
225
|
answerQuestion: "Reply", answerPlaceholder: "Write a reply…", sendAnswer: "Send reply",
|
|
218
226
|
answerFailed: "Reply failed. Your draft is still here.", questionAlreadyAnswered: "This question was answered elsewhere.",
|
|
219
227
|
sendAsQuestion: "Send as a question",
|
|
220
|
-
settings: "Settings", tokenRequired: "The server requires an access token (401).",
|
|
228
|
+
settings: "Settings", adminAccess: "Administration", adminToken: "Administration token", openAdministration: "Open administration", administration: "Administration", designations: "Designations", adminRoom: "Admin room", targetRoom: "Agent room", targetAgent: "Registered agent", designate: "Designate and issue enrollment", revokeDesignation: "Revoke designation", globalStatus: "Global status", adminTasks: "Tasks", taskText: "Task", dispatchTask: "Dispatch task", timers: "Timers", planName: "Timer name", createTimer: "Create timer", tokenRequired: "The server requires an access token (401).",
|
|
229
|
+
adminLoading: "Loading administration…", refreshAdmin: "Refresh", adminRoomBadge: "admin", chooseAdminRoom: "Choose a normal room", chooseTargetRoom: "Choose an agent room", chooseAgent: "Choose a registered agent", taskTargetRoom: "Target room", taskTargetAgent: "Target agent", createAdminRoomFirst: "Create a normal room first, then select it as the admin room.", noAgents: "No registered agents", selectAdminAgent: "Choose an admin room and registered agent.", privateEnrollment: ({ expires }) => `Copy this instruction and paste it privately into the selected agent session. Expires ${expires}. Never post it in a room.`, copyEnrollment: "Copy private instruction", enrollmentCopied: "Private instruction copied.", revokeConfirm: "Revoke this admin designation? The normal room will remain.", updateTask: "Update task", task_pending: "Pending", task_working: "Working", task_blocked: "Blocked", task_completed: "Completed", task_cancelled: "Cancelled", nextRun: ({ time, minutes }) => `Every ${minutes} min · next ${time}`, paused: "Paused", pauseTimer: "Pause", resumeTimer: "Resume", deleteTimer: "Delete", deleteTimerConfirm: ({ name }) => `Delete timer “${name}”?`,
|
|
221
230
|
leave: "Leave", reconnecting: "Connection lost. Retrying…", messageList: "Message list",
|
|
222
231
|
noMessages: "No messages yet. Say something.", latestMessages: "Back to latest messages",
|
|
223
|
-
mentionMembers: "Choose a member to mention", messagePlaceholder: "Message · Enter
|
|
232
|
+
mentionMembers: "Choose a member to mention", messagePlaceholder: "Message · Enter to send",
|
|
233
|
+
attachments: "Attachments", addFiles: "Add files", dropFilesHere: "Drop files here to attach",
|
|
234
|
+
attachmentVolatile: "File attachments are held in this tab and are cleared if you reload.", retryUpload: "Retry", removeFile: "Remove",
|
|
235
|
+
uploadQueued: "Waiting to upload", uploadReady: "Ready to send", uploadPercent: ({ percent }) => `Uploading ${percent}%`,
|
|
236
|
+
uploadFailed: "Upload failed. Retry or remove the file.",
|
|
237
|
+
fileTooLarge: "File exceeds the server's current size limit.",
|
|
224
238
|
send: "Send", roomMeta: ({ members, count }) => `${members} ${members === 1 ? "member" : "members"} · ${count} ${count === 1 ? "message" : "messages"}`,
|
|
225
239
|
joinArrow: "Join →", joinDirectTitle: "Click to join directly", mentionEmpty: "No matching members",
|
|
226
240
|
joined: "Joined", joinAction: "Join room", unreadMessages: ({ count }) => `${count} unread`,
|
|
227
241
|
mentionHint: "↑↓ Select · Enter to confirm · Esc to close", today: "Today", yesterday: "Yesterday",
|
|
228
242
|
earlierMessages: "Earlier messages omitted", messagesBetweenOmitted: "Messages between this reading point and latest are omitted.", you: "You", saved: "Saved",
|
|
229
243
|
savedMemory: "Saved for this tab only", copyFailed: ({ id }) => `Copy failed. Copy manually: ${id}`,
|
|
230
|
-
copyCode: "Copy code", copiedCode: "Copied", copyCodeFailed: "Could not copy code. Select and copy it manually.",
|
|
231
244
|
copyMessage: "Copy", copiedMessage: "Copied", copyMessageFailed: "Could not copy. Select and copy the message manually.",
|
|
232
245
|
identityChanged: "This browser identity changed in another tab. Reload this tab before continuing.",
|
|
233
246
|
networkError: "Network connection failed", requestFailed: ({ status }) => `Request failed (HTTP ${status})`,
|
|
@@ -238,6 +251,7 @@ const messages = {
|
|
|
238
251
|
roomNotFound: "This room is gone, or you no longer have access.",
|
|
239
252
|
sendAuth: "Send failed: an access token is required", sendNetwork: "Send failed. Your message is saved below.",
|
|
240
253
|
sendFailed: ({ message }) => `Send failed: ${message}`,
|
|
254
|
+
adminRoomDeleteDenied: "This room is designated for administration. Enter the Administration token in Settings to delete it.",
|
|
241
255
|
failedMessages: "Messages not sent", retryFailed: "Retry", discardFailed: "Discard",
|
|
242
256
|
roomListError: "Unable to load rooms. You can enter a room ID directly.", guest: "Guest",
|
|
243
257
|
roomsLabel: "Rooms", refreshRooms: "Refresh rooms", identityLabel: ({ name }) => `Chatting as ${name}`,
|
|
@@ -251,11 +265,12 @@ const messages = {
|
|
|
251
265
|
activity_working: "Working", activity_idle: "Foreground idle", activity_waiting: "Waiting", activity_unknown: "Status unknown", activity_offline: "Status stale",
|
|
252
266
|
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.",
|
|
253
267
|
receiptCount: ({ count }) => `Read by ${count}`, receiptNone: "No readers yet", receiptNotLoaded: "Read status not loaded", readerPanelTitle: "Message readers", close: "Close", departedMember: "left",
|
|
254
|
-
receiptEvidence_displayed: "Shown on screen", receiptEvidence_tool: "Fetched with room tool", receiptEvidence_context: "
|
|
268
|
+
receiptEvidence_displayed: "Shown on screen", receiptEvidence_tool: "Fetched with room tool", receiptEvidence_context: "In agent context",
|
|
255
269
|
},
|
|
256
270
|
"zh-CN": {
|
|
257
271
|
brand: "OC Chat", documentTitle: "OC Chat", roomTitle: ({ name }) => `${name} · OC Chat`,
|
|
258
272
|
tagline: "一个轻量的聊天房间。输入房间 ID 加入,或直接新建一个。", languageLabel: "语言",
|
|
273
|
+
restoringSession: "正在恢复会话…", retry: "重试", roomOptions: "选项",
|
|
259
274
|
roomIdLabel: "房间 ID", roomIdPlaceholder: "粘贴或输入房间 ID", nameLabel: "你的昵称",
|
|
260
275
|
namePlaceholder: "怎么称呼你", joinRoom: "加入房间", or: "或", newRoomNameLabel: "新房间名称",
|
|
261
276
|
newRoomNamePlaceholder: "例如:周末电影夜", createRoom: "创建新房间", tokenOptional: "访问令牌(可选)",
|
|
@@ -277,15 +292,21 @@ const messages = {
|
|
|
277
292
|
answerQuestion: "回复", answerPlaceholder: "写下回复…", sendAnswer: "发送回复",
|
|
278
293
|
answerFailed: "回复失败,草稿仍已保留。", questionAlreadyAnswered: "此问题已由其他人回答。",
|
|
279
294
|
sendAsQuestion: "作为问题发送",
|
|
295
|
+
adminAccess: "管理", adminToken: "管理令牌", openAdministration: "打开管理面板", administration: "管理面板", designations: "管理绑定", adminRoom: "管理房间", targetRoom: "Agent 房间", targetAgent: "已注册 Agent", designate: "绑定并生成加入指令", revokeDesignation: "撤销绑定", globalStatus: "全局状态", adminTasks: "任务", taskText: "任务内容", dispatchTask: "派发任务", timers: "定时任务", planName: "定时任务名称", createTimer: "创建定时任务",
|
|
296
|
+
adminLoading: "正在加载管理面板…", refreshAdmin: "刷新", adminRoomBadge: "管理", chooseAdminRoom: "选择普通房间", chooseTargetRoom: "选择 Agent 房间", chooseAgent: "选择已注册 Agent", taskTargetRoom: "任务目标房间", taskTargetAgent: "任务目标 Agent", createAdminRoomFirst: "请先按普通流程创建房间,再选作管理房间。", noAgents: "没有已注册的 Agent", selectAdminAgent: "请选择管理房间和已注册的 Agent。", privateEnrollment: ({ expires }) => `复制此指令并私下粘贴到指定的 Agent 会话中。有效期至 ${expires}。请勿发送到房间。`, copyEnrollment: "复制私密指令", enrollmentCopied: "私密指令已复制。", revokeConfirm: "撤销此管理绑定?普通房间会保留。", updateTask: "更新任务", task_pending: "待处理", task_working: "进行中", task_blocked: "受阻", task_completed: "已完成", task_cancelled: "已取消", nextRun: ({ time, minutes }) => `每 ${minutes} 分钟 · 下次 ${time}`, paused: "已暂停", pauseTimer: "暂停", resumeTimer: "恢复", deleteTimer: "删除", deleteTimerConfirm: ({ name }) => `删除定时任务“${name}”?`,
|
|
280
297
|
tokenRequired: "服务器要求访问令牌(401)。", leave: "离开", reconnecting: "连接中断,正在重试…",
|
|
281
298
|
messageList: "消息列表", noMessages: "还没有消息,说点什么吧。", latestMessages: "回到最新消息",
|
|
282
|
-
mentionMembers: "选择要提及的成员", messagePlaceholder: "输入消息,Enter
|
|
299
|
+
mentionMembers: "选择要提及的成员", messagePlaceholder: "输入消息,Enter 发送",
|
|
300
|
+
attachments: "附件", addFiles: "添加文件", dropFilesHere: "将文件拖到这里添加",
|
|
301
|
+
attachmentVolatile: "附件仅保存在当前标签页,刷新页面后会清除。", retryUpload: "重试", removeFile: "移除",
|
|
302
|
+
uploadQueued: "等待上传", uploadReady: "可以发送", uploadPercent: ({ percent }) => `正在上传 ${percent}%`,
|
|
303
|
+
uploadFailed: "上传失败,请重试或移除文件。",
|
|
304
|
+
fileTooLarge: "文件超过服务器当前大小限制。",
|
|
283
305
|
send: "发送", roomMeta: ({ members, count }) => `${members} 人 · ${count} 条消息`, joinArrow: "加入 →",
|
|
284
306
|
joinDirectTitle: "点击直接加入", mentionEmpty: "没有匹配的成员", mentionHint: "↑↓ 选择 · Enter 确认 · Esc 关闭",
|
|
285
307
|
joined: "已加入", joinAction: "加入房间", unreadMessages: ({ count }) => `${count} 条未读`,
|
|
286
308
|
today: "今天", yesterday: "昨天", earlierMessages: "更早的消息已省略", messagesBetweenOmitted: "此阅读位置与最新消息之间的部分消息已省略。", you: "我", saved: "已保存",
|
|
287
309
|
savedMemory: "仅保存于当前标签页", copyFailed: ({ id }) => `复制失败,请手动复制:${id}`,
|
|
288
|
-
copyCode: "复制代码", copiedCode: "已复制", copyCodeFailed: "复制失败,请手动选择并复制代码。",
|
|
289
310
|
copyMessage: "复制", copiedMessage: "已复制", copyMessageFailed: "复制失败,请手动选择并复制消息。",
|
|
290
311
|
identityChanged: "此浏览器身份已在另一个标签页中更改,请重新加载此标签页后继续。",
|
|
291
312
|
networkError: "网络连接失败", requestFailed: ({ status }) => `请求失败(HTTP ${status})`,
|
|
@@ -294,6 +315,7 @@ const messages = {
|
|
|
294
315
|
roomNameRequired: "请输入房间名称", createFailed: ({ message }) => `创建失败:${message}`,
|
|
295
316
|
roomNotFound: "房间不存在,或你已被移出房间", sendAuth: "发送失败:需要访问令牌",
|
|
296
317
|
sendNetwork: "发送失败,消息已保存在下方", sendFailed: ({ message }) => `发送失败:${message}`,
|
|
318
|
+
adminRoomDeleteDenied: "此房间用于管理。请先在设置中输入管理令牌,再删除房间。",
|
|
297
319
|
failedMessages: "未发送的消息", retryFailed: "重试", discardFailed: "删除",
|
|
298
320
|
roomListError: "无法加载房间列表,可直接输入房间 ID 加入。", guest: "访客", roomsLabel: "房间列表",
|
|
299
321
|
refreshRooms: "刷新房间", identityLabel: ({ name }) => `当前昵称:${name}`, roomsMenu: "打开房间列表", closeRoomList: "关闭房间列表", direct: "私聊",
|
|
@@ -305,7 +327,7 @@ const messages = {
|
|
|
305
327
|
activity_working: "工作中", activity_idle: "前台空闲", activity_waiting: "等待中", activity_unknown: "状态未知", activity_offline: "状态已过期",
|
|
306
328
|
activityHint_working: "Agent 正在报告工作状态。", activityHint_idle: "前台空闲;后台任务仍可能继续。", activityHint_waiting: "Agent 正在报告等待状态。", activityHint_unknown: "暂无活动状态报告。", activityHint_offline: "最近的状态已过期;这不能证明 Agent 已离线。",
|
|
307
329
|
receiptCount: ({ count }) => `已读 ${count} 人`, receiptNone: "尚无人已读", receiptNotLoaded: "尚未加载已读状态", readerPanelTitle: "消息已读情况", close: "关闭", departedMember: "已离开",
|
|
308
|
-
receiptEvidence_displayed: "已显示在屏幕上", receiptEvidence_tool: "通过房间工具读取", receiptEvidence_context: "
|
|
330
|
+
receiptEvidence_displayed: "已显示在屏幕上", receiptEvidence_tool: "通过房间工具读取", receiptEvidence_context: "进入上下文",
|
|
309
331
|
},
|
|
310
332
|
};
|
|
311
333
|
|
|
@@ -314,10 +336,11 @@ app.t = (key, values = {}) => {
|
|
|
314
336
|
const text = typeof entry === "function" ? entry(values) : entry;
|
|
315
337
|
return String(text).replace(/\{(\w+)\}/g, (_, name) => values[name] ?? "");
|
|
316
338
|
};
|
|
317
|
-
export const { LS, saveToken, api, apiBlob } = createAuth(undefined, undefined, (key, values) => app.t(key, values));
|
|
339
|
+
export const { LS, saveToken, api, apiBlob, adminApi } = createAuth(undefined, undefined, (key, values) => app.t(key, values));
|
|
318
340
|
app.LS = LS;
|
|
319
341
|
app.api = api;
|
|
320
342
|
app.apiBlob = apiBlob;
|
|
343
|
+
app.adminApi = adminApi;
|
|
321
344
|
app.setToken = saveToken;
|
|
322
345
|
app.locale = LS.locale === "zh-CN" ? "zh-CN" : "en";
|
|
323
346
|
app.state.joinedIds = new Set(LS.joinedRoomIds);
|
|
@@ -407,12 +430,21 @@ app.dayText = (timestamp) => {
|
|
|
407
430
|
return new Intl.DateTimeFormat(app.intlLocale(), { month: "short", day: "numeric" }).format(date);
|
|
408
431
|
};
|
|
409
432
|
app.flash = (button, key) => {
|
|
433
|
+
const output = button.querySelector("[data-flash-output]");
|
|
410
434
|
button._flashKey = key;
|
|
411
|
-
|
|
435
|
+
if (output) {
|
|
436
|
+
output._flashKey = key; output.hidden = false; output.textContent = app.t(key);
|
|
437
|
+
button.classList.add("is-flashing");
|
|
438
|
+
if (button.dataset.i18nAriaLabel) button.setAttribute("aria-label", app.t(key));
|
|
439
|
+
} else button.textContent = app.t(key);
|
|
412
440
|
setTimeout(() => {
|
|
413
441
|
if (button._flashKey !== key) return;
|
|
414
442
|
delete button._flashKey;
|
|
415
|
-
|
|
443
|
+
if (output) {
|
|
444
|
+
delete output._flashKey; output.hidden = true; output.textContent = app.t(output.dataset.i18n, output._i18nValues || {});
|
|
445
|
+
button.classList.remove("is-flashing");
|
|
446
|
+
if (button.dataset.i18nAriaLabel) button.setAttribute("aria-label", app.t(button.dataset.i18nAriaLabel));
|
|
447
|
+
} else button.textContent = app.t(button.dataset.i18n, button._i18nValues || {});
|
|
416
448
|
}, 1200);
|
|
417
449
|
};
|
|
418
450
|
app.updateTitle = () => {
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
align-items: center;
|
|
5
5
|
justify-content: space-between;
|
|
6
|
-
gap:
|
|
7
|
-
padding:
|
|
6
|
+
gap: 10px 18px;
|
|
7
|
+
padding: 16px 24px;
|
|
8
8
|
border-bottom: 1px solid var(--line);
|
|
9
|
-
background: var(--surface);
|
|
9
|
+
background: linear-gradient(115deg, color-mix(in srgb, var(--accent-soft) 38%, var(--surface)), var(--surface) 62%);
|
|
10
10
|
}
|
|
11
|
-
.chat-head-main h1 { margin: 0; font-family: var(--font-
|
|
11
|
+
.chat-head-main h1 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
|
|
12
12
|
.room-title-row { display: flex; align-items: center; min-width: 0; gap: 8px; }
|
|
13
13
|
.room-title-row h1 { flex: 1; min-width: 0; }
|
|
14
14
|
.rooms-drawer-trigger { display: none; }
|
|
15
15
|
.room-drawer-backdrop { position: fixed; inset: 0; z-index: 49; border: 0; background: rgb(9 16 22 / .38); }
|
|
16
|
-
.room-meta { margin:
|
|
16
|
+
.room-meta { margin: 4px 0 0; font-size: 11px; color: var(--ink-3); }
|
|
17
17
|
.mono { font-family: var(--font-mono); }
|
|
18
18
|
.copy-id {
|
|
19
19
|
appearance: none;
|
|
20
20
|
font: inherit;
|
|
21
|
-
font-size:
|
|
21
|
+
font-size: 11px;
|
|
22
22
|
color: var(--ink-3);
|
|
23
23
|
background: none;
|
|
24
24
|
border: none;
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
.copy-id.copied .copy-ok { display: inline; color: var(--accent); }
|
|
34
34
|
|
|
35
35
|
.chat-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
|
|
36
|
+
.chat-head .action-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
|
|
36
37
|
.question-panel { width: min(390px, calc(100vw - 32px)); max-height: min(70vh, 620px); overflow: auto; }
|
|
37
38
|
.questions-trigger { position: relative; }
|
|
38
39
|
.question-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
cursor: pointer;
|
|
62
63
|
transition: color .12s, border-color .12s, background .12s;
|
|
63
64
|
}
|
|
64
|
-
.chip:hover { color: var(--
|
|
65
|
+
.chip:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
|
|
66
|
+
.chip[aria-expanded="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 44%, var(--line)); background: var(--accent-soft); }
|
|
65
67
|
.profile-trigger { display: grid; place-items: center; width: 36px; height: 36px; padding: 3px; border-radius: 50%; }
|
|
66
68
|
.profile-trigger .rail-avatar { width: 25px; height: 25px; font-size: 12px; font-weight: 700; }
|
|
67
69
|
.chip.danger { color: var(--danger); }
|
|
@@ -74,11 +76,12 @@
|
|
|
74
76
|
right: 0;
|
|
75
77
|
z-index: 20;
|
|
76
78
|
width: min(320px, calc(100vw - 32px));
|
|
77
|
-
padding:
|
|
79
|
+
padding: 17px;
|
|
78
80
|
background: var(--surface);
|
|
79
|
-
border: 1px solid var(--line);
|
|
80
|
-
border-radius:
|
|
81
|
+
border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
|
|
82
|
+
border-radius: 16px;
|
|
81
83
|
box-shadow: var(--shadow);
|
|
84
|
+
backdrop-filter: blur(12px);
|
|
82
85
|
animation: rise .18s ease both;
|
|
83
86
|
}
|
|
84
87
|
.panel h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
|
|
@@ -150,17 +153,18 @@
|
|
|
150
153
|
right: 20px;
|
|
151
154
|
bottom: 16px;
|
|
152
155
|
z-index: 5;
|
|
153
|
-
display:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
display: grid;
|
|
157
|
+
place-items: center;
|
|
158
|
+
width: 44px;
|
|
159
|
+
height: 44px;
|
|
160
|
+
padding: 0;
|
|
157
161
|
font: inherit;
|
|
158
162
|
font-size: 13px;
|
|
159
163
|
font-weight: 600;
|
|
160
164
|
color: var(--accent-ink);
|
|
161
165
|
background: var(--accent);
|
|
162
166
|
border: none;
|
|
163
|
-
border-radius:
|
|
167
|
+
border-radius: 50%;
|
|
164
168
|
cursor: pointer;
|
|
165
169
|
box-shadow: var(--shadow);
|
|
166
170
|
transition: filter .12s, transform .1s;
|
|
@@ -168,6 +172,9 @@
|
|
|
168
172
|
.jump:hover { filter: brightness(1.07); }
|
|
169
173
|
.jump:active { transform: translateY(1px); }
|
|
170
174
|
.jump .badge {
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: -6px;
|
|
177
|
+
right: -6px;
|
|
171
178
|
display: inline-flex;
|
|
172
179
|
align-items: center;
|
|
173
180
|
justify-content: center;
|
|
@@ -181,12 +188,12 @@
|
|
|
181
188
|
border-radius: 999px;
|
|
182
189
|
}
|
|
183
190
|
|
|
184
|
-
.msg { display: flex; flex-direction: column; margin-bottom:
|
|
191
|
+
.msg { display: flex; flex-direction: column; margin-bottom: 16px; }
|
|
185
192
|
.msg.in, .sys.in, .day-sep.in { animation: msg-in .25s ease both; }
|
|
186
193
|
.msg.own { align-items: flex-end; }
|
|
187
194
|
.msg.repeat { margin-bottom: 8px; }
|
|
188
195
|
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
|
|
189
|
-
.msg-name { font-size:
|
|
196
|
+
.msg-name { font-size: 13px; font-weight: 650; color: var(--ink-2); }
|
|
190
197
|
.msg.own .msg-name { color: var(--accent); }
|
|
191
198
|
.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; }
|
|
192
199
|
.msg.repeat .msg-name { display: none; }
|
|
@@ -195,8 +202,10 @@
|
|
|
195
202
|
display: inline-block;
|
|
196
203
|
width: max-content;
|
|
197
204
|
max-width: min(86%, 540px);
|
|
198
|
-
padding:
|
|
199
|
-
border
|
|
205
|
+
padding: 9px 13px;
|
|
206
|
+
border: 1px solid color-mix(in srgb, var(--ink) 5%, transparent);
|
|
207
|
+
border-radius: 16px;
|
|
208
|
+
box-shadow: 0 1px 2px rgb(20 40 32 / .035);
|
|
200
209
|
background: var(--surface-2);
|
|
201
210
|
border-bottom-left-radius: 4px;
|
|
202
211
|
font-size: 16px;
|
|
@@ -204,26 +213,36 @@
|
|
|
204
213
|
white-space: normal;
|
|
205
214
|
overflow-wrap: anywhere;
|
|
206
215
|
}
|
|
207
|
-
.msg
|
|
208
|
-
.msg.own .msg-text
|
|
216
|
+
.msg-text::selection, .msg-text *::selection { color: var(--accent-ink); background: var(--accent); }
|
|
217
|
+
.msg.own .msg-text { background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 86%, var(--surface)), var(--accent-soft)); border-color: color-mix(in srgb, var(--accent) 12%, transparent); border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
|
|
209
218
|
.msg-content { position: relative; display: flex; align-items: flex-end; gap: 6px; width: 100%; max-width: 100%; }
|
|
210
219
|
.msg.own .msg-content { flex-direction: row-reverse; }
|
|
211
220
|
.message-copy {
|
|
221
|
+
position: relative;
|
|
212
222
|
align-self: flex-start;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
223
|
+
display: grid;
|
|
224
|
+
place-items: center;
|
|
225
|
+
flex: none;
|
|
226
|
+
width: 32px;
|
|
227
|
+
height: 32px;
|
|
228
|
+
margin: 3px 0 0 4px;
|
|
229
|
+
padding: 0;
|
|
230
|
+
border: 1px solid transparent;
|
|
231
|
+
border-radius: 9px;
|
|
217
232
|
color: var(--ink-3);
|
|
218
233
|
background: transparent;
|
|
219
234
|
font: inherit;
|
|
220
|
-
font-size: 11px;
|
|
221
235
|
cursor: pointer;
|
|
236
|
+
transition: color .14s, background .14s, border-color .14s;
|
|
222
237
|
}
|
|
223
238
|
.msg.own .message-copy { align-self: flex-end; margin-right: 4px; }
|
|
224
|
-
.message-copy:
|
|
239
|
+
.message-copy-icon { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
|
|
240
|
+
.message-copy:hover, .message-copy:focus-visible, .message-copy.is-flashing { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); }
|
|
225
241
|
.message-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
226
|
-
.message-
|
|
242
|
+
.message-copy-feedback { position: absolute; z-index: 25; left: 0; bottom: calc(100% + 5px); width: max-content; max-width: min(260px, calc(100vw - 32px)); padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 11px; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal; overflow-wrap: anywhere; }
|
|
243
|
+
.msg.own .message-copy-feedback { left: auto; right: 0; }
|
|
244
|
+
.sys .message-copy-feedback { left: 50%; right: auto; transform: translateX(-50%); }
|
|
245
|
+
.message-readers { flex: 0 0 24px; align-self: flex-end; margin: 0 0 4px; padding: 0; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-3); background: var(--surface); font: inherit; font-size: 10px; cursor: pointer; box-shadow: 0 1px 3px rgb(20 40 32 / .06); }
|
|
227
246
|
.message-readers[data-reader-state="empty"], .message-readers[data-reader-state="unknown"] { background: var(--surface-2); }
|
|
228
247
|
.message-readers:hover, .message-readers[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
|
|
229
248
|
.message-readers:focus-visible, .reader-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
@@ -238,7 +257,7 @@
|
|
|
238
257
|
.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
258
|
.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
259
|
.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:
|
|
260
|
+
.chat-resource { display: grid; gap: 9px; min-width: 0; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 76%, var(--surface)); }
|
|
242
261
|
.resource-info, .resource-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
|
|
243
262
|
.resource-name { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
|
|
244
263
|
.resource-size, .resource-status { color: var(--ink-3); font-size: 12px; }
|
|
@@ -383,29 +402,29 @@
|
|
|
383
402
|
|
|
384
403
|
.gap { padding: 6px 0 2px; text-align: center; font-size: 12px; color: var(--ink-3); }
|
|
385
404
|
|
|
386
|
-
.chat-empty { padding:
|
|
405
|
+
.chat-empty { padding: 64px 0 44px; text-align: center; font-family: var(--font-display); font-size: 16px; color: var(--ink-3); }
|
|
387
406
|
.chat-empty::before {
|
|
388
407
|
content: "";
|
|
389
408
|
display: block;
|
|
390
409
|
width: 56px;
|
|
391
410
|
height: 56px;
|
|
392
411
|
margin: 0 auto 14px;
|
|
393
|
-
border:
|
|
412
|
+
border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
|
|
394
413
|
border-radius: 50%;
|
|
395
|
-
background: radial-gradient(circle at 50% 50%, var(--
|
|
414
|
+
background: radial-gradient(circle at 50% 50%, var(--accent) 0 3px, transparent 4px), var(--accent-soft);
|
|
396
415
|
}
|
|
397
416
|
|
|
398
417
|
.composer {
|
|
399
418
|
position: relative;
|
|
400
419
|
display: flex;
|
|
401
420
|
flex-direction: column;
|
|
402
|
-
gap:
|
|
403
|
-
padding:
|
|
421
|
+
gap: 9px;
|
|
422
|
+
padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
|
|
404
423
|
border-top: 1px solid var(--line);
|
|
405
|
-
background: var(--surface);
|
|
424
|
+
background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent-soft) 18%, var(--surface)));
|
|
406
425
|
}
|
|
407
|
-
.composer-row { display: flex; gap:
|
|
408
|
-
.composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(940px, 100%); min-width: 0; margin: -
|
|
426
|
+
.composer-row { display: flex; gap: 9px; align-items: flex-end; }
|
|
427
|
+
.composer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(940px, 100%); min-width: 0; margin: -1px auto 0; }
|
|
409
428
|
.question-toggle { min-width: 0; margin: 0; color: var(--ink-2); font-size: 12px; }
|
|
410
429
|
.question-toggle input { accent-color: var(--accent); vertical-align: -1px; }
|
|
411
430
|
.composer .input { flex: 1; }
|
|
@@ -414,6 +433,8 @@
|
|
|
414
433
|
min-height: 0;
|
|
415
434
|
padding: 12px 13px;
|
|
416
435
|
line-height: 1.5;
|
|
436
|
+
border-radius: 15px;
|
|
437
|
+
background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
|
|
417
438
|
resize: none;
|
|
418
439
|
overflow-y: hidden;
|
|
419
440
|
}
|
|
@@ -426,3 +447,27 @@
|
|
|
426
447
|
.failed-message p { flex: 1; min-width: 0; max-height: 48px; overflow: auto; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
|
|
427
448
|
.failed-message button { flex: none; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
|
|
428
449
|
.failed-message button:disabled { opacity: .5; cursor: default; }
|
|
450
|
+
.attachment-button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); background: var(--surface); font: inherit; font-size: 24px; cursor: pointer; }
|
|
451
|
+
.attachment-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
|
|
452
|
+
.attachment-button:hover { color: var(--accent); border-color: var(--accent); }
|
|
453
|
+
.attachment-button:disabled { opacity: .5; cursor: default; }
|
|
454
|
+
.attachment-tray { width: min(940px, 100%); margin: 0 auto; }
|
|
455
|
+
.attachment-volatile { margin: 0 0 3px; color: var(--ink-3); font-size: 10.5px; }
|
|
456
|
+
.attachment-status { display: inline-flex; width: fit-content; margin: 5px 0 0; padding: 3px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 10.5px; }
|
|
457
|
+
.attachment-status.danger-text { color: var(--danger); background: var(--danger-soft); }
|
|
458
|
+
.attachment-status:empty { display: none; }
|
|
459
|
+
.attachment-list { display: grid; gap: 6px; max-height: 132px; overflow: auto; margin: 0; padding: 0; list-style: none; }
|
|
460
|
+
.attachment-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 1px 2px rgb(20 40 32 / .035); }
|
|
461
|
+
.attachment-preview { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--ink) 5%, transparent); border-radius: 8px; background: var(--surface-2); color: var(--ink-3); font-size: 11px; font-weight: 700; }
|
|
462
|
+
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
|
|
463
|
+
.attachment-file { min-width: 0; }
|
|
464
|
+
.attachment-name { overflow: hidden; margin: 0; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
|
|
465
|
+
.attachment-detail { margin: 0; color: var(--ink-3); font-size: 10px; }
|
|
466
|
+
.attachment-item progress { display: block; width: 100%; height: 5px; accent-color: var(--accent); }
|
|
467
|
+
.attachment-actions { display: flex; gap: 4px; }
|
|
468
|
+
.attachment-actions button { min-width: 44px; min-height: 44px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2); background: var(--surface); font: inherit; font-size: 11px; cursor: pointer; }
|
|
469
|
+
.attachment-actions button:hover { border-color: var(--accent); color: var(--accent); }
|
|
470
|
+
.attachment-over-limit { color: var(--danger); }
|
|
471
|
+
#draftCount.over-limit { color: var(--danger); font-weight: 700; }
|
|
472
|
+
.attachment-drop-overlay { position: fixed; inset: 12px; z-index: 100; place-items: center; border: 2px dashed var(--accent); border-radius: 18px; color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 88%, transparent); font-size: clamp(18px, 4vw, 28px); font-weight: 700; pointer-events: none; }
|
|
473
|
+
#chatView.drag-over .attachment-drop-overlay { display: grid; }
|
|
@@ -31,34 +31,78 @@
|
|
|
31
31
|
min-height: 0;
|
|
32
32
|
padding: 22px 14px 14px;
|
|
33
33
|
color: var(--ink);
|
|
34
|
-
background:
|
|
34
|
+
background: radial-gradient(320px 260px at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%), linear-gradient(160deg, var(--surface), color-mix(in srgb, var(--accent-soft) 25%, var(--surface)));
|
|
35
35
|
border-right: 1px solid var(--line);
|
|
36
36
|
}
|
|
37
|
-
.rail-brand { display: flex; align-items: center; gap:
|
|
38
|
-
.brand-mark { display: grid; place-items: center; width:
|
|
39
|
-
.rail-label { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 10px; color: var(--ink-3); font-size:
|
|
37
|
+
.rail-brand { display: flex; align-items: center; gap: 11px; margin: 0 0 30px 5px; font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.025em; }
|
|
38
|
+
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--accent-ink) 24%, transparent); border-radius: 12px 12px 12px 5px; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 82%, #18382f), var(--accent)); color: var(--accent-ink); font: 700 11px var(--font-sans); box-shadow: 0 3px 8px color-mix(in srgb, var(--accent) 18%, transparent); }
|
|
39
|
+
.rail-label { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 10px; color: var(--ink-3); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
|
|
40
40
|
.rail-tools { display: flex; align-items: center; gap: 7px; }
|
|
41
|
-
.icon-btn { border:
|
|
42
|
-
.icon-btn:hover { color: var(--accent); }
|
|
41
|
+
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-2); font: inherit; font-size: 20px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
|
|
42
|
+
.icon-btn:hover { color: var(--accent); border-color: var(--line); background: var(--surface); }
|
|
43
|
+
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
|
|
43
44
|
.rail-composer { position: absolute; top: 76px; left: 12px; right: 12px; z-index: 25; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
|
|
44
45
|
.rail-composer .field { margin-bottom: 8px; }
|
|
45
46
|
.rail-composer .btn { width: 100%; }
|
|
46
47
|
.mobile-locale { display: none; }
|
|
47
48
|
.rail-rooms { flex: 1; min-height: 0; overflow: auto; list-style: none; margin: 0; padding: 0; }
|
|
48
|
-
#roomListChat .room-row { padding:
|
|
49
|
-
#roomListChat .room-row.selected { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent)
|
|
49
|
+
#roomListChat .room-row { padding: 11px 12px; border-color: transparent; border-radius: 12px; }
|
|
50
|
+
#roomListChat .room-row.selected { background: linear-gradient(110deg, color-mix(in srgb, var(--accent-soft) 92%, var(--surface)), var(--accent-soft)); border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); box-shadow: inset 3px 0 var(--accent); }
|
|
50
51
|
.r-kind { color: var(--accent); font-size: 11px; font-weight: 700; }
|
|
51
52
|
.r-status { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
|
|
52
53
|
.r-preview { overflow: hidden; color: var(--ink-3); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
|
|
53
54
|
.r-badge { position: absolute; top: 8px; right: 9px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; }
|
|
54
|
-
.rail-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding:
|
|
55
|
+
.rail-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 4px 0; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); font-size: 12px; color: var(--ink-3); }
|
|
56
|
+
.rail-foot .anchor { width: 100%; }
|
|
57
|
+
.user-menu-trigger { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 7px; border: 1px solid transparent; border-radius: 12px; color: var(--ink); background: transparent; font: inherit; text-align: left; cursor: pointer; transition: border-color .16s, background .16s, box-shadow .16s; }
|
|
58
|
+
.user-menu-trigger:hover, .user-menu-trigger[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); background: color-mix(in srgb, var(--surface) 84%, var(--accent-soft)); box-shadow: 0 2px 8px rgb(25 50 42 / .06); }
|
|
59
|
+
.user-menu-trigger:focus-visible, .menu-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
60
|
+
.user-menu-trigger #railIdentity { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
|
|
61
|
+
.user-menu-trigger .rail-avatar { flex: none; width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--accent) 15%, var(--line)); font-size: 13px; font-weight: 700; }
|
|
62
|
+
.user-menu-caret { font-size: 14px; }
|
|
63
|
+
.user-menu-panel { top: auto; right: auto; bottom: calc(100% + 8px); left: 0; max-height: min(65dvh, 560px); overflow: auto; }
|
|
64
|
+
.room-options-panel { display: grid; gap: 4px; width: 190px; }
|
|
65
|
+
.menu-action { width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; font: inherit; text-align: left; cursor: pointer; }
|
|
66
|
+
.menu-action:hover { background: var(--surface-2); }
|
|
67
|
+
.restore-view { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; color: var(--ink-2); text-align: center; }
|
|
68
|
+
.session-restore #joinView { display: none; }
|
|
69
|
+
.session-restore .restore-view { display: flex; }
|
|
70
|
+
.restore-message { display: flex; align-items: center; justify-content: center; gap: 12px; }
|
|
71
|
+
#restoreError { max-width: min(440px, 100%); margin: 0; }
|
|
72
|
+
.restore-spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
|
|
73
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
74
|
+
.admin-access { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
|
|
75
|
+
.admin-access summary { margin: 0 0 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
|
|
76
|
+
.admin-dialog { width: min(1020px, calc(100vw - 32px)); max-width: none; max-height: 90dvh; overflow: auto; padding: 24px; color: var(--ink); background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent-soft) 16%, var(--surface))); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 20px; box-shadow: 0 24px 80px rgb(10 25 20 / .2); }
|
|
77
|
+
.admin-dialog::backdrop { background: rgb(9 22 18 / .52); backdrop-filter: blur(4px); }
|
|
78
|
+
.admin-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
79
|
+
.admin-dialog-head h2 { margin: 0; font-family: var(--font-display); font-size: 25px; font-weight: 600; letter-spacing: -.02em; }
|
|
80
|
+
.admin-dialog h3 { margin: 20px 0 9px; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
|
|
81
|
+
.admin-columns { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr); gap: 26px; }
|
|
82
|
+
.admin-columns > section { min-width: 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--surface) 84%, var(--accent-soft)); }
|
|
83
|
+
.admin-columns > section > h3:first-child { margin-top: 0; }
|
|
84
|
+
.admin-columns .field { margin-bottom: 10px; }
|
|
85
|
+
.admin-dialog .admin-select { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font: inherit; }
|
|
86
|
+
.admin-overview, .admin-list { margin: 0; padding: 0; list-style: none; }
|
|
87
|
+
.admin-overview p, .admin-list li { margin: 6px 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
|
|
88
|
+
.admin-list li { display: grid; gap: 7px; }
|
|
89
|
+
.admin-plan-form { display: grid; gap: 8px; }
|
|
90
|
+
.admin-enrollment { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--accent-soft); overflow-wrap: anywhere; }
|
|
91
|
+
.admin-enrollment code { user-select: all; }
|
|
92
|
+
@media (max-width: 620px) { .admin-dialog { padding: 15px; } .admin-columns { grid-template-columns: minmax(0, 1fr); gap: 0; } }
|
|
55
93
|
.rail-avatar { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); }
|
|
56
94
|
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #609773; box-shadow: 0 0 0 3px color-mix(in srgb, #609773 16%, transparent); }
|
|
57
|
-
#chatView > .chat-head { grid-column: 2; grid-row: 1; min-width: 0;
|
|
95
|
+
#chatView > .chat-head { grid-column: 2; grid-row: 1; min-width: 0; }
|
|
96
|
+
@media (min-width: 901px) {
|
|
97
|
+
#chatView > .chat-head .action-icon { display: none; }
|
|
98
|
+
}
|
|
99
|
+
@media (max-width: 900px) {
|
|
100
|
+
#chatView > .chat-head .action-icon { display: block; }
|
|
101
|
+
#chatView > .chat-head .action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
|
|
102
|
+
}
|
|
58
103
|
#chatView > .conn-bar { grid-column: 2; grid-row: 2; }
|
|
59
104
|
#chatView > .msg-scroll { grid-column: 2; grid-row: 3; min-height: 0; }
|
|
60
105
|
#chatView > .composer { grid-column: 2; grid-row: 4; }
|
|
61
|
-
.chat-head-main h1 { font-size: 21px; }
|
|
62
106
|
.thread { padding: 28px 24px 12px; }
|
|
63
107
|
.msg-text { max-width: min(82%, 680px); padding: 10px 14px; }
|
|
64
108
|
.composer { padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); }
|
|
@@ -67,9 +111,6 @@
|
|
|
67
111
|
.member-action { border: 0; background: transparent; padding: 2px 4px; color: var(--accent); font: inherit; font-size: 11px; cursor: pointer; white-space: nowrap; }
|
|
68
112
|
.member-action:hover { text-decoration: underline; }
|
|
69
113
|
#memberList li { align-items: center; }
|
|
70
|
-
.msg-text pre { position: relative; padding-top: 32px; }
|
|
71
|
-
.code-copy { position: absolute; top: 5px; right: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 11px; cursor: pointer; }
|
|
72
|
-
.code-copy:hover { color: var(--accent); border-color: var(--accent); }
|
|
73
114
|
.msg-text table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
|
|
74
115
|
.msg-text th, .msg-text td { padding: 5px 9px; border: 1px solid var(--line); text-align: left; }
|
|
75
116
|
.msg-text td { overflow-wrap: normal; }
|
|
@@ -81,6 +122,16 @@
|
|
|
81
122
|
.mermaid-diagram svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
|
|
82
123
|
.diagram-status { margin: 0 0 6px; color: var(--ink-3); font-size: 12px; }
|
|
83
124
|
|
|
125
|
+
@media (min-width: 761px) and (max-width: 900px) {
|
|
126
|
+
#chatView > .chat-head { flex-wrap: nowrap; gap: 8px; }
|
|
127
|
+
.chat-head-main { flex: 1; min-width: 0; }
|
|
128
|
+
.chat-head-main h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
|
|
129
|
+
.chat-head-actions { flex: none; flex-wrap: nowrap; gap: 4px; }
|
|
130
|
+
.chat-head-actions > .locale-control { display: none; }
|
|
131
|
+
#chatView > .chat-head .chip:not(.rooms-drawer-trigger) { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; font-size: 0; }
|
|
132
|
+
#btnQuestions .question-badge { position: absolute; top: -5px; right: -5px; margin: 0; font-size: 10px; }
|
|
133
|
+
}
|
|
134
|
+
|
|
84
135
|
@media (max-width: 760px) {
|
|
85
136
|
#chatView { width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; }
|
|
86
137
|
.room-rail { display: none; position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 88vw); height: 100dvh; min-height: 0; padding: 20px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow); }
|
|
@@ -104,16 +155,11 @@
|
|
|
104
155
|
.chat-head-main { flex: 1; min-width: 0; }
|
|
105
156
|
.room-title-row { gap: 6px; }
|
|
106
157
|
.chat-head-main h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
|
|
107
|
-
.chat-head .chip { display: grid; place-items: center; width:
|
|
158
|
+
.chat-head .chip { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; font-size: 0; }
|
|
159
|
+
#chatView > .chat-head .action-icon { display: block; }
|
|
108
160
|
.rooms-drawer-trigger { display: grid; flex: none; }
|
|
109
|
-
#btnRoomsDrawer::before { content: "☰"; font-size: 16px; }
|
|
110
|
-
#btnQuestions::before { content: "?"; font-size: 17px; }
|
|
111
|
-
#btnAnnouncements::before { content: "▤"; font-size: 16px; }
|
|
112
161
|
#btnQuestions .question-badge { position: absolute; top: -5px; right: -5px; margin: 0; font-size: 10px; }
|
|
113
|
-
|
|
114
|
-
#btnDeleteRoom::before { content: "×"; font-size: 20px; }
|
|
115
|
-
#btnLeave::before { content: "↪"; font-size: 17px; }
|
|
116
|
-
.mobile-locale { display: block; }
|
|
162
|
+
.room-options-panel { right: 0; left: auto; }
|
|
117
163
|
.thread { padding: 14px 12px 6px; }
|
|
118
164
|
.msg-text { max-width: 92%; font-size: 15px; }
|
|
119
165
|
.composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
|
|
@@ -126,10 +172,13 @@
|
|
|
126
172
|
@media (max-width: 420px) {
|
|
127
173
|
#chatView > .chat-head { align-items: center; }
|
|
128
174
|
.chat-head-actions { justify-content: flex-start; gap: 2px; }
|
|
129
|
-
.chat-head-actions .chip { width: 30px; height: 30px; padding: 0; font-size: 0; }
|
|
130
175
|
.chat-head-actions .panel { max-height: min(70dvh, 520px); overflow: auto; }
|
|
131
176
|
.room-meta { max-width: 100px; overflow: hidden; }
|
|
132
177
|
}
|
|
178
|
+
@media (max-width: 300px) {
|
|
179
|
+
.chat-head .chip { width: 36px; height: 36px; }
|
|
180
|
+
#btnRoomsDrawer { width: 36px; height: 36px; }
|
|
181
|
+
}
|
|
133
182
|
@media (max-width: 260px) {
|
|
134
183
|
#msgInput:placeholder-shown { min-height: calc(7.25em + 20px); }
|
|
135
184
|
.composer-meta { min-height: 3.6em; }
|
|
@@ -137,7 +186,7 @@
|
|
|
137
186
|
@media (max-width: 220px) {
|
|
138
187
|
#chatView > .chat-head { padding: 8px; gap: 3px; }
|
|
139
188
|
.chat-head-actions { gap: 1px; }
|
|
140
|
-
.chat-head
|
|
141
|
-
|
|
189
|
+
.chat-head .chip { width: 28px; height: 28px; }
|
|
190
|
+
#btnRoomsDrawer { width: 28px; height: 28px; }
|
|
142
191
|
.room-title-row { gap: 3px; }
|
|
143
192
|
}
|
package/server/chat-server.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { roomManagement } from "./newrooms";
|
|
|
21
21
|
import { memberRoutes } from "./member-routes";
|
|
22
22
|
import { resourceRoutes } from "./resource-routes";
|
|
23
23
|
import { maxResourceBytes } from "../src/resources";
|
|
24
|
+
import { adminRoutes } from "./admin-routes";
|
|
24
25
|
|
|
25
26
|
function parsePort(value: string): number {
|
|
26
27
|
const port = Number(value);
|
|
@@ -80,8 +81,6 @@ async function handle(req: Request): Promise<Response> {
|
|
|
80
81
|
return Response.redirect(new URL("/chat", url).toString(), 302);
|
|
81
82
|
}
|
|
82
83
|
if (req.method === "GET" && p === "/chat") {
|
|
83
|
-
// ponytail: the human-facing chat page; APIs stay token-gated, the page
|
|
84
|
-
// itself is a static shell
|
|
85
84
|
const html = await fs
|
|
86
85
|
.readFile(path.join(import.meta.dir, "chat.html"), "utf8")
|
|
87
86
|
.catch(() => null);
|
|
@@ -91,8 +90,6 @@ async function handle(req: Request): Promise<Response> {
|
|
|
91
90
|
return new Response(html, {
|
|
92
91
|
headers: {
|
|
93
92
|
"Content-Type": "text/html; charset=utf-8",
|
|
94
|
-
// ponytail: never cache the page — the UI is iterated often and the
|
|
95
|
-
// server reads it fresh from disk on every request
|
|
96
93
|
"Cache-Control": "no-store",
|
|
97
94
|
},
|
|
98
95
|
});
|
|
@@ -122,6 +119,7 @@ async function handle(req: Request): Promise<Response> {
|
|
|
122
119
|
return json({ error: "unauthorized" }, 401);
|
|
123
120
|
}
|
|
124
121
|
try {
|
|
122
|
+
const admin = await adminRoutes(req, url); if (admin) return admin;
|
|
125
123
|
const resource = await resourceRoutes(req, url);
|
|
126
124
|
if (resource) return resource;
|
|
127
125
|
const history = await historyRoute(url);
|