@alexsun-top/opencode-chat-room 0.7.1 → 0.7.3
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 +21 -0
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/package.json +1 -1
- package/server/assets/base.css +2 -0
- package/server/assets/chat/create-room-dialog.js +49 -0
- package/server/assets/chat/editor.js +28 -9
- package/server/assets/chat/events.js +31 -21
- package/server/assets/chat/image-zoom.js +49 -16
- package/server/assets/chat/index.js +2 -0
- package/server/assets/chat/locales/de.js +5 -1
- package/server/assets/chat/locales/es.js +5 -1
- package/server/assets/chat/locales/fr.js +5 -1
- package/server/assets/chat/locales/it.js +5 -1
- package/server/assets/chat/locales/ja.js +5 -1
- package/server/assets/chat/locales/ko.js +5 -1
- package/server/assets/chat/markdown.js +14 -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/rooms.js +19 -12
- package/server/assets/chat/settings.js +40 -1
- package/server/assets/chat/shortcuts.js +113 -23
- package/server/assets/chat/state.js +12 -4
- package/server/assets/code-highlight.css +2 -5
- package/server/assets/conversation.css +22 -14
- package/server/assets/responsive.css +48 -4
- package/server/assets/room-create.css +85 -0
- package/server/assets/settings.css +93 -35
- package/server/chat-server.ts +3 -3
- package/server/chat.html +138 -72
- package/server/join-requests.ts +1 -0
- package/server/room-join.ts +7 -2
- package/server/sw.js +1 -0
- package/skills/chatroom/SKILL.md +1 -1
- package/src/runtime/v2-plugin.ts +2 -2
|
@@ -57,6 +57,10 @@ export const ja = {
|
|
|
57
57
|
settings: "設定", adminAccess: "管理", adminToken: "管理トークン", openAdministration: "管理画面を開く", administration: "管理", designations: "指定", adminRoom: "管理ルーム", targetRoom: "Agent の所属ルーム", adminScopeNote: "管理ルーム内の Agent を選択してください。管理者はすべてのルームを管理できます。", targetAgent: "登録済み Agent", designate: "管理者に指定", revokeDesignation: "指定を解除", globalStatus: "全体ステータス", adminTasks: "タスク", taskText: "タスク", dispatchTask: "タスクを送信", timers: "タイマー", planName: "タイマー名", createTimer: "タイマーを作成", tokenRequired: "サーバーはアクセストークンを要求しています(401)。",
|
|
58
58
|
themeLabel: "テーマ", themeSystem: "システム", themeLight: "ライト", themeDark: "ダーク", themeForest: "フォレスト", themeSand: "サンド",
|
|
59
59
|
settingsLocalHint: "言語とテーマはこのブラウザに保存されます。",
|
|
60
|
+
settingsSections: "設定セクション", settingsGeneral: "一般", settingsAppearance: "外観", settingsConnection: "接続",
|
|
61
|
+
settingsLanguageHint: "すぐに反映され、このブラウザに保存されます。", settingsThemeHint: "このブラウザに保存されます。システムは端末の設定に従います。", settingsTokenHint: "このブラウザにのみ保存されます。サーバーから求められた場合にのみ必要です。",
|
|
62
|
+
contentTransition: "ルーム内容のトランジション", contentTransitionHint: "Alt+矢印キーでルームを切り替えるとき、メッセージ内容を方向に沿ってスライドします。既定ではオフです。",
|
|
63
|
+
pageStep: "ページ送り距離", pageStepHint: "PageUp・PageDown を押すたびにスクロールする距離(会話領域の高さに対する割合)。既定は 90%。",
|
|
60
64
|
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}」を削除しますか?`,
|
|
61
65
|
leave: "退出", reconnecting: "接続が切れました。再接続中…", messageList: "メッセージ一覧",
|
|
62
66
|
noMessages: "メッセージはまだありません。何か書き込みましょう。", latestMessages: "最新のメッセージに戻る",
|
|
@@ -75,7 +79,7 @@ export const ja = {
|
|
|
75
79
|
shortcutsOpen: "すべてのショートカット",
|
|
76
80
|
shortcutsWriting: "入力", shortcutsSend: "メッセージを送信", shortcutsNewline: "改行",
|
|
77
81
|
shortcutsMention: "メンションするメンバーを選択", shortcutsRooms: "ルーム",
|
|
78
|
-
shortcutsSwitchRoom: "前後のルームに切り替え", shortcutsReading: "閲覧",
|
|
82
|
+
shortcutsSwitchRoom: "前後のルームに切り替え", shortcutsNumberRoom: "番号で参加中のルームに切り替え", shortcutsReading: "閲覧",
|
|
79
83
|
shortcutsScroll: "入力中にメッセージをスクロール", shortcutsJump: "会話の先頭または末尾に移動", shortcutsMenus: "メニューとダイアログ",
|
|
80
84
|
shortcutsClose: "開いているメニュー、パネル、ダイアログを閉じる",
|
|
81
85
|
earlierMessages: "以前のメッセージは省略されています", messagesBetweenOmitted: "この閲覧位置と最新の間のメッセージは省略されています。", you: "あなた", saved: "保存済み",
|
|
@@ -57,6 +57,10 @@ export const ko = {
|
|
|
57
57
|
settings: "설정", adminAccess: "관리", adminToken: "관리 토큰", openAdministration: "관리 열기", administration: "관리", designations: "지정", adminRoom: "관리 방", targetRoom: "Agent 소속 방", adminScopeNote: "관리 방에서 Agent를 선택하세요. 관리자는 모든 방을 관리할 수 있습니다.", targetAgent: "등록된 Agent", designate: "관리자로 지정", revokeDesignation: "지정 해제", globalStatus: "전체 상태", adminTasks: "작업", taskText: "작업", dispatchTask: "작업 보내기", timers: "타이머", planName: "타이머 이름", createTimer: "타이머 만들기", tokenRequired: "서버가 액세스 토큰을 요구합니다(401).",
|
|
58
58
|
themeLabel: "테마", themeSystem: "시스템", themeLight: "라이트", themeDark: "다크", themeForest: "포레스트", themeSand: "샌드",
|
|
59
59
|
settingsLocalHint: "언어와 테마는 이 브라우저에 저장됩니다.",
|
|
60
|
+
settingsSections: "설정 섹션", settingsGeneral: "일반", settingsAppearance: "모양", settingsConnection: "연결",
|
|
61
|
+
settingsLanguageHint: "즉시 적용되며 이 브라우저에 저장됩니다.", settingsThemeHint: "이 브라우저에 저장됩니다. 시스템은 기기 설정을 따릅니다.", settingsTokenHint: "이 브라우저에만 저장됩니다. 서버에서 요구할 때만 필요합니다.",
|
|
62
|
+
contentTransition: "방 콘텐츠 전환", contentTransitionHint: "Alt+방향키로 방을 전환할 때 메시지 내용을 방향에 맞춰 슬라이드합니다. 기본값은 꺼짐입니다.",
|
|
63
|
+
pageStep: "페이지 이동 거리", pageStepHint: "PageUp 또는 PageDown을 누를 때마다 스크롤할 거리(대화 영역 높이의 백분율). 기본값 90%.",
|
|
60
64
|
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}”을(를) 삭제할까요?`,
|
|
61
65
|
leave: "나가기", reconnecting: "연결이 끊겼습니다. 다시 연결하는 중…", messageList: "메시지 목록",
|
|
62
66
|
noMessages: "아직 메시지가 없습니다. 무언가 남겨 보세요.", latestMessages: "최신 메시지로 돌아가기",
|
|
@@ -75,7 +79,7 @@ export const ko = {
|
|
|
75
79
|
shortcutsOpen: "모든 단축키",
|
|
76
80
|
shortcutsWriting: "작성", shortcutsSend: "메시지 보내기", shortcutsNewline: "줄 바꾸기",
|
|
77
81
|
shortcutsMention: "멘션할 멤버 선택", shortcutsRooms: "방",
|
|
78
|
-
shortcutsSwitchRoom: "이전 또는 다음 방으로 전환", shortcutsReading: "읽기",
|
|
82
|
+
shortcutsSwitchRoom: "이전 또는 다음 방으로 전환", shortcutsNumberRoom: "번호로 참여 중인 방으로 전환", shortcutsReading: "읽기",
|
|
79
83
|
shortcutsScroll: "입력 중에 메시지 스크롤", shortcutsJump: "대화의 시작이나 끝으로 이동", shortcutsMenus: "메뉴 및 대화 상자",
|
|
80
84
|
shortcutsClose: "열린 메뉴, 패널 또는 대화 상자 닫기",
|
|
81
85
|
earlierMessages: "이전 메시지는 생략됨", messagesBetweenOmitted: "이 읽기 지점과 최신 메시지 사이는 생략되었습니다.", you: "나", saved: "저장됨",
|
|
@@ -56,6 +56,13 @@ function decorateCodeBlock(code, app) {
|
|
|
56
56
|
block.className = "code-block";
|
|
57
57
|
pre.replaceWith(block);
|
|
58
58
|
block.append(pre, codeToolbar(code, pre, block, app));
|
|
59
|
+
// Touch screens have no hover: a tapped code block keeps focus so its toolbar stays reachable.
|
|
60
|
+
if (window.matchMedia("(pointer: coarse)").matches) {
|
|
61
|
+
block.tabIndex = 0;
|
|
62
|
+
block.addEventListener("pointerdown", (event) => {
|
|
63
|
+
if (!event.target.closest?.(".code-tool-button")) block.focus({ preventScroll: true });
|
|
64
|
+
});
|
|
65
|
+
}
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
function highlightCode(code) {
|
|
@@ -76,6 +83,8 @@ function codeToolbar(code, pre, block, app) {
|
|
|
76
83
|
wrap.setAttribute("aria-pressed", "false");
|
|
77
84
|
wrap.addEventListener("click", (event) => {
|
|
78
85
|
event.stopPropagation();
|
|
86
|
+
// A pointer click should not pin the toolbar open; hovering is enough on desktop, focus on touch.
|
|
87
|
+
if (event.detail > 0 && !matchMedia("(pointer: coarse)").matches) wrap.blur();
|
|
79
88
|
const wrapped = !block.classList.contains("is-wrapped");
|
|
80
89
|
if (wrapped) block._codeScrollLeft = pre.scrollLeft;
|
|
81
90
|
block.classList.toggle("is-wrapped", wrapped);
|
|
@@ -83,7 +92,11 @@ function codeToolbar(code, pre, block, app) {
|
|
|
83
92
|
pre.scrollLeft = wrapped ? 0 : block._codeScrollLeft || 0;
|
|
84
93
|
});
|
|
85
94
|
const copy = codeToolButton("code-copy-button", "copyMessage", app, copyIcon(), checkIcon());
|
|
86
|
-
copy.addEventListener("click", (event) => {
|
|
95
|
+
copy.addEventListener("click", (event) => {
|
|
96
|
+
event.stopPropagation();
|
|
97
|
+
if (event.detail > 0 && !matchMedia("(pointer: coarse)").matches) copy.blur();
|
|
98
|
+
void copyCode(copy, code, app);
|
|
99
|
+
});
|
|
87
100
|
toolbar.append(wrap, copy);
|
|
88
101
|
return toolbar;
|
|
89
102
|
}
|
|
@@ -11,6 +11,8 @@ export function initMembers(app) {
|
|
|
11
11
|
.map((person) => person.name));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
app.mentionExists = (name) => name === "all" || name === app.state.myName || app.mentionNames().has(name);
|
|
15
|
+
|
|
14
16
|
app.renderMembers = () => {
|
|
15
17
|
const people = app.state.room?.participants || [];
|
|
16
18
|
app.setText($("#btnMembers .action-label"), "membersCount", { count: people.length });
|
|
@@ -9,6 +9,7 @@ import { initMessagePolling } from "./message-polling.js";
|
|
|
9
9
|
export function initMessages(app) {
|
|
10
10
|
const $ = app.$;
|
|
11
11
|
installEditor($("#msgInput"));
|
|
12
|
+
$("#msgInput").isKnownMention = (name) => app.mentionExists(name);
|
|
12
13
|
|
|
13
14
|
app.autoGrow = (textarea) => {
|
|
14
15
|
const thread = $("#thread"), atBottom = Boolean(app.state.room && Math.abs(thread.scrollHeight - thread.clientHeight - thread.scrollTop) < 1);
|
|
@@ -108,6 +108,7 @@ export function initQuestions(app) {
|
|
|
108
108
|
input.setAttribute("aria-placeholder", app.t("answerPlaceholder"));
|
|
109
109
|
input.setAttribute("aria-label", app.t("answerPlaceholder"));
|
|
110
110
|
installEditor(input);
|
|
111
|
+
input.isKnownMention = (name) => app.mentionExists(name);
|
|
111
112
|
const key = `${roomId}\0${question.id}`;
|
|
112
113
|
input.draftValue = drafts.has(key) ? drafts.get(key) : questionAuthorMention(question, roomId, app);
|
|
113
114
|
input.dataset.empty = input.value ? "false" : "true";
|
|
@@ -154,12 +154,16 @@ export function initRooms(app) {
|
|
|
154
154
|
$("#msgInput").draftValue = app.state.drafts.get(roomId) || ""; app.renderReplyPreview?.();
|
|
155
155
|
app.renderFailedMessages();
|
|
156
156
|
app.autoGrow($("#msgInput"));
|
|
157
|
-
// A restored draft can resize the composer after the initial bottom
|
|
158
|
-
|
|
157
|
+
// A restored draft and late layout can resize the composer after the initial bottom
|
|
158
|
+
// pin. Keep following for a few frames instead of sampling one fragile moment.
|
|
159
|
+
let settleFrames = 0;
|
|
160
|
+
const settleBottom = () => {
|
|
159
161
|
if (app.state.room?.id !== roomId || !app.state.followBottom) return;
|
|
160
162
|
const thread = $("#thread");
|
|
161
163
|
if (thread.scrollHeight - thread.scrollTop - thread.clientHeight > 1) thread.scrollTop = thread.scrollHeight;
|
|
162
|
-
|
|
164
|
+
if (++settleFrames < 30) requestAnimationFrame(settleBottom);
|
|
165
|
+
};
|
|
166
|
+
requestAnimationFrame(settleBottom);
|
|
163
167
|
app.updateDraftCount();
|
|
164
168
|
app.updateSendState();
|
|
165
169
|
app.hideSendError();
|
|
@@ -204,12 +208,15 @@ export function initRooms(app) {
|
|
|
204
208
|
const name = pending?.name || (fromChat ? app.state.myName : $("#inName").value.trim()) || LS.name || app.t("guest");
|
|
205
209
|
const roomName = pending?.roomName || $(fromChat ? "#inRoomNameChat" : "#inRoomName").value.trim();
|
|
206
210
|
const joinPolicy = pending?.joinPolicy ?? ((fromChat ? $("#inApprovalRequiredChat").checked : $("#inApprovalRequired").checked) ? "approval" : "open");
|
|
207
|
-
if (!roomName)
|
|
211
|
+
if (!roomName) {
|
|
212
|
+
if (!fromChat) return app.showJoinError("roomNameRequired");
|
|
213
|
+
app.showCreateRoomError("roomNameRequired"); $("#inRoomNameChat").focus(); return;
|
|
214
|
+
}
|
|
208
215
|
const intent = ++app.state.navigationGeneration; invalidateRoomList();
|
|
209
216
|
app.setJoinBusy(true);
|
|
210
217
|
app.hideJoinError();
|
|
211
218
|
app.state.pendingAction = null;
|
|
212
|
-
if (fromChat) $("#btnCreateChatRoom").disabled = true;
|
|
219
|
+
if (fromChat) { app.hideCreateRoomError(); $("#btnCreateChatRoom").disabled = true; }
|
|
213
220
|
try {
|
|
214
221
|
const room = await app.api("/rooms", {
|
|
215
222
|
method: "POST",
|
|
@@ -219,18 +226,18 @@ export function initRooms(app) {
|
|
|
219
226
|
LS.name = name;
|
|
220
227
|
$("#inApprovalRequired").checked = false;
|
|
221
228
|
$("#inApprovalRequiredChat").checked = false;
|
|
222
|
-
if (fromChat) {
|
|
223
|
-
$("#inRoomNameChat").value = "";
|
|
224
|
-
$("#railRoomForm").hidden = true;
|
|
225
|
-
}
|
|
229
|
+
if (fromChat) { $("#inRoomNameChat").value = ""; app.closeCreateRoomDialog(false); }
|
|
226
230
|
app.enterRoom(room, name, intent);
|
|
227
231
|
} catch (error) {
|
|
228
232
|
if (error.status === 401) {
|
|
229
233
|
app.state.pendingAction = { type: "create", name, roomName, fromChat, joinPolicy };
|
|
230
|
-
if (fromChat) { app.openChatSettings(); app.showSendError("sendAuth"); }
|
|
234
|
+
if (fromChat) { app.closeCreateRoomDialog(false); app.openChatSettings(); app.showSendError("sendAuth"); }
|
|
231
235
|
else { app.openTokenBox(); app.showJoinError("authRetry"); }
|
|
232
|
-
} else if (fromChat) {
|
|
233
|
-
|
|
236
|
+
} else if (fromChat) {
|
|
237
|
+
if ($("#createRoomDialog")?.open) app.showCreateRoomError("createFailed", { message: error.message });
|
|
238
|
+
else app.showSendError("createFailed", { message: error.message });
|
|
239
|
+
void app.refreshRoomList();
|
|
240
|
+
} else { app.showJoinError("createFailed", { message: error.message }); void app.refreshRoomList(); }
|
|
234
241
|
} finally {
|
|
235
242
|
app.setJoinBusy(false);
|
|
236
243
|
$("#btnCreateChatRoom").disabled = false;
|
|
@@ -6,6 +6,9 @@ export function initSettings(app) {
|
|
|
6
6
|
const dialog = $("#chatSettings");
|
|
7
7
|
if (!dialog) return;
|
|
8
8
|
const tokenInput = $("#inTokenChat"), tokenHint = $("#tokenHint");
|
|
9
|
+
const contentInput = $("#inContentTransition");
|
|
10
|
+
const pageInput = $("#inPageStep");
|
|
11
|
+
const tabs = [...dialog.querySelectorAll('[role="tab"]')];
|
|
9
12
|
const scheme = matchMedia("(prefers-color-scheme: dark)");
|
|
10
13
|
let opener = null;
|
|
11
14
|
|
|
@@ -28,17 +31,48 @@ export function initSettings(app) {
|
|
|
28
31
|
app.setTheme = (value) => applyTheme(value, true);
|
|
29
32
|
app.settingsOpen = () => dialog.open;
|
|
30
33
|
|
|
34
|
+
// One tab stop for the whole tablist; arrow keys move selection like a native tab widget.
|
|
35
|
+
const activateTab = (name, { focus = false } = {}) => {
|
|
36
|
+
for (const tab of tabs) {
|
|
37
|
+
const selected = tab.dataset.settingsTab === name;
|
|
38
|
+
tab.setAttribute("aria-selected", String(selected));
|
|
39
|
+
tab.tabIndex = selected ? 0 : -1;
|
|
40
|
+
const panel = document.getElementById(tab.getAttribute("aria-controls"));
|
|
41
|
+
if (panel) panel.hidden = !selected;
|
|
42
|
+
if (selected && focus) tab.focus();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const onTabKey = (event) => {
|
|
46
|
+
const index = tabs.indexOf(event.target);
|
|
47
|
+
if (index < 0) return;
|
|
48
|
+
const step = event.key === "ArrowUp" || event.key === "ArrowLeft" ? -1 : event.key === "ArrowDown" || event.key === "ArrowRight" ? 1 : 0;
|
|
49
|
+
const target = event.key === "Home" ? 0 : event.key === "End" ? tabs.length - 1 : step ? (index + step + tabs.length) % tabs.length : -1;
|
|
50
|
+
if (target < 0) return;
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
activateTab(tabs[target].dataset.settingsTab, { focus: true });
|
|
53
|
+
};
|
|
54
|
+
for (const tab of tabs) {
|
|
55
|
+
tab.addEventListener("click", () => activateTab(tab.dataset.settingsTab));
|
|
56
|
+
tab.addEventListener("keydown", onTabKey);
|
|
57
|
+
}
|
|
58
|
+
|
|
31
59
|
const open = ({ token = false } = {}) => {
|
|
32
60
|
app.closePanels?.();
|
|
33
61
|
syncThemeInputs();
|
|
62
|
+
if (contentInput) contentInput.checked = app.LS.contentTransition;
|
|
63
|
+
if (pageInput) pageInput.value = String(app.LS.pageStep);
|
|
34
64
|
tokenInput.value = app.LS.token;
|
|
35
65
|
if (tokenHint) tokenHint.hidden = !token;
|
|
36
66
|
if (dialog.open) {
|
|
37
|
-
if (token)
|
|
67
|
+
if (token) {
|
|
68
|
+
activateTab("connection");
|
|
69
|
+
tokenInput.focus();
|
|
70
|
+
}
|
|
38
71
|
return;
|
|
39
72
|
}
|
|
40
73
|
opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
41
74
|
opener?.setAttribute("aria-expanded", "true");
|
|
75
|
+
activateTab(token ? "connection" : "general");
|
|
42
76
|
dialog.showModal();
|
|
43
77
|
(token ? tokenInput : $("#localeSelectSettings"))?.focus();
|
|
44
78
|
};
|
|
@@ -56,6 +90,11 @@ export function initSettings(app) {
|
|
|
56
90
|
dialog.addEventListener("cancel", () => opener?.setAttribute("aria-expanded", "false"));
|
|
57
91
|
dialog.addEventListener("change", (event) => {
|
|
58
92
|
if (event.target instanceof HTMLInputElement && event.target.name === "theme") app.setTheme(event.target.value);
|
|
93
|
+
if (event.target === contentInput) app.LS.contentTransition = contentInput.checked;
|
|
94
|
+
if (event.target === pageInput) {
|
|
95
|
+
app.LS.pageStep = pageInput.value;
|
|
96
|
+
pageInput.value = String(app.LS.pageStep);
|
|
97
|
+
}
|
|
59
98
|
});
|
|
60
99
|
dialog.addEventListener("close", () => {
|
|
61
100
|
const target = opener;
|
|
@@ -31,42 +31,87 @@ export function initShortcuts(app) {
|
|
|
31
31
|
dialog.addEventListener("close", () => requestAnimationFrame(() => app.focusComposer?.()));
|
|
32
32
|
let scrollFrame = 0;
|
|
33
33
|
let scrollGeneration = 0;
|
|
34
|
+
let pageTarget = null;
|
|
35
|
+
let pageFrame = 0;
|
|
34
36
|
const cancelScroll = () => {
|
|
35
37
|
cancelAnimationFrame(scrollFrame);
|
|
36
38
|
scrollFrame = 0;
|
|
37
39
|
scrollGeneration++;
|
|
38
40
|
};
|
|
41
|
+
const cancelPageScroll = () => {
|
|
42
|
+
cancelAnimationFrame(pageFrame);
|
|
43
|
+
pageFrame = 0;
|
|
44
|
+
pageTarget = null;
|
|
45
|
+
};
|
|
39
46
|
const animateScroll = (target) => {
|
|
40
|
-
if (!thread) return
|
|
41
|
-
|
|
42
|
-
const generation = scrollGeneration;
|
|
47
|
+
if (!thread) return;
|
|
48
|
+
cancelPageScroll();
|
|
43
49
|
const max = Math.max(0, thread.scrollHeight - thread.clientHeight);
|
|
44
50
|
const end = Math.max(0, Math.min(max, target));
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const reduced = matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
48
|
-
if (reduced || Math.abs(distance) < 2) {
|
|
51
|
+
if (matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
52
|
+
cancelScroll();
|
|
49
53
|
thread.scrollTop = end;
|
|
50
|
-
return
|
|
54
|
+
return;
|
|
51
55
|
}
|
|
56
|
+
cancelScroll();
|
|
57
|
+
const generation = scrollGeneration;
|
|
58
|
+
const from = thread.scrollTop;
|
|
59
|
+
const distance = end - from;
|
|
52
60
|
const duration = Math.min(300, Math.max(140, Math.abs(distance) * 0.3));
|
|
53
|
-
const
|
|
61
|
+
const start = performance.now();
|
|
54
62
|
const step = (now) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
if (generation !== scrollGeneration) {
|
|
64
|
+
scrollFrame = 0;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const progress = Math.min(1, (now - start) / duration);
|
|
68
|
+
const eased = 1 - Math.pow(1 - progress, 3);
|
|
69
|
+
thread.scrollTop = from + distance * eased;
|
|
59
70
|
if (progress < 1) scrollFrame = requestAnimationFrame(step);
|
|
71
|
+
else scrollFrame = 0;
|
|
60
72
|
};
|
|
61
73
|
scrollFrame = requestAnimationFrame(step);
|
|
62
|
-
return duration;
|
|
63
74
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
const pageScrollBy = (delta) => {
|
|
76
|
+
if (!thread) return;
|
|
77
|
+
cancelScroll();
|
|
78
|
+
const max = Math.max(0, thread.scrollHeight - thread.clientHeight);
|
|
79
|
+
const clamp = (value) => Math.max(0, Math.min(max, value));
|
|
80
|
+
if (matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
81
|
+
cancelPageScroll();
|
|
82
|
+
thread.scrollTop = clamp(thread.scrollTop + delta);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const base = pageTarget ?? thread.scrollTop;
|
|
86
|
+
pageTarget = clamp(base + delta);
|
|
87
|
+
if (pageFrame) return;
|
|
88
|
+
const step = () => {
|
|
89
|
+
if (pageTarget === null) {
|
|
90
|
+
pageFrame = 0;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const remaining = pageTarget - thread.scrollTop;
|
|
94
|
+
if (Math.abs(remaining) <= 0.6) {
|
|
95
|
+
thread.scrollTop = pageTarget;
|
|
96
|
+
pageTarget = null;
|
|
97
|
+
pageFrame = 0;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
thread.scrollTop += remaining * 0.28;
|
|
101
|
+
pageFrame = requestAnimationFrame(step);
|
|
102
|
+
};
|
|
103
|
+
pageFrame = requestAnimationFrame(step);
|
|
104
|
+
};
|
|
105
|
+
const cancelThreadScroll = () => {
|
|
106
|
+
cancelScroll();
|
|
107
|
+
cancelPageScroll();
|
|
108
|
+
};
|
|
109
|
+
app.cancelThreadScrollAnimation = cancelThreadScroll;
|
|
110
|
+
thread?.addEventListener("wheel", cancelThreadScroll, { passive: true });
|
|
111
|
+
thread?.addEventListener("touchmove", cancelThreadScroll, { passive: true });
|
|
112
|
+
thread?.addEventListener("pointerdown", cancelThreadScroll, { passive: true });
|
|
68
113
|
app.animateThreadScrollTo = animateScroll;
|
|
69
|
-
app.animateThreadScrollBy =
|
|
114
|
+
app.animateThreadScrollBy = pageScrollBy;
|
|
70
115
|
const scrollToEdge = (bottom) => {
|
|
71
116
|
if (!thread) return;
|
|
72
117
|
const reduced = matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -79,11 +124,39 @@ export function initShortcuts(app) {
|
|
|
79
124
|
animateScroll(bottom ? thread.scrollHeight : 0);
|
|
80
125
|
};
|
|
81
126
|
app.animateRoomSwitch = (direction) => {
|
|
127
|
+
// Keep the motion in the room list: a vertical glide shows where the selection moved.
|
|
128
|
+
for (const row of document.querySelectorAll("#roomList .room-row.selected, #roomListChat .room-row.selected")) {
|
|
129
|
+
row.classList.remove("room-switch-enter");
|
|
130
|
+
row.style.setProperty("--room-switch-shift", `${direction > 0 ? 6 : -6}px`);
|
|
131
|
+
void row.offsetWidth;
|
|
132
|
+
row.classList.add("room-switch-enter");
|
|
133
|
+
row.scrollIntoView({ block: "nearest" });
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
app.switchRoom = (roomId, direction) => {
|
|
82
137
|
const list = app.$("#msgList");
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
138
|
+
const transition = app.LS.contentTransition && list && !matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
139
|
+
if (!transition || app.state.contentSwitching) {
|
|
140
|
+
if (app.state.contentSwitching) return;
|
|
141
|
+
app.activateRoom(roomId);
|
|
142
|
+
app.animateRoomSwitch?.(direction);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const out = direction > 0 ? "room-content-out-next" : "room-content-out-prev";
|
|
146
|
+
const into = direction > 0 ? "room-content-in-next" : "room-content-in-prev";
|
|
147
|
+
app.state.contentSwitching = true;
|
|
148
|
+
list.classList.add(out);
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
app.activateRoom(roomId);
|
|
151
|
+
app.animateRoomSwitch?.(direction);
|
|
152
|
+
list.classList.remove(out, "room-content-in-next", "room-content-in-prev");
|
|
153
|
+
void list.offsetWidth;
|
|
154
|
+
list.classList.add(into);
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
list.classList.remove(into);
|
|
157
|
+
app.state.contentSwitching = false;
|
|
158
|
+
}, 220);
|
|
159
|
+
}, 140);
|
|
87
160
|
};
|
|
88
161
|
document.addEventListener("keydown", (event) => {
|
|
89
162
|
if (event.defaultPrevented || event.isComposing) return;
|
|
@@ -91,6 +164,23 @@ export function initShortcuts(app) {
|
|
|
91
164
|
if (document.querySelector("dialog[open]")) return;
|
|
92
165
|
if (event.key === "Home" || event.code === "Home") { event.preventDefault(); scrollToEdge(false); return; }
|
|
93
166
|
if (event.key === "End" || event.code === "End") { event.preventDefault(); scrollToEdge(true); return; }
|
|
167
|
+
const digit = /^(?:Digit|Numpad)([1-9])$/.exec(event.code)?.[1] ?? (/^[1-9]$/.test(event.key) ? event.key : null);
|
|
168
|
+
if (digit) {
|
|
169
|
+
const rows = Array.from(document.querySelectorAll("#roomListChat .room-row.joined"));
|
|
170
|
+
const target = rows[Number(digit) - 1];
|
|
171
|
+
if (!target) return;
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
const current = rows.findIndex((row) => row.dataset.roomId === app.state.room?.id);
|
|
174
|
+
const targetIndex = Number(digit) - 1;
|
|
175
|
+
if (targetIndex === current) return;
|
|
176
|
+
const direction = current < 0 || targetIndex > current ? 1 : -1;
|
|
177
|
+
const roomId = target.dataset.roomId;
|
|
178
|
+
if (roomId) {
|
|
179
|
+
if (app.switchRoom) app.switchRoom(roomId, direction);
|
|
180
|
+
else { app.activateRoom(roomId); app.animateRoomSwitch?.(direction); }
|
|
181
|
+
}
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
94
184
|
if (event.key !== "/" && event.code !== "Slash") return;
|
|
95
185
|
event.preventDefault();
|
|
96
186
|
openSheet();
|
|
@@ -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 {
|
|
@@ -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",
|
|
@@ -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} 条未读`,
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.code-block { position: relative; min-width: 0; }
|
|
13
|
+
.code-block:focus { outline: none; }
|
|
14
|
+
.code-block:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
13
15
|
|
|
14
16
|
.code-block pre {
|
|
15
17
|
margin: 0;
|
|
@@ -53,11 +55,6 @@
|
|
|
53
55
|
pointer-events: auto;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
/* Touch screens have no hover: keep the controls reachable at all times. */
|
|
57
|
-
@media (hover: none), (pointer: coarse) {
|
|
58
|
-
.code-toolbar { opacity: 1; pointer-events: auto; }
|
|
59
|
-
}
|
|
60
|
-
|
|
61
58
|
.code-tool-button {
|
|
62
59
|
display: grid;
|
|
63
60
|
place-items: center;
|
|
@@ -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,7 +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
|
+
@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,14 +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
|
|
74
|
+
/* On short windows the rail must fit its grid cell; the room list keeps one full row. */
|
|
75
75
|
@media (max-height: 560px) {
|
|
76
|
-
.rail-foot { min-height:
|
|
77
|
-
.rail-brand { margin-bottom: 14px; }
|
|
78
|
-
.rail-label { margin-bottom: 6px; }
|
|
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
79
|
#roomListChat .room-row { gap: 1px; padding: 5px 9px; }
|
|
80
80
|
#roomListChat .r-kind:empty, #roomListChat .r-meta, #roomListChat .r-preview { display: none; }
|
|
81
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
|
+
}
|
|
82
126
|
.rail-foot .anchor { width: 100%; }
|
|
83
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; }
|
|
84
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); }
|