clavarium 0.2.305-next.1 → 0.2.307-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
- package/server/api.mjs +1 -1
- package/server/rooms.mjs +5 -3
- package/web/app.js +70 -15
- package/web/index.html +2 -0
- package/web/style.css +10 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.307-next.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.307-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
|
13
13
|
"@xterm/xterm": "^6.0.0",
|
|
14
14
|
"clavarium-binder": "0.1.59-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.2-next.2",
|
|
16
|
-
"clavarium-parley": "0.17.
|
|
16
|
+
"clavarium-parley": "0.17.57-next.1",
|
|
17
17
|
"clavarium-tether": "0.1.0-next.49",
|
|
18
18
|
"mammoth": "1.13.0",
|
|
19
19
|
"mermaid": "11.17.2",
|
|
@@ -787,9 +787,9 @@
|
|
|
787
787
|
}
|
|
788
788
|
},
|
|
789
789
|
"node_modules/clavarium-parley": {
|
|
790
|
-
"version": "0.17.
|
|
791
|
-
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.
|
|
792
|
-
"integrity": "sha512-
|
|
790
|
+
"version": "0.17.57-next.1",
|
|
791
|
+
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.57-next.1.tgz",
|
|
792
|
+
"integrity": "sha512-jG+AXX7QOkQWaFAxT/oZpE58HgdRvnR5ChsCiI7YURom1AeWBuGjXOoCVSABXv4QYmFfCIqCe+nUH0/N9XgqOA==",
|
|
793
793
|
"license": "MIT",
|
|
794
794
|
"bin": {
|
|
795
795
|
"parley": "bin/parley.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.307-next.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
47
|
"clavarium-binder": "0.1.59-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.2-next.2",
|
|
49
|
-
"clavarium-parley": "0.17.
|
|
49
|
+
"clavarium-parley": "0.17.57-next.1",
|
|
50
50
|
"clavarium-tether": "0.1.0-next.49",
|
|
51
51
|
"mammoth": "1.13.0",
|
|
52
52
|
"mermaid": "11.17.2",
|
package/server/api.mjs
CHANGED
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
* POST /api/asset-groups/place {asset, group}: put an asset in a group (group null to take it out)
|
|
90
90
|
* POST /api/asset-groups/<id>/rename {label}
|
|
91
91
|
* POST /api/asset-groups/<id>/remove
|
|
92
|
-
* GET /api/rooms the rooms (#268): [{id, name, host, members: [{id, kind, name, ref, host?}]}]
|
|
92
|
+
* GET /api/rooms the rooms (#268): [{id, name, host, members: [{id, kind, name, ref, host?}], unread, last, thinking: [names]}]
|
|
93
93
|
* POST /api/rooms {name, conversations: [names], boxes: [ids], host?}: a new room
|
|
94
94
|
* POST /api/rooms/<id> {name?, host?, add?: {conversations, boxes}, remove?: [member ids]}
|
|
95
95
|
* POST /api/rooms/<id>/remove the room and its thread
|
package/server/rooms.mjs
CHANGED
|
@@ -57,7 +57,10 @@ export class Rooms {
|
|
|
57
57
|
#unread(r) { try { const seen = Date.parse(r.seen ?? '') || 0; return this.#thread(r.id).read({ last: 200 }).messages.filter((m) => (m.from === 'agent' || m.by) && (Date.parse(m.at) || 0) > seen).length; } catch { return 0; } }
|
|
58
58
|
/* Its last message, for the list: when, and its first words. */
|
|
59
59
|
#last(r) { try { const m = this.#thread(r.id).read({ last: 1 }).messages.at(-1); return m ? { at: m.at, text: String(m.text ?? '').replace(/\s+/g, ' ').slice(0, 120), ...(m.by?.name ? { by: m.by.name } : {}) } : null; } catch { return null; } }
|
|
60
|
-
|
|
60
|
+
/* Who has a message of the room and has not answered yet (#282), by their names of the moment: « Hugo parle… »
|
|
61
|
+
in its row of the list and on its bar, « Hugo réfléchit… » in its thread. */
|
|
62
|
+
#thinkingOf(id, members) { return [...(this.#thinking.get(id) ?? new Map()).entries()].filter(([, at]) => Date.now() - at < THINKING_MS).map(([mid]) => members.find((m) => m.id === mid)?.name).filter(Boolean); }
|
|
63
|
+
list() { return this.#all().map((r) => { const members = this.#shown(r); return { id: r.id, name: r.name, host: r.host, members, at: r.at, unread: this.#unread(r), last: this.#last(r), thinking: this.#thinkingOf(r.id, members) }; }); }
|
|
61
64
|
get(id) { const r = this.#find(id); return { id: r.id, name: r.name, host: r.host, members: this.#shown(r), at: r.at }; }
|
|
62
65
|
|
|
63
66
|
/* A new room: its name, its AIs (conversation names), its boxes (ids), and which AI is the host (the first by default). */
|
|
@@ -121,8 +124,7 @@ export class Rooms {
|
|
|
121
124
|
/* A member named in a text (@{id}): its name of the moment, on the screen. */
|
|
122
125
|
const named = (text) => String(text ?? '').replace(/@\{([0-9a-f-]{36})\}/g, (whole, mid) => { const m = members.find((x) => x.id === mid); return m ? `@${m.name}` : whole; });
|
|
123
126
|
if (options?.seen !== false) { const list = this.#all(); const r = list.find((x) => x.id === id); if (r) { r.seen = this.#now().toISOString(); this.#file.set(list); } }
|
|
124
|
-
|
|
125
|
-
const thinking = [...(this.#thinking.get(id) ?? new Map()).entries()].filter(([, at]) => Date.now() - at < THINKING_MS).map(([mid]) => members.find((m) => m.id === mid)?.name).filter(Boolean);
|
|
127
|
+
const thinking = this.#thinkingOf(id, members);
|
|
126
128
|
return { room: this.get(id), thinking, ...read, messages: (read.messages ?? []).map((m) => (typeof m.text === 'string' && m.text.includes('@{') ? { ...m, text: named(m.text) } : m)) };
|
|
127
129
|
}
|
|
128
130
|
|
package/web/app.js
CHANGED
|
@@ -424,6 +424,8 @@
|
|
|
424
424
|
return bar;
|
|
425
425
|
}
|
|
426
426
|
for (const top of [...document.querySelectorAll('#places .sheet > .panel-top')]) topBar(top, top.parentElement.id === 'salon' ? { state: 'salon-state' } : {});
|
|
427
|
+
/* A room's title: its name, and under it who speaks now (salonLive). */
|
|
428
|
+
{ const t = $('salon-title'); const name = document.createElement('span'); name.id = 'salon-name'; name.textContent = t.textContent; const live = document.createElement('small'); live.id = 'salon-live'; live.className = 'salon-live'; live.hidden = true; t.replaceChildren(name, live); }
|
|
427
429
|
/* A room's settings: on its bar's right, in the same group of views a conversation's settings sit in. */
|
|
428
430
|
{ const views = document.createElement('div'); views.className = 'views'; views.setAttribute('role', 'group'); views.setAttribute('aria-label', 'Room'); views.append($('salon-settings')); $('salon').querySelector('.topbar .bar-right').prepend(views); }
|
|
429
431
|
const applyFold = (folded) => {
|
|
@@ -1257,6 +1259,17 @@
|
|
|
1257
1259
|
/* The rooms known, even before their part of this page has run (a list painted early). */
|
|
1258
1260
|
const roomsNow = () => { try { return Array.isArray(rooms) ? rooms : []; } catch { return []; } };
|
|
1259
1261
|
const roomOpenNow = () => { try { return place === 'salon' ? salonId : ''; } catch { return ''; } };
|
|
1262
|
+
/* Words of the screen's language (Parley's texts, /api/talk/words) once read; English till then. */
|
|
1263
|
+
const uiSaid = (key, fallback, vars = {}) => {
|
|
1264
|
+
let words = null; try { words = chatWords; } catch { /* not read yet */ }
|
|
1265
|
+
return (typeof words?.[key] === 'string' ? words[key] : fallback).replace(/\{(\w+)\}/g, (all, k) => (k in vars ? String(vars[k]) : all));
|
|
1266
|
+
};
|
|
1267
|
+
/* Who of a room speaks now (#282, an AI given a message and not done): « Cuisine parle… ». */
|
|
1268
|
+
const speaking = (who) => (who.length > 1 ? uiSaid('room-speaking-many', '{names} are speaking\u2026', { names: who.join(', ') }) : uiSaid('room-speaking', '{name} is speaking\u2026', { name: who[0] }));
|
|
1269
|
+
const thinkingOf = (r) => (Array.isArray(r?.thinking) ? r.thinking.filter((x) => typeof x === 'string' && x) : []);
|
|
1270
|
+
/* ROOMS ONLY (a filter of the list): kept on this device. */
|
|
1271
|
+
let roomsOnly = false;
|
|
1272
|
+
try { roomsOnly = localStorage.getItem('clavarium-list-show') === 'rooms'; } catch { /* a private window */ }
|
|
1260
1273
|
function roomItem(r) {
|
|
1261
1274
|
/* The same row as a conversation's (03-11: « de même nature ») -- its name, when, its last words on one line,
|
|
1262
1275
|
its state's dot -- told apart by a small room sign before its name. */
|
|
@@ -1265,12 +1278,15 @@
|
|
|
1265
1278
|
const sign = document.createElement('span'); sign.className = 'room-sign'; sign.setAttribute('aria-hidden', 'true');
|
|
1266
1279
|
title.append(sign, r.name);
|
|
1267
1280
|
b.append(title);
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1281
|
+
/* One of its AIs speaking now: said instead of its last message (a conversation at work: its dot, gold). */
|
|
1282
|
+
const who = thinkingOf(r);
|
|
1283
|
+
if (who.length) b.dataset.live = 'true';
|
|
1284
|
+
if (r.last || who.length) {
|
|
1285
|
+
const last = document.createElement('small'); last.className = 'last'; last.textContent = who.length ? speaking(who) : `${r.last.by ? `${r.last.by}: ` : ''}${r.last.text}`; b.append(last);
|
|
1286
|
+
if (r.last) { const when = document.createElement('small'); when.className = 'when'; when.textContent = whenWords(Date.parse(r.last.at)); b.append(when); b.dataset.when = 'true'; }
|
|
1271
1287
|
} else { const sub = document.createElement('small'); sub.textContent = `Room \u00b7 ${r.members.filter((m) => m.kind === 'ai').length} AIs`; b.append(sub); }
|
|
1272
|
-
/* Its dot: new words in it waiting (the colour of what waits for you), else ready. */
|
|
1273
|
-
const point = statePoint(r.unread > 0 ? 'wait' : 'ready'); point.title = r.unread > 0 ? `${r.unread} new` : 'Room'; b.append(point);
|
|
1288
|
+
/* Its dot: new words in it waiting (the colour of what waits for you), else at work while one speaks, else ready. */
|
|
1289
|
+
const point = statePoint(r.unread > 0 ? 'wait' : who.length ? 'work' : 'ready'); point.title = r.unread > 0 ? `${r.unread} new` : who.length ? speaking(who) : 'Room'; b.append(point);
|
|
1274
1290
|
if (r.id === roomOpenNow()) b.setAttribute('aria-current', 'true');
|
|
1275
1291
|
b.addEventListener('click', () => { void openSalon(r.id); });
|
|
1276
1292
|
return b;
|
|
@@ -1307,6 +1323,26 @@
|
|
|
1307
1323
|
if (open) { const body = document.createElement('div'); body.className = 'group-body'; body.append(...inside.map((c) => itemButton(c))); unfolding(g, [body]); box.append(body); }
|
|
1308
1324
|
return box;
|
|
1309
1325
|
}
|
|
1326
|
+
/* THE LIST'S FILTER (All | Rooms only): the same pressed buttons as the other views' (Files: List | Icons). */
|
|
1327
|
+
let wordsAsked = false;
|
|
1328
|
+
function paintListShow() {
|
|
1329
|
+
const box = $('list-show'); if (!box) return;
|
|
1330
|
+
box.hidden = DEVICE || roomsNow().length === 0;
|
|
1331
|
+
/* Its words (and a room's « … parle… ») in the screen's language: read once, then painted again. */
|
|
1332
|
+
if (!box.hidden && !wordsAsked) { wordsAsked = true; void readWords().then(() => paint(), () => { wordsAsked = false; }); }
|
|
1333
|
+
for (const b of box.querySelectorAll('button')) {
|
|
1334
|
+
b.textContent = b.dataset.show === 'rooms' ? uiSaid('list-rooms-only', 'Rooms only') : uiSaid('list-all', 'All');
|
|
1335
|
+
b.setAttribute('aria-pressed', String((b.dataset.show === 'rooms') === roomsOnly));
|
|
1336
|
+
}
|
|
1337
|
+
box.setAttribute('aria-label', uiSaid('list-show', 'Show'));
|
|
1338
|
+
}
|
|
1339
|
+
for (const b of $('list-show')?.querySelectorAll('button') ?? []) {
|
|
1340
|
+
b.addEventListener('click', () => {
|
|
1341
|
+
roomsOnly = b.dataset.show === 'rooms';
|
|
1342
|
+
try { localStorage.setItem('clavarium-list-show', roomsOnly ? 'rooms' : 'all'); } catch { /* a private window */ }
|
|
1343
|
+
paint();
|
|
1344
|
+
});
|
|
1345
|
+
}
|
|
1310
1346
|
function paint() {
|
|
1311
1347
|
if (listHeld) { paintLater = true; return; }
|
|
1312
1348
|
/* The groups, folded as a whole or not (a search shows them all). */
|
|
@@ -1319,7 +1355,11 @@
|
|
|
1319
1355
|
const shown = conversations.filter((c) => (query ? matches(c) : c.hidden !== true || showHidden || c.name === current)).sort(byRank);
|
|
1320
1356
|
const heading = (text) => { const h = document.createElement('h3'); h.className = 'list-head'; h.textContent = text; return h; };
|
|
1321
1357
|
const groups = groupsInOrder();
|
|
1322
|
-
|
|
1358
|
+
/* ROOMS ONLY: the rooms alone (a search among them); offered once there is one. */
|
|
1359
|
+
const onlyRooms = roomsOnly && !DEVICE && roomsNow().length > 0;
|
|
1360
|
+
paintListShow();
|
|
1361
|
+
if (onlyRooms) groupsOpen = false;
|
|
1362
|
+
else if (query || DEVICE) {
|
|
1323
1363
|
/* A search: everything found, in its place. */
|
|
1324
1364
|
items.append(...shown.filter((c) => !c.group).map((c) => itemButton(c)));
|
|
1325
1365
|
} else {
|
|
@@ -1391,15 +1431,15 @@
|
|
|
1391
1431
|
if (inside.length === 0) continue;
|
|
1392
1432
|
items.append(groupBox(g, inside, conversations.filter((c) => c.group === g).sort(byRank), Boolean(query) || !folded.has(g)));
|
|
1393
1433
|
}
|
|
1394
|
-
if (groupsOpen) unfolding(GROUPS, [...items.children]);
|
|
1434
|
+
if (groupsOpen && !onlyRooms) unfolding(GROUPS, [...items.children]);
|
|
1395
1435
|
/* ROOMS (03-11): their own list, after the groups of conversations; a search finds them by name. */
|
|
1396
1436
|
const roomsShown = roomsNow().filter((r) => !query || r.name.toLowerCase().includes(String(query).toLowerCase()));
|
|
1397
1437
|
if (!DEVICE && roomsShown.length) {
|
|
1398
1438
|
const b = document.createElement('button'); b.type = 'button'; b.className = 'list-head list-fold'; b.dataset.section = 'rooms';
|
|
1399
|
-
const open = !folded.has(ROOMS); b.setAttribute('aria-expanded', String(open));
|
|
1439
|
+
const open = onlyRooms || !folded.has(ROOMS); b.setAttribute('aria-expanded', String(open));
|
|
1400
1440
|
const chevron = document.createElement('span'); chevron.className = 'list-chevron'; chevron.setAttribute('aria-hidden', 'true'); chevron.textContent = open ? '\u25BE' : '\u25B8';
|
|
1401
1441
|
b.append(chevron, document.createTextNode('Rooms'));
|
|
1402
|
-
b.addEventListener('click', () => { if (folded.has(ROOMS)) folded.delete(ROOMS); else folded.add(ROOMS); keepFolded(); paint(); });
|
|
1442
|
+
b.addEventListener('click', () => { if (onlyRooms) return; if (folded.has(ROOMS)) folded.delete(ROOMS); else folded.add(ROOMS); keepFolded(); paint(); });
|
|
1403
1443
|
items.append(b);
|
|
1404
1444
|
if (open) items.append(...roomsShown.map((r) => roomItem(r)));
|
|
1405
1445
|
}
|
|
@@ -1410,7 +1450,7 @@
|
|
|
1410
1450
|
if (query) hits.forEach((h, i) => { h.toggleAttribute('data-chosen', i === chosenHit); if (i === chosenHit) h.scrollIntoView?.({ block: 'nearest' }); });
|
|
1411
1451
|
$('search-none').hidden = !query || hits.length > 0;
|
|
1412
1452
|
const toggle = $('hidden-toggle');
|
|
1413
|
-
toggle.hidden = DEVICE || hidden.length === 0 || Boolean(query);
|
|
1453
|
+
toggle.hidden = DEVICE || hidden.length === 0 || Boolean(query) || onlyRooms;
|
|
1414
1454
|
toggle.textContent = showHidden ? `Hide ${hidden.length} hidden` : `${hidden.length} hidden`;
|
|
1415
1455
|
toggle.setAttribute('aria-expanded', String(showHidden));
|
|
1416
1456
|
const calling = hidden.some(needsYou);
|
|
@@ -2772,6 +2812,10 @@
|
|
|
2772
2812
|
/* "Send when I stop", for dictation in the chat: kept by this device. */
|
|
2773
2813
|
let chatAuto = false;
|
|
2774
2814
|
try { chatAuto = localStorage.getItem('clavarium-chat-auto') === '1'; } catch { /* as above */ }
|
|
2815
|
+
/* The silence before it sends by itself, chosen on this device (Parley's menu, under the switch). */
|
|
2816
|
+
let chatAutoMs;
|
|
2817
|
+
try { chatAutoMs = Number(localStorage.getItem('clavarium-chat-auto-ms')) || undefined; } catch { /* as above */ }
|
|
2818
|
+
const keepAutoMs = (ms) => { chatAutoMs = ms; try { localStorage.setItem('clavarium-chat-auto-ms', String(ms)); } catch { /* as above */ } };
|
|
2775
2819
|
const deviceLang = () => (navigator.language || 'en');
|
|
2776
2820
|
let chatWords = null;
|
|
2777
2821
|
async function readWords() {
|
|
@@ -2890,7 +2934,7 @@
|
|
|
2890
2934
|
forget: (secretName) => post(`${API}/conversations/${encodeURIComponent(name)}/secrets/${encodeURIComponent(secretName)}/forget`, {}).then(() => { delete chatSecrets[secretName]; if (thread && threadOf === name) void thread.refresh(); }).catch(() => {}),
|
|
2891
2935
|
remind: () => post(talkPath(name, '/remind'), {}),
|
|
2892
2936
|
/* The helpers of the terminal, in the chat: this page's voice, the owner's ready answers, the keyboard rule of this device. */
|
|
2893
|
-
voice: chatVoice(), autoSend: chatAuto,
|
|
2937
|
+
voice: chatVoice(), autoSend: chatAuto, autoSendMs: chatAutoMs, onAutoSendMs: keepAutoMs,
|
|
2894
2938
|
onAutoSend: (on) => { chatAuto = on; try { localStorage.setItem('clavarium-chat-auto', on ? '1' : '0'); } catch { /* as above */ } },
|
|
2895
2939
|
touch: touchScreen,
|
|
2896
2940
|
});
|
|
@@ -5160,6 +5204,12 @@
|
|
|
5160
5204
|
return card;
|
|
5161
5205
|
}
|
|
5162
5206
|
let salonThread = null; let salonId = ''; let salonTimer = null;
|
|
5207
|
+
/* A room's bar while one of its AIs speaks: its dot at work (gold, breathing), the words under its name. */
|
|
5208
|
+
function salonLive(who) {
|
|
5209
|
+
const dot = $('salon-state'); const line = $('salon-live');
|
|
5210
|
+
if (dot) { dot.dataset.state = who.length ? 'work' : 'ok'; dot.title = who.length ? speaking(who) : ''; }
|
|
5211
|
+
if (line) { line.hidden = who.length === 0; line.textContent = who.length ? speaking(who) : ''; }
|
|
5212
|
+
}
|
|
5163
5213
|
function salonLeft() { clearInterval(salonTimer); salonTimer = null; salonThread?.destroy(); salonThread = null; salonId = ''; }
|
|
5164
5214
|
async function openSalon(id, push = true) {
|
|
5165
5215
|
if (DEVICE) return;
|
|
@@ -5167,7 +5217,8 @@
|
|
|
5167
5217
|
const r = rooms.find((x) => x.id === id); if (!r) return;
|
|
5168
5218
|
enterPlace('salon', push);
|
|
5169
5219
|
salonLeft(); salonId = id;
|
|
5170
|
-
$('salon-
|
|
5220
|
+
$('salon-name').textContent = r.name;
|
|
5221
|
+
salonLive(thinkingOf(r));
|
|
5171
5222
|
$('salon-who').replaceChildren(memberChips(r.members), el('span', 'hint', `${countOf(r.members)} \u25BE`));
|
|
5172
5223
|
$('salon-who').setAttribute('aria-expanded', 'false'); $('salon-members').hidden = true;
|
|
5173
5224
|
const rows = ['person', 'ai', 'box'].map((k) => { const of = r.members.filter((m) => m.kind === k); if (!of.length) return null; const row = el('div', 'salon-members-row'); row.append(el('span', 'hint', k === 'person' ? 'People' : k === 'ai' ? 'AIs' : 'Boxes'), ...of.map((m) => { const x = el('span', 'salon-member'); x.append(memberChips([m], 1), document.createTextNode(m.name)); if (m.host) x.append(el('span', 'salon-host', 'host')); return x; })); return row; }).filter(Boolean);
|
|
@@ -5179,10 +5230,14 @@
|
|
|
5179
5230
|
words, markdown: true, agentName: '',
|
|
5180
5231
|
load: (asked = {}) => fetch(`${API}/rooms/${id}/talk${asked.last ? `?last=${asked.last}` : ''}`).then((x) => x.json()).then((d) => {
|
|
5181
5232
|
/* Who was given a message and has not answered yet (#282): « Hugo réfléchit… ». */
|
|
5182
|
-
const who =
|
|
5233
|
+
const who = thinkingOf(d);
|
|
5183
5234
|
$('salon-thinking').hidden = who.length === 0;
|
|
5184
|
-
$('salon-thinking').replaceChildren(el('span', 'state-dot'), document.createTextNode(
|
|
5235
|
+
$('salon-thinking').replaceChildren(el('span', 'state-dot'), document.createTextNode(who.length > 1 ? uiSaid('room-thinking-many', '{names} are thinking\u2026', { names: who.join(', ') }) : uiSaid('room-thinking', '{name} is thinking\u2026', { name: who[0] ?? '' })));
|
|
5185
5236
|
$('salon-thinking').firstChild.dataset.state = 'work';
|
|
5237
|
+
/* Its bar says it too, as its row in the list: its dot at work, « Cuisine parle… » under its name. */
|
|
5238
|
+
salonLive(who);
|
|
5239
|
+
const known = rooms.find((x) => x.id === id);
|
|
5240
|
+
if (known && JSON.stringify(thinkingOf(known)) !== JSON.stringify(who)) { known.thinking = who; paint(); }
|
|
5186
5241
|
return d;
|
|
5187
5242
|
}),
|
|
5188
5243
|
send: (text) => post(`${API}/rooms/${id}/talk`, { text }),
|
|
@@ -5190,7 +5245,7 @@
|
|
|
5190
5245
|
view: chatView, onView: (v) => { chatView = v; try { localStorage.setItem('clavarium-chat-view', v); } catch { /* as above */ } },
|
|
5191
5246
|
math: { url: new URL('vendor/katex/katex.mjs', new URL('/', location.href)).href },
|
|
5192
5247
|
diagram: drawDiagram, highlight: colourCode, touch: touchScreen,
|
|
5193
|
-
voice: chatVoice(), autoSend: chatAuto, onAutoSend: (on) => { chatAuto = on; try { localStorage.setItem('clavarium-chat-auto', on ? '1' : '0'); } catch { /* as above */ } },
|
|
5248
|
+
voice: chatVoice(), autoSend: chatAuto, autoSendMs: chatAutoMs, onAutoSendMs: keepAutoMs, onAutoSend: (on) => { chatAuto = on; try { localStorage.setItem('clavarium-chat-auto', on ? '1' : '0'); } catch { /* as above */ } },
|
|
5194
5249
|
draft: `room:${id}`,
|
|
5195
5250
|
});
|
|
5196
5251
|
salonTimer = setInterval(() => { if (salonThread && salonId === id) void salonThread.refresh(); }, 3000);
|
package/web/index.html
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
<!-- SEARCH, discreet: opened by the magnifier, "/" or Ctrl+K; filters as it is typed. -->
|
|
19
19
|
<div id="search" role="search" hidden><input id="search-field" type="search" placeholder="Search" aria-label="Search conversations: name, folder, identifier, tool" autocomplete="off" spellcheck="false" maxlength="60" aria-controls="items"></div>
|
|
20
20
|
<!-- Needs you and Recent: copies of rows of the list below, by when they were last used (app.js, paint). -->
|
|
21
|
+
<!-- A FILTER of the list (once there is a room): everything, or the rooms only; kept on this device. -->
|
|
22
|
+
<div id="list-show" class="levels list-show" role="group" aria-label="Show" hidden><button type="button" data-show="all" aria-pressed="true">All</button><button type="button" data-show="rooms" aria-pressed="false">Rooms only</button></div>
|
|
21
23
|
<div id="recent"></div>
|
|
22
24
|
<div id="items"></div>
|
|
23
25
|
<p id="search-none" class="hint" hidden>Nothing found.</p>
|
package/web/style.css
CHANGED
|
@@ -57,7 +57,7 @@ button:focus-visible, input:focus-visible { outline: 2px solid var(--brass); out
|
|
|
57
57
|
.unfolding { animation: unfold .18s ease-out; }
|
|
58
58
|
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
|
|
59
59
|
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.85); } }
|
|
60
|
-
@media (prefers-reduced-motion: reduce) { .item > .state-dot, .unfolding { animation: none !important; } }
|
|
60
|
+
@media (prefers-reduced-motion: reduce) { .item > .state-dot, header.topbar .bar-state, .unfolding { animation: none !important; } }
|
|
61
61
|
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
62
62
|
.choices button[aria-checked="true"] { border-color: var(--brass); background: rgba(210, 169, 78, .16); }
|
|
63
63
|
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
@@ -1384,6 +1384,9 @@ select.pill { appearance: auto; }
|
|
|
1384
1384
|
#list-pin[aria-pressed="true"] .ic { transform: none; fill: currentColor; fill-opacity: .25; }
|
|
1385
1385
|
@media (max-width: 700px) { #list-pin { display: none; } }
|
|
1386
1386
|
#search[hidden] { display: none; }
|
|
1387
|
+
/* The list's filter (All | Rooms only): the pressed buttons of the other views, small, the list's width. */
|
|
1388
|
+
.list-show[hidden] { display: none; }
|
|
1389
|
+
.list-show button { flex: 1 1 0; padding: 4px 8px; font-size: .78rem; }
|
|
1387
1390
|
#search-field { width: 100%; box-sizing: border-box; padding: 6px 10px; font-size: .9rem; border-radius: 8px; }
|
|
1388
1391
|
#search-none { margin: 0 .25rem; }
|
|
1389
1392
|
.item[data-chosen] { border-color: var(--brass); }
|
|
@@ -2285,6 +2288,12 @@ header.topbar > .fold-here { font-size: 1rem; line-height: 1; padding: 4px 9px;
|
|
|
2285
2288
|
header.topbar > b { flex: 1 1 auto; font-size: 1rem; }
|
|
2286
2289
|
header.topbar > .bar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
|
|
2287
2290
|
header.topbar .bar-state { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
|
|
2291
|
+
/* A room one of whose AIs speaks now: its dot as a conversation's at work, the words under its name. */
|
|
2292
|
+
header.topbar .bar-state[data-state="work"] { background: var(--brass); animation: breathe 1.7s ease-in-out infinite; }
|
|
2293
|
+
#salon-title { display: flex; flex-direction: column; min-width: 0; }
|
|
2294
|
+
#salon-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2295
|
+
.salon-live { font-size: .75rem; font-weight: 400; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2296
|
+
.salon-live[hidden] { display: none; }
|
|
2288
2297
|
header.topbar .views .icon-btn { width: auto; height: auto; }
|
|
2289
2298
|
/* Pages with margins of their own: their bar goes edge to edge, as a conversation's. */
|
|
2290
2299
|
#places .sheet:not(.as-place) > header.topbar { margin: -14px -14px 4px; }
|