@alexsun-top/opencode-chat-room 0.8.4 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -3
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/cli.ts +20 -1
- package/dist/cli.js +3785 -1462
- package/package.json +19 -11
- package/packages/chat-room-channeld/README.md +16 -10
- package/packages/chat-room-channeld/src/delivery.ts +0 -4
- package/packages/chat-room-channeld/src/host.ts +48 -37
- package/packages/chat-room-channeld/src/inbound.ts +3 -6
- package/packages/chat-room-channeld/src/pg/database.ts +141 -49
- package/packages/chat-room-channeld/src/pg/sql.mjs +157 -142
- package/packages/chat-room-channeld/src/pg/sql.mts +175 -0
- package/packages/chat-room-channeld/src/pg/worker.mjs +148 -99
- package/packages/chat-room-channeld/src/pg/worker.mts +201 -0
- package/packages/chat-room-channeld/src/state-rows.ts +132 -0
- package/packages/chat-room-channeld/src/state.ts +129 -157
- package/plugin.ts +21 -5
- package/server/app.ts +9 -0
- package/server/assets/base.css +22 -2
- package/server/assets/chat/admin.js +17 -1
- package/server/assets/chat/announcements.js +79 -34
- package/server/assets/chat/attachments.js +3 -3
- package/server/assets/chat/clipboard.js +1 -1
- package/server/assets/chat/confirm-dialog.js +3 -0
- package/server/assets/chat/copy-action.js +1 -1
- package/server/assets/chat/create-room-dialog.js +7 -0
- package/server/assets/chat/diagram-viewer.js +4 -8
- package/server/assets/chat/doc-preview.js +71 -31
- package/server/assets/chat/editor.js +49 -10
- package/server/assets/chat/events.js +13 -6
- package/server/assets/chat/files.js +33 -27
- package/server/assets/chat/history-loader.js +31 -15
- package/server/assets/chat/integration-editor.js +27 -1
- package/server/assets/chat/integrations.js +108 -16
- package/server/assets/chat/join-requests.js +40 -2
- package/server/assets/chat/locales/de.js +5 -3
- package/server/assets/chat/locales/es.js +5 -3
- package/server/assets/chat/locales/fr.js +5 -3
- package/server/assets/chat/locales/it.js +5 -3
- package/server/assets/chat/locales/ja.js +5 -3
- package/server/assets/chat/locales/ko.js +5 -3
- package/server/assets/chat/markdown-footnotes.js +27 -15
- package/server/assets/chat/markdown.js +6 -12
- package/server/assets/chat/members.js +34 -22
- package/server/assets/chat/mentions.js +8 -5
- package/server/assets/chat/message-cache.js +9 -3
- package/server/assets/chat/message-polling.js +10 -4
- package/server/assets/chat/message-window.js +58 -1
- package/server/assets/chat/messages.js +90 -37
- package/server/assets/chat/office-preview.js +3 -3
- package/server/assets/chat/operator.js +624 -0
- package/server/assets/chat/palette.js +7 -10
- package/server/assets/chat/panels.js +42 -0
- package/server/assets/chat/questions.js +75 -58
- package/server/assets/chat/recall.js +14 -5
- package/server/assets/chat/receipts.js +63 -7
- package/server/assets/chat/refresh-timing.js +6 -0
- package/server/assets/chat/reminders.js +47 -13
- package/server/assets/chat/replies.js +39 -25
- package/server/assets/chat/resource-format.js +6 -3
- package/server/assets/chat/room-list.js +202 -3
- package/server/assets/chat/room-watcher.js +3 -1
- package/server/assets/chat/rooms.js +29 -7
- package/server/assets/chat/settings.js +37 -6
- package/server/assets/chat/shortcuts.js +3 -1
- package/server/assets/chat/side-pane.js +1 -1
- package/server/assets/chat/state.js +51 -18
- package/server/assets/chat/system-events.js +3 -2
- package/server/assets/chat/system-messages.js +15 -15
- package/server/assets/chat/tasks.js +37 -14
- package/server/assets/chat/window-controls.js +25 -15
- package/server/assets/code-highlight.css +0 -13
- package/server/assets/conversation.css +45 -5
- package/server/assets/doc-preview.css +9 -0
- package/server/assets/files.css +4 -0
- package/server/assets/monaco/integration-rules.js +1 -1
- package/server/assets/office/THIRD-PARTY-NOTICES.txt +23 -1
- package/server/assets/office/licenses/docx-preview-HEADER.txt +6 -0
- package/server/assets/office/licenses/echarts-LICENSE-d3.txt +27 -0
- package/server/assets/office/licenses/echarts-NOTICE.txt +5 -0
- package/server/assets/office/licenses/immediate-LICENSE.txt +20 -0
- package/server/assets/office/licenses/lie-LICENSE.txt +7 -0
- package/server/assets/office/licenses/pako-LICENSE.txt +21 -0
- package/server/assets/office/licenses/pako-ZLIB.txt +18 -0
- package/server/assets/office/licenses/setimmediate-LICENSE.txt +20 -0
- package/server/assets/responsive.css +12 -2
- package/server/assets/settings.css +3 -1
- package/server/assets/tasks.css +6 -1
- package/server/assets/window-controls.css +3 -1
- package/server/channels.ts +3 -2
- package/server/chat.html +7 -2
- package/server/inbox.ts +3 -1
- package/server/join-requests.ts +8 -1
- package/server/member-routes.ts +16 -2
- package/server/newrooms.ts +2 -13
- package/server/operator-auth.ts +21 -0
- package/server/operator-routes.ts +150 -0
- package/server/operator-state.ts +64 -0
- package/server/operator.css +139 -0
- package/server/room-owner.ts +17 -0
- package/server/routes/inbox.ts +15 -5
- package/server/routes/pages.ts +12 -2
- package/server/routes/room-actions.ts +4 -3
- package/server/sw.js +3 -1
- package/server/system.html +109 -0
- package/server/wake.ts +1 -1
- package/skills/chatroom/SKILL.md +9 -0
- package/src/README.md +1 -1
- package/src/acp/client.ts +254 -0
- package/src/acp/protocol.ts +300 -0
- package/src/acp/watch.ts +498 -0
- package/src/agent/agent-receipts.ts +98 -8
- package/src/center/center-client.ts +6 -1
- package/src/center/center-inbox.ts +54 -7
- package/src/center/center-wake.ts +57 -3
- package/src/center/forward-client.ts +48 -0
- package/src/center/mentions.ts +16 -3
- package/src/center/notification-delay.ts +139 -0
- package/src/center/queue.ts +3 -0
- package/src/config/file-config.ts +25 -0
- package/src/mcp/server.ts +389 -0
- package/src/protocol/config.ts +7 -0
- package/src/runtime/plugin-notifications.ts +43 -9
- package/src/runtime/v2-plugin.ts +14 -3
- package/src/runtime/v2-receiver.ts +10 -2
- package/src/runtime/watch.ts +5 -1
- package/src/state/pg-database.ts +133 -49
- package/src/state/pg-sql.mjs +157 -142
- package/src/state/pg-sql.mts +175 -0
- package/src/state/pg-worker.mjs +148 -99
- package/src/state/pg-worker.mts +201 -0
- package/src/state/receiver-state.ts +47 -0
- package/src/state/sqlite-database.ts +6 -2
- package/src/state/sqlite-members.ts +48 -4
- package/src/state/sqlite-messages.ts +25 -12
- package/src/state/sqlite-schema.ts +4 -1
- package/src/state/sqlite-state.ts +1 -1
- package/src/state/store.ts +31 -11
- package/src/tui/app-types.mjs +1 -0
- package/src/tui/app-types.mts +175 -0
- package/src/tui/app.mjs +473 -423
- package/src/tui/app.mts +543 -0
- package/src/tui/config.mjs +166 -158
- package/src/tui/config.mts +247 -0
- package/src/tui/http.mjs +239 -206
- package/src/tui/http.mts +412 -0
- package/src/tui/i18n.mjs +17 -20
- package/src/tui/i18n.mts +42 -0
- package/src/tui/info-app.mjs +431 -427
- package/src/tui/info-app.mts +500 -0
- package/src/tui/info-content.mjs +205 -199
- package/src/tui/info-content.mts +341 -0
- package/src/tui/join-app.mjs +75 -64
- package/src/tui/join-app.mts +99 -0
- package/src/tui/locales/en.mjs +302 -320
- package/src/tui/locales/en.mts +349 -0
- package/src/tui/locales/zh-CN.mjs +302 -320
- package/src/tui/locales/zh-CN.mts +349 -0
- package/src/tui/main.mjs +219 -213
- package/src/tui/main.mts +255 -0
- package/src/tui/markdown.mjs +128 -272
- package/src/tui/markdown.mts +152 -0
- package/src/tui/mentions.mjs +181 -184
- package/src/tui/mentions.mts +251 -0
- package/src/tui/message-app.mjs +181 -173
- package/src/tui/message-app.mts +213 -0
- package/src/tui/message-view.mjs +90 -111
- package/src/tui/message-view.mts +151 -0
- package/src/tui/messages.mjs +55 -49
- package/src/tui/messages.mts +106 -0
- package/src/tui/palette-app.mjs +364 -344
- package/src/tui/palette-app.mts +388 -0
- package/src/tui/palette.mjs +100 -98
- package/src/tui/palette.mts +176 -0
- package/src/tui/prefs.mjs +56 -63
- package/src/tui/prefs.mts +126 -0
- package/src/tui/reminder-app.mjs +191 -181
- package/src/tui/reminder-app.mts +228 -0
- package/src/tui/room-settings-app.mjs +275 -242
- package/src/tui/room-settings-app.mts +318 -0
- package/src/tui/session.mjs +30 -29
- package/src/tui/session.mts +51 -0
- package/src/tui/settings-app.mjs +151 -138
- package/src/tui/settings-app.mts +179 -0
- package/src/tui/ui-content.mjs +426 -421
- package/src/tui/ui-content.mts +499 -0
- package/src/tui/ui-help.mjs +58 -67
- package/src/tui/ui-help.mts +87 -0
- package/src/tui/ui-mentions.mjs +34 -36
- package/src/tui/ui-mentions.mts +60 -0
- package/src/tui/ui-overlay-view.mjs +259 -267
- package/src/tui/ui-overlay-view.mts +322 -0
- package/src/tui/ui-suggest-view.mjs +54 -57
- package/src/tui/ui-suggest-view.mts +78 -0
- package/src/tui/ui-suggest.mjs +164 -167
- package/src/tui/ui-suggest.mts +248 -0
- package/src/tui/ui-theme.mjs +52 -57
- package/src/tui/ui-theme.mts +98 -0
- package/src/tui/ui-view.mjs +267 -275
- package/src/tui/ui-view.mts +308 -0
- package/src/tui/ui.mjs +372 -359
- package/src/tui/ui.mts +440 -0
- package/src/tui/wire.mjs +215 -0
- package/src/tui/wire.mts +383 -0
- package/src/web/integration-rules-editor.ts +25 -2
|
@@ -10,7 +10,7 @@ export const app = {
|
|
|
10
10
|
receiptObservation: null,
|
|
11
11
|
memberApiUnavailable: new Set(), receiptApiUnavailable: new Set(),
|
|
12
12
|
receipts: new Map(), acknowledgedMessages: new Map(), pendingAcknowledgements: new Map(),
|
|
13
|
-
pendingAction: null, watcherTimer: 0, restored: false, resizeScrollAdjusting: false, layoutScrollAdjusting: false,
|
|
13
|
+
pendingAction: null, pendingJoinRequests: new Set(), watcherTimer: 0, restored: false, resizeScrollAdjusting: false, layoutScrollAdjusting: false,
|
|
14
14
|
readAnchorGuard: null, userScrollIntentUntil: 0, listMetrics: { height: 0, top: 0, client: 0 }, followBottom: true, threadPointerDown: false,
|
|
15
15
|
},
|
|
16
16
|
rendered: 0,
|
|
@@ -69,7 +69,7 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
69
69
|
};
|
|
70
70
|
const read = (key) => {
|
|
71
71
|
if (Object.hasOwn(memory, key))
|
|
72
|
-
return memory[key];
|
|
72
|
+
return memory[key] ?? null;
|
|
73
73
|
try {
|
|
74
74
|
return (storage ?? globalThis.localStorage).getItem(key);
|
|
75
75
|
}
|
|
@@ -229,6 +229,16 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
231
|
set panelMode(value) { write("chat.panelMode", JSON.stringify(value || {})); },
|
|
232
|
+
get roomOrder() {
|
|
233
|
+
try {
|
|
234
|
+
const ids = JSON.parse(read("chat.roomOrder") || "[]");
|
|
235
|
+
return Array.isArray(ids) ? ids.filter((id) => typeof id === "string") : [];
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
return [];
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
set roomOrder(ids) { write("chat.roomOrder", JSON.stringify([...new Set(ids)])); },
|
|
232
242
|
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); },
|
|
233
243
|
get joinedRoomIds() {
|
|
234
244
|
try {
|
|
@@ -298,6 +308,11 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
298
308
|
}
|
|
299
309
|
return auth.token;
|
|
300
310
|
};
|
|
311
|
+
const networkError = () => {
|
|
312
|
+
const error = new Error(translate("networkError"));
|
|
313
|
+
error.network = true;
|
|
314
|
+
return error;
|
|
315
|
+
};
|
|
301
316
|
const apiResponse = async (url, options = {}) => {
|
|
302
317
|
assertIdentity();
|
|
303
318
|
const headers = { ...options.headers };
|
|
@@ -310,9 +325,7 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
310
325
|
response = await (fetcher ?? globalThis.fetch)(url, { ...options, headers });
|
|
311
326
|
}
|
|
312
327
|
catch {
|
|
313
|
-
|
|
314
|
-
error.network = true;
|
|
315
|
-
throw error;
|
|
328
|
+
throw networkError();
|
|
316
329
|
}
|
|
317
330
|
assertIdentity();
|
|
318
331
|
if (!response.ok) {
|
|
@@ -324,10 +337,26 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
324
337
|
}
|
|
325
338
|
return response;
|
|
326
339
|
};
|
|
327
|
-
const api = async (url, options) => {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
340
|
+
const api = async (url, { timeoutMs = 20_000, ...options } = {}) => {
|
|
341
|
+
// Bound restore reads through the end of the body, without timing out writes or downloads.
|
|
342
|
+
const controller = !options.signal && (options.method ?? "GET") === "GET" ? new AbortController() : undefined;
|
|
343
|
+
const timer = controller ? setTimeout(() => controller.abort(), timeoutMs) : undefined;
|
|
344
|
+
try {
|
|
345
|
+
const response = await apiResponse(url, controller ? { ...options, signal: controller.signal } : options);
|
|
346
|
+
const data = await response.json().catch(() => ({}));
|
|
347
|
+
controller?.signal.throwIfAborted();
|
|
348
|
+
assertIdentity();
|
|
349
|
+
return data;
|
|
350
|
+
}
|
|
351
|
+
catch (error) {
|
|
352
|
+
if (controller?.signal.aborted)
|
|
353
|
+
throw networkError();
|
|
354
|
+
throw error;
|
|
355
|
+
}
|
|
356
|
+
finally {
|
|
357
|
+
if (timer !== undefined)
|
|
358
|
+
clearTimeout(timer);
|
|
359
|
+
}
|
|
331
360
|
};
|
|
332
361
|
const apiBlob = async (url, options) => {
|
|
333
362
|
const response = await apiResponse(url, options), blob = await response.blob();
|
|
@@ -368,7 +397,7 @@ export const messages = {
|
|
|
368
397
|
editRoom: "Edit room", editRoomSections: "Edit room sections", editRoomDetails: "Room details", editRoomJoining: "Joining & approval", editRoomMembers: "Members & roles", editRoomOwnership: "Ownership", roomOwnerOnlyTitle: "Owner or administrator only", roomOwnerOnlyNote: ({ owner }) => `Only the room owner or a room administrator can change these settings. This room belongs to ${owner}.`, roomNameLabel: "Room name", roomDescriptionLabel: "Description", adminAgentLabel: "Administrator agent", roomOwnerBadge: "Owner", roomAdminBadge: "Admin",
|
|
369
398
|
adminIdsLabel: "Human administrators", adminIdsHint: "These members can edit room details, manage members, delete files, and choose a successor. The owner always has the same powers.", adminIdsEmpty: "No other members are in this room yet.", newOwnerLabel: "New owner", newOwnerHint: "Hand the room to another person who is in it. Only the owner can do this; agents cannot own a room.",
|
|
370
399
|
successorLabel: "Successor if the owner leaves", successorNone: "Longest-present member", successorHint: "If the owner leaves, this person becomes owner. If an administrator leaves, this person takes that role. Leave empty to use the longest-present member.", ownerOnlySettingsNote: "Only the owner can change the administrator agent or hand off the room.", adminAgentHint: "The designated agent can use the admin tool to inspect this room and its history. Only the owner can change this; leave empty for none.",
|
|
371
|
-
noAdminAgent: "None", openQuestions: ({ count }) => `${count} unanswered question${count === 1 ? "" : "s"}`,
|
|
400
|
+
noAdminAgent: "None", openQuestions: ({ count }) => `${count} unanswered question${count === 1 ? "" : "s"}`, pendingJoinRequests: "Join requests pending",
|
|
372
401
|
newRoom: "Create a room",
|
|
373
402
|
copyRoomIdTitle: ({ id }) => `Click to copy the full room ID: ${id}`, copied: "Copied",
|
|
374
403
|
members: "Members", membersCount: ({ count }) => `Members (${count})`, noMembers: "No members yet.", profileMenu: "Your profile and settings",
|
|
@@ -467,9 +496,9 @@ export const messages = {
|
|
|
467
496
|
shortcutsOpen: "All shortcuts",
|
|
468
497
|
shortcutsWriting: "Writing", shortcutsSend: "Send the message", shortcutsNewline: "Start a new line",
|
|
469
498
|
shortcutsMention: "Choose a member to mention", shortcutsRooms: "Rooms", shortcutsSearch: "Search and commands", shortcutsOpenPalette: "Open search and commands",
|
|
470
|
-
shortcutsSwitchRoom: "Switch to the previous or next room", shortcutsNumberRoom: "Switch to a joined room by number", shortcutsReading: "Reading",
|
|
499
|
+
shortcutsSwitchRoom: "Switch to the previous or next room", shortcutsNumberRoom: "Switch to a joined room by number", shortcutsMoveRoom: "Move the focused room up or down", shortcutsReading: "Reading",
|
|
471
500
|
shortcutsScroll: "Scroll messages while typing", shortcutsJump: "Jump to the start or end of the conversation", shortcutsMenus: "Menus and dialogs",
|
|
472
|
-
shortcutsClose: "Close the open menu
|
|
501
|
+
shortcutsClose: "Close the open menu or dialog",
|
|
473
502
|
paletteTitle: "Search and commands", paletteSearchLabel: "Search messages",
|
|
474
503
|
palettePlaceholder: "Search messages, or type / for commands", paletteScopeRoom: "This room", paletteScopeAll: "All rooms",
|
|
475
504
|
paletteScopeHint: "Tab switches between this room and all joined rooms", paletteSearchMode: "Search", paletteCommandMode: "Commands",
|
|
@@ -526,6 +555,7 @@ export const messages = {
|
|
|
526
555
|
failedMessages: "Messages not sent", retryFailed: "Retry", discardFailed: "Discard",
|
|
527
556
|
roomListError: "Unable to load rooms. You can enter a room ID directly.", guest: "Guest",
|
|
528
557
|
roomsLabel: "Rooms", refreshRooms: "Refresh rooms", identityLabel: ({ name }) => `Chatting as ${name}`,
|
|
558
|
+
roomMoveUp: ({ name }) => `Move ${name} up`, roomMoveDown: ({ name }) => `Move ${name} down`, roomMoved: ({ name }) => `Moved ${name}`,
|
|
529
559
|
roomsMenu: "Open room list", closeRoomList: "Close room list",
|
|
530
560
|
direct: "Direct", messagePrivately: "Message privately", removeMember: "Remove",
|
|
531
561
|
kickConfirm: ({ name }) => `Remove ${name} from this room? They can rejoin with the room ID.`,
|
|
@@ -544,6 +574,7 @@ export const messages = {
|
|
|
544
574
|
receiptCount: ({ count }) => `Read by ${count}`, receiptNone: "No readers yet", receiptAllRead: "Everyone has read this message", receiptNotLoaded: "Read status not loaded", readerPanelTitle: "Message readers", close: "Close", departedMember: "left",
|
|
545
575
|
confirmTitle: "Please confirm", cancel: "Cancel", confirmAction: "Confirm",
|
|
546
576
|
receiptEvidence_displayed: "Shown on screen", receiptEvidence_tool: "Fetched with room tool", receiptEvidence_context: "In agent context",
|
|
577
|
+
receiptDeliveredCount: ({ count }) => `Delivered to ${count} ${count === 1 ? "agent" : "agents"}; read not confirmed`, receiptDeliveredRow: "Read not confirmed",
|
|
547
578
|
},
|
|
548
579
|
"zh-CN": {
|
|
549
580
|
brand: "OC Chat", documentTitle: "OC Chat", roomTitle: ({ name }) => `${name} · OC Chat`,
|
|
@@ -574,7 +605,7 @@ export const messages = {
|
|
|
574
605
|
editRoom: "编辑房间", editRoomSections: "编辑房间分区", editRoomDetails: "房间信息", editRoomJoining: "加入与审核", editRoomMembers: "成员与角色", editRoomOwnership: "所有权", roomOwnerOnlyTitle: "仅房主或管理员可修改", roomOwnerOnlyNote: ({ owner }) => `只有房主或房间管理员可以修改这些设置。这个房间属于 ${owner}。`, roomNameLabel: "房间名称", roomDescriptionLabel: "描述", adminAgentLabel: "管理员 Agent", roomOwnerBadge: "房主", roomAdminBadge: "管理员",
|
|
575
606
|
adminIdsLabel: "成员管理员", adminIdsHint: "这些成员可以修改房间信息、管理成员、删除文件并指定接任者。房主始终拥有这些权限。", adminIdsEmpty: "房间里暂无其他成员。", newOwnerLabel: "新房主", newOwnerHint: "可以把房间交给房间里的另一个人。只有房主可以操作;Agent 不能成为房主。",
|
|
576
607
|
successorLabel: "房主离开后的接任者", successorNone: "最早加入的成员", successorHint: "房主离开后,此人接任房主;管理员离开后,此人接任管理员。留空则最早加入的成员接任房主。", ownerOnlySettingsNote: "只有房主可以更改管理员 Agent 或移交房间。", adminAgentHint: "被指定的 Agent 可用 admin 工具查看此房间及其历史。只有房主可以更改,留空表示不指定。",
|
|
577
|
-
noAdminAgent: "不指定", openQuestions: ({ count }) => `${count} 个待回答的问题`,
|
|
608
|
+
noAdminAgent: "不指定", openQuestions: ({ count }) => `${count} 个待回答的问题`, pendingJoinRequests: "有待审核的加入申请",
|
|
578
609
|
newRoom: "创建房间",
|
|
579
610
|
copyRoomIdTitle: ({ id }) => `点击复制完整房间 ID:${id}`, copied: "已复制", members: "成员",
|
|
580
611
|
membersCount: ({ count }) => `成员 ${count}`, noMembers: "暂无成员", settings: "设置", profileMenu: "个人资料和设置",
|
|
@@ -669,9 +700,9 @@ export const messages = {
|
|
|
669
700
|
shortcutsOpen: "全部快捷键",
|
|
670
701
|
shortcutsWriting: "输入", shortcutsSend: "发送消息", shortcutsNewline: "换行",
|
|
671
702
|
shortcutsMention: "选择要提及的成员", shortcutsRooms: "房间", shortcutsSearch: "搜索与命令", shortcutsOpenPalette: "打开搜索与命令面板",
|
|
672
|
-
shortcutsSwitchRoom: "切换到上一个或下一个房间", shortcutsNumberRoom: "按编号切换到已加入的房间", shortcutsReading: "阅读",
|
|
703
|
+
shortcutsSwitchRoom: "切换到上一个或下一个房间", shortcutsNumberRoom: "按编号切换到已加入的房间", shortcutsMoveRoom: "上移或下移聚焦的房间", shortcutsReading: "阅读",
|
|
673
704
|
shortcutsScroll: "输入时滚动消息", shortcutsJump: "跳到会话开头或结尾", shortcutsMenus: "菜单和对话框",
|
|
674
|
-
shortcutsClose: "
|
|
705
|
+
shortcutsClose: "关闭当前菜单或对话框",
|
|
675
706
|
paletteTitle: "搜索与命令", paletteSearchLabel: "搜索消息",
|
|
676
707
|
palettePlaceholder: "搜索消息,输入 / 使用命令", paletteScopeRoom: "当前房间", paletteScopeAll: "全部房间",
|
|
677
708
|
paletteScopeHint: "按 Tab 在当前房间和全部已加入房间之间切换", paletteSearchMode: "搜索", paletteCommandMode: "命令",
|
|
@@ -727,6 +758,7 @@ export const messages = {
|
|
|
727
758
|
failedMessages: "未发送的消息", retryFailed: "重试", discardFailed: "删除",
|
|
728
759
|
roomListError: "无法加载房间列表,可直接输入房间 ID 加入。", guest: "访客", roomsLabel: "房间列表",
|
|
729
760
|
refreshRooms: "刷新房间", identityLabel: ({ name }) => `当前昵称:${name}`, roomsMenu: "打开房间列表", closeRoomList: "关闭房间列表", direct: "私聊",
|
|
761
|
+
roomMoveUp: ({ name }) => `上移 ${name}`, roomMoveDown: ({ name }) => `下移 ${name}`, roomMoved: ({ name }) => `已移动 ${name}`,
|
|
730
762
|
messagePrivately: "私聊", removeMember: "移除", kickConfirm: ({ name }) => `确定将 ${name} 移出此房间?对方仍可用房间 ID 重新加入。`,
|
|
731
763
|
leaveRoomConfirm: ({ name }) => `离开“${name}”?你将离开这个房间,之后可以用房间 ID 重新加入。`,
|
|
732
764
|
deleteRoom: "删除房间", deleteConfirm: ({ name }) => `删除“${name}”及全部聊天记录?此操作无法撤销。`,
|
|
@@ -742,18 +774,19 @@ export const messages = {
|
|
|
742
774
|
receiptCount: ({ count }) => `已读 ${count} 人`, receiptNone: "尚无人已读", receiptAllRead: "所有人已读", receiptNotLoaded: "尚未加载已读状态", readerPanelTitle: "消息已读情况", close: "关闭", departedMember: "已离开",
|
|
743
775
|
confirmTitle: "请确认", cancel: "取消", confirmAction: "确认",
|
|
744
776
|
receiptEvidence_displayed: "已显示在屏幕上", receiptEvidence_tool: "通过房间工具读取", receiptEvidence_context: "进入上下文",
|
|
777
|
+
receiptDeliveredCount: ({ count }) => `已投递 ${count} 个 Agent,尚未确认已读`, receiptDeliveredRow: "尚未确认已读",
|
|
745
778
|
},
|
|
746
779
|
...extraLocales,
|
|
747
780
|
};
|
|
748
781
|
// Every locale falls back to English for keys it has not translated yet.
|
|
749
782
|
for (const dictionary of Object.values(messages)) {
|
|
750
|
-
for (const key of Object.
|
|
783
|
+
for (const [key, entry] of Object.entries(messages.en)) {
|
|
751
784
|
if (dictionary[key] === undefined)
|
|
752
|
-
dictionary[key] =
|
|
785
|
+
dictionary[key] = entry;
|
|
753
786
|
}
|
|
754
787
|
}
|
|
755
788
|
app.t = (key, values = {}) => {
|
|
756
|
-
const entry = messages[app.locale][key] ?? messages.en[key] ?? key;
|
|
789
|
+
const entry = messages[app.locale]?.[key] ?? messages.en[key] ?? key;
|
|
757
790
|
const text = typeof entry === "function" ? entry(values) : entry;
|
|
758
791
|
return String(text).replace(/\{(\w+)\}/g, (_, name) => String(values[name] ?? ""));
|
|
759
792
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { iconNode } from "./icons.js";
|
|
2
2
|
import { formatRelayMessage, formatSystemMessage, systemMessageKind } from "./system-messages.js";
|
|
3
3
|
import { renderMarkdown, renderResourceText } from "./markdown.js";
|
|
4
|
+
const noticeIcon = "megaphone";
|
|
4
5
|
const icons = {
|
|
5
6
|
join: "add",
|
|
6
7
|
leave: "arrow_exit",
|
|
@@ -8,7 +9,7 @@ const icons = {
|
|
|
8
9
|
admin: "shield_checkmark",
|
|
9
10
|
forward: "arrow_swap",
|
|
10
11
|
reminder: "alert",
|
|
11
|
-
notice:
|
|
12
|
+
notice: noticeIcon,
|
|
12
13
|
};
|
|
13
14
|
// Notices are Markdown and switch from a pill to a card once they pass three
|
|
14
15
|
// rendered lines; relays always keep the message-card shape because they carry
|
|
@@ -41,7 +42,7 @@ export function renderSystemRow(row, message, app) {
|
|
|
41
42
|
event.className = "sys-event";
|
|
42
43
|
event.setAttribute("role", "note");
|
|
43
44
|
mark.className = "sys-icon";
|
|
44
|
-
mark.append(iconNode(icons[kind]
|
|
45
|
+
mark.append(iconNode(icons[kind] ?? noticeIcon, "sys-icon-glyph"));
|
|
45
46
|
text.className = "sys-text";
|
|
46
47
|
if (kind === "relay")
|
|
47
48
|
renderResourceText(text, formatRelayMessage(message, app), app);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// The fourth column drives the event icon and tint in the web client.
|
|
2
2
|
const patterns = [
|
|
3
|
-
[/^(.*?) joined the room$/, "systemJoined", (m) => ({ name: m[1] }), "join"],
|
|
4
|
-
[/^(.*?) left the room$/, "systemLeft", (m) => ({ name: m[1] }), "leave"],
|
|
5
|
-
[/^(.*?) was removed from the room$/, "systemRemoved", (m) => ({ name: m[1] }), "remove"],
|
|
6
|
-
[/^(.*?) designated (.*?) as administrator$/, "systemDesignated", (m) => ({ actor: m[1], name: m[2] }), "admin"],
|
|
7
|
-
[/^(.*?) updated the room administrators$/, "systemAdminsUpdated", (m) => ({ actor: m[1] }), "admin"],
|
|
8
|
-
[/^(.*?) named (.*?) as the room successor$/, "systemSuccessorNamed", (m) => ({ actor: m[1], name: m[2] }), "admin"],
|
|
9
|
-
[/^(.*?) cleared the room successor$/, "systemSuccessorCleared", (m) => ({ actor: m[1] }), "admin"],
|
|
10
|
-
[/^(.*?) revoked the administrator designation$/, "systemRevoked", (m) => ({ actor: m[1] }), "admin"],
|
|
11
|
-
[/^(.*?) renamed the room from "(.*)" to "(.*)"$/, "systemRenamed", (m) => ({ actor: m[1], from: m[2], to: m[3] }), "admin"],
|
|
12
|
-
[/^(.*?) updated the room description$/, "systemDescribed", (m) => ({ actor: m[1] }), "admin"],
|
|
13
|
-
[/^(.*?) set join approval to (open|approval)$/, "systemJoinPolicy", (m) => ({ actor: m[1], policy: m[2] }), "admin"],
|
|
14
|
-
[/^(.*?) handed the room to (.*)$/, "systemHanded", (m) => ({ actor: m[1], name: m[2] }), "admin"],
|
|
15
|
-
[/^Forwarded to (.*)$/, "systemForwarded", (m) => ({ target: m[1] }), "forward"],
|
|
16
|
-
[/^Forward to (.*?) failed: (.*)$/, "systemForwardFailed", (m) => ({ target: m[1], reason: m[2] }), "forward"],
|
|
3
|
+
[/^(.*?) joined the room$/, "systemJoined", (m) => ({ name: m[1] ?? "" }), "join"],
|
|
4
|
+
[/^(.*?) left the room$/, "systemLeft", (m) => ({ name: m[1] ?? "" }), "leave"],
|
|
5
|
+
[/^(.*?) was removed from the room$/, "systemRemoved", (m) => ({ name: m[1] ?? "" }), "remove"],
|
|
6
|
+
[/^(.*?) designated (.*?) as administrator$/, "systemDesignated", (m) => ({ actor: m[1] ?? "", name: m[2] ?? "" }), "admin"],
|
|
7
|
+
[/^(.*?) updated the room administrators$/, "systemAdminsUpdated", (m) => ({ actor: m[1] ?? "" }), "admin"],
|
|
8
|
+
[/^(.*?) named (.*?) as the room successor$/, "systemSuccessorNamed", (m) => ({ actor: m[1] ?? "", name: m[2] ?? "" }), "admin"],
|
|
9
|
+
[/^(.*?) cleared the room successor$/, "systemSuccessorCleared", (m) => ({ actor: m[1] ?? "" }), "admin"],
|
|
10
|
+
[/^(.*?) revoked the administrator designation$/, "systemRevoked", (m) => ({ actor: m[1] ?? "" }), "admin"],
|
|
11
|
+
[/^(.*?) renamed the room from "(.*)" to "(.*)"$/, "systemRenamed", (m) => ({ actor: m[1] ?? "", from: m[2] ?? "", to: m[3] ?? "" }), "admin"],
|
|
12
|
+
[/^(.*?) updated the room description$/, "systemDescribed", (m) => ({ actor: m[1] ?? "" }), "admin"],
|
|
13
|
+
[/^(.*?) set join approval to (open|approval)$/, "systemJoinPolicy", (m) => ({ actor: m[1] ?? "", policy: m[2] ?? "" }), "admin"],
|
|
14
|
+
[/^(.*?) handed the room to (.*)$/, "systemHanded", (m) => ({ actor: m[1] ?? "", name: m[2] ?? "" }), "admin"],
|
|
15
|
+
[/^Forwarded to (.*)$/, "systemForwarded", (m) => ({ target: m[1] ?? "" }), "forward"],
|
|
16
|
+
[/^Forward to (.*?) failed: (.*)$/, "systemForwardFailed", (m) => ({ target: m[1] ?? "", reason: m[2] ?? "" }), "forward"],
|
|
17
17
|
];
|
|
18
18
|
function formatLine(line, app) {
|
|
19
19
|
for (const [pattern, key, values] of patterns) {
|
|
@@ -49,7 +49,7 @@ export function formatSystemMessage(message, app) {
|
|
|
49
49
|
export function systemMessageKind(message) {
|
|
50
50
|
if (String(message?.id ?? "").startsWith("reminder:"))
|
|
51
51
|
return "reminder";
|
|
52
|
-
const line = String(message?.text ?? "").split("; ")[0];
|
|
52
|
+
const line = String(message?.text ?? "").split("; ")[0] ?? "";
|
|
53
53
|
// Inbound relay lines carry provider ids and read like messages, not notices.
|
|
54
54
|
if (/^\[[A-Za-z][\w .-]*\] message_id=\S+/.test(line))
|
|
55
55
|
return "relay";
|
|
@@ -4,6 +4,8 @@ import { LS } from "./state.js";
|
|
|
4
4
|
import { isRoomAdmin } from "./admin-badge.js";
|
|
5
5
|
import { TITLE_MAX, buildTaskForm, createStepsEditor, fillAssignees, fillPeople, readPeople } from "./task-form.js";
|
|
6
6
|
import { buildTaskRow } from "./task-row.js";
|
|
7
|
+
import { waitForRefresh } from "./refresh-timing.js";
|
|
8
|
+
import { closeOnBackdrop } from "./panels.js";
|
|
7
9
|
const STATUSES = ["todo", "doing", "done"];
|
|
8
10
|
const STATUS_LABELS = { todo: "tasksStatusTodo", doing: "tasksStatusDoing", done: "tasksStatusDone" };
|
|
9
11
|
const PANE_QUERY = "(min-width: 1100px) and (min-height: 560px)";
|
|
@@ -41,6 +43,10 @@ export function initTasks(app) {
|
|
|
41
43
|
|| !createStepsHost || !createStepsButton)
|
|
42
44
|
return;
|
|
43
45
|
const createSteps = createStepsEditor(app, createStepsHost, createStepsButton);
|
|
46
|
+
// A form signature lets a backdrop click separate an untouched form from a draft.
|
|
47
|
+
let createBaseline = "", editBaseline = "";
|
|
48
|
+
const formState = (root) => Array.from(root.querySelectorAll("input, select, textarea"))
|
|
49
|
+
.map((field) => field instanceof HTMLInputElement && field.type === "checkbox" ? String(field.checked) : field.value).join("\0");
|
|
44
50
|
let items = [], loading = false, failed = false, generation = 0, editingId = "";
|
|
45
51
|
let taskLimit = null;
|
|
46
52
|
let opener = null, restoreFocus = true, pendingReopen = false;
|
|
@@ -54,7 +60,8 @@ export function initTasks(app) {
|
|
|
54
60
|
const canEdit = (task) => isAdmin() || isCreator(task);
|
|
55
61
|
const canStatus = (task) => canEdit(task) || isAssignee(task);
|
|
56
62
|
const formatDue = (value) => {
|
|
57
|
-
|
|
63
|
+
// NaN defaults keep malformed dates rendering as Invalid Date, as before.
|
|
64
|
+
const [year = NaN, month = NaN, day = NaN] = value.split("-").map(Number);
|
|
58
65
|
return new Intl.DateTimeFormat(app.intlLocale(), { month: "short", day: "numeric", year: "numeric" })
|
|
59
66
|
.format(new Date(year, month - 1, day));
|
|
60
67
|
};
|
|
@@ -62,7 +69,7 @@ export function initTasks(app) {
|
|
|
62
69
|
const value = dateValue(task.dueDate);
|
|
63
70
|
if (!value || statusOf(task) === "done")
|
|
64
71
|
return false;
|
|
65
|
-
const [year, month, day] = value.split("-").map(Number);
|
|
72
|
+
const [year = NaN, month = NaN, day = NaN] = value.split("-").map(Number);
|
|
66
73
|
const now = new Date();
|
|
67
74
|
return new Date(year, month - 1, day) < new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
68
75
|
};
|
|
@@ -110,6 +117,8 @@ export function initTasks(app) {
|
|
|
110
117
|
const setBusy = (busy) => {
|
|
111
118
|
loading = busy;
|
|
112
119
|
dialog.setAttribute("aria-busy", String(busy));
|
|
120
|
+
// A same-room reload spins the reload glyph in place; nothing else moves.
|
|
121
|
+
refresh.classList.toggle("is-refreshing", busy);
|
|
113
122
|
// A reload that finishes while an editor is open must not re-enable the
|
|
114
123
|
// refresh control the editor has locked.
|
|
115
124
|
refresh.disabled = busy || Boolean(editingId);
|
|
@@ -237,6 +246,7 @@ export function initTasks(app) {
|
|
|
237
246
|
editBody.textContent = "";
|
|
238
247
|
editHeading.textContent = app.t("tasksEditHeading");
|
|
239
248
|
editBody.append(buildTaskForm(view, task));
|
|
249
|
+
editBaseline = formState(editBody);
|
|
240
250
|
refresh.disabled = true;
|
|
241
251
|
editDialog.showModal();
|
|
242
252
|
editBody.querySelector(".task-edit-title")?.focus();
|
|
@@ -323,14 +333,18 @@ export function initTasks(app) {
|
|
|
323
333
|
const roomId = room.id, request = ++generation;
|
|
324
334
|
taskLimit = null;
|
|
325
335
|
setBusy(true);
|
|
326
|
-
|
|
336
|
+
// The rows stay put; a loading label only replaces an empty board.
|
|
327
337
|
if (!items.length)
|
|
328
338
|
summary.textContent = app.t("tasksLoading");
|
|
339
|
+
const started = performance.now();
|
|
329
340
|
try {
|
|
330
341
|
const result = await app.api(`/rooms/${encodeURIComponent(roomId)}/tasks?sessionID=${encodeURIComponent(LS.sessionID)}`);
|
|
342
|
+
await waitForRefresh(started);
|
|
331
343
|
if (request !== generation || !currentRoom(roomId))
|
|
332
344
|
return;
|
|
333
345
|
failed = false;
|
|
346
|
+
// A retry clears an earlier error at the same moment the rows swap.
|
|
347
|
+
hideError();
|
|
334
348
|
const payload = isRecord(result) ? result : {};
|
|
335
349
|
items = (Array.isArray(payload.tasks) ? payload.tasks : []).filter(isTask);
|
|
336
350
|
const limit = Number(payload.limit);
|
|
@@ -338,6 +352,7 @@ export function initTasks(app) {
|
|
|
338
352
|
render();
|
|
339
353
|
}
|
|
340
354
|
catch {
|
|
355
|
+
await waitForRefresh(started);
|
|
341
356
|
if (request !== generation || !currentRoom(roomId))
|
|
342
357
|
return;
|
|
343
358
|
failed = true;
|
|
@@ -392,6 +407,7 @@ export function initTasks(app) {
|
|
|
392
407
|
fillAssignees(app, assigneeSelect, "");
|
|
393
408
|
fillPeople(app, createPeople, []);
|
|
394
409
|
createSteps.reset();
|
|
410
|
+
createBaseline = formState(createForm);
|
|
395
411
|
};
|
|
396
412
|
const show = () => {
|
|
397
413
|
if (app.panelPlacement("tasks") === "pane") {
|
|
@@ -530,7 +546,7 @@ export function initTasks(app) {
|
|
|
530
546
|
});
|
|
531
547
|
menuButton.addEventListener("click", (event) => {
|
|
532
548
|
event.stopPropagation();
|
|
533
|
-
const next = menu.hidden;
|
|
549
|
+
const next = menu.hidden === true;
|
|
534
550
|
setMenu(next);
|
|
535
551
|
if (next && !clearButton.disabled)
|
|
536
552
|
clearButton.focus();
|
|
@@ -614,21 +630,28 @@ export function initTasks(app) {
|
|
|
614
630
|
}
|
|
615
631
|
});
|
|
616
632
|
$("#btnCloseTaskEdit")?.addEventListener("click", () => closeEdit(true));
|
|
633
|
+
// A backdrop click closes only a clean board or editor; a draft waits for the
|
|
634
|
+
// user's own close control, and a save in flight always holds.
|
|
635
|
+
closeOnBackdrop(dialog, () => {
|
|
636
|
+
if (dialog.classList.contains("is-pane") || editDialog.open || formState(createForm) !== createBaseline)
|
|
637
|
+
return;
|
|
638
|
+
close();
|
|
639
|
+
});
|
|
640
|
+
closeOnBackdrop(editDialog, () => {
|
|
641
|
+
const save = editBody.querySelector('button[type="submit"]');
|
|
642
|
+
if (save?.disabled || formState(editBody) !== editBaseline)
|
|
643
|
+
return;
|
|
644
|
+
closeEdit(true);
|
|
645
|
+
});
|
|
617
646
|
editDialog.addEventListener("cancel", (event) => { event.preventDefault(); closeEdit(true); });
|
|
618
647
|
dialog.addEventListener("cancel", (event) => { event.preventDefault(); close(); });
|
|
648
|
+
// The board's menu is a popup, so Escape closes it; the docked board itself stays.
|
|
619
649
|
document.addEventListener("keydown", (event) => {
|
|
620
|
-
if (event.key !== "Escape" || event.altKey)
|
|
621
|
-
return;
|
|
622
|
-
if (!menu.hidden) {
|
|
623
|
-
event.preventDefault();
|
|
624
|
-
setMenu(false);
|
|
625
|
-
menuButton.focus();
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
if (!dialog.open || !dialog.classList.contains("is-pane") || !dialog.contains(document.activeElement))
|
|
650
|
+
if (event.key !== "Escape" || event.altKey || menu.hidden)
|
|
629
651
|
return;
|
|
630
652
|
event.preventDefault();
|
|
631
|
-
|
|
653
|
+
setMenu(false);
|
|
654
|
+
menuButton.focus();
|
|
632
655
|
});
|
|
633
656
|
document.addEventListener("chat-room-activated", () => {
|
|
634
657
|
closeEdit(false);
|
|
@@ -2,34 +2,44 @@
|
|
|
2
2
|
// visible overlay gets the drag strip and titlebar inset; every other surface keeps
|
|
3
3
|
// its normal layout with no dead drag area.
|
|
4
4
|
const PROPS = ["top", "left", "width", "height"];
|
|
5
|
+
export const WCO_VISIBILITY_CHANGE = "wco-visibilitychange";
|
|
5
6
|
export function initWindowControls() {
|
|
6
7
|
const overlay = navigator.windowControlsOverlay;
|
|
7
8
|
if (!overlay)
|
|
8
9
|
return;
|
|
9
10
|
const root = document.documentElement;
|
|
10
11
|
let drag = null;
|
|
12
|
+
let visible = false;
|
|
11
13
|
const sync = () => {
|
|
12
|
-
|
|
14
|
+
const next = overlay.visible === true;
|
|
15
|
+
if (next) {
|
|
16
|
+
// Real browsers resolve env(titlebar-area-*) first; the variables are a fallback
|
|
17
|
+
// for browsers that expose the overlay without the CSS environment values.
|
|
18
|
+
const rect = overlay.getTitlebarAreaRect?.();
|
|
19
|
+
if (rect) {
|
|
20
|
+
const area = { top: rect.y, left: rect.x, width: rect.width, height: rect.height };
|
|
21
|
+
for (const name of PROPS)
|
|
22
|
+
root.style.setProperty(`--wco-${name}`, `${area[name]}px`);
|
|
23
|
+
}
|
|
24
|
+
root.dataset.wco = "true";
|
|
25
|
+
if (!drag) {
|
|
26
|
+
drag = document.createElement("div");
|
|
27
|
+
drag.className = "wco-drag";
|
|
28
|
+
drag.setAttribute("aria-hidden", "true");
|
|
29
|
+
document.body.append(drag);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
13
33
|
delete root.dataset.wco;
|
|
14
34
|
for (const name of PROPS)
|
|
15
35
|
root.style.removeProperty(`--wco-${name}`);
|
|
16
36
|
drag?.remove();
|
|
17
37
|
drag = null;
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
// Real browsers resolve env(titlebar-area-*) first; the variables are a fallback
|
|
21
|
-
// for browsers that expose the overlay without the CSS environment values.
|
|
22
|
-
const area = overlay.getTitlebarAreaRect?.();
|
|
23
|
-
if (area) {
|
|
24
|
-
for (const name of PROPS)
|
|
25
|
-
root.style.setProperty(`--wco-${name}`, `${area[name]}px`);
|
|
26
38
|
}
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
drag.setAttribute("aria-hidden", "true");
|
|
32
|
-
document.body.append(drag);
|
|
39
|
+
// Only a visibility flip changes the native caption color; a resize keeps it.
|
|
40
|
+
if (next !== visible) {
|
|
41
|
+
visible = next;
|
|
42
|
+
root.dispatchEvent(new Event(WCO_VISIBILITY_CHANGE));
|
|
33
43
|
}
|
|
34
44
|
};
|
|
35
45
|
overlay.addEventListener("geometrychange", sync);
|
|
@@ -90,19 +90,6 @@
|
|
|
90
90
|
.code-block.is-wrapped pre { overflow-x: hidden; }
|
|
91
91
|
.code-block.is-wrapped pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
92
92
|
|
|
93
|
-
.code-language {
|
|
94
|
-
min-width: 0;
|
|
95
|
-
overflow: hidden;
|
|
96
|
-
text-overflow: ellipsis;
|
|
97
|
-
white-space: nowrap;
|
|
98
|
-
color: var(--ink-3);
|
|
99
|
-
font: 600 10.5px/1.5 var(--font-mono);
|
|
100
|
-
letter-spacing: .07em;
|
|
101
|
-
text-transform: uppercase;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.code-block:hover .code-language { color: var(--ink-2); }
|
|
105
|
-
|
|
106
93
|
.code-toolbar {
|
|
107
94
|
display: flex;
|
|
108
95
|
flex: none;
|
|
@@ -209,6 +209,10 @@
|
|
|
209
209
|
.jump .fluent-icon { width: 18px; height: 18px; }
|
|
210
210
|
.jump:hover { filter: brightness(1.07); }
|
|
211
211
|
.jump:active { transform: translateY(1px); }
|
|
212
|
+
/* The resize hold already waited out the gesture, so the settle shows without a pop. */
|
|
213
|
+
.jump.is-settling { animation: jump-fade-in .18s ease-out; }
|
|
214
|
+
@keyframes jump-fade-in { from { opacity: 0; transform: translateY(4px); } }
|
|
215
|
+
@media (prefers-reduced-motion: reduce) { .jump.is-settling { animation: none; } }
|
|
212
216
|
.jump .badge {
|
|
213
217
|
position: absolute;
|
|
214
218
|
top: -6px;
|
|
@@ -264,23 +268,34 @@
|
|
|
264
268
|
.msg.repeat .msg-name { display: none; }
|
|
265
269
|
.msg.repeat .admin-agent-badge { display: none; }
|
|
266
270
|
.msg-time { font-size: 12px; color: var(--ink-2); }
|
|
271
|
+
/* Grouped messages drop their meta line; the receipt column carries their own
|
|
272
|
+
time above the badge and only shows it on hover or keyboard focus. */
|
|
273
|
+
.msg.repeat:has(.msg-receipt-stack .msg-time) .msg-meta { display: none; }
|
|
274
|
+
/* A question marker is content, not a timestamp, so it keeps its own line. */
|
|
275
|
+
.msg.repeat:has(.msg-receipt-stack .msg-time):has(.question-mark) .msg-meta { display: flex; }
|
|
276
|
+
.msg-receipt-stack { display: flex; flex-direction: column; align-items: flex-start; align-self: stretch; flex: 0 0 24px; min-width: 0; }
|
|
277
|
+
.msg.own .msg-receipt-stack { align-items: flex-end; }
|
|
278
|
+
.msg-receipt-stack .message-readers { margin-top: auto; }
|
|
279
|
+
.msg-receipt-stack .msg-time { font-size: 11px; line-height: 1.4; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .14s; }
|
|
280
|
+
.msg.repeat:hover .msg-receipt-stack .msg-time, .msg.repeat:focus-within .msg-receipt-stack .msg-time { opacity: 1; }
|
|
267
281
|
.msg-text {
|
|
268
282
|
display: inline-block;
|
|
269
283
|
width: max-content;
|
|
270
284
|
max-width: min(86%, 540px);
|
|
285
|
+
/* Confirming a send only lifts the pending dimming, so fade it instead of snapping. */
|
|
286
|
+
transition: opacity .16s ease;
|
|
271
287
|
padding: 9px 13px;
|
|
272
288
|
border: 1px solid color-mix(in srgb, var(--ink) 5%, transparent);
|
|
273
289
|
border-radius: 16px;
|
|
274
290
|
box-shadow: 0 1px 2px rgb(20 40 32 / .035);
|
|
275
291
|
background: var(--surface-2);
|
|
276
|
-
border-bottom-left-radius: 4px;
|
|
277
292
|
font-size: 16px;
|
|
278
293
|
line-height: 1.6;
|
|
279
294
|
white-space: normal;
|
|
280
295
|
overflow-wrap: anywhere;
|
|
281
296
|
}
|
|
282
297
|
.msg-text::selection, .msg-text *::selection { color: var(--accent-ink); background: var(--accent); }
|
|
283
|
-
.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);
|
|
298
|
+
.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); }
|
|
284
299
|
.msg.jump-flash .msg-text { animation: jump-flash .4s ease-in-out 2; }
|
|
285
300
|
@keyframes jump-flash {
|
|
286
301
|
0%, 100% { box-shadow: 0 1px 2px rgb(20 40 32 / .035); }
|
|
@@ -290,7 +305,7 @@
|
|
|
290
305
|
.msg-content { position: relative; display: flex; align-items: flex-end; gap: 6px; width: 100%; max-width: 100%; }
|
|
291
306
|
.msg.own .msg-content { flex-direction: row; justify-content: flex-end; }
|
|
292
307
|
/* Own bubbles sit at the right edge, so the receipt belongs on their inner (left) side. */
|
|
293
|
-
.msg.own .
|
|
308
|
+
.msg.own .msg-receipt-stack { order: -1; }
|
|
294
309
|
.message-copy {
|
|
295
310
|
position: relative;
|
|
296
311
|
align-self: flex-start;
|
|
@@ -329,10 +344,14 @@
|
|
|
329
344
|
.reply-quote:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
|
|
330
345
|
.reply-quote:disabled { cursor: default; opacity: .7; }
|
|
331
346
|
.msg.own .message-copy-feedback { left: auto; right: 0; }
|
|
332
|
-
|
|
347
|
+
/* A 1:1 line box keeps the tiny count optically centred; the grid box centres
|
|
348
|
+
the all-read icon without depending on font metrics. */
|
|
349
|
+
.message-readers { flex: 0 0 24px; align-self: flex-end; display: grid; place-items: center; margin: 0; 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; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgb(20 40 32 / .06); }
|
|
333
350
|
.message-readers[data-reader-state="empty"], .message-readers[data-reader-state="unknown"] { background: var(--surface-2); }
|
|
351
|
+
.message-readers[data-reader-state="delivered"] { color: var(--ink-2); background: var(--surface-2); }
|
|
334
352
|
.message-readers[data-reader-state="all"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); background: var(--accent-soft); }
|
|
335
|
-
.message-read-check { display: block; width: 14px; height: 14px; }
|
|
353
|
+
.message-read-check, .message-delivered-icon { display: block; width: 14px; height: 14px; }
|
|
354
|
+
.reader-delivered { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
|
|
336
355
|
.message-readers:hover, .message-readers[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
|
|
337
356
|
.message-readers:focus-visible, .reader-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
338
357
|
.receipt-reader-list { margin: 0; padding: 0; list-style: none; }
|
|
@@ -693,3 +712,24 @@
|
|
|
693
712
|
#msgList.room-content-out-prev { animation: room-content-out-prev .14s ease-in both; }
|
|
694
713
|
#msgList.room-content-in-next { animation: room-content-in-next .2s ease-out both; }
|
|
695
714
|
#msgList.room-content-in-prev { animation: room-content-in-prev .2s ease-out both; }
|
|
715
|
+
|
|
716
|
+
/* Room reordering: native drag on pointer devices, move buttons where dragging is unavailable. */
|
|
717
|
+
#roomList > li, #roomListChat > li { display: flex; align-items: center; }
|
|
718
|
+
#roomList > li > .room-row, #roomListChat > li > .room-row { flex: 1; min-width: 0; }
|
|
719
|
+
.room-row[draggable="true"] { cursor: grab; }
|
|
720
|
+
.room-row.dragging { opacity: .45; }
|
|
721
|
+
.room-row.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
|
|
722
|
+
.room-move { display: none; flex-direction: column; gap: 2px; margin-left: 2px; }
|
|
723
|
+
.room-move-btn { display: grid; place-items: center; width: 26px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: 7px; color: var(--ink-3); background: transparent; cursor: pointer; }
|
|
724
|
+
.room-move-btn:hover { color: var(--accent); border-color: var(--line); background: var(--surface); }
|
|
725
|
+
.room-move-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
726
|
+
.room-move-btn:disabled { opacity: .3; cursor: default; }
|
|
727
|
+
.room-move-btn svg { width: 14px; height: 14px; }
|
|
728
|
+
@media (hover: none), (pointer: coarse) {
|
|
729
|
+
.room-move { display: flex; }
|
|
730
|
+
.room-row[draggable="true"] { cursor: pointer; }
|
|
731
|
+
}
|
|
732
|
+
#roomList[aria-busy="true"], #roomListChat[aria-busy="true"] { opacity: .6; transition: opacity .15s ease; }
|
|
733
|
+
#btnRefreshRooms.is-refreshing svg { animation: spin .8s linear infinite; }
|
|
734
|
+
@media (prefers-reduced-motion: reduce) { #btnRefreshRooms.is-refreshing svg { animation: none; opacity: .6; } }
|
|
735
|
+
.room-order-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
@@ -107,6 +107,12 @@
|
|
|
107
107
|
background: var(--surface);
|
|
108
108
|
z-index: 1000;
|
|
109
109
|
}
|
|
110
|
+
/* An installed PWA draws the page under its native title bar, so full screen
|
|
111
|
+
starts below that strip instead of putting the header actions under it. */
|
|
112
|
+
html[data-wco="true"] .doc-preview.is-fullscreen {
|
|
113
|
+
top: calc(env(titlebar-area-y, var(--wco-top, 0px)) + env(titlebar-area-height, var(--wco-height, 0px)));
|
|
114
|
+
height: auto;
|
|
115
|
+
}
|
|
110
116
|
html:has(body.doc-preview-fullscreen),
|
|
111
117
|
body.doc-preview-fullscreen { overflow: hidden; }
|
|
112
118
|
.doc-preview.is-fullscreen .doc-preview-head { padding: 16px 18px 12px 24px; }
|
|
@@ -157,6 +163,9 @@ pre.doc-code code { padding: 0; font-family: var(--font-mono); font-size: 12.5px
|
|
|
157
163
|
.doc-preview.is-pdf .doc-preview-empty { display: none; }
|
|
158
164
|
.doc-pdf-frame { flex: 1 1 auto; width: 100%; height: 100%; min-height: 0; border: 0; background: var(--surface-2); }
|
|
159
165
|
|
|
166
|
+
/* SVG previews decode through an <img>, so the markup stays inert. */
|
|
167
|
+
.doc-svg-image { display: block; max-width: 100%; height: auto; margin: 0 auto; }
|
|
168
|
+
|
|
160
169
|
/* Code files fill the reading surface with a read-only Monaco editor. */
|
|
161
170
|
.doc-preview.is-code .doc-preview-scroll { display: flex; padding: 0; overflow: hidden; }
|
|
162
171
|
.doc-preview.is-code .doc-preview-body { flex: 1 1 auto; min-height: 0; }
|
package/server/assets/files.css
CHANGED
|
@@ -71,6 +71,9 @@
|
|
|
71
71
|
font-size: 12px;
|
|
72
72
|
}
|
|
73
73
|
.files-summary { margin: 0 0 0 auto; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; }
|
|
74
|
+
/* A refresh spins the reload glyph in place, so the rows and the toolbar hold
|
|
75
|
+
their geometry while the request is in flight. */
|
|
76
|
+
#btnRefreshFiles.is-refreshing svg { animation: spin .8s linear infinite; }
|
|
74
77
|
|
|
75
78
|
.files-error { margin: 0 20px 8px; }
|
|
76
79
|
.files-scroll {
|
|
@@ -227,4 +230,5 @@
|
|
|
227
230
|
|
|
228
231
|
@media (prefers-reduced-motion: reduce) {
|
|
229
232
|
#filesDialog[open], .file-row { animation: none; }
|
|
233
|
+
#btnRefreshFiles.is-refreshing svg { animation: none; opacity: .7; }
|
|
230
234
|
}
|