wezard 3.0.3 → 3.0.5
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/CLAUDE.md +1 -1
- package/README.md +271 -193
- package/cli/wezard.sh +109 -12
- package/config.example.jsonc +26 -17
- package/dist/cli/audit.js +42 -25
- package/dist/cli/audit.js.map +1 -1
- package/dist/cli/ext.js +1 -1
- package/dist/cli/ext.js.map +1 -1
- package/dist/cli/init.js +4 -1
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/wx.js +3 -0
- package/dist/cli/wx.js.map +1 -1
- package/dist/daemon/approval.js +11 -10
- package/dist/daemon/approval.js.map +1 -1
- package/dist/daemon/audit.js +12 -0
- package/dist/daemon/audit.js.map +1 -1
- package/dist/daemon/bg-tasks.js +74 -0
- package/dist/daemon/bg-tasks.js.map +1 -0
- package/dist/daemon/channel-context.js +2 -2
- package/dist/daemon/channel-context.js.map +1 -1
- package/dist/daemon/channel-newpost.js +88 -0
- package/dist/daemon/channel-newpost.js.map +1 -0
- package/dist/daemon/channel-onboarding.js +27 -31
- package/dist/daemon/channel-onboarding.js.map +1 -1
- package/dist/daemon/channel-posts.js +51 -8
- package/dist/daemon/channel-posts.js.map +1 -1
- package/dist/daemon/channel-rebind.js +4 -5
- package/dist/daemon/channel-rebind.js.map +1 -1
- package/dist/daemon/channel.js +79 -35
- package/dist/daemon/channel.js.map +1 -1
- package/dist/daemon/danger-scrub.js +18 -1
- package/dist/daemon/danger-scrub.js.map +1 -1
- package/dist/daemon/danger-workspace.js +177 -0
- package/dist/daemon/danger-workspace.js.map +1 -0
- package/dist/daemon/danger.js +293 -23
- package/dist/daemon/danger.js.map +1 -1
- package/dist/daemon/detail.js +1 -0
- package/dist/daemon/detail.js.map +1 -1
- package/dist/daemon/handoff.js +27 -10
- package/dist/daemon/handoff.js.map +1 -1
- package/dist/daemon/http.js +15 -3
- package/dist/daemon/http.js.map +1 -1
- package/dist/daemon/inbound.js +36 -7
- package/dist/daemon/inbound.js.map +1 -1
- package/dist/daemon/index.js +584 -343
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/loop-lag.js +39 -0
- package/dist/daemon/loop-lag.js.map +1 -0
- package/dist/daemon/mcp-http.js +3 -0
- package/dist/daemon/mcp-http.js.map +1 -1
- package/dist/daemon/mirror-bridge.js +163 -48
- package/dist/daemon/mirror-bridge.js.map +1 -1
- package/dist/daemon/onboarding.js +25 -8
- package/dist/daemon/onboarding.js.map +1 -1
- package/dist/daemon/peers.js +61 -12
- package/dist/daemon/peers.js.map +1 -1
- package/dist/daemon/quota.js +1 -1
- package/dist/daemon/quota.js.map +1 -1
- package/dist/daemon/room-archive.js +189 -0
- package/dist/daemon/room-archive.js.map +1 -0
- package/dist/daemon/room-bind.js +16 -109
- package/dist/daemon/room-bind.js.map +1 -1
- package/dist/daemon/room-facts.js +2 -1
- package/dist/daemon/room-facts.js.map +1 -1
- package/dist/daemon/room-hub.js +65 -10
- package/dist/daemon/room-hub.js.map +1 -1
- package/dist/daemon/room-watchdog.js +4 -0
- package/dist/daemon/room-watchdog.js.map +1 -1
- package/dist/daemon/rooms.js +203 -11
- package/dist/daemon/rooms.js.map +1 -1
- package/dist/daemon/spawn-tmux.js +41 -21
- package/dist/daemon/spawn-tmux.js.map +1 -1
- package/dist/daemon/steward-model.js +19 -4
- package/dist/daemon/steward-model.js.map +1 -1
- package/dist/daemon/steward.js +12 -0
- package/dist/daemon/steward.js.map +1 -1
- package/dist/daemon/store-metrics.js +124 -0
- package/dist/daemon/store-metrics.js.map +1 -0
- package/dist/daemon/tool-latency.js +24 -0
- package/dist/daemon/tool-latency.js.map +1 -0
- package/dist/daemon/wezard-session.js +1 -1
- package/dist/daemon/wezard-session.js.map +1 -1
- package/dist/daemon/wizard.js +4 -4
- package/dist/daemon/wizard.js.map +1 -1
- package/dist/daemon/zombie-panes.js +216 -0
- package/dist/daemon/zombie-panes.js.map +1 -0
- package/dist/mcp/tools.js +20 -17
- package/dist/mcp/tools.js.map +1 -1
- package/dist/shared/chat-http.js +8 -4
- package/dist/shared/chat-http.js.map +1 -1
- package/dist/shared/cli-backends.js +13 -1
- package/dist/shared/cli-backends.js.map +1 -1
- package/dist/shared/config.js +45 -8
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/daemon-client.js +13 -2
- package/dist/shared/daemon-client.js.map +1 -1
- package/dist/shared/external.js +0 -1
- package/dist/shared/external.js.map +1 -1
- package/dist/shared/group-members.js +2 -1
- package/dist/shared/group-members.js.map +1 -1
- package/dist/shared/log.js +76 -5
- package/dist/shared/log.js.map +1 -1
- package/dist/shared/mention-filter.js +63 -0
- package/dist/shared/mention-filter.js.map +1 -0
- package/dist/shared/room-view.js +32 -2
- package/dist/shared/room-view.js.map +1 -1
- package/dist/shared/room.js +12 -3
- package/dist/shared/room.js.map +1 -1
- package/dist/shared/session-hooks.js +1 -1
- package/dist/shared/session-hooks.js.map +1 -1
- package/dist/shared/topic-room.js +23 -0
- package/dist/shared/topic-room.js.map +1 -0
- package/dist/shared/workspace-trust.js +88 -2
- package/dist/shared/workspace-trust.js.map +1 -1
- package/dist/shared/world.js.map +1 -1
- package/dist/svr/index.js +3 -37
- package/dist/svr/index.js.map +1 -1
- package/dist/svr/room-reader.js +140 -0
- package/dist/svr/room-reader.js.map +1 -0
- package/hooks/pre-tool-use.sh +2 -0
- package/package.json +1 -1
- package/web/chat.js +314 -45
package/web/chat.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
var convsEl = $('#convs'), thread = $('#thread'), inner = $('#thread-in');
|
|
23
23
|
var gside = $('#gside'), chWho = $('#ch-who'), chActs = $('#ch-acts');
|
|
24
24
|
|
|
25
|
-
var W = { at: 0, rooms: [], nodes: [], uidTargets: {}, chatNames: {}, names: {}, degraded: false };
|
|
25
|
+
var W = { at: 0, rooms: [], nodes: [], channels: [], uidTargets: {}, chatNames: {}, names: {}, degraded: false };
|
|
26
26
|
var D = { mode: '', roomId: '', role: '', uid: '', at: 0, msgs: [], notes: [], total: 0, earlier: '', room: null, label: '', members: [], duties: [], verdicts: {}, wizard: null, sessions: [], session: 'all', ledger: true, plans: [], schedules: [], charterBrief: null, stream: null, streamOld: [], streamMore: false, streamSess: '', streamSig: '', stats: null };
|
|
27
27
|
var S = { openTurns: {}, charter: null, sim: null, gsig: '', gmap: null, elById: null, lines: null, view: 'list' };
|
|
28
28
|
var SIDE_KEY = 'wezard.role.side';
|
|
@@ -188,6 +188,30 @@
|
|
|
188
188
|
if (ns.length === 2) return ns.join(' ↔ ');
|
|
189
189
|
return ns.slice(0, 3).join('·') + (ns.length > 3 ? ' 等' + ns.length + '人' : '');
|
|
190
190
|
};
|
|
191
|
+
// 图上的频道名四级: 服务端真名 (channels[].name / 频道 room 的人起 title) > chatNames['chat:<id>']
|
|
192
|
+
// 的兜底名 (cwd 仓目录名, 有信息量: 频道就是这个项目) > id 前 8 位。写 wrc.channel.name 就落在第一级。
|
|
193
|
+
var channelName = function (id, name) {
|
|
194
|
+
var real = name && name !== 'chat:' + id ? name : '';
|
|
195
|
+
var auto = W.chatNames['chat:' + id] || '';
|
|
196
|
+
return real || (auto && auto !== 'chat:' + id ? auto : String(id).slice(0, 8));
|
|
197
|
+
};
|
|
198
|
+
// 帖子 room 的帖号尾 6 位: 新 id `topic:<T>/<P>` 从 id 读, 旧 `chat:<opk>` 帖子 room 用服务端给的 rootPost。
|
|
199
|
+
var postTail = function (r) {
|
|
200
|
+
var m = /^topic:[^/]+\/(.+)$/.exec(r.id);
|
|
201
|
+
return String(r.rootPost || (m && m[1]) || r.id).slice(-6);
|
|
202
|
+
};
|
|
203
|
+
// 帖子 room 的可读名: 频道名已在频道框标题 / 侧栏分组上, 这里不再重复「频道名 · 帖 xxxxxx」, 改显示第一条人话的缩略 (服务端 r.firstAsk, 读账本算);
|
|
204
|
+
// 取不到 (还没人说过话 / 旧服务端) 退回「帖 xxxxxx」。显式 title / 旧的聊天名仍然优先 (topicBase 的前两项)。
|
|
205
|
+
// firstAsk 排在自动聊天名之前: 帖子 room 的 chatNames 是从频道 / 工作目录派生的自动名 (形如「cc-wecom」), 会把首条人话挡住。
|
|
206
|
+
var topicBase = function (r) { return r.title || r.firstAsk || W.chatNames[r.id] || ('帖 ' + postTail(r)); };
|
|
207
|
+
// 同一频道里两个帖子撞名 (比如同一句话开了两帖) 时追加「· 帖xxxxxx」消歧; 不撞名不追加。
|
|
208
|
+
var topicName = function (r) {
|
|
209
|
+
var b = topicBase(r);
|
|
210
|
+
var dup = (W.rooms || []).some(function (o) { return o.id !== r.id && o.kind === 'topic-post' && o.channel && r.channel && o.channel.id === r.channel.id && topicBase(o) === b; });
|
|
211
|
+
// 撞名时只追加帖号, 正文原样保留 (不压到 8 字): 首条人话开头若是日志名 / 文件名这种长 token,
|
|
212
|
+
// 8 字截断后 (「wecom-ag…」) 读起来就像个自动名, 正是「名字不是用户说的第一句」的观感。
|
|
213
|
+
return dup ? b + ' · 帖' + postTail(r) : b;
|
|
214
|
+
};
|
|
191
215
|
var shortRoom = function (id) {
|
|
192
216
|
var s = String(id || '');
|
|
193
217
|
var kind = /^user:/.test(s) ? '单聊' : /^chat:wx/.test(s) ? '微信' : /^(?:dm|adhoc):/.test(s) ? 'room' : '群';
|
|
@@ -206,6 +230,7 @@
|
|
|
206
230
|
* 绑定的群没起名也没有聊天名时不拿成员拼 (成员是侧栏的事), 只给短代号。 */
|
|
207
231
|
var roomNameOf = function (r, fallback) {
|
|
208
232
|
if (!r) return fallback || shortRoom(fallback);
|
|
233
|
+
if (r.kind === 'topic-post' && r.channel) return topicName(r);
|
|
209
234
|
if (r.title) return r.title;
|
|
210
235
|
if (W.chatNames[r.id]) return W.chatNames[r.id];
|
|
211
236
|
return (/^(?:dm|adhoc):/.test(r.id) && memberNames(r)) || shortRoom(r.id);
|
|
@@ -213,7 +238,9 @@
|
|
|
213
238
|
var roomLabelOf = function (r) {
|
|
214
239
|
return r ? roomNameOf(r, r.label) : '';
|
|
215
240
|
};
|
|
216
|
-
//
|
|
241
|
+
// 帖子 (topic-post) 的图标: 全站单一来源 (roomIcon / roomIconOf / 图例), 换图标只改这里。
|
|
242
|
+
var POST_ICON = '📄';
|
|
243
|
+
// room 图标: 多人群聊 👥 / 人与 wizard 的单聊 💬 / 频道 #️⃣ / 帖子 📄 / 只有 wizard 的 room 🧙 (与 wizard 默认头像同一个 emoji)。
|
|
217
244
|
// 先分「有没有人参与」(isPeopleRoom, 与列表的「群聊 / 会话」分组、搜索的 group 同一口径: 绑定企微 / topic / 微信的 room 不管有没有人发过话都算有人);
|
|
218
245
|
// 频道 (channel) 与帖子 (topic-post) 各有一个专属图标, 与群聊 / 单聊一眼分开 —— 它们是传输形态, 比成员数更能说明「这是什么 room」。
|
|
219
246
|
// 其余有人的再分单聊 / 群聊: 单聊 = 恰好两位参与者、其中一位是人、且不是企微群 / topic 帖 (即绑定的 wecom-dm 那种: 一个人 + 一个 wizard) —— 这是唯一保留 💬 的特例;
|
|
@@ -226,14 +253,14 @@
|
|
|
226
253
|
var roomIcon = function (r) {
|
|
227
254
|
if (!isPeopleRoom(r)) return '🧙';
|
|
228
255
|
if (r.kind === 'channel') return '#️⃣';
|
|
229
|
-
if (r.kind === 'topic-post') return
|
|
256
|
+
if (r.kind === 'topic-post') return POST_ICON;
|
|
230
257
|
return isSoloChat(r) ? '💬' : '👥';
|
|
231
258
|
};
|
|
232
259
|
// 搜索命中带 id + group (+ kind): 能在 W.rooms 里找到就走同一套, 找不到 (没拉到的老 room) 按 kind / group 退回。
|
|
233
260
|
var roomIconOf = function (id, group, kind) {
|
|
234
261
|
var r = roomById(id);
|
|
235
262
|
if (r) return roomIcon(r);
|
|
236
|
-
return kind === 'channel' ? '#️⃣' : kind === 'topic-post' ?
|
|
263
|
+
return kind === 'channel' ? '#️⃣' : kind === 'topic-post' ? POST_ICON : group ? '👥' : '🧙';
|
|
237
264
|
};
|
|
238
265
|
var KIND_WORD = { 'wecom-group': '企微群', 'wecom-dm': '企微单聊', channel: '频道', 'topic-post': '帖子', wx: '微信', dm: 'wizard 两人会话', adhoc: '临时多人 room' };
|
|
239
266
|
var roomKindWord = function (r) { return (isPeopleRoom(r) ? '群聊' : '会话') + ' · ' + (KIND_WORD[r.kind] || r.kind || ''); };
|
|
@@ -244,6 +271,7 @@
|
|
|
244
271
|
var seen = {};
|
|
245
272
|
(rooms || []).forEach(function (r) {
|
|
246
273
|
(r.members || []).forEach(function (m) {
|
|
274
|
+
if (m.role === 'monitor') return; // monitor 不上图: 只在频道框标题的 👁 chip 里露面 (侧栏成员列表照旧列出)
|
|
247
275
|
var id = nodeIdOf(m.who);
|
|
248
276
|
if (id) seen[id] = true;
|
|
249
277
|
});
|
|
@@ -262,8 +290,10 @@
|
|
|
262
290
|
// 其余只改样式 / 文字 —— 不整图重建、不重排; 只有节点或边真的增减才给模拟补一点热量。
|
|
263
291
|
// 有人 (human) 的 room 始终画 room 节点; 只有恰好两个 wizard 才收成直连线。
|
|
264
292
|
var directPair = function (r, people) {
|
|
293
|
+
if (r.channel) return null; // 频道名下的 room (帖子 / 存档) 必须留成 room 节点: 它要被画进频道框, 收成直连线就出框了
|
|
265
294
|
var ids = {}, human = false;
|
|
266
295
|
(r.members || []).forEach(function (m) {
|
|
296
|
+
if (m.role === 'monitor') return; // monitor 不是图上节点, 也就不参与「两人 wizard 收成直连线」的判断
|
|
267
297
|
var id = nodeIdOf(m.who);
|
|
268
298
|
if (!id) return;
|
|
269
299
|
ids[id] = true;
|
|
@@ -358,43 +388,114 @@
|
|
|
358
388
|
var smartsWord = function (sm) { var e = eduOf(sm); return e ? e[0] + ' ' + e[1] + ' · 档位 ' + sm.tier + (sm.note ? ' · 模型 ' + sm.note : '') : ''; };
|
|
359
389
|
// 没有档位就说「档位未知」并带上实际模型 —— 不猜档位。
|
|
360
390
|
var smartsTip = function (nd) { return smartsWord(nd && nd.smarts) || (nd && nd.model ? '档位未知 · 模型 ' + nd.model : '档位未知'); };
|
|
391
|
+
// 图上 room 胶囊里的字: 帖子 room 在频道框里, 名字本来就不带频道名 (见 topicName); 完整名在 tooltip。
|
|
392
|
+
// 旧的频道 room (kind=channel) 现在只是只读存档, 名字前冠「存档 · 」(再配 .arch 的弱化样式)。
|
|
393
|
+
var graphLabel = function (r) {
|
|
394
|
+
var l = roomLabelOf(r);
|
|
395
|
+
return r.kind === 'channel' ? '存档 · ' + l : l;
|
|
396
|
+
};
|
|
397
|
+
// ── 频道框 ──
|
|
398
|
+
// 频道不是 room, 但图上要把它名下的 room (topic room / 旧帖子 room / 存档频道 room) 框在一起。框 = 每个在**这个窗口里真有 room** 的频道一个
|
|
399
|
+
// (窗口内一个 room 都没有的频道整框不出, 连标题一起隐藏); 里面只装「窗口内画出来的」room; 人 (wizard / 用户) 不进框, 布局时被推到框外。框不是节点: 它由一个看不见的 hub 节点 (id `c:<topic_id>`, 用虚拟边连着框内每个 room) 把
|
|
400
|
+
// 一个频道的 room 聚在一起, 再按框内 room 的包围盒现算矩形 (gFrameBox); hub 不画、不参与碰撞, 虚拟边 (virt) 不画、不参与交叉 / 让点。
|
|
401
|
+
var channelFrames = function (rooms) {
|
|
402
|
+
var by = {}, order = [];
|
|
403
|
+
var touch = function (id, name, host) {
|
|
404
|
+
if (!by[id]) { by[id] = { id: 'c:' + id, cid: id, name: '', host: null, rooms: [] }; order.push(id); }
|
|
405
|
+
var f = by[id];
|
|
406
|
+
// 服务端的原始占位 (`chat:<id>`) 不算名字: 后面哪个来源有真名就用它。
|
|
407
|
+
if (name && name !== 'chat:' + id && (!f.name || f.name === 'chat:' + id)) f.name = name;
|
|
408
|
+
if (host && !f.host) f.host = host;
|
|
409
|
+
return f;
|
|
410
|
+
};
|
|
411
|
+
(W.channels || []).forEach(function (c) { touch(c.id, c.name, c.host); });
|
|
412
|
+
// room.channel.name 是读时算的 (可能已掺进 chatNames 的 cwd 自动名): 只把频道**自己那个 room 的人起 title**
|
|
413
|
+
// 当名字用 (room_name 过的才算人起的名字); 帖子 room 的 title 是帖子名, 不能拿来命名频道。
|
|
414
|
+
rooms.forEach(function (r) { if (r.channel && r.channel.id) touch(r.channel.id, r.kind === 'channel' ? r.title : '', r.channel.host).rooms.push(r.id); });
|
|
415
|
+
return order.filter(function (id) { return by[id].rooms.length; }).sort().map(function (id) {
|
|
416
|
+
var f = by[id]; f.name = channelName(f.cid, f.name);
|
|
417
|
+
// 框标题里的 👁 monitor: 框内各 room 的 perceptron 成员 (role=monitor), 按 target 去重 —— 同一个 monitor 服务本频道多个帖也只出现一次。
|
|
418
|
+
var seen = {};
|
|
419
|
+
f.mons = [];
|
|
420
|
+
f.rooms.forEach(function (rid) {
|
|
421
|
+
var r = roomById(rid);
|
|
422
|
+
((r && r.members) || []).forEach(function (m) {
|
|
423
|
+
if (m.role !== 'monitor' || !m.who) return;
|
|
424
|
+
var t = nodeIdOf(m.who);
|
|
425
|
+
if (!t || seen[t]) return;
|
|
426
|
+
seen[t] = true;
|
|
427
|
+
f.mons.push({ target: t, name: m.name || nodeOf(t).name });
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
return f;
|
|
431
|
+
});
|
|
432
|
+
};
|
|
433
|
+
// 文字宽的估值 (12px 粗体): 汉字 / 全角 12.5, emoji 15, 其余 7。
|
|
434
|
+
var textW = function (t) {
|
|
435
|
+
return Array.from(String(t)).reduce(function (w, ch) { var c = ch.codePointAt(0); return w + (c > 0xffff ? 15 : c >= 0x2e80 ? 12.5 : 7); }, 0);
|
|
436
|
+
};
|
|
437
|
+
var clipText = function (t, n) { t = String(t); return t.length > n ? t.slice(0, n - 1) + '…' : t; };
|
|
438
|
+
// 框的标题: 频道名 + 🎩 host 名 (没绑 host 显示「未绑 host」) + 👁 monitor 名 (框内 room 的 perceptron, 去重; 没有就不出这段); 窄屏截得更短。w = 标题像素宽 (含 monitor 段, 框宽 minW 按它兜底)。
|
|
439
|
+
var frameTitle = function (f) {
|
|
440
|
+
var narrow = (panelBox().w || 332) <= 420;
|
|
441
|
+
var name = clipText(f.name, narrow ? 8 : 14);
|
|
442
|
+
var host = f.host && f.host.name ? clipText(f.host.name, narrow ? 7 : 12) : '';
|
|
443
|
+
var tail = host ? ' · 🎩 ' + host : ' · 未绑 host';
|
|
444
|
+
var mons = (f.mons || []).map(function (m) { return { target: m.target, text: ' · 👁 ' + clipText(m.name, narrow ? 7 : 12) }; });
|
|
445
|
+
return { name: name, tail: tail, bound: !!host, mons: mons, w: textW(name + tail + mons.map(function (m) { return m.text; }).join('')) };
|
|
446
|
+
};
|
|
447
|
+
var FR_PAD = 12, FR_HEAD = 26; // 框离框内 room 的边距 / 顶部标题条高
|
|
448
|
+
// 框的矩形: 框内 room 的包围盒 (胶囊 ±3 / ±16) 外扩 FR_PAD, 顶上多留标题条, 宽不小于标题 (框一定有 room: 空频道不出框)。
|
|
449
|
+
// X / Y 把布局坐标映成屏幕坐标 (布局里传恒等), 边距是固定像素, 不随视野缩放。
|
|
450
|
+
var gFrameBox = function (f, X, Y) {
|
|
451
|
+
var minW = frameTitle(f).w + 24;
|
|
452
|
+
var x0 = 1e9, x1 = -1e9, y0 = 1e9, y1 = -1e9;
|
|
453
|
+
f.nodes.forEach(function (p) {
|
|
454
|
+
var hw = p.w / 2 + 3, x = X(p), y = Y(p);
|
|
455
|
+
x0 = Math.min(x0, x - hw); x1 = Math.max(x1, x + hw); y0 = Math.min(y0, y - 16); y1 = Math.max(y1, y + 16);
|
|
456
|
+
});
|
|
457
|
+
x0 -= FR_PAD; x1 += FR_PAD; y0 -= FR_PAD + FR_HEAD; y1 += FR_PAD;
|
|
458
|
+
return { x0: x0, x1: Math.max(x1, x0 + minW), y0: y0, y1: y1 };
|
|
459
|
+
};
|
|
361
460
|
// 这一轮想画的图 (纯数据, 不碰坐标): 节点 + 边, 边按身份去重。
|
|
362
461
|
var graphModel = function (rooms, people, directs) {
|
|
363
462
|
var nodes = [], links = [], seen = {}, have = {};
|
|
364
463
|
rooms.forEach(function (r) {
|
|
365
464
|
// 胶囊宽按 13px 字估: 图标 + 名字 (最多 gNameMax 个字) 每字 ~7.6px (= 16px 字时的 9.3px × 13/16), 两侧各留 8。
|
|
366
465
|
// 选中的 room 名字加粗 (见 CSS .rv-room.on > text), 每字再宽 ~16%, 胶囊跟着撑开, 免得字溢出边框、压到两侧 chevron。
|
|
367
|
-
var
|
|
368
|
-
|
|
466
|
+
var label = graphLabel(r);
|
|
467
|
+
var w = Math.max(64, 36 + Math.min(gRoomMax() + 1, label.length + (r.kind === 'channel' ? 2 : 0)) * (!!D.roomId && D.roomId === r.id ? 8.8 : 7.6)); // 存档 room 的「存档 · 」是全角字, 多留两字
|
|
468
|
+
nodes.push({ id: 'r:' + r.id, ref: r, label: label, isRoom: true, w: w, r: Math.max(w, 22) / 2 });
|
|
369
469
|
});
|
|
370
470
|
people.forEach(function (p) {
|
|
371
471
|
have['p:' + p.target] = true;
|
|
372
472
|
nodes.push({ id: 'p:' + p.target, ref: p, isRoom: false, w: 0, r: nodeR(p) });
|
|
373
473
|
});
|
|
374
474
|
var add = function (l) { if (!seen[l.key]) { seen[l.key] = true; links.push(l); } };
|
|
375
|
-
var roomIds = {};
|
|
376
|
-
rooms.forEach(function (r) { roomIds['r:' + r.id] = true; });
|
|
377
475
|
rooms.forEach(function (r) {
|
|
378
476
|
(r.members || []).forEach(function (m) {
|
|
379
477
|
var pid = 'p:' + nodeIdOf(m.who);
|
|
380
478
|
// host 边方向 = room → host (线从 room 出发, 箭头落在 host 的圆点边上); 普通成员边无向、同样粗细。
|
|
381
|
-
// monitor
|
|
382
|
-
if (have[pid]) add({ key: 'm|' + r.id + '|' + pid, a: 'r:' + r.id, b: pid, room: r.id, host: !!m.host
|
|
479
|
+
// monitor 没有节点 (见 participants), 这里也就画不出它的边。
|
|
480
|
+
if (have[pid]) add({ key: 'm|' + r.id + '|' + pid, a: 'r:' + r.id, b: pid, room: r.id, host: !!m.host });
|
|
383
481
|
});
|
|
384
482
|
});
|
|
385
|
-
//
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
483
|
+
// 频道框: 每个频道一个 hub + 连向框内各 room 的虚拟边 (不画)。归属由框表达, 不再有「帖子 → 频道 room」的弱连线。
|
|
484
|
+
var frames = channelFrames(rooms);
|
|
485
|
+
frames.forEach(function (f) {
|
|
486
|
+
nodes.push({ id: f.id, hub: true, ref: f, isRoom: false, w: 0, r: 0 });
|
|
487
|
+
f.rooms.forEach(function (rid) { add({ key: 'f|' + f.id + '|' + rid, a: f.id, b: 'r:' + rid, room: rid, virt: true }); });
|
|
389
488
|
});
|
|
489
|
+
// 框与框之间再串一条虚拟边: 否则没有真实边连着的框 (只有孤立 host 的频道) 会被当成不连通块甩到图的远处。
|
|
490
|
+
frames.forEach(function (f, i) { if (i) add({ key: 'f|' + frames[i - 1].id + '|' + f.id, a: frames[i - 1].id, b: f.id, room: '', virt: true }); });
|
|
390
491
|
// 节点级 host: 在任一 room 里是 host 就戴礼帽 (边上不再有箭头)。
|
|
391
|
-
var hostIds = {}
|
|
392
|
-
links.forEach(function (l) { if (l.host) hostIds[l.b] = true;
|
|
393
|
-
nodes.forEach(function (n) { if (hostIds[n.id]) n.host = true;
|
|
492
|
+
var hostIds = {};
|
|
493
|
+
links.forEach(function (l) { if (l.host) hostIds[l.b] = true; });
|
|
494
|
+
nodes.forEach(function (n) { if (hostIds[n.id]) n.host = true; });
|
|
394
495
|
(directs || []).forEach(function (d) {
|
|
395
496
|
add({ key: 'd|' + d.room.id, a: 'p:' + d.pair[0], b: 'p:' + d.pair[1], room: d.room.id, direct: true, unread: unreadOf(d.room) > 0 });
|
|
396
497
|
});
|
|
397
|
-
return { nodes: nodes, links: links };
|
|
498
|
+
return { nodes: nodes, links: links, frames: frames };
|
|
398
499
|
};
|
|
399
500
|
// 把 model 并进常驻节点表: 已有的沿用对象 (坐标 / 速度 / 钉子都在), 新的落在已就位邻居的旁边。
|
|
400
501
|
// 图所在面板的尺寸: 每次 reconcile / viewBox 都现读 clientWidth 会把刚改的 DOM 强制同步排版一遍 (点 room 一次两趟, 24~116ms)。
|
|
@@ -417,7 +518,7 @@
|
|
|
417
518
|
model.links.forEach(function (l) { (nb[l.a] = nb[l.a] || []).push(l.b); (nb[l.b] = nb[l.b] || []).push(l.a); });
|
|
418
519
|
model.nodes.forEach(function (n) {
|
|
419
520
|
var o = old[n.id];
|
|
420
|
-
if (o) { o.ref = n.ref; o.w = n.w; o.r = n.r; next[n.id] = o; } else { next[n.id] = n; fresh.push(n); }
|
|
521
|
+
if (o) { o.ref = n.ref; o.label = n.label; o.w = n.w; o.r = n.r; next[n.id] = o; } else { next[n.id] = n; fresh.push(n); }
|
|
421
522
|
});
|
|
422
523
|
var panelW = Math.max(240, (panelBox().w || 332) - 12);
|
|
423
524
|
var panelH = Math.max(300, (panelBox().h || 620) - 30);
|
|
@@ -438,7 +539,15 @@
|
|
|
438
539
|
var lsig = links.map(function (l) { return l.key; }).sort().join(',');
|
|
439
540
|
var changed = fresh.length > 0 || gone > 0 || lsig !== S.glsig;
|
|
440
541
|
S.glsig = lsig;
|
|
441
|
-
|
|
542
|
+
// 框: 每轮的 frame 对象是新的, 把 hub / 框内 room 解析成常驻节点 (坐标在节点上)。
|
|
543
|
+
var frames = (model.frames || []).map(function (f) {
|
|
544
|
+
f.hub = next[f.id];
|
|
545
|
+
f.nodes = f.rooms.map(function (rid) { return next['r:' + rid]; }).filter(Boolean);
|
|
546
|
+
f.set = {};
|
|
547
|
+
f.nodes.forEach(function (n) { f.set[n.id] = true; });
|
|
548
|
+
return f;
|
|
549
|
+
});
|
|
550
|
+
return { g: { nodes: model.nodes.map(function (n) { return next[n.id]; }), links: links, frames: frames, hw: hw, hh: hh }, changed: changed };
|
|
442
551
|
};
|
|
443
552
|
// 布局 = stress majorization (局部 SMACOF, 即 Graphviz neato 的做法): 任意两点的目标距离 = 图上的带权最短路,
|
|
444
553
|
// 每一步把每个点挪到「让它与所有点的距离最接近目标」的位置 (权 1/d², 近处的关系说了算)。比之前的
|
|
@@ -449,12 +558,14 @@
|
|
|
449
558
|
var gDeg = function (g) {
|
|
450
559
|
if (g._deg) return g._deg;
|
|
451
560
|
var d = {};
|
|
452
|
-
g.links.forEach(function (l) { d[l.s.id] = (d[l.s.id] || 0) + 1; d[l.t.id] = (d[l.t.id] || 0) + 1; });
|
|
561
|
+
g.links.forEach(function (l) { if (l.virt) return; d[l.s.id] = (d[l.s.id] || 0) + 1; d[l.t.id] = (d[l.t.id] || 0) + 1; });
|
|
453
562
|
return (g._deg = d);
|
|
454
563
|
};
|
|
455
564
|
// 边的目标长度: 枢纽的边要长到一圈放得下它所有的邻居 (每个邻居约占 44px 弧长, 名字上下错开), 否则叶子只能叠在一起;
|
|
456
565
|
// room 胶囊比圆点宽, 边从胶囊中心出发, 补上胶囊的半宽; host 边略短, 让 host 贴着自己的 room。
|
|
457
566
|
var gLen = function (g, l) {
|
|
567
|
+
// 框内 room 到 hub 的虚拟边: 短, 让一个频道的 room 聚成一团 (不随间距倍数放大, 框才紧凑)。
|
|
568
|
+
if (l.virt) return l.s.isRoom || l.t.isRoom ? (l.s.isRoom ? l.s : l.t).w * 0.3 + 28 : 120;
|
|
458
569
|
var dg = gDeg(g), m = Math.max(dg[l.s.id] || 1, dg[l.t.id] || 1);
|
|
459
570
|
var ex = (l.s.isRoom ? l.s.w / 2 - 10 : 0) + (l.t.isRoom ? l.t.w / 2 - 10 : 0);
|
|
460
571
|
return (Math.max(GK, m * 44 / (2 * Math.PI)) * (l.host ? 0.85 : 1) + ex) * (S.gs || 1);
|
|
@@ -494,6 +605,7 @@
|
|
|
494
605
|
var gRoomMax = function () { return gNameMax() + 5; };
|
|
495
606
|
// 包围盒 [半宽, 半高, 中心下移] (像素): 人 = 圆点 + 下方名字, 圆点上方留 4 (选中环 / 视角箭头在左右); room = 胶囊。
|
|
496
607
|
var gBox = function (p) {
|
|
608
|
+
if (p.hub) return [0, 0, 0];
|
|
497
609
|
if (p.isRoom) return [p.w / 2 + 3, 16, 0];
|
|
498
610
|
var hw = Math.max(p.r + 12, Math.min(gNameMax(), String((p.ref && p.ref.name) || '').length) * 0.29 * GFS + 3);
|
|
499
611
|
var top = p.r + 4, bot = p.r + 5 + GFS;
|
|
@@ -515,6 +627,41 @@
|
|
|
515
627
|
else { var my = oy * s * (dy < 0 ? -1 : 1); p.y -= my * wp; q.y += my * (1 - wp); }
|
|
516
628
|
}
|
|
517
629
|
};
|
|
630
|
+
// 框的碰撞 (只在有频道框时): ① 不属于某框的节点 (别的 room / 人 / wizard) 的包围盒压进了这个框, 沿「出框最近」的方向推出去 (被钉住的不动);
|
|
631
|
+
// ② 两个框的矩形相交, 沿穿透最浅的轴把两边框内的 room 各退一半。框没有自己的坐标, 矩形每步由框内 room 现算 (gFrameBox)。
|
|
632
|
+
var gFrameCollide = function (g, s) {
|
|
633
|
+
var fs = g.frames;
|
|
634
|
+
if (!fs || !fs.length) return;
|
|
635
|
+
var ix = function (p) { return p.x; }, iy = function (p) { return p.y; };
|
|
636
|
+
var rs = fs.map(function (f) { return gFrameBox(f, ix, iy); });
|
|
637
|
+
// 视野缩到 1 以下 (窄屏塞频道框) 时, 节点形状 (圆的半径 / 名字宽度) 不跟着缩: 判「压进框」要按屏幕尺寸
|
|
638
|
+
// 把节点包围盒放大 1/k, 否则框边会切掉一点圆点 (图上看是人贴/压在虚线上)。
|
|
639
|
+
var vk = Math.max(0.5, Math.min(1, (S.gvNow && S.gvNow.k) || 1)), ik = 1 / vk;
|
|
640
|
+
fs.forEach(function (f, i) {
|
|
641
|
+
var R = rs[i];
|
|
642
|
+
g.nodes.forEach(function (p) {
|
|
643
|
+
if (p.hub || p.fx != null || f.set[p.id]) return;
|
|
644
|
+
var b = gBox(p), cy = p.y + b[2], l = p.x - b[0] * ik, r = p.x + b[0] * ik, t = cy - b[1] * ik, d = cy + b[1] * ik;
|
|
645
|
+
if (r <= R.x0 || l >= R.x1 || d <= R.y0 || t >= R.y1) return;
|
|
646
|
+
// 只推到框边 (m = 穿透), 不额外加固定 10px 空隙: 加了它会每帧过冲 —— 这一帧被推出框 10px, 下一帧 gCollide
|
|
647
|
+
// 把邻居推回来又被整段推出 20px, 60fps 下就是 +-10~20px 的抖动 (拖动时最明显)。不阻尼: 阻尼会让被两个
|
|
648
|
+
// 约束夹住的人停在框内十几到几十像素 (实测 q50 12px), 全推反而每帧停在框边上 (实测 q50 1px)。
|
|
649
|
+
var ex = [r - R.x0, R.x1 - l, d - R.y0, R.y1 - t], k = ex.indexOf(Math.min.apply(null, ex)), m = ex[k] * s;
|
|
650
|
+
if (k === 0) p.x -= m; else if (k === 1) p.x += m; else if (k === 2) p.y -= m; else p.y += m;
|
|
651
|
+
});
|
|
652
|
+
});
|
|
653
|
+
for (var a = 0; a < fs.length; a++) for (var c = a + 1; c < fs.length; c++) {
|
|
654
|
+
var A = rs[a], B = rs[c];
|
|
655
|
+
var ox = Math.min(A.x1, B.x1) - Math.max(A.x0, B.x0), oy = Math.min(A.y1, B.y1) - Math.max(A.y0, B.y0);
|
|
656
|
+
if (ox <= 0 || oy <= 0) continue;
|
|
657
|
+
// 窄长的面板 (手机 / 左栏) 优先上下错开、宽面板优先左右错开: 框很大, 沿面板的短边排会把图撑出画布。
|
|
658
|
+
var horiz = g.hh >= g.hw ? ox < oy * 0.4 : ox < oy * 2.5, sg = horiz ? ((A.x0 + A.x1) < (B.x0 + B.x1) ? -1 : 1) : ((A.y0 + A.y1) < (B.y0 + B.y1) ? -1 : 1), m2 = (horiz ? ox : oy) * s / 2;
|
|
659
|
+
var mv = function (f, dir) {
|
|
660
|
+
f.nodes.forEach(function (p) { if (p.fx == null) { if (horiz) p.x += dir * m2; else p.y += dir * m2; } });
|
|
661
|
+
};
|
|
662
|
+
mv(fs[a], sg); mv(fs[c], -sg);
|
|
663
|
+
}
|
|
664
|
+
};
|
|
518
665
|
// 边让点: 一个点离一条不以它为端点的边太近 (投影在线段内部) 就沿法线推到够远 —— stress 只管点对点的距离,
|
|
519
666
|
// 不管点压在边上; 三角形挤扁时第三个点会躺在对边上, 边和点完全重叠看不出连着谁。只推点, 不动边的两端:
|
|
520
667
|
// 枢纽是几十条边的端点, 每条都让它退一点会把整张图推着走。正好共线 (距离 0) 时按点的序号奇偶定往哪边推, 保持确定性。
|
|
@@ -525,11 +672,11 @@
|
|
|
525
672
|
moved = false;
|
|
526
673
|
for (var li = 0; li < ls.length; li++) {
|
|
527
674
|
var l = ls[li], A = l.s, B = l.t, vx = B.x - A.x, vy = B.y - A.y, L2 = vx * vx + vy * vy;
|
|
528
|
-
if (L2 < 1) continue;
|
|
675
|
+
if (l.virt || L2 < 1) continue;
|
|
529
676
|
var Ln = Math.sqrt(L2), nx = -vy / Ln, ny = vx / Ln;
|
|
530
677
|
for (var i = 0; i < ns.length; i++) {
|
|
531
678
|
var p = ns[i];
|
|
532
|
-
if (p === A || p === B || p.fx != null) continue;
|
|
679
|
+
if (p === A || p === B || p.fx != null || p.hub) continue;
|
|
533
680
|
var t = ((p.x - A.x) * vx + (p.y - A.y) * vy) / L2;
|
|
534
681
|
if (t <= 0.03 || t >= 0.97) continue;
|
|
535
682
|
var d = (p.x - A.x - t * vx) * nx + (p.y - A.y - t * vy) * ny;
|
|
@@ -565,6 +712,7 @@
|
|
|
565
712
|
mv = Math.max(mv, Math.abs(mx), Math.abs(my));
|
|
566
713
|
}
|
|
567
714
|
gCollide(g, cs == null ? 1 : cs);
|
|
715
|
+
gFrameCollide(g, cs == null ? 1 : cs);
|
|
568
716
|
// 边让点是硬约束 (每步把压边的点整段推出去), 不随热量衰减: 软的话热量小时 stress 每帧往回拉一点, 又慢慢压回边上。
|
|
569
717
|
if (!rough) gEdgeClear(g);
|
|
570
718
|
return mv;
|
|
@@ -631,6 +779,16 @@
|
|
|
631
779
|
el = Math.max(el, b[0]); er = el; et = Math.max(et, b[1] - b[2]); eb = Math.max(eb, b[1] + b[2]);
|
|
632
780
|
});
|
|
633
781
|
if (!g.nodes.length) return { k: 1, cx: 0, cy: 0 };
|
|
782
|
+
// 有频道框时按「节点包围盒 + 框矩形」的真实外框来定中心与缩放 (框在节点之外还有一圈边距和标题条, 只按节点中心算会让框被画布边切掉)。
|
|
783
|
+
if ((g.frames || []).length) {
|
|
784
|
+
var X0 = 1e9, X1 = -1e9, Y0 = 1e9, Y1 = -1e9, ix = function (p) { return p.x; }, iy = function (p) { return p.y; };
|
|
785
|
+
g.nodes.forEach(function (p) {
|
|
786
|
+
var b = gBox(p);
|
|
787
|
+
X0 = Math.min(X0, p.x - b[0]); X1 = Math.max(X1, p.x + b[0]); Y0 = Math.min(Y0, p.y + b[2] - b[1]); Y1 = Math.max(Y1, p.y + b[2] + b[1]);
|
|
788
|
+
});
|
|
789
|
+
g.frames.forEach(function (f) { var b = gFrameBox(f, ix, iy); X0 = Math.min(X0, b.x0); X1 = Math.max(X1, b.x1); Y0 = Math.min(Y0, b.y0); Y1 = Math.max(Y1, b.y1); });
|
|
790
|
+
return { k: Math.max(0.05, Math.min((pn.w - 28) / Math.max(1, X1 - X0), (pn.h - 28) / Math.max(1, Y1 - Y0))), cx: (X0 + X1) / 2, cy: (Y0 + Y1) / 2 };
|
|
791
|
+
}
|
|
634
792
|
var pad = 14, kx = (pn.w - 2 * pad - el - er) / Math.max(1, x1 - x0), ky = (pn.h - 2 * pad - et - eb) / Math.max(1, y1 - y0);
|
|
635
793
|
return { k: Math.max(0.05, Math.min(kx, ky)), cx: (x0 + x1) / 2, cy: (y0 + y1) / 2 };
|
|
636
794
|
};
|
|
@@ -681,12 +839,13 @@
|
|
|
681
839
|
S.graf = 0; S.gtarget = 0; S.gdom = null; S.gdrag = '';
|
|
682
840
|
};
|
|
683
841
|
var nodeOn = function (n) {
|
|
842
|
+
if (n.hub) return false;
|
|
684
843
|
return n.isRoom ? (!!D.roomId && D.roomId === n.ref.id) : isRoleId(n.ref.target);
|
|
685
844
|
};
|
|
686
845
|
var nodeCls = function (n) {
|
|
687
|
-
if (n.isRoom) return 'rv-node rv-room' + (nodeOn(n) ? ' on' : '');
|
|
846
|
+
if (n.isRoom) return 'rv-node rv-room' + (n.ref.kind === 'channel' ? ' arch' : '') + (nodeOn(n) ? ' on' : '');
|
|
688
847
|
var human = n.ref.kind === 'human';
|
|
689
|
-
return 'rv-node rv-person ' + (human ? 'human' : 'wizard st-' + stateOfNode(n.ref) + (coldOfNode(n.ref) ? ' cold' : '')
|
|
848
|
+
return 'rv-node rv-person ' + (human ? 'human' : 'wizard st-' + stateOfNode(n.ref) + (coldOfNode(n.ref) ? ' cold' : '')) + (nodeOn(n) ? ' on' : '') + (n.ref.ghost ? ' ghost' : '');
|
|
690
849
|
};
|
|
691
850
|
// 名字过长用省略号收尾 (全名在节点 <title> 悬停里), 不再硬截成 `DavidDavi` 这种半截词。
|
|
692
851
|
var clipName = function (t, n) { t = String(t); return t.length > n ? t.slice(0, n - 1) + '…' : t; };
|
|
@@ -713,8 +872,8 @@
|
|
|
713
872
|
var r = n.ref;
|
|
714
873
|
var un = unreadOf(r);
|
|
715
874
|
var dot = un ? '<g class="rv-un"><circle cx="' + (n.w / 2 - 2).toFixed(1) + '" cy="-13" r="' + (un > 9 ? 8 : 7) + '"/><text x="' + (n.w / 2 - 2).toFixed(1) + '" y="-10" text-anchor="middle">' + (un > 99 ? '99+' : un) + '</text></g>' : '';
|
|
716
|
-
return '<title>' + esc(roomLabelOf(r) + ' · ' + roomKindWord(r) + (r.channel
|
|
717
|
-
'<text x="' + (-n.w / 2 + 8).toFixed(1) + '" y="4.7">' + esc(roomIcon(r) + ' ' + clipName(roomLabelOf(r), gRoomMax())) + '</text>' + dot;
|
|
875
|
+
return '<title>' + esc(roomLabelOf(r) + ' · ' + roomKindWord(r) + (r.kind === 'channel' ? ' · 旧频道 room (只读存档)' : '') + (r.channel ? ' · 频道 ' + channelName(r.channel.id, r.channel.name) : '') + (un ? ' · 未读 ' + un + ' 条' : '') + (r.openDuties ? ' · 未决 duty ' + r.openDuties + ' 件' : '')) + '</title><rect x="' + (-n.w / 2).toFixed(1) + '" y="-13" width="' + n.w.toFixed(1) + '" height="26" rx="9"/>' +
|
|
876
|
+
'<text x="' + (-n.w / 2 + 8).toFixed(1) + '" y="4.7">' + esc(roomIcon(r) + ' ' + clipName(n.label != null ? n.label : roomLabelOf(r), gRoomMax())) + '</text>' + dot;
|
|
718
877
|
}
|
|
719
878
|
var p = n.ref, human = p.kind === 'human', st = stateOfNode(p), rr = n.r;
|
|
720
879
|
var sides = human ? 0 : polySides(p);
|
|
@@ -722,12 +881,15 @@
|
|
|
722
881
|
var shape = function (cls, grow) {
|
|
723
882
|
return polyEl(sides, rr + grow, cls);
|
|
724
883
|
};
|
|
884
|
+
// 命中区: 形状本身只有 14~20px, 用户按的是「这个节点」而不是那个小多边形 —— 再垫一个透明圆,
|
|
885
|
+
// 否则点在图形与名字之间的空隙只落到 svg 上 (被当成拖背景), 看着就是「点不动」。
|
|
886
|
+
var tap = '<circle class="rv-tap" r="' + (rr + 8) + '"/>';
|
|
725
887
|
// 用户不画圆: 一个 👤 emoji + 名字 (多位用户靠名字分辨); 选中与否只靠名字蓝色加粗 (.on)。
|
|
726
|
-
if (human) return '<title>' + esc(p.name + ' · 用户') + '</title>' +
|
|
888
|
+
if (human) return '<title>' + esc(p.name + ' · 用户') + '</title>' + tap +
|
|
727
889
|
'<g class="rv-body"><text class="rv-emo" y="5.5" text-anchor="middle">👤</text></g>' +
|
|
728
890
|
'<text class="rv-nm" y="' + (rr + 13) + '" text-anchor="middle">' + esc(clipName(p.name, gNameMax())) + '</text>';
|
|
729
|
-
var tip = [p.name, ST_WORD[st], coldOfNode(p) ? COLD_WORD : '', n.host ? '🎩 host' : '',
|
|
730
|
-
return '<title>' + esc(tip) + '</title>' +
|
|
891
|
+
var tip = [p.name, ST_WORD[st], coldOfNode(p) ? COLD_WORD : '', n.host ? '🎩 host' : '', p.lead ? '👑 lead' : '', smartsTip(p)].filter(Boolean).join(' · ');
|
|
892
|
+
return '<title>' + esc(tip) + '</title>' + tap +
|
|
731
893
|
'<g class="rv-body">' + shape('sh', 0) + '</g>' + headGear(topR(sides, rr), n.host, p.lead) +
|
|
732
894
|
'<text class="rv-nm" y="' + (rr + 13) + '" text-anchor="middle">' + esc(clipName(p.name, gNameMax())) + '</text>';
|
|
733
895
|
};
|
|
@@ -735,23 +897,70 @@
|
|
|
735
897
|
// role 不是成员 (旧链接) 时没有这条边, 只有 room 节点 .on。
|
|
736
898
|
var edgeCls = function (l) {
|
|
737
899
|
var sel = !!D.roomId && D.roomId === l.room && (l.direct || isRoleId(String(l.b).slice(2)));
|
|
738
|
-
return 'rv-edge' + (l.host ? ' host' : '') + (l.
|
|
900
|
+
return 'rv-edge' + (l.host ? ' host' : '') + (l.direct ? ' direct' : '') + (l.direct && l.unread ? ' unread' : '') +
|
|
739
901
|
(sel ? ' on sel' : '');
|
|
740
902
|
};
|
|
903
|
+
// 频道框配色: 对频道 id 做稳定 hash 取色相 —— 同一频道每次加载颜色不变, 不同频道可辨;
|
|
904
|
+
// 填充压到 7% 不压住框内胶囊与虚线, 描边 50% 够分辨。
|
|
905
|
+
var channelTint = function (cid) {
|
|
906
|
+
var h = 0;
|
|
907
|
+
for (var i = 0; i < cid.length; i++) h = (h * 31 + cid.charCodeAt(i)) >>> 0;
|
|
908
|
+
// 黄金角散布: 相近的 id 也会落到相隔很远的色相上 (直接取模会挤在相邻的绿/黄)。
|
|
909
|
+
var hue = Math.round((h * 137.508) % 360);
|
|
910
|
+
return { fill: 'hsla(' + hue + ', 62%, 62%, .07)', stroke: 'hsla(' + hue + ', 46%, 52%, .5)' };
|
|
911
|
+
};
|
|
912
|
+
// 频道框的 tooltip 与矩形 (标题文字在上层, 见 syncGraphDom); 矩形的坐标每帧由 drawPos 设。
|
|
913
|
+
var frameHtml = function (f) {
|
|
914
|
+
return '<title>' + esc('频道 ' + f.name + (f.host && f.host.name ? ' · host ' + f.host.name : ' · 未绑 host') + ' · ' + f.nodes.length + ' 个 room') + '</title>' +
|
|
915
|
+
'<rect rx="14"/>';
|
|
916
|
+
};
|
|
741
917
|
// 增量同步 DOM: 没了的删, 新的建, 其余只在内容 / class 变了时才写。
|
|
742
918
|
var syncGraphDom = function (svg, g) {
|
|
743
919
|
var dom = S.gdom;
|
|
744
920
|
var layer = function (c) { return svg.querySelector('.' + c); };
|
|
745
|
-
var ids = {}, ks = {};
|
|
746
|
-
|
|
747
|
-
g.links.
|
|
921
|
+
var ids = {}, ks = {}, fids = {};
|
|
922
|
+
// hub 节点与虚拟边只参与布局, 不进 DOM; 频道框单独一层 (rv-gframes), 画在最底下。
|
|
923
|
+
var nodes = g.nodes.filter(function (n) { return !n.hub; }), links = g.links.filter(function (l) { return !l.virt; });
|
|
924
|
+
nodes.forEach(function (n) { ids[n.id] = true; });
|
|
925
|
+
links.forEach(function (l) { ks[l.key] = true; });
|
|
926
|
+
(g.frames || []).forEach(function (f) { fids[f.id] = true; });
|
|
927
|
+
Object.keys(dom.frames).forEach(function (id) { if (!fids[id]) { dom.frames[id].remove(); dom.frames[id]._tx.remove(); delete dom.frames[id]; } });
|
|
928
|
+
// 框 = 底层的一个 <g> (矩形 + tooltip) + 标题文字另放在边的上面一层 (rv-gftl): 边穿过标题时字不被线划掉, 字带一圈底色描边。
|
|
929
|
+
(g.frames || []).forEach(function (f) {
|
|
930
|
+
var e = dom.frames[f.id];
|
|
931
|
+
if (!e) {
|
|
932
|
+
e = document.createElementNS(SVGNS, 'g');
|
|
933
|
+
e.setAttribute('data-channel', f.cid);
|
|
934
|
+
var tint = channelTint(f.cid);
|
|
935
|
+
e.style.setProperty('--cf', tint.fill);
|
|
936
|
+
e.style.setProperty('--cs', tint.stroke);
|
|
937
|
+
e._tx = document.createElementNS(SVGNS, 'text');
|
|
938
|
+
layer('rv-gframes').appendChild(e);
|
|
939
|
+
layer('rv-gftl').appendChild(e._tx);
|
|
940
|
+
dom.frames[f.id] = e;
|
|
941
|
+
}
|
|
942
|
+
if (e.getAttribute('class') !== 'rv-frame') e.setAttribute('class', 'rv-frame');
|
|
943
|
+
var h = frameHtml(f), t = frameTitle(f);
|
|
944
|
+
if (e._h !== h) { e._h = h; e.innerHTML = h; e._rc = e.querySelector('rect'); }
|
|
945
|
+
var th = '<tspan class="fn">' + esc(t.name) + '</tspan><tspan class="fh' + (t.bound ? '' : ' none') + '">' + esc(t.tail) + '</tspan>' +
|
|
946
|
+
(t.mons || []).map(function (m) { return '<tspan class="fm" data-mon="' + esc(m.target) + '">' + esc(m.text) + '</tspan>'; }).join('');
|
|
947
|
+
if (e._tx._h !== th) { e._tx._h = th; e._tx.setAttribute('class', 'rv-ftl'); e._tx.innerHTML = th; }
|
|
948
|
+
if (!e._tx.onclick) e._tx.onclick = function (ev) {
|
|
949
|
+
var el = ev.target && ev.target.closest ? ev.target.closest('[data-mon]') : null;
|
|
950
|
+
if (!el || S.gmoved) return;
|
|
951
|
+
// 这一下已经由 pointerup 处理过了 (按下时的那颗 chip): 别再切一次, pushNav 会多压一层历史。
|
|
952
|
+
if (Date.now() - (S.gchipAt || 0) < 500) return;
|
|
953
|
+
ev.stopPropagation();
|
|
954
|
+
goRole(el.getAttribute('data-mon')); // 与点击图里那个 monitor 节点同一个动作
|
|
955
|
+
};
|
|
956
|
+
});
|
|
748
957
|
Object.keys(dom.nodes).forEach(function (id) { if (!ids[id]) { dom.nodes[id].remove(); delete dom.nodes[id]; } });
|
|
749
958
|
Object.keys(dom.edges).forEach(function (k) {
|
|
750
959
|
if (ks[k]) return;
|
|
751
960
|
dom.edges[k].ln.remove(); if (dom.edges[k].hit) dom.edges[k].hit.remove();
|
|
752
961
|
delete dom.edges[k];
|
|
753
962
|
});
|
|
754
|
-
|
|
963
|
+
links.forEach(function (l) {
|
|
755
964
|
var d = dom.edges[l.key];
|
|
756
965
|
if (!d) {
|
|
757
966
|
d = { ln: document.createElementNS(SVGNS, 'line'), hit: null };
|
|
@@ -769,7 +978,7 @@
|
|
|
769
978
|
var c = edgeCls(l);
|
|
770
979
|
if (d.ln.getAttribute('class') !== c) d.ln.setAttribute('class', c);
|
|
771
980
|
});
|
|
772
|
-
|
|
981
|
+
nodes.forEach(function (n) {
|
|
773
982
|
var e = dom.nodes[n.id];
|
|
774
983
|
if (!e) {
|
|
775
984
|
e = document.createElementNS(SVGNS, 'g');
|
|
@@ -785,7 +994,7 @@
|
|
|
785
994
|
});
|
|
786
995
|
// 选中的节点 (含它两侧的 < >) 提到最上层: 邻近节点名字的白色描边 (paint-order: stroke) 否则会盖住 chevron 的一截。
|
|
787
996
|
// 只在有选中节点后面还跟着别的节点时才挪 (新节点按创建顺序排在后面), 平时不动 DOM。
|
|
788
|
-
var nodesLayer = layer('rv-gnodes'), picked =
|
|
997
|
+
var nodesLayer = layer('rv-gnodes'), picked = nodes.filter(nodeOn).map(function (n) { return dom.nodes[n.id]; }).filter(Boolean);
|
|
789
998
|
var buried = picked.some(function (e) { var nx = e.nextElementSibling; return !!nx && picked.indexOf(nx) < 0; });
|
|
790
999
|
if (buried) picked.forEach(function (e) { nodesLayer.appendChild(e); });
|
|
791
1000
|
};
|
|
@@ -799,6 +1008,17 @@
|
|
|
799
1008
|
};
|
|
800
1009
|
var start = null;
|
|
801
1010
|
svg.onpointerdown = function (e) {
|
|
1011
|
+
// 频道框标题里的 👁 chip 只认「点」, 不从它起手拖动: 以前它走通用路径, 手抖 4px 就被判成拖背景 (S.gmoved),
|
|
1012
|
+
// 随后的 click 被吞掉 —— 真人点 chip 手都会抖几像素, 看着就是「点不动」。这里直接不起拖, click 照常触发。
|
|
1013
|
+
var chipEl = e.target.closest ? e.target.closest('[data-mon]') : null;
|
|
1014
|
+
if (chipEl) {
|
|
1015
|
+
// 记下按下时的那颗 chip: 图很可能还在收敛 (坐标在动), 到 pointerup 时 chip 已经挪开、click 落空 ——
|
|
1016
|
+
// 所以判定放在 pointerup, 按「按下的那颗 chip」走, 不按抬起处命中的元素走。
|
|
1017
|
+
start = null; S.gmoved = false; S.gdrag = '';
|
|
1018
|
+
S.gchip = { mon: chipEl.getAttribute('data-mon'), x: e.clientX, y: e.clientY };
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
S.gchip = null;
|
|
802
1022
|
var el = e.target.closest ? e.target.closest('[data-node],[data-room]') : null;
|
|
803
1023
|
var node = el && el.getAttribute('data-node'), room = el && el.getAttribute('data-room');
|
|
804
1024
|
start = { id: node ? 'p:' + node : room ? 'r:' + room : '', el: el,
|
|
@@ -835,6 +1055,15 @@
|
|
|
835
1055
|
}
|
|
836
1056
|
};
|
|
837
1057
|
var stop = function (e) {
|
|
1058
|
+
// 按下的是一颗 👁 chip: 抬起时离按下处 24px 以内就算点它 (图在动也点得中)。
|
|
1059
|
+
if (S.gchip) {
|
|
1060
|
+
var ch = S.gchip; S.gchip = null;
|
|
1061
|
+
var cdx = (e.clientX || 0) - ch.x, cdy = (e.clientY || 0) - ch.y;
|
|
1062
|
+
if (e.type !== 'pointercancel' && cdx * cdx + cdy * cdy < 576) {
|
|
1063
|
+
S.gchipAt = Date.now();
|
|
1064
|
+
goRole(ch.mon);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
838
1067
|
var held = start && start.id && S.gnodes && S.gnodes[start.id];
|
|
839
1068
|
start = null;
|
|
840
1069
|
S.gdrag = '';
|
|
@@ -861,19 +1090,48 @@
|
|
|
861
1090
|
};
|
|
862
1091
|
// 视野: svg 的 viewBox 恒等于它的像素尺寸 (1 单位 = 1 像素), 节点半径 / 名字字号 / 线宽 / 箭头都是固定像素;
|
|
863
1092
|
// 视野缩放 (k) 与平移只作用在节点中心的坐标上 —— 屏幕坐标 = (布局坐标 − 中心) × k + 画布中点 + 平移。
|
|
864
|
-
//
|
|
1093
|
+
// 取景只在首次出图 / 双击重排 / 画布尺寸变化时算一次, 之后不再跟着内容跑 (否则谁动一下整张图就重新居中, 看着像自己往左滑)。
|
|
1094
|
+
// k 夹在 0.95~1: 不放大, 也几乎不缩 ——
|
|
865
1095
|
// 节点和字是固定像素, 再缩只会把名字压到一起; 画布实在放不下 (手机上三十几个节点) 就溢出, 拖背景平移看其余部分;
|
|
1096
|
+
// 例外: 有频道框时下限放到 0.8 —— 一个框刚好比画布宽一点时宁可按比例缩进画布, 也别把虚线框切在画布边上 (框是频道边界, 切一半看着像少个频道);
|
|
866
1097
|
|
|
867
|
-
//
|
|
1098
|
+
// 视野 = 取景 (v0) 叠加用户的缩放 (S.gzoom) 与平移 (S.gpx / S.gpy, 像素): 平移永远由用户拖背景决定, 图不会自己滑。
|
|
1099
|
+
// 以前是「没缩放/平移过就每帧按内容重算」: 布局还在收敛时包围盒每帧都变 → 中心与缩放跟着变, 整张图自己在滑。
|
|
1100
|
+
var gViewFit = function (f, pn, frames, rescue) {
|
|
1101
|
+
// 窄屏 (手机 / 左栏) 上的频道框: 宁可缩到 0.8 也要整个框进画布 (不让虚线框被画布边切掉); 宽屏不变。
|
|
1102
|
+
// rescue = 兜底修正 (见 gRescueView): 内容确实放不下时允许再缩一些, 也要让框 (和它的标题条) 整个进画布。
|
|
1103
|
+
var kmin = rescue ? 0.55 : ((frames || []).length && pn.w < 420 ? 0.8 : 0.95);
|
|
1104
|
+
return { k: Math.max(kmin, Math.min(1, f.k)), cx: f.cx, cy: f.cy };
|
|
1105
|
+
};
|
|
1106
|
+
// 取景只做一次 (首次出图 / 双击重排 / 画布尺寸变了): 不再按内容每帧重算 —— 以前谁动一下 (拖节点、来一条新消息)
|
|
1107
|
+
// 整张图就跟着重新居中/缩放, 看起来就是自己在往左滑。现在视野由用户拖背景平移 (S.gpx / S.gpy) 与滚轮缩放控制。
|
|
868
1108
|
var gView = function (g) {
|
|
869
1109
|
var pn = gPanel();
|
|
870
|
-
if (!S.gv0
|
|
1110
|
+
if (!S.gv0) S.gv0 = gViewFit(gFitK(g, pn), pn, g.frames);
|
|
871
1111
|
var v0 = S.gv0;
|
|
872
1112
|
return { w: pn.w, h: pn.h, k: v0.k * (S.gzoom || 1), cx: v0.cx, cy: v0.cy, ox: pn.w / 2 + (S.gpx || 0), oy: pn.h / 2 + (S.gpy || 0) };
|
|
873
1113
|
};
|
|
1114
|
+
// 取景兜底: 首帧取的景是那一刻的包围盒, 之后布局还在收敛 / 又来了 room 或频道框, 内容就长出了画布 ——
|
|
1115
|
+
// 最上面那个框的标题条 (连着 👁 chip) 被推到画布上边界之外, 既看不见也点不到。
|
|
1116
|
+
// 这里只做一次性修正: 发现框出了画布就按当前内容重新取一次景; 用户自己平移 / 缩放过就完全不动 (视野归用户)。
|
|
1117
|
+
// 不动「每帧按内容重算视野」—— 那会让整张图自己在滑 (见 gViewFit 上面的注释)。
|
|
1118
|
+
var gRescueView = function (g) {
|
|
1119
|
+
if (S.gpx || S.gpy || (S.gzoom || 1) !== 1) return false;
|
|
1120
|
+
var pn = gPanel(), v = gView(g);
|
|
1121
|
+
var X = function (p) { return (p.x - v.cx) * v.k + v.ox; }, Y = function (p) { return (p.y - v.cy) * v.k + v.oy; };
|
|
1122
|
+
var cut = false;
|
|
1123
|
+
(g.frames || []).forEach(function (f) {
|
|
1124
|
+
var b = gFrameBox(f, X, Y);
|
|
1125
|
+
if (b.x0 < -1 || b.y0 < -1 || b.x1 > v.w + 1 || b.y1 > v.h + 1) cut = true;
|
|
1126
|
+
});
|
|
1127
|
+
if (!cut) return false;
|
|
1128
|
+
S.gv0 = gViewFit(gFitK(g, pn), pn, g.frames, true);
|
|
1129
|
+
return true;
|
|
1130
|
+
};
|
|
874
1131
|
var drawPos = function (g) {
|
|
875
1132
|
var dom = S.gdom, svg = convsEl.querySelector('.rv-graph');
|
|
876
1133
|
if (!dom || !svg) return;
|
|
1134
|
+
if (!S.gdrag) gRescueView(g); // 正在拖节点时不动视野
|
|
877
1135
|
var v = gView(g), box = '0 0 ' + v.w + ' ' + v.h;
|
|
878
1136
|
if (svg.getAttribute('width') !== String(v.w)) svg.setAttribute('width', v.w);
|
|
879
1137
|
if (svg.getAttribute('height') !== String(v.h)) svg.setAttribute('height', v.h);
|
|
@@ -884,6 +1142,14 @@
|
|
|
884
1142
|
var e = dom.nodes[p.id];
|
|
885
1143
|
if (e) e.setAttribute('transform', 'translate(' + X(p).toFixed(1) + ' ' + Y(p).toFixed(1) + ')');
|
|
886
1144
|
});
|
|
1145
|
+
(g.frames || []).forEach(function (f) {
|
|
1146
|
+
var e = dom.frames[f.id];
|
|
1147
|
+
if (!e || !e._rc) return;
|
|
1148
|
+
var b = gFrameBox(f, X, Y);
|
|
1149
|
+
e._rc.setAttribute('x', b.x0.toFixed(1)); e._rc.setAttribute('y', b.y0.toFixed(1));
|
|
1150
|
+
e._rc.setAttribute('width', (b.x1 - b.x0).toFixed(1)); e._rc.setAttribute('height', (b.y1 - b.y0).toFixed(1));
|
|
1151
|
+
e._tx.setAttribute('x', (b.x0 + 11).toFixed(1)); e._tx.setAttribute('y', (b.y0 + 18).toFixed(1));
|
|
1152
|
+
});
|
|
887
1153
|
Object.keys(dom.edges).forEach(function (k) {
|
|
888
1154
|
var d = dom.edges[k], l = d.l;
|
|
889
1155
|
if (!l || !l.s || !l.t) return;
|
|
@@ -902,6 +1168,7 @@
|
|
|
902
1168
|
if (S.gpanel === key) return false;
|
|
903
1169
|
var had = !!S.gpanel;
|
|
904
1170
|
S.gpanel = key;
|
|
1171
|
+
S.gv0 = null; // 画布尺寸变了: 取景重算一次 (唯一的「自己动」的合法时机之外, 视野不跟着内容跑)
|
|
905
1172
|
if (had && gFitScale(g)) gKick(0.2);
|
|
906
1173
|
return true;
|
|
907
1174
|
};
|
|
@@ -909,7 +1176,7 @@
|
|
|
909
1176
|
'<span><i class="lg wz working"></i>工作中</span><span title="停在审批框 / 弹窗上等人点"><i class="lg wz blocked"></i>等审批</span>' +
|
|
910
1177
|
'<span><i class="lg wz idle"></i>空闲</span><span title="pane 不在, 下一句话会重新拉起"><i class="lg wz asleep"></i>休眠</span>' +
|
|
911
1178
|
'<span title="叠加属性: 提示缓存已超 TTL, 下一句要重写缓存。空闲 / 休眠的节点都会变白 (休眠的服务端不报缓存, 按最近动静超过 5 分钟估); 工作中 / 等审批不受影响"><i class="lg wz cold"></i>缓存冷</span>' +
|
|
912
|
-
'<span><span class="lgemo">👤</span>用户</span><span title="room 图标: 多人群聊 (企微群 / 多人 room, 有人参与)"><span class="lgemo">👥</span>群聊</span><span title="room 图标: 人与 wizard 的单聊 (绑定的企微单聊)"><span class="lgemo">💬</span>单聊</span><span title="room
|
|
1179
|
+
'<span><span class="lgemo">👤</span>用户</span><span title="room 图标: 多人群聊 (企微群 / 多人 room, 有人参与)"><span class="lgemo">👥</span>群聊</span><span title="room 图标: 人与 wizard 的单聊 (绑定的企微单聊)"><span class="lgemo">💬</span>单聊</span><span title="虚线框 = 一个频道: 框住它名下的 room (帖子 room / 存档频道 room); 标题 = 频道名 + 🎩 host 身份 (频道没有自己的 room, 只绑一个 host 身份)"><i class="lg frm"></i>频道</span><span title="room 图标: 帖子 (频道下某个 topic 帖的评论区, 一帖一个 room)"><span class="lgemo">' + POST_ICON + '</span>帖子</span><span title="旧频道 room: 改造前的频道 room, 现为只读存档 (淡色虚线胶囊), 画在频道框里"><span class="lgemo">#️⃣</span>存档</span><span title="room 图标: 只有 wizard 的 room (dm / 临时多人)"><span class="lgemo">🧙</span>wizard room</span><span title="room 的 host: 本 room 里加入序最小的 wizard"><svg class="lghost" viewBox="-6 -5 12 10" width="13" height="11" aria-hidden="true"><path d="M-3.3 2L-3.3 -3.9L3.3 -3.9L3.3 2Z"/><path class="hb" d="M-3.3 .4L3.3 .4L3.3 2L-3.3 2Z"/><path d="M-5.2 3.6L-5.2 2L5.2 2L5.2 3.6Z"/></svg>host</span>' +
|
|
913
1180
|
'<span title="被派来领一件复杂活的 lead (daemon 在 lead 派活时记下, 不能自封)"><svg class="lglead" viewBox="-5 -5 10 10" width="11" height="11" aria-hidden="true"><path d="M-4.6 3.6L-4.6 -2.4L-2.3 0L0 -3.9L2.3 0L4.6 -2.4L4.6 3.6Z"/></svg>lead</span>' +
|
|
914
1181
|
'<span title="聪明程度 = 档位 (tier): 三角形 🧒小学生 mini · 四边形 🎒初中生 light · 五边形 🎓大学生 standard · 六边形 🔬研究生 hard · 圆 👨🏫专家教授 ultra; 档位记在名册里 (出生时按 spawn 的档位, set_model 换模型后按档位表反查更新), 实际模型只作附注; 没有档位 = 五边形"><svg class="lgpoly" viewBox="-6 -6 12 12" width="12" height="12" aria-hidden="true">'+polyEl(3,5.2)+'</svg><svg class="lgpoly" viewBox="-6 -6 12 12" width="12" height="12" aria-hidden="true">'+polyEl(0,5.2)+'</svg>边数 = 聪明程度</span>' +
|
|
915
1182
|
'</div>';
|
|
@@ -944,10 +1211,12 @@
|
|
|
944
1211
|
var first = !svg || !S.gdom;
|
|
945
1212
|
if (first) {
|
|
946
1213
|
convsEl.innerHTML = head +
|
|
947
|
-
|
|
1214
|
+
// 层序 (下 → 上): 框 < 边 < 命中线 < 节点 < 标题。标题必须在节点之上 —— 标题里的 👁 monitor chip 是唯一可点的,
|
|
1215
|
+
// 节点层在上时, 挨着的节点名 / 透明命中圆会盖住它, 点下去命中的是节点 (看着就是 chip 点不动)。
|
|
1216
|
+
'<svg class="rv-graph"><g class="rv-gframes"></g><g class="rv-gedges"></g><g class="rv-ghits"></g><g class="rv-gnodes"></g><g class="rv-gftl"></g></svg>' + GRAPH_LEGEND;
|
|
948
1217
|
convsEl._html = ''; convsEl._gh = head;
|
|
949
1218
|
svg = convsEl.querySelector('.rv-graph');
|
|
950
|
-
S.gdom = { nodes: {}, edges: {} };
|
|
1219
|
+
S.gdom = { nodes: {}, edges: {}, frames: {} };
|
|
951
1220
|
bindHead();
|
|
952
1221
|
bindGraph(svg);
|
|
953
1222
|
} else if (convsEl._gh !== head) {
|
|
@@ -2529,7 +2798,7 @@
|
|
|
2529
2798
|
// 没有好的 (首屏) 就用占位名先画, 2s 后重取, 名册一到立刻补上 —— 不让 id 当名字露出来。
|
|
2530
2799
|
if (r.degraded && W.good) { W.degraded = true; scheduleWorldRetry(); return r; }
|
|
2531
2800
|
W.at = r.at; W.rooms = r.rooms || []; W.nodes = (r.nodes || []).map(function (n) { return n.name && ID_LIKE.test(n.name) ? Object.assign({}, n, { name: safeName(n.name) }) : n; });
|
|
2532
|
-
W.uidTargets = r.uidTargets || {}; W.chatNames = r.chatNames || {}; W.names = r.names || {}; W.degraded = !!r.degraded;
|
|
2801
|
+
W.channels = r.channels || []; W.uidTargets = r.uidTargets || {}; W.chatNames = r.chatNames || {}; W.names = r.names || {}; W.degraded = !!r.degraded;
|
|
2533
2802
|
if (!r.degraded) W.good = true; else scheduleWorldRetry();
|
|
2534
2803
|
// 日程栏要的 plans / 定时任务: 名册快照里就是全量 (带 gate 与出错), 每 6s 一次, 开着就看得到最新。
|
|
2535
2804
|
W.plans = r.plans || []; W.schedules = r.schedules || [];
|
|
@@ -2835,7 +3104,7 @@
|
|
|
2835
3104
|
inner.innerHTML = '<div class="rv-none">还没有 room —— 说一句话, 或者在群里 .name 点名一个 wizard。</div>';
|
|
2836
3105
|
};
|
|
2837
3106
|
// ── 样式: 本页新加的 DOM 只在 chat.js 里, 样式也一并带上 (不改 web/chat.css, 无构建) ──
|
|
2838
|
-
var CSS = ".side-body { flex: 1; min-height: 0; display: flex }\n.convs { flex: 1; min-width: 0; overflow: auto; padding: 0 }\n.rv-list { padding: 2px 8px 16px }\n.convs-h { padding: 2px 8px 0 }\n.convs-h h2 { margin-top: 6px }\n.convs h2 > span:nth-of-type(2) { flex: none }\n.convs h2 .vt + .vt { margin-left: 0 }\n.convs h2 .vt.on { color: var(--accent) }\n.convs h2 .vt svg { flex: none }\n@media (min-width: 761px) { .app.side-list .side { width: max(332px, 25vw) } }\n/* 滚动条: 支持 ::-webkit-scrollbar 的 (Chrome / Safari) 走伪元素; 其余 (Firefox) 走标准属性。不能两套并设: Chrome 121+ / Safari 18.2+ 见到 scrollbar-width / scrollbar-color 就让 ::-webkit-scrollbar 整个失效。 */\n@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--line) transparent } }\n::-webkit-scrollbar { width: 8px; height: 8px }\n::-webkit-scrollbar-track { background: transparent }\n::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box }\n::-webkit-scrollbar-thumb:hover { background-color: var(--faint) }\n::-webkit-scrollbar-corner { background: transparent }\n.thread-in, .gside, .rolebar, .rv-mh { overflow-wrap: anywhere }\n.rv-bub { min-width: 0; overflow-wrap: anywhere }\n.rv-files { min-width: 0 }\n.rv-files .rv-chip { white-space: normal; overflow-wrap: anywhere; max-width: 100%; line-height: 1.45; padding: 1px 7px }\n.rv-mh > * { min-width: 0 }\n.gs-mem .nm { white-space: normal; overflow-wrap: anywhere }\n.gs-cls { min-width: 0; overflow-wrap: anywhere }\n.rv-list .ci .l2 .rv-chip { flex: none }\n.rv-msg.hit .rv-bub { animation: hit 1.6s ease-out }\n.rv-graph { display: block; font: 11.5px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor: grab; touch-action: none; user-select: none }\n.rv-edge { stroke: #c9d2df; stroke-width: 1 }\n.rv-edge.unread { stroke: #f2a7ad; stroke-width: 1.6 }\n.rv-edge.on { stroke: var(--accent); stroke-width: 1.6 }\n.rv-hit { stroke: transparent; stroke-width: 12; cursor: pointer }\n.rv-node { cursor: grab }\n.rv-room rect { fill: var(--them); stroke: var(--line) }\n.rv-room text { fill: var(--ink) }\n.rv-room.on > text { fill: var(--accent); font-weight: 700 }\n.rv-person .sh, .smi .sh { fill: var(--card); stroke: var(--mute); stroke-width: 1.6 }\n.rv-person .rv-emo { font-size: 17px; fill: initial }\n.rv-person.human .rv-nm { fill: var(--human); font-weight: 600 }\n.rv-person.wizard.st-working .sh, .smi.st-working .sh { fill: #2da44e; stroke: #1a7f37 }\n.rv-body { transform-box: fill-box; transform-origin: center }\n.rv-person.wizard.st-working .rv-body { animation: rvbreath 1.8s ease-in-out infinite }\n@keyframes rvbreath { 0%, 100% { transform: scale(.88) } 50% { transform: scale(1.14) } }\n.rv-person.wizard.st-blocked .sh, .smi.st-blocked .sh { fill: #e8336d; stroke: #b3124a }\n.rv-person.wizard.st-idle .sh, .smi.st-idle .sh { fill: #e4e7ec; stroke: #7d8795 }\n.rv-person.wizard.st-asleep .sh, .smi.st-asleep .sh { fill: #f6f7f9; stroke: #b9c0ca; stroke-dasharray: 3 2.5 }\n.rv-person.wizard.cold .sh, .smi.cold .sh { fill: #fff; stroke: #c9d0da; stroke-width: 1 }\n.rv-person.wizard.st-asleep text { fill: var(--faint) }\n.rv-hosthat .hh, .rv-legend .lghost path { fill: #7c4dcc; stroke: #2d1a5e; stroke-width: .9; stroke-linejoin: round }\n.rv-hosthat .hb, .rv-legend .lghost .hb { fill: #d9c8ff; stroke: #2d1a5e; stroke-width: .6 }\n.rv-hosthat { pointer-events: none }\n.rv-legend .lghost { flex: none }\n.rv-room .rv-un circle { fill: #cf222e }\n.rv-room .rv-un text { fill: #fff; font-size: 9px; font-weight: 600 }\n.rv-edge.direct { stroke: #9aa7ba; stroke-width: 1.4 }\n.rv-edge.mon { stroke-dasharray: 4 3; stroke: #b3a7d6 }\n.rv-edge.chan { stroke-dasharray: 2 3; opacity: .65 }\n.rv-person.wizard.mon .sh { stroke-dasharray: 4 3 }\n.rv-edge.sel { stroke: var(--accent); stroke-width: 3 }\n.rv-person.wizard.on .rv-nm, .rv-person.human.on .rv-nm { fill: var(--accent); font-weight: 700 }\n.rv-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 4px 10px 8px; font-size: 11px; color: var(--faint) }\n.rv-legend span { display: inline-flex; align-items: center; gap: 4px }\n.rv-legend .lg { display: inline-block; width: 9px; height: 9px; border: 1.6px solid var(--mute); box-sizing: border-box }\n.rv-legend .wz { border-radius: 50% }\n.rv-legend .wz.working { background: #2da44e; border-color: #1a7f37 }\n.rv-legend .wz.idle { background: #e4e7ec; border-color: #7d8795 }\n.rv-legend .wz.blocked { background: #e8336d; border-color: #b3124a }\n.rv-legend .wz.cold { background: #fff; border: 1px solid #c9d0da }\n.rv-legend .wz.asleep { background: #f6f7f9; border-style: dashed; border-color: #b9c0ca }\n.rv-legend .lgemo { font-size: 11px; line-height: 1 }\n.rv-lead { fill: #f5b301; stroke: #6b4a00; stroke-width: .9; stroke-linejoin: round; pointer-events: none }\n.rv-legend .lglead { fill: #f5b301; stroke: #6b4a00; stroke-width: .9 }\n.rv-legend .lgpoly { flex: none }\n.rv-legend .lgpoly polygon, .rv-legend .lgpoly circle { fill: #e4e7ec; stroke: #7d8795; stroke-width: 1.4; stroke-linejoin: round }\n.smi { flex: none; vertical-align: -4px }\n.smi:not([class*=st-]) .sh { fill: #e4e7ec; stroke: #8a93a0 }\n.rolebar .facts .fx-smi { display: inline-flex; align-items: center; cursor: help }\n.rolebar .facts .lead { color: #b07d00 }\n.rv-person text { fill: var(--ink); font-size: 12px }\n.rv-person text.rv-nm { font-size: 12px; paint-order: stroke; stroke: var(--card); stroke-width: 3.5px; stroke-linejoin: round }\n.rv-room text { font-size: 13px }\n.rv-person.ghost .sh { fill: #f6f7f9; stroke: #c9d0da; stroke-dasharray: 3 2.5 }\n.rv-person.ghost text { fill: var(--faint) }\n.rv-ttl { font-size: 15.5px; line-height: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }\n.rv-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 3px; font-size: 11.5px; color: var(--mute) }\n.rv-lb { font-size: 15px }\n.rv-chip { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 999px; background: var(--them); color: var(--mute); font-size: 11px; line-height: 17px; white-space: nowrap }\n.rv-chip.ok { background: #e8f5ee; color: #1a7f3c }\n.rv-chip.warn { background: #fdf1e3; color: #9a5b10 }\n.rv-chip.ask, .rv-chip.bad { background: #fdecec; color: #b42318 }\n.rv-chip.go { background: var(--mine); color: var(--accent) }\n.rv-chip.file { background: var(--them-soft) }\n.rv-chip.re { background: transparent; color: var(--faint); border: 1px solid var(--line) }\n.rv-act { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--mute) }\n.rv-act:hover, .rv-act.on { color: var(--accent); border-color: var(--accent) }\n/* 图右侧的成员列: 点开一个 room 才有, 看 wizard 时收起。 */\n.gside { flex: none; width: 252px; min-height: 0; overflow: auto; border-left: 1px solid var(--line); background: var(--card); padding: 8px }\n.gs-host { flex: none; font-size: 11px; line-height: 1 }\n.gside[hidden] { display: none }\n.gs-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 4px; color: var(--faint); font-size: 12px; line-height: 20px }\n.gs-hl { min-width: 0 }\n.gs-hn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto }\n.gs-x { display: none; flex: none; margin-left: auto; width: 32px; height: 32px; border: 0; background: none; color: var(--mute); font-size: 15px; cursor: pointer }\n.gs-hn + .gs-x { margin-left: 0 }\n.gs-meta { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 0 2px 4px; color: var(--faint); font-size: 11px; line-height: 1.6 }\n.gs-notice { display: flex; align-items: flex-start; gap: 5px; width: 100%; margin: 0 0 6px; padding: 5px 8px; border: 0; border-radius: 8px; background: #fff8e1; color: #6b4a00; font: inherit; font-size: 11.5px; line-height: 1.5; text-align: left; cursor: pointer }\n.gs-notice:hover { background: #fff3cd }\n.gs-np { flex: none; font-size: 11px }\n.gs-nt { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }\n.gs-notice.on .gs-nt { display: block; -webkit-line-clamp: unset; overflow: visible }\n.gs-srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 6px; padding: 4px 6px; border-radius: 8px; background: var(--paper); font-size: 11.5px; line-height: 1.5 }\n.gs-sbt { flex: none; color: var(--faint); font-size: 10.5px }\n.gs-src { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; background: var(--card); color: var(--mute); font: inherit; font-size: 11px; line-height: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }\n.gs-src.post { border-color: #cbb7ea; color: #5b3f8f; background: #f6f1fd }\nbutton.gs-src { cursor: pointer }\nbutton.gs-src:hover { color: var(--accent); border-color: var(--accent) }\n.gs-head b { color: var(--mute); font-weight: 600 }\n.gs-duty { color: #b42318; font-weight: 600 }\n.gs-list { padding-top: 2px }\n.gs-item { border-radius: 6px }\n.gs-item.grp { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--paper) }\n.gs-row { display: flex; align-items: center; gap: 4px; min-width: 0; border-radius: 6px; padding-right: 6px }\n.gs-row:hover { background: var(--paper) }\n.gs-ago { flex: none; min-width: 2.6em; text-align: right; color: var(--faint); font-size: 10.5px; white-space: nowrap; cursor: pointer }\n.gs-ago.none { opacity: .6 }\n.gs-role { flex: none; font-size: 11px; line-height: 1; width: 10px; text-align: center; opacity: .8 }\n.gs-host, .gs-lead { flex: none; font-size: 11px; line-height: 1 }\n.gs-blk { margin-left: -2px; font-weight: 600; font-size: 10.5px; color: #b3124a }\n.gs-due.on { background: #b42318; color: #fff }\n.gs-ch { width: 0; height: 0; border-left: 3.5px solid currentColor; border-top: 3px solid transparent; border-bottom: 3px solid transparent; transition: transform .12s }\n.gs-due.on .gs-ch { transform: rotate(90deg) }\n.gs-duties { display: flex; flex-direction: column; gap: 2px; margin: 2px 4px 4px 10px; padding-left: 6px; border-left: 2px solid #f3c6c6 }\n.gs-dt { display: flex; flex-direction: column; gap: 0; text-align: left; border: 0; border-radius: 5px; padding: 2px 6px; background: none; cursor: pointer; font: inherit; color: inherit }\n.gs-dt:hover { background: var(--paper) }\n.gs-dq { font-size: 10.5px; color: var(--mute) }\n.gs-dq b { color: #b42318; font-weight: 600 }\n.gs-ds { font-size: 11px; line-height: 1.45; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }\n.gs-open { display: none }\n.gs-pip { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: #cf222e; vertical-align: 2px }\n.gs-list { display: flex; flex-direction: column; gap: 2px }\n.gs-mem { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; padding: 5px 6px; border: 0; border-radius: 6px; background: none; color: var(--ink); text-align: left; cursor: pointer }\n.gs-mem .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px }\n.gs-mem.human .nm { color: var(--human) }\n.gs-mem.busy .nm { color: var(--accent) }\n.gs-cls { flex: none; color: var(--faint); font-size: 10.5px }\n.gs-row:has(.gs-mem.me), .gs-row:has(.gs-mem.me):hover { background: var(--mine) }\n.gs-item.out .gs-mem .nm, .gs-item.out .gs-mem.human .nm, .gs-item.out .gs-mem.busy .nm { color: var(--faint) }\n.gs-item.out .gs-ago, .gs-item.out .gs-role, .gs-item.out .gs-host, .gs-item.out .gs-lead, .gs-item.out .smi { opacity: .6 }\n.gs-pov { flex: none; font-size: 11px; line-height: 1 }\n.gs-due { flex: none; display: inline-flex; align-items: center; gap: 3px; border: 0; border-radius: 999px; padding: 0 6px; background: #fdecec; color: #b42318; font-size: 10.5px; line-height: 17px; cursor: pointer }\n@media (max-width: 760px) { .gside { display: none } .gs-open { display: inline-flex; align-items: center } .gside.sheet:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; z-index: 30; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 32px #0003; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)) } .gside.sheet .gs-x { display: inline-block } .gside.sheet .gs-mem { padding: 10px 6px } .gside.sheet .gs-dt { padding: 5px 6px } .gside.sheet .gs-due { padding: 3px 10px } .gside.sheet .gs-ago { font-size: 11.5px } .gside.sheet .gs-row { gap: 8px } }\n.rv-older { display: block; margin: 8px auto; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 2px 12px; font-size: 12px; color: var(--mute); cursor: pointer }\n/* 一条消息: 头在气泡外 (谁 → 谁 · room · 时刻), 气泡只装正文。 */\n.rv-msg { display: flex; flex-direction: column; gap: 3px; margin: 10px 0; min-width: 0 }\n.rv-msg > .rv-mh { padding: 0 2px }\n.rv-bub { align-self: flex-start; max-width: min(88%, 720px); padding: 8px 13px; background: var(--them); border: 0; border-radius: 14px }\n.rv-msg.me .rv-bub { align-self: flex-end; background: var(--mine) }\n.rv-msg.k-system .rv-bub { background: var(--them-soft, var(--them)) }\n.rv-msg.me .rv-turn .bubbles > .say { align-self: flex-end }\n.rv-mh { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: center; font-size: 11.5px; color: var(--mute) }\n.rv-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; min-width: 0 }\n.rv-arr { color: var(--faint); white-space: nowrap }\n.rv-arr::before { content: '→' }\n.rv-via::before { content: '—' }\n.rv-via::after { content: '→' }\n.rv-msg.me > .rv-mh, .rv-msg.me .rv-spk > .rv-mh { flex-direction: row-reverse }\n.rv-msg.me .rv-path { flex-direction: row-reverse }\n.rv-msg.me .rv-arr::before { content: '←' }\n.rv-msg.me .rv-via::before { content: '←' }\n.rv-msg.me .rv-via::after { content: '—' }\n.rv-msg.me .rv-rawbtn { margin-left: 0 }\n.rv-au { font-weight: 600; color: var(--ink); cursor: pointer }\n.rv-au:hover { text-decoration: underline dotted var(--faint); text-underline-offset: 3px }\n.rv-au.human { color: var(--human) }\n.rv-au.daemon { color: var(--wezard) }\n.rv-tag { color: var(--accent); cursor: pointer }\n.rv-roomtag { color: var(--chat); cursor: pointer; font-size: 11px; margin: 0 1px }\n.rv-roomtag:hover { text-decoration: underline dotted; text-underline-offset: 3px }\n.rv-mh time { color: var(--faint) }\n.rv-open { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 0 6px; font-size: 11px; color: var(--faint); cursor: pointer }\n.rv-open:hover { color: var(--accent); border-color: var(--accent) }\n.rv-quote { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; min-width: 0 }\n.rv-quote .rq-it { flex: 1; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; gap: 1px; text-align: left; border: 0; border-radius: 8px; padding: 4px 8px; background: #0000000a; font: inherit; cursor: pointer; color: inherit }\n.rv-quote .rq-it:hover { background: #00000012 }\n.rv-quote .rq-who { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--accent) }\n.rv-quote .rq-who.human { color: var(--human) }\n.rv-quote .rq-tx { display: block; min-width: 0; max-width: 100%; font-size: 12px; line-height: 1.45; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }\n.rv-quote .rq-gone { font-style: italic; color: var(--faint); cursor: default }\n.rv-quote .rq-more { flex: none; align-self: center; border: 0; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; background: #0000000a; color: var(--mute); cursor: pointer }\n.rv-quote .rq-more.on { color: var(--accent); background: var(--mine) }\n.rv-quote .rq-rest { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px }\n.rv-quote .rq-rest[hidden] { display: none }\n.rv-open { display: inline-flex; align-items: center; gap: 4px }\n.rv-och { width: 0; height: 0; border-left: 4px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; transition: transform .12s }\n.rv-open.on { background: var(--mine); color: var(--accent); border-color: var(--accent); font-weight: 600 }\n.rv-open.on .rv-och { transform: rotate(90deg) }\n.rv-tx { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; color: #1f2328 }\n.rv-tx > :first-child { margin-top: 0 }\n.rv-tx > :last-child { margin-bottom: 0 }\n.rv-tx p { margin: .6em 0 }\n.rv-tx h1, .rv-tx h2, .rv-tx h3, .rv-tx h4 { margin: 1em 0 .4em; font-weight: 600; line-height: 1.35 }\n.rv-tx h1 { font-size: 1.4em }\n.rv-tx h2 { font-size: 1.2em }\n.rv-tx h3 { font-size: 1.05em }\n.rv-tx h4 { font-size: 1em }\n.rv-tx ul, .rv-tx ol { margin: .6em 0; padding-left: 1.6em }\n.rv-tx li { margin: .2em 0 }\n.rv-tx li > p { margin: .2em 0 }\n.rv-tx code { background: #0000000d; border-radius: 4px; padding: 1px 5px; font-size: .9em; font-family: ui-monospace, Menlo, monospace }\n.rv-tx pre { background: #ffffffb3; border-radius: 8px; padding: 8px 10px; margin: .6em 0; overflow: auto; font-size: 12.5px; line-height: 1.5 }\n.rv-tx pre code { background: transparent; padding: 0; font-size: inherit }\n.rv-tx blockquote { margin: .6em 0; padding: .1em 1em; border-left: 3px solid #0000001f; color: #656d76 }\n.rv-tx table { border-collapse: collapse; margin: .7em 0; display: block; overflow: auto; max-width: 100% }\n.rv-tx th, .rv-tx td { border: 1px solid #0000001a; padding: 5px 10px }\n.rv-tx th { background: #0000000a; font-weight: 600 }\n.rv-tx hr { border: 0; border-top: 1px solid #0000001a; margin: .9em 0 }\n.rv-tx a { color: #0969da; text-decoration: none }\n.rv-tx a:hover { text-decoration: underline }\n.rv-empty { color: var(--faint); font-size: 12px; margin: 0 }\n.rv-box { margin-top: 4px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--card) }\n.rv-box[hidden] { display: none }\n.rv-turn { margin: 0; padding: 0; border: 0; background: none }\n.rv-turn .turn-group { margin: 0 }\n.rv-mark { margin: 10px 12px; display: flex; justify-content: center }\n.rv-box .turn-group { margin: 0 }\n.rv-none { padding: 14px; color: var(--faint); font-size: 12.5px }\n.rv-note { margin: 8px 12px; padding: 7px 10px; border-radius: 8px; background: #fdf1e3; color: #9a5b10; font-size: 12px }\n.rv-charter { margin: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 12px }\n.rv-charter h4 { margin: 6px 0 2px; font-size: 11.5px; color: var(--faint); font-weight: 600 }\n.rv-charter h5 { margin: 8px 0 2px; font-size: 11.5px; color: var(--faint) }\n.rv-charter pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; color: var(--mute) }\n/* 一轮写进账本的气泡: 过程框下面, 靠自己那一侧; 多颗时各带一行小头 (去处 / 定论)。 */\n.rv-spk { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; min-width: 0 }\n.rv-msg.me .rv-spk { align-items: flex-end }\n.rv-smh { font-size: 11px }\n.rv-smh time { margin-left: 6px }\n.rv-files { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px }\n/* reminder 标签收在气泡底: 默认只露种类, 点开看原文。 */\n.rv-bub .rems { padding: 4px 0 0 }\n.rv-bub .rem-raw { max-height: 360px; overflow: auto }\n.rv-mh .mstat { display: inline-flex; gap: 6px; align-items: center; color: var(--faint) }\n.ho-who[data-node], .ho-line[data-node] { cursor: pointer }\n/* 标题行: room 名 × 👁 role 名 —— ×「取消选择 room」夹在两者之间, 消除的是前者。× 触控区 32px (窄屏不挤标题: 标题先让位 min-width:0), 字形 14px, 与返回键 chevron 同一套线描。 */\n.rv-trow { display: flex; align-items: center; gap: 2px; min-width: 0 }\n.rv-trow .rv-ttl { min-width: 0; flex: 0 1 auto }\n.rv-pov-tag { flex: 0 1 auto; min-width: 4.2em; max-width: 45%; margin-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--faint) }\n.rv-clr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -5px 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--mute); cursor: pointer }\n.rv-clr:hover, .rv-clr:focus-visible { color: var(--ink); background: var(--paper) }\n.rv-clr svg { display: block }\n.rv-sys { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 8px; margin: 8px 12px; padding: 0 4px; min-width: 0; color: var(--faint); font-size: 11.5px; line-height: 1.6; text-align: center; overflow-wrap: anywhere }\n.rv-sys time { flex: none; font-size: 10.5px; opacity: .8 }\n.rv-sys.remove > span { color: var(--mute) }";
|
|
3107
|
+
var CSS = ".side-body { flex: 1; min-height: 0; display: flex }\n.convs { flex: 1; min-width: 0; overflow: auto; padding: 0 }\n.rv-list { padding: 2px 8px 16px }\n.convs-h { padding: 2px 8px 0 }\n.convs-h h2 { margin-top: 6px }\n.convs h2 > span:nth-of-type(2) { flex: none }\n.convs h2 .vt + .vt { margin-left: 0 }\n.convs h2 .vt.on { color: var(--accent) }\n.convs h2 .vt svg { flex: none }\n@media (min-width: 761px) { .app.side-list .side { width: max(332px, 25vw) } }\n/* 滚动条: 支持 ::-webkit-scrollbar 的 (Chrome / Safari) 走伪元素; 其余 (Firefox) 走标准属性。不能两套并设: Chrome 121+ / Safari 18.2+ 见到 scrollbar-width / scrollbar-color 就让 ::-webkit-scrollbar 整个失效。 */\n@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--line) transparent } }\n::-webkit-scrollbar { width: 8px; height: 8px }\n::-webkit-scrollbar-track { background: transparent }\n::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box }\n::-webkit-scrollbar-thumb:hover { background-color: var(--faint) }\n::-webkit-scrollbar-corner { background: transparent }\n.thread-in, .gside, .rolebar, .rv-mh { overflow-wrap: anywhere }\n.rv-bub { min-width: 0; overflow-wrap: anywhere }\n.rv-files { min-width: 0 }\n.rv-files .rv-chip { white-space: normal; overflow-wrap: anywhere; max-width: 100%; line-height: 1.45; padding: 1px 7px }\n.rv-mh > * { min-width: 0 }\n.gs-mem .nm { white-space: normal; overflow-wrap: anywhere }\n.gs-cls { min-width: 0; overflow-wrap: anywhere }\n.rv-list .ci .l2 .rv-chip { flex: none }\n.rv-msg.hit .rv-bub { animation: hit 1.6s ease-out }\n.rv-graph { display: block; font: 11.5px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor: grab; touch-action: none; user-select: none }\n.rv-edge { stroke: #c9d2df; stroke-width: 1 }\n.rv-edge.unread { stroke: #f2a7ad; stroke-width: 1.6 }\n.rv-edge.on { stroke: var(--accent); stroke-width: 1.6 }\n.rv-hit { stroke: transparent; stroke-width: 12; cursor: pointer }\n.rv-node { cursor: grab }\n.rv-tap { fill: transparent; stroke: none; pointer-events: all }\n.rv-room rect { fill: var(--them); stroke: var(--line) }\n.rv-room text { fill: var(--ink) }\n.rv-room.on > text { fill: var(--accent); font-weight: 700 }\n.rv-person .sh, .smi .sh { fill: var(--card); stroke: var(--mute); stroke-width: 1.6 }\n.rv-person .rv-emo { font-size: 17px; fill: initial }\n.rv-person.human .rv-nm { fill: var(--human); font-weight: 600 }\n.rv-person.wizard.st-working .sh, .smi.st-working .sh { fill: #2da44e; stroke: #1a7f37 }\n.rv-body { transform-box: fill-box; transform-origin: center }\n.rv-person.wizard.st-working .rv-body { animation: rvbreath 1.8s ease-in-out infinite }\n@keyframes rvbreath { 0%, 100% { transform: scale(.88) } 50% { transform: scale(1.14) } }\n.rv-person.wizard.st-blocked .sh, .smi.st-blocked .sh { fill: #e8336d; stroke: #b3124a }\n.rv-person.wizard.st-idle .sh, .smi.st-idle .sh { fill: #e4e7ec; stroke: #7d8795 }\n.rv-person.wizard.st-asleep .sh, .smi.st-asleep .sh { fill: #f6f7f9; stroke: #b9c0ca; stroke-dasharray: 3 2.5 }\n.rv-person.wizard.cold .sh, .smi.cold .sh { fill: #fff; stroke: #c9d0da; stroke-width: 1 }\n.rv-person.wizard.st-asleep text { fill: var(--faint) }\n.rv-hosthat .hh, .rv-legend .lghost path { fill: #7c4dcc; stroke: #2d1a5e; stroke-width: .9; stroke-linejoin: round }\n.rv-hosthat .hb, .rv-legend .lghost .hb { fill: #d9c8ff; stroke: #2d1a5e; stroke-width: .6 }\n.rv-hosthat { pointer-events: none }\n.rv-legend .lghost { flex: none }\n.rv-room .rv-un circle { fill: #cf222e }\n.rv-room .rv-un text { fill: #fff; font-size: 9px; font-weight: 600 }\n.rv-edge.direct { stroke: #9aa7ba; stroke-width: 1.4 }\n.rv-frame rect { fill: var(--cf, #7c4dcc10); stroke: var(--cs, #b9a6e0); stroke-width: 1.1; stroke-dasharray: 6 4 }\n.rv-ftl { font-size: 12px; font-weight: 600; fill: #5b3f8f; pointer-events: none; paint-order: stroke; stroke: #f7f4fd; stroke-width: 3.5px; stroke-linejoin: round }\n.rv-ftl .fh { font-weight: 400; fill: #7c6aa6 }\n.rv-ftl .fh.none { fill: var(--faint); font-style: italic }\n.rv-ftl .fm { pointer-events: all; cursor: pointer; fill: var(--accent) }\n.rv-ftl .fm:hover { text-decoration: underline; text-underline-offset: 2px }\n.rv-room.arch { opacity: .6 }\n.rv-room.arch rect { stroke-dasharray: 3 2.5; fill: var(--card) }\n.rv-legend .lg.frm { width: 13px; height: 9px; border: 1.2px dashed #b9a6e0; background: #7c4dcc10; border-radius: 3px }\n.rv-edge.sel { stroke: var(--accent); stroke-width: 3 }\n.rv-person.wizard.on .rv-nm, .rv-person.human.on .rv-nm { fill: var(--accent); font-weight: 700 }\n.rv-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 4px 10px 8px; font-size: 11px; color: var(--faint) }\n.rv-legend span { display: inline-flex; align-items: center; gap: 4px }\n.rv-legend .lg { display: inline-block; width: 9px; height: 9px; border: 1.6px solid var(--mute); box-sizing: border-box }\n.rv-legend .wz { border-radius: 50% }\n.rv-legend .wz.working { background: #2da44e; border-color: #1a7f37 }\n.rv-legend .wz.idle { background: #e4e7ec; border-color: #7d8795 }\n.rv-legend .wz.blocked { background: #e8336d; border-color: #b3124a }\n.rv-legend .wz.cold { background: #fff; border: 1px solid #c9d0da }\n.rv-legend .wz.asleep { background: #f6f7f9; border-style: dashed; border-color: #b9c0ca }\n.rv-legend .lgemo { font-size: 11px; line-height: 1 }\n.rv-lead { fill: #f5b301; stroke: #6b4a00; stroke-width: .9; stroke-linejoin: round; pointer-events: none }\n.rv-legend .lglead { fill: #f5b301; stroke: #6b4a00; stroke-width: .9 }\n.rv-legend .lgpoly { flex: none }\n.rv-legend .lgpoly polygon, .rv-legend .lgpoly circle { fill: #e4e7ec; stroke: #7d8795; stroke-width: 1.4; stroke-linejoin: round }\n.smi { flex: none; vertical-align: -4px }\n.smi:not([class*=st-]) .sh { fill: #e4e7ec; stroke: #8a93a0 }\n.rolebar .facts .fx-smi { display: inline-flex; align-items: center; cursor: help }\n.rolebar .facts .lead { color: #b07d00 }\n.rv-person text { fill: var(--ink); font-size: 12px }\n.rv-person text.rv-nm { font-size: 12px; paint-order: stroke; stroke: var(--card); stroke-width: 3.5px; stroke-linejoin: round }\n.rv-room text { font-size: 13px }\n.rv-person.ghost .sh { fill: #f6f7f9; stroke: #c9d0da; stroke-dasharray: 3 2.5 }\n.rv-person.ghost text { fill: var(--faint) }\n.rv-ttl { font-size: 15.5px; line-height: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }\n.rv-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 3px; font-size: 11.5px; color: var(--mute) }\n.rv-lb { font-size: 15px }\n.rv-chip { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 999px; background: var(--them); color: var(--mute); font-size: 11px; line-height: 17px; white-space: nowrap }\n.rv-chip.ok { background: #e8f5ee; color: #1a7f3c }\n.rv-chip.warn { background: #fdf1e3; color: #9a5b10 }\n.rv-chip.ask, .rv-chip.bad { background: #fdecec; color: #b42318 }\n.rv-chip.go { background: var(--mine); color: var(--accent) }\n.rv-chip.file { background: var(--them-soft) }\n.rv-chip.re { background: transparent; color: var(--faint); border: 1px solid var(--line) }\n.rv-act { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 2px 9px; font-size: 12px; cursor: pointer; color: var(--mute) }\n.rv-act:hover, .rv-act.on { color: var(--accent); border-color: var(--accent) }\n/* 图右侧的成员列: 点开一个 room 才有, 看 wizard 时收起。 */\n.gside { flex: none; width: 252px; min-height: 0; overflow: auto; border-left: 1px solid var(--line); background: var(--card); padding: 8px }\n.gs-host { flex: none; font-size: 11px; line-height: 1 }\n.gside[hidden] { display: none }\n.gs-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 4px; color: var(--faint); font-size: 12px; line-height: 20px }\n.gs-hl { min-width: 0 }\n.gs-hn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto }\n.gs-x { display: none; flex: none; margin-left: auto; width: 32px; height: 32px; border: 0; background: none; color: var(--mute); font-size: 15px; cursor: pointer }\n.gs-hn + .gs-x { margin-left: 0 }\n.gs-meta { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 0 2px 4px; color: var(--faint); font-size: 11px; line-height: 1.6 }\n.gs-notice { display: flex; align-items: flex-start; gap: 5px; width: 100%; margin: 0 0 6px; padding: 5px 8px; border: 0; border-radius: 8px; background: #fff8e1; color: #6b4a00; font: inherit; font-size: 11.5px; line-height: 1.5; text-align: left; cursor: pointer }\n.gs-notice:hover { background: #fff3cd }\n.gs-np { flex: none; font-size: 11px }\n.gs-nt { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }\n.gs-notice.on .gs-nt { display: block; -webkit-line-clamp: unset; overflow: visible }\n.gs-srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 6px; padding: 4px 6px; border-radius: 8px; background: var(--paper); font-size: 11.5px; line-height: 1.5 }\n.gs-sbt { flex: none; color: var(--faint); font-size: 10.5px }\n.gs-src { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; background: var(--card); color: var(--mute); font: inherit; font-size: 11px; line-height: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }\n.gs-src.post { border-color: #cbb7ea; color: #5b3f8f; background: #f6f1fd }\nbutton.gs-src { cursor: pointer }\nbutton.gs-src:hover { color: var(--accent); border-color: var(--accent) }\n.gs-head b { color: var(--mute); font-weight: 600 }\n.gs-duty { color: #b42318; font-weight: 600 }\n.gs-list { padding-top: 2px }\n.gs-item { border-radius: 6px }\n.gs-item.grp { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--paper) }\n.gs-row { display: flex; align-items: center; gap: 4px; min-width: 0; border-radius: 6px; padding-right: 6px }\n.gs-row:hover { background: var(--paper) }\n.gs-ago { flex: none; min-width: 2.6em; text-align: right; color: var(--faint); font-size: 10.5px; white-space: nowrap; cursor: pointer }\n.gs-ago.none { opacity: .6 }\n.gs-role { flex: none; font-size: 11px; line-height: 1; width: 10px; text-align: center; opacity: .8 }\n.gs-host, .gs-lead { flex: none; font-size: 11px; line-height: 1 }\n.gs-blk { margin-left: -2px; font-weight: 600; font-size: 10.5px; color: #b3124a }\n.gs-due.on { background: #b42318; color: #fff }\n.gs-ch { width: 0; height: 0; border-left: 3.5px solid currentColor; border-top: 3px solid transparent; border-bottom: 3px solid transparent; transition: transform .12s }\n.gs-due.on .gs-ch { transform: rotate(90deg) }\n.gs-duties { display: flex; flex-direction: column; gap: 2px; margin: 2px 4px 4px 10px; padding-left: 6px; border-left: 2px solid #f3c6c6 }\n.gs-dt { display: flex; flex-direction: column; gap: 0; text-align: left; border: 0; border-radius: 5px; padding: 2px 6px; background: none; cursor: pointer; font: inherit; color: inherit }\n.gs-dt:hover { background: var(--paper) }\n.gs-dq { font-size: 10.5px; color: var(--mute) }\n.gs-dq b { color: #b42318; font-weight: 600 }\n.gs-ds { font-size: 11px; line-height: 1.45; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }\n.gs-open { display: none }\n.gs-pip { display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: #cf222e; vertical-align: 2px }\n.gs-list { display: flex; flex-direction: column; gap: 2px }\n.gs-mem { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; padding: 5px 6px; border: 0; border-radius: 6px; background: none; color: var(--ink); text-align: left; cursor: pointer }\n.gs-mem .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px }\n.gs-mem.human .nm { color: var(--human) }\n.gs-mem.busy .nm { color: var(--accent) }\n.gs-cls { flex: none; color: var(--faint); font-size: 10.5px }\n.gs-row:has(.gs-mem.me), .gs-row:has(.gs-mem.me):hover { background: var(--mine) }\n.gs-item.out .gs-mem .nm, .gs-item.out .gs-mem.human .nm, .gs-item.out .gs-mem.busy .nm { color: var(--faint) }\n.gs-item.out .gs-ago, .gs-item.out .gs-role, .gs-item.out .gs-host, .gs-item.out .gs-lead, .gs-item.out .smi { opacity: .6 }\n.gs-pov { flex: none; font-size: 11px; line-height: 1 }\n.gs-due { flex: none; display: inline-flex; align-items: center; gap: 3px; border: 0; border-radius: 999px; padding: 0 6px; background: #fdecec; color: #b42318; font-size: 10.5px; line-height: 17px; cursor: pointer }\n@media (max-width: 760px) { .gside { display: none } .gs-open { display: inline-flex; align-items: center } .gside.sheet:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; z-index: 30; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 32px #0003; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)) } .gside.sheet .gs-x { display: inline-block } .gside.sheet .gs-mem { padding: 10px 6px } .gside.sheet .gs-dt { padding: 5px 6px } .gside.sheet .gs-due { padding: 3px 10px } .gside.sheet .gs-ago { font-size: 11.5px } .gside.sheet .gs-row { gap: 8px } }\n.rv-older { display: block; margin: 8px auto; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 2px 12px; font-size: 12px; color: var(--mute); cursor: pointer }\n/* 一条消息: 头在气泡外 (谁 → 谁 · room · 时刻), 气泡只装正文。 */\n.rv-msg { display: flex; flex-direction: column; gap: 3px; margin: 10px 0; min-width: 0 }\n.rv-msg > .rv-mh { padding: 0 2px }\n.rv-bub { align-self: flex-start; max-width: min(88%, 720px); padding: 8px 13px; background: var(--them); border: 0; border-radius: 14px }\n.rv-msg.me .rv-bub { align-self: flex-end; background: var(--mine) }\n.rv-msg.k-system .rv-bub { background: var(--them-soft, var(--them)) }\n.rv-msg.me .rv-turn .bubbles > .say { align-self: flex-end }\n.rv-mh { display: flex; flex-wrap: wrap; gap: 3px 8px; align-items: center; font-size: 11.5px; color: var(--mute) }\n.rv-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; min-width: 0 }\n.rv-arr { color: var(--faint); white-space: nowrap }\n.rv-arr::before { content: '→' }\n.rv-via::before { content: '—' }\n.rv-via::after { content: '→' }\n.rv-msg.me > .rv-mh, .rv-msg.me .rv-spk > .rv-mh { flex-direction: row-reverse }\n.rv-msg.me .rv-path { flex-direction: row-reverse }\n.rv-msg.me .rv-arr::before { content: '←' }\n.rv-msg.me .rv-via::before { content: '←' }\n.rv-msg.me .rv-via::after { content: '—' }\n.rv-msg.me .rv-rawbtn { margin-left: 0 }\n.rv-au { font-weight: 600; color: var(--ink); cursor: pointer }\n.rv-au:hover { text-decoration: underline dotted var(--faint); text-underline-offset: 3px }\n.rv-au.human { color: var(--human) }\n.rv-au.daemon { color: var(--wezard) }\n.rv-tag { color: var(--accent); cursor: pointer }\n.rv-roomtag { color: var(--chat); cursor: pointer; font-size: 11px; margin: 0 1px }\n.rv-roomtag:hover { text-decoration: underline dotted; text-underline-offset: 3px }\n.rv-mh time { color: var(--faint) }\n.rv-open { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 0 6px; font-size: 11px; color: var(--faint); cursor: pointer }\n.rv-open:hover { color: var(--accent); border-color: var(--accent) }\n.rv-quote { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; min-width: 0 }\n.rv-quote .rq-it { flex: 1; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; gap: 1px; text-align: left; border: 0; border-radius: 8px; padding: 4px 8px; background: #0000000a; font: inherit; cursor: pointer; color: inherit }\n.rv-quote .rq-it:hover { background: #00000012 }\n.rv-quote .rq-who { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--accent) }\n.rv-quote .rq-who.human { color: var(--human) }\n.rv-quote .rq-tx { display: block; min-width: 0; max-width: 100%; font-size: 12px; line-height: 1.45; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }\n.rv-quote .rq-gone { font-style: italic; color: var(--faint); cursor: default }\n.rv-quote .rq-more { flex: none; align-self: center; border: 0; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; background: #0000000a; color: var(--mute); cursor: pointer }\n.rv-quote .rq-more.on { color: var(--accent); background: var(--mine) }\n.rv-quote .rq-rest { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px }\n.rv-quote .rq-rest[hidden] { display: none }\n.rv-open { display: inline-flex; align-items: center; gap: 4px }\n.rv-och { width: 0; height: 0; border-left: 4px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; transition: transform .12s }\n.rv-open.on { background: var(--mine); color: var(--accent); border-color: var(--accent); font-weight: 600 }\n.rv-open.on .rv-och { transform: rotate(90deg) }\n.rv-tx { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; color: #1f2328 }\n.rv-tx > :first-child { margin-top: 0 }\n.rv-tx > :last-child { margin-bottom: 0 }\n.rv-tx p { margin: .6em 0 }\n.rv-tx h1, .rv-tx h2, .rv-tx h3, .rv-tx h4 { margin: 1em 0 .4em; font-weight: 600; line-height: 1.35 }\n.rv-tx h1 { font-size: 1.4em }\n.rv-tx h2 { font-size: 1.2em }\n.rv-tx h3 { font-size: 1.05em }\n.rv-tx h4 { font-size: 1em }\n.rv-tx ul, .rv-tx ol { margin: .6em 0; padding-left: 1.6em }\n.rv-tx li { margin: .2em 0 }\n.rv-tx li > p { margin: .2em 0 }\n.rv-tx code { background: #0000000d; border-radius: 4px; padding: 1px 5px; font-size: .9em; font-family: ui-monospace, Menlo, monospace }\n.rv-tx pre { background: #ffffffb3; border-radius: 8px; padding: 8px 10px; margin: .6em 0; overflow: auto; font-size: 12.5px; line-height: 1.5 }\n.rv-tx pre code { background: transparent; padding: 0; font-size: inherit }\n.rv-tx blockquote { margin: .6em 0; padding: .1em 1em; border-left: 3px solid #0000001f; color: #656d76 }\n.rv-tx table { border-collapse: collapse; margin: .7em 0; display: block; overflow: auto; max-width: 100% }\n.rv-tx th, .rv-tx td { border: 1px solid #0000001a; padding: 5px 10px }\n.rv-tx th { background: #0000000a; font-weight: 600 }\n.rv-tx hr { border: 0; border-top: 1px solid #0000001a; margin: .9em 0 }\n.rv-tx a { color: #0969da; text-decoration: none }\n.rv-tx a:hover { text-decoration: underline }\n.rv-empty { color: var(--faint); font-size: 12px; margin: 0 }\n.rv-box { margin-top: 4px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--card) }\n.rv-box[hidden] { display: none }\n.rv-turn { margin: 0; padding: 0; border: 0; background: none }\n.rv-turn .turn-group { margin: 0 }\n.rv-mark { margin: 10px 12px; display: flex; justify-content: center }\n.rv-box .turn-group { margin: 0 }\n.rv-none { padding: 14px; color: var(--faint); font-size: 12.5px }\n.rv-note { margin: 8px 12px; padding: 7px 10px; border-radius: 8px; background: #fdf1e3; color: #9a5b10; font-size: 12px }\n.rv-charter { margin: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 12px }\n.rv-charter h4 { margin: 6px 0 2px; font-size: 11.5px; color: var(--faint); font-weight: 600 }\n.rv-charter h5 { margin: 8px 0 2px; font-size: 11.5px; color: var(--faint) }\n.rv-charter pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; color: var(--mute) }\n/* 一轮写进账本的气泡: 过程框下面, 靠自己那一侧; 多颗时各带一行小头 (去处 / 定论)。 */\n.rv-spk { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; min-width: 0 }\n.rv-msg.me .rv-spk { align-items: flex-end }\n.rv-smh { font-size: 11px }\n.rv-smh time { margin-left: 6px }\n.rv-files { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px }\n/* reminder 标签收在气泡底: 默认只露种类, 点开看原文。 */\n.rv-bub .rems { padding: 4px 0 0 }\n.rv-bub .rem-raw { max-height: 360px; overflow: auto }\n.rv-mh .mstat { display: inline-flex; gap: 6px; align-items: center; color: var(--faint) }\n.ho-who[data-node], .ho-line[data-node] { cursor: pointer }\n/* 标题行: room 名 × 👁 role 名 —— ×「取消选择 room」夹在两者之间, 消除的是前者。× 触控区 32px (窄屏不挤标题: 标题先让位 min-width:0), 字形 14px, 与返回键 chevron 同一套线描。 */\n.rv-trow { display: flex; align-items: center; gap: 2px; min-width: 0 }\n.rv-trow .rv-ttl { min-width: 0; flex: 0 1 auto }\n.rv-pov-tag { flex: 0 1 auto; min-width: 4.2em; max-width: 45%; margin-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--faint) }\n.rv-clr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -5px 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--mute); cursor: pointer }\n.rv-clr:hover, .rv-clr:focus-visible { color: var(--ink); background: var(--paper) }\n.rv-clr svg { display: block }\n.rv-sys { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 8px; margin: 8px 12px; padding: 0 4px; min-width: 0; color: var(--faint); font-size: 11.5px; line-height: 1.6; text-align: center; overflow-wrap: anywhere }\n.rv-sys time { flex: none; font-size: 10.5px; opacity: .8 }\n.rv-sys.remove > span { color: var(--mute) }";
|
|
2839
3108
|
var injectStyle = function () {
|
|
2840
3109
|
if (document.getElementById('rv-style')) return;
|
|
2841
3110
|
var s = document.createElement('style');
|