@alexsun-top/opencode-chat-room 0.7.0 → 0.7.2
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 +24 -0
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/package.json +1 -1
- package/server/assets/base.css +4 -1
- package/server/assets/chat/create-room-dialog.js +49 -0
- package/server/assets/chat/editor.js +28 -9
- package/server/assets/chat/events.js +41 -23
- package/server/assets/chat/history-loader.js +1 -0
- package/server/assets/chat/image-zoom.js +49 -16
- package/server/assets/chat/index.js +2 -0
- package/server/assets/chat/locales/de.js +6 -2
- package/server/assets/chat/locales/es.js +6 -2
- package/server/assets/chat/locales/fr.js +6 -2
- package/server/assets/chat/locales/it.js +6 -2
- package/server/assets/chat/locales/ja.js +6 -2
- package/server/assets/chat/locales/ko.js +6 -2
- package/server/assets/chat/markdown.js +7 -1
- package/server/assets/chat/members.js +2 -0
- package/server/assets/chat/messages.js +1 -0
- package/server/assets/chat/questions.js +1 -0
- package/server/assets/chat/room-list.js +9 -1
- package/server/assets/chat/rooms.js +23 -9
- package/server/assets/chat/settings.js +40 -1
- package/server/assets/chat/shortcuts.js +137 -14
- package/server/assets/chat/state.js +14 -6
- package/server/assets/chat/viewport.js +3 -0
- package/server/assets/conversation.css +22 -19
- package/server/assets/responsive.css +52 -0
- package/server/assets/room-create.css +86 -0
- package/server/assets/settings.css +93 -35
- package/server/chat-server.ts +3 -3
- package/server/chat.html +138 -72
- package/server/sw.js +1 -0
- package/skills/chatroom/SKILL.md +2 -1
|
@@ -140,6 +140,8 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
140
140
|
get token() { return read("chat.token") || ""; }, set token(value) { write("chat.token", value || null); },
|
|
141
141
|
get locale() { return read("chat.locale") || "en"; }, set locale(value) { write("chat.locale", value || null); },
|
|
142
142
|
get theme() { return read("chat.theme") || "system"; }, set theme(value) { write("chat.theme", value || null); },
|
|
143
|
+
get contentTransition() { return read("chat.contentTransition") === "1"; }, set contentTransition(value) { write("chat.contentTransition", value ? "1" : null); },
|
|
144
|
+
get pageStep() { const raw = read("chat.pageStep"); const value = Number(raw); return raw !== null && raw !== "" && Number.isFinite(value) ? Math.min(200, Math.max(20, Math.round(value))) : 90; }, set pageStep(value) { const next = Number(value); write("chat.pageStep", Number.isFinite(next) ? String(Math.min(200, Math.max(20, Math.round(next)))) : null); },
|
|
143
145
|
|
|
144
146
|
get joinedRoomIds() {
|
|
145
147
|
try {
|
|
@@ -214,7 +216,7 @@ export const messages = {
|
|
|
214
216
|
requireApproval: "Require approval to join", requireApprovalHint: "New members need a human administrator's approval. Agents may also be approved by the administrator agent.",
|
|
215
217
|
joinPolicyEditHint: "New members need a human administrator's approval. Turning this off clears all pending requests.", joinPolicyOpenConfirm: "Turn off approval? All pending join requests will be cleared.",
|
|
216
218
|
approvalRequired: "Approval required", joinRequired: "Approval required", joinPendingStatus: "Approval pending",
|
|
217
|
-
joinPendingTitle: "Waiting for approval", joinPendingBody: ({ name }) => `Your request to join “${name}” was sent. A human administrator must approve it before you can join.`,
|
|
219
|
+
joinPendingTitle: "Waiting for approval", joinApprovalPrompt: ({ name }) => `Request to join “${name}”? A human administrator must approve it.`, joinPendingBody: ({ name }) => `Your request to join “${name}” was sent. A human administrator must approve it before you can join.`,
|
|
218
220
|
joinPendingHint: "You can leave this page; the request stays pending. Check the room list later.", joinPendingNotice: ({ name }) => `Request sent to join “${name}”. Waiting for a human administrator.`, joinPendingCancel: "Cancel request", joinPendingCancelError: "Could not cancel the request. Try again.",
|
|
219
221
|
joinPendingGoneTitle: "Request not pending", joinPendingGoneBody: "It may have been denied or cleared. You can send a new request.", joinPendingAgain: "Request again",
|
|
220
222
|
joinPendingError: "Could not check the request. Try again.", joinPendingRoomGone: "This room is gone, or you no longer have access.",
|
|
@@ -258,7 +260,11 @@ export const messages = {
|
|
|
258
260
|
adminBindingGuide: "Choose a room and an Agent in it. Send the invitation privately to finish setup.", adminRoomLabel: "Administrator room", adminDesignateAgent: "Invite Agent",
|
|
259
261
|
settings: "Settings", adminAccess: "Administration", adminToken: "Administration token", openAdministration: "Open administration", administration: "Administration", designations: "Designations", adminRoom: "Administrator room", targetRoom: "Agent membership room", adminScopeNote: "Choose an Agent in the administrator room. Administrators can manage all rooms.", targetAgent: "Registered agent", designate: "Designate administrator", 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).",
|
|
260
262
|
themeLabel: "Theme", themeSystem: "System", themeLight: "Light", themeDark: "Dark", themeForest: "Forest", themeSand: "Sand",
|
|
261
|
-
settingsLocalHint: "Language and
|
|
263
|
+
settingsLocalHint: "Language, theme, transition, and scrolling preferences are saved in this browser.",
|
|
264
|
+
settingsSections: "Settings sections", settingsGeneral: "General", settingsAppearance: "Appearance", settingsConnection: "Connection",
|
|
265
|
+
settingsLanguageHint: "Applies right away and is saved in this browser.", settingsThemeHint: "Saved in this browser. System follows your device.", settingsTokenHint: "Stored only in this browser. Needed only when the server asks for it.",
|
|
266
|
+
contentTransition: "Room content transition", contentTransitionHint: "Slide messages in when switching rooms with Alt+Arrow. Off by default.",
|
|
267
|
+
pageStep: "Page scroll distance", pageStepHint: "How far PageUp and PageDown move per press, as a percentage of the conversation height. Default 90%.",
|
|
262
268
|
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.", adminDesignated: "Administrator designation is active immediately and stays until you revoke it.", 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}”?`,
|
|
263
269
|
leave: "Leave", reconnecting: "Connection lost. Retrying…", messageList: "Message list",
|
|
264
270
|
noMessages: "No messages yet. Say something.", latestMessages: "Back to latest messages",
|
|
@@ -278,7 +284,7 @@ export const messages = {
|
|
|
278
284
|
shortcutsOpen: "All shortcuts",
|
|
279
285
|
shortcutsWriting: "Writing", shortcutsSend: "Send the message", shortcutsNewline: "Start a new line",
|
|
280
286
|
shortcutsMention: "Choose a member to mention", shortcutsRooms: "Rooms",
|
|
281
|
-
shortcutsSwitchRoom: "Switch to the previous or next room", shortcutsReading: "Reading",
|
|
287
|
+
shortcutsSwitchRoom: "Switch to the previous or next room", shortcutsNumberRoom: "Switch to a joined room by number", shortcutsReading: "Reading",
|
|
282
288
|
shortcutsScroll: "Scroll messages while typing", shortcutsJump: "Jump to the start or end of the conversation", shortcutsMenus: "Menus and dialogs",
|
|
283
289
|
shortcutsClose: "Close the open menu, panel, or dialog",
|
|
284
290
|
earlierMessages: "Earlier messages omitted", messagesBetweenOmitted: "Messages between this reading point and latest are omitted.", you: "You", saved: "Saved",
|
|
@@ -328,7 +334,7 @@ export const messages = {
|
|
|
328
334
|
requireApproval: "加入需要审核", requireApprovalHint: "新成员需经人类管理员审核;Agent 也可以由管理员 Agent 审核。",
|
|
329
335
|
joinPolicyEditHint: "新成员需经人类管理员审核。关闭后,所有待审核申请都会被清除。", joinPolicyOpenConfirm: "关闭加入审核?所有待审核的加入申请都会被清除。",
|
|
330
336
|
approvalRequired: "需审核加入", joinRequired: "需审核加入", joinPendingStatus: "等待审核",
|
|
331
|
-
joinPendingTitle: "等待审核", joinPendingBody: ({ name }) => `加入“${name}”的申请已发送,需人类管理员审核通过后才能进入。`,
|
|
337
|
+
joinPendingTitle: "等待审核", joinApprovalPrompt: ({ name }) => `申请加入“${name}”?需要人类管理员审核通过。`, joinPendingBody: ({ name }) => `加入“${name}”的申请已发送,需人类管理员审核通过后才能进入。`,
|
|
332
338
|
joinPendingHint: "可以离开此页面,申请会保留;稍后可在房间列表查看。", joinPendingNotice: ({ name }) => `已发送加入“${name}”的申请,正在等待人类管理员审核。`, joinPendingCancel: "取消申请", joinPendingCancelError: "取消申请失败,请重试。",
|
|
333
339
|
joinPendingGoneTitle: "申请已不在等待", joinPendingGoneBody: "申请可能已被拒绝或清除,可以重新发送。", joinPendingAgain: "重新申请",
|
|
334
340
|
joinPendingError: "无法检查申请状态,请重试。", joinPendingRoomGone: "房间不存在,或你已无权访问。",
|
|
@@ -373,7 +379,9 @@ export const messages = {
|
|
|
373
379
|
adminLoading: "正在加载管理面板…", refreshAdmin: "刷新", adminRoomBadge: "管理", chooseAdminRoom: "选择普通房间", chooseTargetRoom: "选择 Agent 房间", chooseAgent: "选择已注册 Agent", taskTargetRoom: "任务目标房间", taskTargetAgent: "任务目标 Agent", createAdminRoomFirst: "请先按普通流程创建房间,再选作管理房间。", noAgents: "没有已注册的 Agent", selectAdminAgent: "请选择管理房间和已注册的 Agent。", adminDesignated: "管理员已立即生效,长期有效,直到撤销。", revokeConfirm: "撤销此管理绑定?普通房间会保留。", updateTask: "更新任务", task_pending: "待处理", task_working: "进行中", task_blocked: "受阻", task_completed: "已完成", task_cancelled: "已取消", nextRun: ({ time, minutes }) => `每 ${minutes} 分钟 · 下次 ${time}`, paused: "已暂停", pauseTimer: "暂停", resumeTimer: "恢复", deleteTimer: "删除", deleteTimerConfirm: ({ name }) => `删除定时任务“${name}”?`,
|
|
374
380
|
tokenRequired: "服务器要求访问令牌(401)。",
|
|
375
381
|
themeLabel: "主题", themeSystem: "跟随系统", themeLight: "浅色", themeDark: "深色", themeForest: "森林", themeSand: "沙丘",
|
|
376
|
-
settingsLocalHint: "
|
|
382
|
+
settingsLocalHint: "语言、主题、过渡和滚动选项保存在当前浏览器中。", settingsSections: "设置分区", settingsGeneral: "通用", settingsAppearance: "外观", settingsConnection: "连接",
|
|
383
|
+
settingsLanguageHint: "立即生效,并保存在当前浏览器中。", settingsThemeHint: "保存在当前浏览器中。跟随系统会使用设备的外观设置。", settingsTokenHint: "仅保存在当前浏览器中,仅在服务器要求时填写。",
|
|
384
|
+
contentTransition: "内容区域过渡", contentTransitionHint: "使用 Alt+方向键切换房间时,让消息内容按方向滑动。默认关闭。", pageStep: "翻页距离", pageStepHint: "每次按 PageUp 或 PageDown 滚动会话高度的百分比。默认 90%。", leave: "离开", reconnecting: "连接中断,正在重试…",
|
|
377
385
|
messageList: "消息列表", noMessages: "还没有消息,说点什么吧。", latestMessages: "回到最新消息",
|
|
378
386
|
mentionMembers: "选择要提及的成员", messagePlaceholder: "输入消息,Enter 发送",
|
|
379
387
|
attachments: "附件", addFiles: "添加文件", dropFilesHere: "将文件拖到这里添加",
|
|
@@ -389,7 +397,7 @@ export const messages = {
|
|
|
389
397
|
shortcutsOpen: "全部快捷键",
|
|
390
398
|
shortcutsWriting: "输入", shortcutsSend: "发送消息", shortcutsNewline: "换行",
|
|
391
399
|
shortcutsMention: "选择要提及的成员", shortcutsRooms: "房间",
|
|
392
|
-
shortcutsSwitchRoom: "切换到上一个或下一个房间", shortcutsReading: "阅读",
|
|
400
|
+
shortcutsSwitchRoom: "切换到上一个或下一个房间", shortcutsNumberRoom: "按编号切换到已加入的房间", shortcutsReading: "阅读",
|
|
393
401
|
shortcutsScroll: "输入时滚动消息", shortcutsJump: "跳到会话开头或结尾", shortcutsMenus: "菜单和对话框",
|
|
394
402
|
shortcutsClose: "关闭当前菜单、面板或对话框",
|
|
395
403
|
joined: "已加入", joinAction: "加入房间", unreadMessages: ({ count }) => `${count} 条未读`,
|
|
@@ -18,6 +18,9 @@ export function initViewport() {
|
|
|
18
18
|
viewport.addEventListener("resize", sync);
|
|
19
19
|
viewport.addEventListener("scroll", sync);
|
|
20
20
|
window.addEventListener("resize", sync);
|
|
21
|
+
window.addEventListener("pageshow", sync);
|
|
22
|
+
window.addEventListener("orientationchange", sync);
|
|
23
|
+
document.addEventListener("visibilitychange", () => { if (!document.hidden) sync(); });
|
|
21
24
|
sync();
|
|
22
25
|
if (matchMedia("(pointer: coarse)").matches) document.querySelector("#msgInput")?.setAttribute("enterkeyhint", "enter");
|
|
23
26
|
}
|
|
@@ -153,16 +153,20 @@
|
|
|
153
153
|
}
|
|
154
154
|
#msgList { width: min(100%, 940px); list-style: none; margin: 0 auto; padding: 0; }
|
|
155
155
|
|
|
156
|
-
.thread, #roomList, #memberList {
|
|
156
|
+
.thread, #roomList, #roomListChat, #memberList {
|
|
157
157
|
scrollbar-width: thin;
|
|
158
|
-
scrollbar-color: color-mix(in srgb, var(--ink-3)
|
|
158
|
+
scrollbar-color: color-mix(in srgb, var(--ink-3) 26%, transparent) transparent;
|
|
159
159
|
}
|
|
160
|
-
.thread::-webkit-scrollbar, #roomList::-webkit-scrollbar, #memberList::-webkit-scrollbar { width:
|
|
161
|
-
.thread::-webkit-scrollbar-thumb, #roomList::-webkit-scrollbar-thumb, #memberList::-webkit-scrollbar-thumb {
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
.thread::-webkit-scrollbar, #roomList::-webkit-scrollbar, #roomListChat::-webkit-scrollbar, #memberList::-webkit-scrollbar { width: 6px; }
|
|
161
|
+
.thread::-webkit-scrollbar-thumb, #roomList::-webkit-scrollbar-thumb, #roomListChat::-webkit-scrollbar-thumb, #memberList::-webkit-scrollbar-thumb {
|
|
162
|
+
min-height: 32px;
|
|
163
|
+
background: color-mix(in srgb, var(--ink-3) 26%, transparent);
|
|
164
|
+
border-radius: 3px;
|
|
164
165
|
}
|
|
165
|
-
.thread::-webkit-scrollbar-
|
|
166
|
+
.thread::-webkit-scrollbar-thumb:hover, #roomList::-webkit-scrollbar-thumb:hover, #roomListChat::-webkit-scrollbar-thumb:hover, #memberList::-webkit-scrollbar-thumb:hover {
|
|
167
|
+
background: color-mix(in srgb, var(--ink-3) 45%, transparent);
|
|
168
|
+
}
|
|
169
|
+
.thread::-webkit-scrollbar-track, #roomList::-webkit-scrollbar-track, #roomListChat::-webkit-scrollbar-track, #memberList::-webkit-scrollbar-track { background: transparent; }
|
|
166
170
|
|
|
167
171
|
.jump {
|
|
168
172
|
position: absolute;
|
|
@@ -296,10 +300,10 @@
|
|
|
296
300
|
.close-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
|
|
297
301
|
.reader-panel .receipt-reader-list li { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
|
|
298
302
|
.image-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 20px; overflow: hidden; border: 0; background: transparent; }
|
|
299
|
-
.image-dialog[open] { display:
|
|
303
|
+
.image-dialog[open] { display: flex; align-items: center; justify-content: center; }
|
|
300
304
|
.image-dialog::backdrop { background: rgb(9 16 22 / .84); backdrop-filter: blur(3px); }
|
|
301
|
-
.image-dialog img { display: block;
|
|
302
|
-
@keyframes image-zoom-in { from { opacity: 0;
|
|
305
|
+
.image-dialog img { display: block; width: auto; height: auto; max-width: none; max-height: none; object-fit: contain; transform-origin: center; border-radius: 8px; animation: image-zoom-in .16s ease both; }
|
|
306
|
+
@keyframes image-zoom-in { from { opacity: 0; } }
|
|
303
307
|
.image-dialog-close { position: fixed; z-index: 2; top: 14px; right: 14px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgb(255 255 255 / .34); border-radius: 50%; color: #fff; background: rgb(9 16 22 / .58); font: inherit; line-height: 1; cursor: pointer; }
|
|
304
308
|
.image-dialog-close .close-icon { width: 22px; height: 22px; }
|
|
305
309
|
.image-dialog-close:hover, .image-dialog-close:focus-visible { background: rgb(9 16 22 / .82); outline: 2px solid #fff; outline-offset: 2px; }
|
|
@@ -506,12 +510,11 @@
|
|
|
506
510
|
.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; }
|
|
507
511
|
.failed-message button:disabled { opacity: .5; cursor: default; }
|
|
508
512
|
|
|
509
|
-
@keyframes room-
|
|
510
|
-
@keyframes room-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
#msgList.
|
|
517
|
-
#msgList.thread-jump-down { animation: thread-jump-down .18s ease-out; }
|
|
513
|
+
@keyframes room-content-out-next { to { opacity: 0; transform: translateY(-14px); } }
|
|
514
|
+
@keyframes room-content-out-prev { to { opacity: 0; transform: translateY(14px); } }
|
|
515
|
+
@keyframes room-content-in-next { from { opacity: 0; transform: translateY(14px); } }
|
|
516
|
+
@keyframes room-content-in-prev { from { opacity: 0; transform: translateY(-14px); } }
|
|
517
|
+
#msgList.room-content-out-next { animation: room-content-out-next .14s ease-in both; }
|
|
518
|
+
#msgList.room-content-out-prev { animation: room-content-out-prev .14s ease-in both; }
|
|
519
|
+
#msgList.room-content-in-next { animation: room-content-in-next .2s ease-out both; }
|
|
520
|
+
#msgList.room-content-in-prev { animation: room-content-in-prev .2s ease-out both; }
|
|
@@ -71,6 +71,58 @@
|
|
|
71
71
|
/* The rail footer keeps the empty composer's height so the divider lines meet when
|
|
72
72
|
idle. Files or wrapped lines grow only the composer, never this footer. */
|
|
73
73
|
.rail-foot { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 8px; margin-top: auto; min-height: var(--composer-block, 104px); padding: 12px 4px 14px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); font-size: 12px; color: var(--ink-3); }
|
|
74
|
+
/* On short windows the rail must fit its grid cell; the room list keeps one full row. */
|
|
75
|
+
@media (max-height: 560px) {
|
|
76
|
+
body:has(#joinNotice:not([hidden])) #roomRail .rail-foot { min-height: 78px; }
|
|
77
|
+
#roomRail .rail-brand { margin-bottom: 14px; }
|
|
78
|
+
#roomRail .rail-label { margin-bottom: 6px; }
|
|
79
|
+
#roomListChat .room-row { gap: 1px; padding: 5px 9px; }
|
|
80
|
+
#roomListChat .r-kind:empty, #roomListChat .r-meta, #roomListChat .r-preview { display: none; }
|
|
81
|
+
}
|
|
82
|
+
@media (max-height: 400px) {
|
|
83
|
+
#chatView { margin: 10px auto; height: calc(100% - 20px); }
|
|
84
|
+
#chatView > .chat-head { padding: 8px 16px; gap: 6px 12px; }
|
|
85
|
+
.chat-head .room-description, .chat-head .room-meta { display: none; }
|
|
86
|
+
.chat-head-main h1 { font-size: 18px; }
|
|
87
|
+
.composer { gap: 6px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
|
|
88
|
+
.join-notice { padding: 5px 8px; gap: 4px 8px; font-size: 11.5px; }
|
|
89
|
+
.join-notice .btn { min-height: 28px; padding: 3px 9px; font-size: 11px; }
|
|
90
|
+
#msgInput { padding: 7px 10px; }
|
|
91
|
+
#chatView #msgInput[data-empty="true"] { height: 38px !important; }
|
|
92
|
+
#chatView #msgInput[data-empty="true"]::before { inset: 8px 10px auto; }
|
|
93
|
+
.composer-meta .draft-count { display: none; }
|
|
94
|
+
#btnSend { padding: 8px 15px; }
|
|
95
|
+
#roomRail { padding-top: 12px; }
|
|
96
|
+
#roomRail .rail-brand { margin-bottom: 10px; }
|
|
97
|
+
#roomRail .rail-foot { padding: 5px 4px 6px; }
|
|
98
|
+
#roomListChat .room-row { min-width: 0; min-height: 0; }
|
|
99
|
+
#roomListChat .r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
100
|
+
#roomListChat .r-status { display: none; }
|
|
101
|
+
}
|
|
102
|
+
@media (max-height: 300px) {
|
|
103
|
+
#roomRail { padding-top: 8px; }
|
|
104
|
+
#roomRail .rail-brand { display: none; }
|
|
105
|
+
}
|
|
106
|
+
@media (max-height: 220px) {
|
|
107
|
+
#roomRail { padding-top: 8px; }
|
|
108
|
+
#roomRail .rail-brand { display: none; }
|
|
109
|
+
#chatView > .chat-head { padding: 4px 12px; }
|
|
110
|
+
.chat-head-main h1 { font-size: 16px; }
|
|
111
|
+
.composer { gap: 4px; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); }
|
|
112
|
+
#chatView #msgInput[data-empty="true"] { height: 32px !important; }
|
|
113
|
+
#chatView #msgInput[data-empty="true"]::before { inset: 4px 10px auto; }
|
|
114
|
+
#roomRail .rail-foot { padding: 0 4px; }
|
|
115
|
+
#btnSend { padding: 6px 12px; }
|
|
116
|
+
}
|
|
117
|
+
@media (max-height: 200px) {
|
|
118
|
+
#roomRail .rail-label { display: none; }
|
|
119
|
+
}
|
|
120
|
+
@media (max-height: 160px) {
|
|
121
|
+
#roomRail .rail-label { display: none; }
|
|
122
|
+
#roomListChat .room-row { padding-block: 3px; }
|
|
123
|
+
.join-notice { padding: 3px 6px; }
|
|
124
|
+
.join-notice .btn { min-height: 24px; padding: 2px 7px; }
|
|
125
|
+
}
|
|
74
126
|
.rail-foot .anchor { width: 100%; }
|
|
75
127
|
.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; }
|
|
76
128
|
.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); }
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* The rail "+" opens this modal instead of a small popover: one clear surface
|
|
2
|
+
with a backdrop, sized for desktop and near full width on phones. */
|
|
3
|
+
#createRoomDialog {
|
|
4
|
+
width: min(640px, calc(100vw - 40px));
|
|
5
|
+
max-width: none;
|
|
6
|
+
max-height: min(calc(100dvh - 40px), 760px);
|
|
7
|
+
padding: 30px 32px 26px;
|
|
8
|
+
overflow: auto;
|
|
9
|
+
color: var(--ink);
|
|
10
|
+
background:
|
|
11
|
+
radial-gradient(440px 260px at 100% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%),
|
|
12
|
+
linear-gradient(155deg, var(--surface), color-mix(in srgb, var(--accent-soft) 22%, var(--surface)));
|
|
13
|
+
border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
|
|
14
|
+
border-radius: 24px;
|
|
15
|
+
box-shadow: 0 32px 100px rgb(10 25 20 / .28);
|
|
16
|
+
}
|
|
17
|
+
#createRoomDialog::backdrop {
|
|
18
|
+
background:
|
|
19
|
+
radial-gradient(900px 560px at 50% 0%, rgb(38 80 68 / .28), transparent 72%),
|
|
20
|
+
rgb(9 22 18 / .56);
|
|
21
|
+
backdrop-filter: blur(5px);
|
|
22
|
+
}
|
|
23
|
+
#createRoomDialog[open] { animation: create-room-enter .24s cubic-bezier(.2, .7, .3, 1); }
|
|
24
|
+
#createRoomDialog[open]::backdrop { animation: create-room-backdrop .24s ease; }
|
|
25
|
+
@keyframes create-room-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } }
|
|
26
|
+
@keyframes create-room-backdrop { from { opacity: 0; } }
|
|
27
|
+
|
|
28
|
+
.create-room-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
|
|
29
|
+
.create-room-mark {
|
|
30
|
+
display: grid;
|
|
31
|
+
place-items: center;
|
|
32
|
+
width: 46px;
|
|
33
|
+
height: 46px;
|
|
34
|
+
border-radius: 14px 14px 14px 6px;
|
|
35
|
+
color: var(--accent-ink);
|
|
36
|
+
background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 80%, #18382f), var(--accent));
|
|
37
|
+
box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 24%, transparent);
|
|
38
|
+
}
|
|
39
|
+
.create-room-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.9; }
|
|
40
|
+
.create-room-eyebrow { margin: 3px 0 1px; color: var(--ink-3); font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
|
|
41
|
+
.create-room-heading h2 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.12; }
|
|
42
|
+
.create-room-head .reader-close { margin: -8px -10px 0 0; }
|
|
43
|
+
.create-room-hint { max-width: 46ch; margin: 14px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
|
|
44
|
+
|
|
45
|
+
.create-room-form { margin-top: 24px; }
|
|
46
|
+
.create-room-input { min-height: 50px; padding: 12px 14px; font-size: 17px; }
|
|
47
|
+
.create-room-policy {
|
|
48
|
+
margin-top: 16px;
|
|
49
|
+
padding: 14px 16px;
|
|
50
|
+
border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
|
|
51
|
+
border-radius: 16px;
|
|
52
|
+
background: color-mix(in srgb, var(--accent-soft) 46%, var(--surface));
|
|
53
|
+
}
|
|
54
|
+
.create-room-policy .join-policy { margin: 0; }
|
|
55
|
+
.create-room-policy .join-policy-label { font-size: 14px; }
|
|
56
|
+
.create-room-policy-hint { margin: 7px 0 0 43px; line-height: 1.45; }
|
|
57
|
+
.create-room-error { margin: 16px 0 0; }
|
|
58
|
+
.create-room-actions {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: flex-end;
|
|
61
|
+
gap: 10px;
|
|
62
|
+
margin-top: 22px;
|
|
63
|
+
padding-top: 18px;
|
|
64
|
+
border-top: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
|
|
65
|
+
}
|
|
66
|
+
.create-room-actions .btn { min-width: 126px; }
|
|
67
|
+
|
|
68
|
+
@media (max-width: 640px) {
|
|
69
|
+
#createRoomDialog {
|
|
70
|
+
width: calc(100vw - 20px);
|
|
71
|
+
max-height: calc(100dvh - 20px);
|
|
72
|
+
padding: 20px 18px 18px;
|
|
73
|
+
border-radius: 20px;
|
|
74
|
+
}
|
|
75
|
+
.create-room-head { gap: 12px; }
|
|
76
|
+
.create-room-mark { width: 40px; height: 40px; border-radius: 12px 12px 12px 5px; }
|
|
77
|
+
.create-room-mark svg { width: 19px; height: 19px; }
|
|
78
|
+
.create-room-heading h2 { font-size: 24px; }
|
|
79
|
+
.create-room-head .reader-close { margin: -4px -6px 0 0; }
|
|
80
|
+
.create-room-hint { margin-top: 12px; font-size: 13.5px; }
|
|
81
|
+
.create-room-form { margin-top: 18px; }
|
|
82
|
+
.create-room-policy { padding: 12px 13px; }
|
|
83
|
+
.create-room-policy-hint { margin-left: 0; }
|
|
84
|
+
.create-room-actions { flex-direction: column-reverse; margin-top: 18px; padding-top: 16px; }
|
|
85
|
+
.create-room-actions .btn { width: 100%; min-height: 46px; }
|
|
86
|
+
}
|
|
@@ -96,43 +96,101 @@
|
|
|
96
96
|
.join-settings:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
|
|
97
97
|
.join-settings:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
98
98
|
|
|
99
|
-
/* Settings: one dialog for language,
|
|
100
|
-
.settings-dialog { width: min(
|
|
101
|
-
.settings-dialog
|
|
102
|
-
.settings-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
/* Settings: one dialog for language, appearance, and the optional access token. */
|
|
100
|
+
.settings-dialog { width: min(1000px, calc(100vw - 32px)); max-width: none; height: min(720px, calc(100dvh - 40px)); max-height: none; margin: auto; padding: 0; overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line)); border-radius: 22px; box-shadow: 0 30px 90px rgb(8 22 18 / .32); }
|
|
101
|
+
.settings-dialog[open] { display: flex; flex-direction: column; animation: settings-in .18s ease-out both; }
|
|
102
|
+
.settings-dialog::backdrop { background: rgb(8 20 16 / .52); backdrop-filter: blur(5px); }
|
|
103
|
+
@keyframes settings-in { from { opacity: 0; transform: translateY(8px) scale(.995); } }
|
|
104
|
+
@media (prefers-reduced-motion: reduce) { .settings-dialog[open] { animation: none; } }
|
|
105
|
+
|
|
106
|
+
.settings-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; }
|
|
107
|
+
.settings-heading { min-width: 0; }
|
|
108
|
+
.settings-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
|
|
105
109
|
.settings-head h2:focus { outline: none; }
|
|
106
|
-
.settings-lead { margin:
|
|
107
|
-
.settings-
|
|
108
|
-
|
|
109
|
-
.settings-
|
|
110
|
-
.settings-
|
|
111
|
-
.settings-
|
|
112
|
-
.settings-
|
|
113
|
-
.settings-
|
|
114
|
-
.
|
|
115
|
-
.
|
|
110
|
+
.settings-lead { margin: 5px 0 0; max-width: 560px; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
|
|
111
|
+
.settings-close { width: 40px; height: 40px; border-radius: 10px; }
|
|
112
|
+
|
|
113
|
+
.settings-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
|
|
114
|
+
.settings-nav { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 2px 24px 22px; border-right: 1px solid color-mix(in srgb, var(--line) 74%, transparent); }
|
|
115
|
+
.settings-tab { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid transparent; border-radius: 11px; color: var(--ink-2); background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; transition: color .14s, background .14s, border-color .14s; }
|
|
116
|
+
.settings-tab svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
117
|
+
.settings-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
|
|
118
|
+
.settings-tab[aria-selected="true"] { color: var(--ink); background: var(--surface-2); border-color: color-mix(in srgb, var(--line) 72%, transparent); box-shadow: 0 1px 2px rgb(20 35 30 / .06); }
|
|
119
|
+
.settings-tab[aria-selected="true"] svg { color: var(--accent); }
|
|
120
|
+
.settings-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
121
|
+
.settings-content { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
|
|
122
|
+
.settings-panel { max-width: 780px; padding: 4px 30px 30px 26px; }
|
|
123
|
+
.settings-panel[hidden] { display: none; }
|
|
124
|
+
|
|
125
|
+
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 22px; padding: 18px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
|
|
126
|
+
.settings-row:first-child { padding-top: 10px; }
|
|
127
|
+
.settings-row:last-of-type { border-bottom: 0; }
|
|
128
|
+
.settings-copy { min-width: 0; display: grid; gap: 4px; }
|
|
129
|
+
.settings-label { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35; }
|
|
130
|
+
.settings-hint { margin: 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
|
|
131
|
+
.settings-warning { color: var(--warning); font-weight: 600; }
|
|
132
|
+
.settings-select { width: 168px; min-height: 38px; font-size: 13.5px; }
|
|
133
|
+
.settings-number { display: flex; align-items: center; gap: 8px; }
|
|
134
|
+
.settings-number .input { width: 82px; min-height: 38px; text-align: right; }
|
|
135
|
+
.settings-number-unit { color: var(--ink-3); font-size: 13px; }
|
|
136
|
+
|
|
137
|
+
.settings-switch { position: relative; flex: none; appearance: none; width: 42px; height: 24px; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); cursor: pointer; transition: background .16s, border-color .16s; }
|
|
138
|
+
.settings-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(34 53 47 / .18); transition: transform .16s, background .16s; }
|
|
139
|
+
.settings-switch:checked { border-color: var(--accent); background: var(--accent); }
|
|
140
|
+
.settings-switch:checked::after { transform: translateX(18px); background: var(--accent-ink); }
|
|
141
|
+
.settings-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
142
|
+
|
|
143
|
+
.settings-block { min-width: 0; margin: 0; padding: 14px 0 4px; border: 0; }
|
|
144
|
+
.settings-block legend.settings-label { display: block; margin: 0; padding: 0; }
|
|
145
|
+
.settings-block .settings-hint { margin-top: 4px; }
|
|
146
|
+
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; margin-top: 14px; }
|
|
147
|
+
.theme-option { position: relative; display: grid; gap: 8px; min-width: 0; padding: 8px 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
|
|
116
148
|
.theme-option:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); }
|
|
117
|
-
.theme-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft)
|
|
149
|
+
.theme-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
|
|
118
150
|
.theme-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
|
|
119
|
-
.theme-option
|
|
120
|
-
.theme-
|
|
121
|
-
.theme-
|
|
122
|
-
.theme-
|
|
123
|
-
.theme-
|
|
151
|
+
.theme-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
152
|
+
.theme-option:has(input:checked)::after { content: "✓"; position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--accent-ink); background: var(--accent); font-size: 11px; font-weight: 700; line-height: 1; }
|
|
153
|
+
.theme-preview { position: relative; display: block; height: 64px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 75%, transparent); border-radius: 9px; background: var(--swatch-bg, var(--surface-2)); }
|
|
154
|
+
.theme-preview::before { content: ""; position: absolute; top: 10px; left: 10px; right: 10px; height: 14px; border-radius: 5px; background: var(--swatch-surface, var(--surface)); }
|
|
155
|
+
.theme-preview::after { content: ""; position: absolute; left: 10px; bottom: 10px; width: 26px; height: 6px; border-radius: 99px; background: var(--swatch-accent, var(--accent)); }
|
|
156
|
+
.theme-name { min-width: 0; overflow: hidden; color: var(--ink-2); font-size: 11.5px; font-weight: 600; line-height: 1.3; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
|
|
124
157
|
.theme-option:has(input:checked) .theme-name { color: var(--ink); }
|
|
125
|
-
.theme-option[data-theme-choice="system"] .theme-
|
|
126
|
-
.theme-option[data-theme-choice="system"] .theme-
|
|
127
|
-
.theme-option[data-theme-choice="system"] .theme-
|
|
128
|
-
.theme-option[data-theme-choice="light"] .theme-
|
|
129
|
-
.theme-option[data-theme-choice="dark"] .theme-
|
|
130
|
-
.theme-option[data-theme-choice="forest"] .theme-
|
|
131
|
-
.theme-option[data-theme-choice="sand"] .theme-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
158
|
+
.theme-option[data-theme-choice="system"] .theme-preview { background: linear-gradient(118deg, #f3f1ea 0 50%, #111b19 50%); }
|
|
159
|
+
.theme-option[data-theme-choice="system"] .theme-preview::before { background: linear-gradient(90deg, #fffefa 0 50%, #182522 50%); }
|
|
160
|
+
.theme-option[data-theme-choice="system"] .theme-preview::after { background: linear-gradient(90deg, #22695c 0 50%, #8ac9aa 50%); }
|
|
161
|
+
.theme-option[data-theme-choice="light"] .theme-preview { --swatch-bg: #f3f1ea; --swatch-surface: #fffefa; --swatch-accent: #22695c; }
|
|
162
|
+
.theme-option[data-theme-choice="dark"] .theme-preview { --swatch-bg: #111b19; --swatch-surface: #182522; --swatch-accent: #8ac9aa; }
|
|
163
|
+
.theme-option[data-theme-choice="forest"] .theme-preview { --swatch-bg: #e7ede2; --swatch-surface: #f7faf4; --swatch-accent: #2f6b45; }
|
|
164
|
+
.theme-option[data-theme-choice="sand"] .theme-preview { --swatch-bg: #f4e9d6; --swatch-surface: #fff9ef; --swatch-accent: #9a5a32; }
|
|
165
|
+
|
|
166
|
+
.settings-token-control { display: flex; align-items: center; gap: 8px; }
|
|
167
|
+
.settings-token-control .input { width: 220px; min-height: 38px; }
|
|
168
|
+
.settings-token-control .btn { flex: none; }
|
|
169
|
+
.settings-note { margin: 18px 0 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 62%, var(--surface)); color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
|
|
170
|
+
|
|
171
|
+
@media (max-width: 760px) {
|
|
172
|
+
.settings-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 18px; }
|
|
173
|
+
.settings-head { padding: 16px 16px 12px; }
|
|
174
|
+
.settings-head h2 { font-size: 20px; }
|
|
175
|
+
.settings-close { width: 40px; height: 40px; }
|
|
176
|
+
.settings-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
|
|
177
|
+
.settings-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 0 12px 12px; border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 74%, transparent); overflow: visible; }
|
|
178
|
+
.settings-tab { flex-direction: column; justify-content: center; gap: 4px; min-height: 52px; padding: 7px 4px; font-size: 11.5px; text-align: center; }
|
|
179
|
+
.settings-tab svg { width: 16px; height: 16px; }
|
|
180
|
+
.settings-panel { padding: 8px 16px 24px; }
|
|
181
|
+
.settings-row { gap: 10px 14px; padding: 15px 0; }
|
|
182
|
+
.settings-row:first-child { padding-top: 10px; }
|
|
183
|
+
.settings-label { font-size: 13.5px; }
|
|
184
|
+
.settings-hint { font-size: 12px; }
|
|
185
|
+
.settings-select { width: 148px; min-height: 38px; }
|
|
186
|
+
.settings-block { padding-top: 12px; }
|
|
187
|
+
.theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
|
|
188
|
+
.theme-option { padding: 6px 6px 8px; }
|
|
189
|
+
.theme-option:has(input:checked)::after { top: 10px; right: 10px; width: 16px; height: 16px; font-size: 10px; }
|
|
190
|
+
.theme-preview { height: 48px; }
|
|
191
|
+
.theme-name { font-size: 11px; }
|
|
192
|
+
.settings-row-stack { grid-template-columns: minmax(0, 1fr); }
|
|
193
|
+
.settings-token-control { width: 100%; }
|
|
194
|
+
.settings-token-control .input { flex: 1; width: auto; min-width: 0; }
|
|
195
|
+
.settings-note { margin-top: 14px; }
|
|
138
196
|
}
|
package/server/chat-server.ts
CHANGED
|
@@ -276,9 +276,9 @@ async function handle(req: Request): Promise<Response> {
|
|
|
276
276
|
// A recall bumps the version without creating a message; wake the poll so
|
|
277
277
|
// the client can refetch the room snapshot (reliable version compare).
|
|
278
278
|
while (result.items.length === 0 && result.recallVersion === initialRecallVersion && Date.now() < deadline) {
|
|
279
|
-
// ponytail:
|
|
280
|
-
//
|
|
281
|
-
await sleep(Math.max(1, Math.min(
|
|
279
|
+
// ponytail: 500ms between disk scans keeps notification latency under
|
|
280
|
+
// half a second; a longer interval makes deliveries feel stuck.
|
|
281
|
+
await sleep(Math.max(1, Math.min(500, deadline - Date.now())));
|
|
282
282
|
result = await readInbox(sessionID, roomFilter, excludeSelf, afterTs);
|
|
283
283
|
}
|
|
284
284
|
return json(result);
|