clavarium 0.2.439-next.1 → 0.2.441-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 +2 -2
- package/package.json +1 -1
- package/server/capacity.mjs +5 -1
- package/server/settingswords.mjs +16 -1
- package/web/app.js +182 -83
- package/web/index.html +39 -22
- package/web/style.css +63 -10
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.441-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.441-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/server/capacity.mjs
CHANGED
|
@@ -180,9 +180,13 @@ export class Capacity {
|
|
|
180
180
|
const set = this.reserve();
|
|
181
181
|
const all = this.#conversations.list();
|
|
182
182
|
const records = new Map(all.map((c) => [`clv-${c.name}`, c]));
|
|
183
|
+
/* A shared machine (#221) is no conversation's own: named, with who lives in it (14-11: it showed as « another machine »). */
|
|
184
|
+
const shared = new Map();
|
|
185
|
+
for (const c of all) if (c.sharedMachine) { const s = shared.get(`clv-${c.sharedMachine}`) ?? { shared: c.sharedMachine, who: [], sizeMb: c.machineMb ?? null }; s.who.push(c.title ?? c.name); shared.set(`clv-${c.sharedMachine}`, s); }
|
|
183
186
|
const machines = room.machines.map((m) => {
|
|
184
187
|
const c = records.get(m.vm);
|
|
185
|
-
|
|
188
|
+
const s = c ? null : shared.get(m.vm);
|
|
189
|
+
return { name: c ? c.name : null, ...(s ? { shared: s.shared, who: s.who } : {}), shelf: m.vm.startsWith('clvshelf-'), rssMb: m.rssMb, sizeMb: c?.memoryMb ?? s?.sizeMb ?? null, ...(room.machineAge?.[m.vm] !== undefined ? { ageS: room.machineAge[m.vm] } : {}) };
|
|
186
190
|
});
|
|
187
191
|
/* What the system says is available: the machines' own use is in it already. */
|
|
188
192
|
const memory = room.memory ? { totalMb: room.memory.totalMb, freeMb: room.memory.availableMb, usedPercent: percent(room.memory.totalMb - room.memory.availableMb, room.memory.totalMb) } : null;
|
package/server/settingswords.mjs
CHANGED
|
@@ -164,7 +164,22 @@ export const SETTINGS_WORDS_FR = {
|
|
|
164
164
|
'set-na-k-mcp': 'Serveur MCP', 'set-cx-mcp': 'serveur MCP',
|
|
165
165
|
'set-mcp-head': 'Ajouter un serveur MCP', 'set-mcp-hint': 'Ses outils pour vos IA ; la clé reste ici.',
|
|
166
166
|
'set-mcp-name': 'Nom', 'set-mcp-url': 'Adresse', 'set-mcp-key': 'Clé', 'set-mcp-add': 'Ajouter',
|
|
167
|
-
|
|
167
|
+
/* Où elle tourne, et l'assistant Copier ou déplacer (#221, 14-11). */
|
|
168
|
+
'set-where': 'Où elle tourne', 'set-where-copy': 'Copier…', 'set-where-move': 'Déplacer…', 'set-where-own': 'Sa propre machine',
|
|
169
|
+
'set-where-shared': 'Machine partagée « {m} », avec {others}', 'set-where-alone': 'Machine partagée « {m} », seule', 'set-where-stops': 'L’arrêter les arrête aussi', 'set-mem-shared': 'Partagée « {m} » : {who}',
|
|
170
|
+
'set-cm-title': 'Copier ou déplacer {t}', 'set-cm-copy': 'Copier', 'set-cm-copy-what': 'Celle-ci reste telle quelle',
|
|
171
|
+
'set-cm-move': 'Déplacer', 'set-cm-move-what': 'La même, sur une autre machine', 'set-cm-cancel': 'Annuler', 'set-cm-next': 'Suivant',
|
|
172
|
+
'set-cm-not-yet': 'Pas encore', 'set-cm-with': 'Avec {who}', 'set-cm-shared': 'Machine partagée « {m} »', 'set-cm-new': 'Une nouvelle machine partagée',
|
|
173
|
+
'set-cm-name-first': 'Nommez d\'abord la machine partagée', 'set-cm-name-bad': 'Minuscules, chiffres, tirets',
|
|
174
|
+
'set-cm-name-taken': 'C\'est le nom d\'une conversation', 'set-cm-there': 'Elle y est déjà',
|
|
175
|
+
'set-cm-disk': 'Travail sur son disque : gardez-le ici d\'abord',
|
|
176
|
+
'set-cm-own-to': 'sa propre machine', 'set-cm-copy-to': 'Copier {t} vers {where}', 'set-cm-move-to': 'Déplacer {t} dans {where}',
|
|
177
|
+
'set-cm-new-line': 'Nouvelle machine partagée · {size}', 'set-cm-copy-name': 'Nom de la copie',
|
|
178
|
+
'set-cm-goes-work': 'Son dossier de travail', 'set-cm-goes-memory': 'La mémoire de son IA', 'set-cm-goes-access': 'Ses accès',
|
|
179
|
+
'set-cm-not': 'Ni ses appareils, ni ses rappels', 'set-cm-untouched': 'Celle-ci intacte : lue, puis remise en l\'état',
|
|
180
|
+
'set-cm-stay': 'Vous restez ici · « Ouvrir » une fois prête', 'set-cm-stops': 'Son outil s\'arrête environ une minute',
|
|
181
|
+
'set-cm-deleted': 'Sa propre machine est supprimée', 'set-cm-back': 'Retour', 'set-cm-copy-go': 'La copier', 'set-cm-move-go': 'La déplacer',
|
|
182
|
+
'set-cm-ready': 'Copie prête', 'set-cm-open': 'Ouvrir', 'set-cm-failed': 'Pas copiée', 'set-cm-see-why': 'Voir pourquoi',
|
|
168
183
|
'set-carry': 'La mémoire de son outil', 'set-carry-hint': 'Mémoire, sessions, réglages : à emporter.',
|
|
169
184
|
'set-carry-export': 'Exporter', 'set-carry-import': 'Importer…', 'set-carry-go': 'Importer',
|
|
170
185
|
'set-carry-ask': '« {file} » dans « {name} » ? Mémoire remplacée.', 'set-carry-done': 'Importé depuis « {from} ».',
|
package/web/app.js
CHANGED
|
@@ -2002,6 +2002,8 @@
|
|
|
2002
2002
|
was last opened (« ● 1 failed », red); nothing otherwise. Tapped: what runs, its step; then the day's ends,
|
|
2003
2003
|
done or failed with why. A line opens its conversation. Read with the list, nothing asked of the machines. */
|
|
2004
2004
|
let jobsNow = { running: [], done: [] };
|
|
2005
|
+
/* The copies made from here (the wizard, #cm), watched until their job ends: their names, new each time. */
|
|
2006
|
+
const copiesWatched = new Set();
|
|
2005
2007
|
const JOBS_SEEN = 'clavarium.jobsSeen';
|
|
2006
2008
|
const jobsSeen = () => { try { return localStorage.getItem(JOBS_SEEN) ?? ''; } catch { return ''; } };
|
|
2007
2009
|
async function paintJobs() {
|
|
@@ -2020,6 +2022,7 @@
|
|
|
2020
2022
|
}
|
|
2021
2023
|
if (n || failed) $('back').dataset.jobs = n ? 'on' : 'bad'; else delete $('back').dataset.jobs;
|
|
2022
2024
|
if (!$('jobs').hidden) paintJobsList();
|
|
2025
|
+
cmJobsSeen();
|
|
2023
2026
|
}
|
|
2024
2027
|
function paintJobsList() {
|
|
2025
2028
|
const line = (j, mark, result) => {
|
|
@@ -2668,15 +2671,6 @@
|
|
|
2668
2671
|
catch (error) { show(error.message, 'Back to the terminal', enter); }
|
|
2669
2672
|
}, () => { notice.hidden = true; focusTerminal(); });
|
|
2670
2673
|
};
|
|
2671
|
-
/* In a shared machine (#221): its name and the others in it, said once -- stopping it stops them too. */
|
|
2672
|
-
const sharedIn = here?.sharedMachine;
|
|
2673
|
-
$('machine-shared').hidden = DEVICE || !sharedIn;
|
|
2674
|
-
if (sharedIn) {
|
|
2675
|
-
const others = conversations.filter((c) => c.sharedMachine === sharedIn && c.name !== current).map((c) => c.title ?? c.name);
|
|
2676
|
-
$('machine-shared').textContent = others.length
|
|
2677
|
-
? uiSaid('set-mshared-with', 'Shared machine « {m} », with {others}. Stopping it stops them too.', { m: sharedIn, others: others.join(', ') })
|
|
2678
|
-
: uiSaid('set-mshared-alone', 'Shared machine « {m} », alone in it for now.', { m: sharedIn });
|
|
2679
|
-
}
|
|
2680
2674
|
/* Its tool's memory, exported as one file, or put back from one (#351): the person's own act, from here. */
|
|
2681
2675
|
$('carry-box').hidden = DEVICE || !here;
|
|
2682
2676
|
/* Its machine must run to be read: stopped or asleep, said there, with the one button that starts it
|
|
@@ -3071,21 +3065,16 @@
|
|
|
3071
3065
|
$('machine-size-title').textContent = sharedHere ? 'Memory' : 'Memory, cores and disk';
|
|
3072
3066
|
if (sharedHere) { $('machine-size-hint').textContent = 'Its limit in the shared machine · from its next start'; $('machine-size-apply').textContent = 'Apply'; }
|
|
3073
3067
|
$('shared-size').hidden = !sharedHere || here.phase !== 'ready';
|
|
3074
|
-
/*
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
$('
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
if (!$('copy-it').hidden && ![$('copy-title'), $('copy-machine')].includes(document.activeElement)) {
|
|
3085
|
-
if ($('copy-it').dataset.of !== here.name) { $('copy-it').dataset.of = here.name; $('copy-title').value = `${here.title ?? here.name} (copy)`; $('copy-where').value = ''; $('copy-machine').value = ''; }
|
|
3086
|
-
const names = [...new Set(conversations.map((x) => x.sharedMachine).filter(Boolean))].sort();
|
|
3087
|
-
$('machine-names').replaceChildren(...names.map((n) => Object.assign(document.createElement('option'), { value: n })));
|
|
3088
|
-
paintCopy();
|
|
3068
|
+
/* Where it runs (#221, 14-11): its own machine, or a shared one and who else is there; Copy... and Move...
|
|
3069
|
+
open the wizard, for one that is ready. */
|
|
3070
|
+
$('where-row').hidden = DEVICE || !here;
|
|
3071
|
+
if (here) {
|
|
3072
|
+
$('where-now').textContent = whereWords(here);
|
|
3073
|
+
/* Its machine shared with others: stopping or restarting it stops them too -- said where it runs. */
|
|
3074
|
+
const sharers = here.sharedMachine ? conversations.some((x) => x.sharedMachine === here.sharedMachine && x.name !== here.name) : false;
|
|
3075
|
+
$('where-now').title = sharers ? uiSaid('set-where-stops', 'Stopping it stops them too') : '';
|
|
3076
|
+
if (sharers) $('where-now').append(' · ', uiSaid('set-where-stops', 'Stopping it stops them too'));
|
|
3077
|
+
for (const id of ['where-copy', 'where-move']) $(id).disabled = here.phase !== 'ready';
|
|
3089
3078
|
}
|
|
3090
3079
|
if (sharedHere && document.activeElement !== $('shared-memory')) {
|
|
3091
3080
|
const inIt = conversations.filter((x) => x.sharedMachine === here.sharedMachine);
|
|
@@ -3203,68 +3192,178 @@
|
|
|
3203
3192
|
}, resume);
|
|
3204
3193
|
});
|
|
3205
3194
|
|
|
3206
|
-
/*
|
|
3207
|
-
|
|
3208
|
-
|
|
3195
|
+
/* ---------- COPY OR MOVE (#221, 14-11): a wizard of two screens over the page ----------
|
|
3196
|
+
1. Choose: Copy (this one stays as it is) or Move (the same conversation, another machine), and where it
|
|
3197
|
+
runs -- its own machine, a shared machine there (who lives in it, its memory), or a new one (named, its
|
|
3198
|
+
memory chosen). Moving out of a shared machine does not exist yet: said so, not offered.
|
|
3199
|
+
2. Check: what goes and what does not; for a move, its own machine deleted, in red.
|
|
3200
|
+
Confirmed, a copy closes it at once: the person stays where they are, the copy is a job « under way », and
|
|
3201
|
+
its end is one line at the bottom (« Open it », or « See why » in Settings, Jobs). A move does as it did:
|
|
3202
|
+
the page waits for it and reconnects. Work on its own machine's disk cannot go: kept here first. */
|
|
3203
|
+
function whereWords(c) {
|
|
3204
|
+
if (!c.sharedMachine) return uiSaid('set-where-own', 'Its own machine');
|
|
3205
|
+
const others = conversations.filter((x) => x.sharedMachine === c.sharedMachine && x.name !== c.name).map((x) => x.title ?? x.name);
|
|
3206
|
+
return others.length
|
|
3207
|
+
? uiSaid('set-where-shared', 'Shared machine « {m} », with {others}', { m: c.sharedMachine, others: others.join(', ') })
|
|
3208
|
+
: uiSaid('set-where-alone', 'Shared machine « {m} », alone in it', { m: c.sharedMachine });
|
|
3209
|
+
}
|
|
3210
|
+
/* The shared machines there: their names, who lives in each, its memory. */
|
|
3211
|
+
function sharedMachines() {
|
|
3212
|
+
const by = new Map();
|
|
3213
|
+
for (const c of conversations) {
|
|
3214
|
+
if (!c.sharedMachine) continue;
|
|
3215
|
+
const m = by.get(c.sharedMachine) ?? { name: c.sharedMachine, who: [], mb: c.machineMb };
|
|
3216
|
+
m.who.push(c.title ?? c.name); m.mb ??= c.machineMb;
|
|
3217
|
+
by.set(c.sharedMachine, m);
|
|
3218
|
+
}
|
|
3219
|
+
return [...by.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
3220
|
+
}
|
|
3221
|
+
/* What is chosen: of which conversation, copy or move, and where ('' its own machine, 'new', or a machine's name). */
|
|
3222
|
+
const cm = { of: '', kind: 'copy', place: '' };
|
|
3223
|
+
const cmHere = () => conversations.find((x) => x.name === cm.of);
|
|
3224
|
+
const cmCard = (place, title, small, { disabled = false } = {}) => {
|
|
3225
|
+
const b = document.createElement('button'); b.type = 'button'; b.className = 'cm-card'; b.setAttribute('role', 'radio');
|
|
3226
|
+
b.dataset.place = place; b.disabled = disabled;
|
|
3227
|
+
b.setAttribute('aria-checked', String(!disabled && cm.place === place));
|
|
3228
|
+
b.append(Object.assign(document.createElement('b'), { textContent: title }));
|
|
3229
|
+
if (small) b.append(Object.assign(document.createElement('small'), { textContent: small }));
|
|
3230
|
+
b.addEventListener('click', () => { cm.place = place; paintCm(); if (place === 'new') $('cm-new-name').focus(); });
|
|
3231
|
+
return b;
|
|
3232
|
+
};
|
|
3233
|
+
/* The places it may go, for a copy or a move of this one; the one chosen kept if it still is one. */
|
|
3234
|
+
function cmPlaces(here) {
|
|
3235
|
+
const machines = sharedMachines().filter((m) => !(cm.kind === 'move' && m.name === here.sharedMachine));
|
|
3236
|
+
if (cm.kind === 'move' && here.sharedMachine) return { cards: [cmCard('', uiSaid('set-where-own', 'Its own machine'), uiSaid('set-cm-not-yet', 'Not yet'), { disabled: true })], open: [] };
|
|
3237
|
+
const open = [...(cm.kind === 'copy' ? [''] : []), ...machines.map((m) => m.name), 'new'];
|
|
3238
|
+
if (!open.includes(cm.place)) cm.place = open[0];
|
|
3239
|
+
const cards = [];
|
|
3240
|
+
if (cm.kind === 'copy') cards.push(cmCard('', uiSaid('set-where-own', 'Its own machine')));
|
|
3241
|
+
for (const m of machines) {
|
|
3242
|
+
const small = [m.who.length ? uiSaid('set-cm-with', 'With {who}', { who: m.who.join(', ') }) : '', m.mb ? sizeWords(m.mb) : ''].filter(Boolean).join(' · ');
|
|
3243
|
+
cards.push(cmCard(m.name, uiSaid('set-cm-shared', 'Shared machine « {m} »', { m: m.name }), small));
|
|
3244
|
+
}
|
|
3245
|
+
cards.push(cmCard('new', uiSaid('set-cm-new', 'A new shared machine')));
|
|
3246
|
+
return { cards, open };
|
|
3247
|
+
}
|
|
3248
|
+
/* Where it goes, as asked of the server: { machine?, machineMb? }, its words, or why it cannot. */
|
|
3249
|
+
function cmTarget(here) {
|
|
3250
|
+
if (cm.place === '') return { body: {}, said: uiSaid('set-where-own', 'Its own machine') };
|
|
3251
|
+
const machine = cm.place === 'new' ? $('cm-new-name').value.trim() : cm.place;
|
|
3252
|
+
if (cm.place === 'new' && !machine) return { why: uiSaid('set-cm-name-first', 'Name the shared machine first') };
|
|
3253
|
+
if (!/^[a-z][a-z0-9-]{0,31}$/.test(machine)) return { why: uiSaid('set-cm-name-bad', 'Lower-case letters, digits, hyphens') };
|
|
3254
|
+
if (conversations.some((x) => x.name === machine)) return { why: uiSaid('set-cm-name-taken', 'That is a conversation\'s name') };
|
|
3255
|
+
/* A name typed that is a machine there already: that one, its memory its own. */
|
|
3256
|
+
const known = sharedMachines().some((m) => m.name === machine);
|
|
3257
|
+
if (cm.kind === 'move' && machine === here.sharedMachine) return { why: uiSaid('set-cm-there', 'It is there already') };
|
|
3258
|
+
const machineMb = known ? undefined : Number($('cm-new-mb').value);
|
|
3259
|
+
return { body: { machine, ...(machineMb ? { machineMb } : {}) }, machine, known, machineMb };
|
|
3260
|
+
}
|
|
3261
|
+
/* Screen 1, painted again as it is chosen. */
|
|
3262
|
+
function paintCm() {
|
|
3263
|
+
const here = cmHere();
|
|
3264
|
+
if (!here) { closeCm(); return; }
|
|
3265
|
+
const t = here.title ?? here.name;
|
|
3266
|
+
for (const b of document.querySelectorAll('#cm .cm-kinds .cm-card')) b.setAttribute('aria-checked', String(b.dataset.kind === cm.kind));
|
|
3267
|
+
$('cm-sheep').dataset.kind = cm.kind;
|
|
3268
|
+
if (!$('cm-choose').hidden) {
|
|
3269
|
+
$('cm-title').textContent = uiSaid('set-cm-title', 'Copy or move {t}', { t });
|
|
3270
|
+
const { cards, open } = cmPlaces(here);
|
|
3271
|
+
$('cm-places').replaceChildren(...cards);
|
|
3272
|
+
$('cm-new').hidden = cm.place !== 'new' || !open.includes('new');
|
|
3273
|
+
const typed = $('cm-new-name').value.trim();
|
|
3274
|
+
$('cm-new-mb').hidden = sharedMachines().some((m) => m.name === typed);
|
|
3275
|
+
const onDisk = here.work === 'disk';
|
|
3276
|
+
$('cm-why').textContent = onDisk ? uiSaid('set-cm-disk', 'Its work is on its disk: keep it here first') : '';
|
|
3277
|
+
$('cm-why').hidden = !onDisk;
|
|
3278
|
+
$('cm-next').disabled = onDisk || !open.length;
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
function openCm(kind) {
|
|
3209
3282
|
const here = conversations.find((x) => x.name === current);
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
$('
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3283
|
+
if (DEVICE || !here || here.phase !== 'ready') return;
|
|
3284
|
+
if (cm.of !== here.name) { $('cm-new-name').value = ''; $('cm-copy-title').value = ''; }
|
|
3285
|
+
Object.assign(cm, { of: here.name, kind, place: kind === 'copy' ? '' : (sharedMachines().find((m) => m.name !== here.sharedMachine)?.name ?? 'new') });
|
|
3286
|
+
$('machine-names').replaceChildren(...sharedMachines().map((m) => Object.assign(document.createElement('option'), { value: m.name })));
|
|
3287
|
+
$('cm-copy-title').value = `${here.title ?? here.name} (copy)`;
|
|
3288
|
+
/* Its sheep: two for a copy (the second slides out of the first), one walking for a move. */
|
|
3289
|
+
if (!$('cm-sheep').childElementCount) $('cm-sheep').innerHTML = `<div class="mascot cm-one">${MASCOTS[MASCOT]()}</div><div class="mascot cm-one">${MASCOTS[MASCOT]()}</div>`;
|
|
3290
|
+
$('cm-choose').hidden = false; $('cm-check').hidden = true;
|
|
3291
|
+
paintCm();
|
|
3292
|
+
if (!$('cm').open) $('cm').showModal();
|
|
3293
|
+
document.querySelector('#cm .cm-kinds .cm-card[aria-checked="true"]')?.focus();
|
|
3294
|
+
}
|
|
3295
|
+
function closeCm() { if ($('cm').open) $('cm').close(); }
|
|
3296
|
+
$('where-copy').addEventListener('click', () => openCm('copy'));
|
|
3297
|
+
$('where-move').addEventListener('click', () => openCm('move'));
|
|
3298
|
+
for (const b of document.querySelectorAll('#cm .cm-kinds .cm-card')) b.addEventListener('click', () => { cm.kind = b.dataset.kind; paintCm(); });
|
|
3299
|
+
$('cm-new-name').addEventListener('input', () => { $('cm-new-mb').hidden = sharedMachines().some((m) => m.name === $('cm-new-name').value.trim()); $('cm-why').hidden = true; });
|
|
3300
|
+
$('cm-cancel').addEventListener('click', closeCm);
|
|
3301
|
+
/* Escape closes the wizard, and only it: never the place under it too. */
|
|
3302
|
+
document.addEventListener('keydown', (event) => { if (event.key === 'Escape' && $('cm').open) { event.stopImmediatePropagation(); event.preventDefault(); closeCm(); } }, true);
|
|
3303
|
+
/* Screen 2: what it does, said for the copy or the move chosen. */
|
|
3304
|
+
$('cm-next').addEventListener('click', () => {
|
|
3305
|
+
const here = cmHere();
|
|
3306
|
+
if (!here) return;
|
|
3307
|
+
const goes = cmTarget(here);
|
|
3308
|
+
if (goes.why) { $('cm-why').textContent = goes.why; $('cm-why').hidden = false; return; }
|
|
3309
|
+
const t = here.title ?? here.name;
|
|
3310
|
+
const where = goes.machine ? `« ${goes.machine} »` : uiSaid('set-cm-own-to', 'its own machine');
|
|
3311
|
+
$('cm-title').textContent = cm.kind === 'copy' ? uiSaid('set-cm-copy-to', 'Copy {t} to {where}', { t, where }) : uiSaid('set-cm-move-to', 'Move {t} into {where}', { t, where });
|
|
3312
|
+
$('cm-new-line')?.remove();
|
|
3313
|
+
if (goes.machine && !goes.known) $('cm-check').prepend(Object.assign(document.createElement('p'), { id: 'cm-new-line', className: 'cm-not', textContent: uiSaid('set-cm-new-line', 'A new shared machine · {size}', { size: sizeWords(goes.machineMb) }) }));
|
|
3314
|
+
$('cm-copy-part').hidden = cm.kind !== 'copy'; $('cm-move-part').hidden = cm.kind !== 'move';
|
|
3315
|
+
$('cm-go').textContent = cm.kind === 'copy' ? uiSaid('set-cm-copy-go', 'Copy it') : uiSaid('set-cm-move-go', 'Move it');
|
|
3316
|
+
$('cm-go').className = 'primary';
|
|
3317
|
+
$('cm-choose').hidden = true; $('cm-check').hidden = false;
|
|
3318
|
+
(cm.kind === 'copy' ? $('cm-copy-title') : $('cm-go')).focus();
|
|
3235
3319
|
});
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
const
|
|
3239
|
-
const
|
|
3240
|
-
const known = conversations.some((x) => x.sharedMachine && x.sharedMachine === $('copy-machine').value.trim());
|
|
3241
|
-
$('copy-machine').hidden = !shared; $('copy-mb').hidden = !shared || known;
|
|
3242
|
-
const onDisk = here?.work === 'disk';
|
|
3243
|
-
$('copy-hint').textContent = onDisk ? 'Keep its files here first (Where the tool works)' : 'Work, AI memory and accesses · the original untouched';
|
|
3244
|
-
$('copy-apply').disabled = onDisk;
|
|
3245
|
-
}
|
|
3246
|
-
$('copy-where').addEventListener('change', () => { if ($('copy-where').value === 'shared' && !$('copy-machine').value) $('copy-machine').value = [...new Set(conversations.map((x) => x.sharedMachine).filter(Boolean))].sort()[0] ?? ''; paintCopy(); });
|
|
3247
|
-
$('copy-machine').addEventListener('input', () => paintCopy());
|
|
3248
|
-
$('copy-it').addEventListener('submit', (event) => {
|
|
3249
|
-
event.preventDefault();
|
|
3250
|
-
const name = current;
|
|
3251
|
-
const here = conversations.find((x) => x.name === name);
|
|
3320
|
+
$('cm-back').addEventListener('click', () => { $('cm-check').hidden = true; $('cm-choose').hidden = false; paintCm(); $('cm-next').focus(); });
|
|
3321
|
+
$('cm-go').addEventListener('click', async () => {
|
|
3322
|
+
const name = cm.of;
|
|
3323
|
+
const here = cmHere();
|
|
3252
3324
|
if (!here) return;
|
|
3253
|
-
const
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
if (
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
},
|
|
3325
|
+
const goes = cmTarget(here);
|
|
3326
|
+
if (goes.why) return;
|
|
3327
|
+
closeCm();
|
|
3328
|
+
if (cm.kind === 'move') {
|
|
3329
|
+
/* As it was: the page waits for the move, then reconnects to it in its new machine. */
|
|
3330
|
+
leavePanel();
|
|
3331
|
+
disconnect(); say('moving', 'connecting'); show('Moving...'); $('notice-spin').hidden = false;
|
|
3332
|
+
try { await post(`${API}/conversations/${encodeURIComponent(name)}/into-machine`, goes.body); await refresh(); enter(); }
|
|
3333
|
+
catch (error) { show(error.message, 'Back', enter); }
|
|
3334
|
+
return;
|
|
3335
|
+
}
|
|
3336
|
+
const title = $('cm-copy-title').value.trim() || `${here.title ?? here.name} (copy)`;
|
|
3337
|
+
try {
|
|
3338
|
+
const made = await post(`${API}/conversations/${encodeURIComponent(name)}/copy`, { title, ...goes.body });
|
|
3339
|
+
if (made?.name) copiesWatched.add(made.name);
|
|
3340
|
+
await refresh();
|
|
3341
|
+
} catch (error) { cmToast(`✗ ${error.message}`, 'bad'); }
|
|
3267
3342
|
});
|
|
3343
|
+
/* Its end, read with the jobs (paintJobs): done, « Open it »; failed or removed, « See why ». */
|
|
3344
|
+
function cmJobsSeen() {
|
|
3345
|
+
for (const name of copiesWatched) {
|
|
3346
|
+
const end = jobsNow.done.find((j) => j.conversation === name);
|
|
3347
|
+
if (!end) continue;
|
|
3348
|
+
copiesWatched.delete(name);
|
|
3349
|
+
if (end.result === 'done') cmToast(`✓ ${uiSaid('set-cm-ready', 'Copy ready')}`, 'ok', uiSaid('set-cm-open', 'Open it'), () => select(name, { step: true }));
|
|
3350
|
+
else cmToast(`✗ ${uiSaid('set-cm-failed', 'Not copied')}`, 'bad', uiSaid('set-cm-see-why', 'See why'), async () => { await openSettings(); openChapter('s-jobs')?.scrollIntoView({ block: 'start' }); });
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
let cmToastTimer;
|
|
3354
|
+
function cmToast(text, tone, label, act) {
|
|
3355
|
+
const toast = $('cm-toast');
|
|
3356
|
+
$('cm-toast-text').textContent = text;
|
|
3357
|
+
toast.dataset.tone = tone;
|
|
3358
|
+
$('cm-toast-go').hidden = !label;
|
|
3359
|
+
$('cm-toast-go').textContent = label ?? '';
|
|
3360
|
+
$('cm-toast-go').onclick = () => { toast.hidden = true; void act?.(); };
|
|
3361
|
+
toast.hidden = false;
|
|
3362
|
+
clearTimeout(cmToastTimer); cmToastTimer = setTimeout(() => { toast.hidden = true; }, 60_000);
|
|
3363
|
+
}
|
|
3364
|
+
$('cm-toast-close').addEventListener('click', () => { $('cm-toast').hidden = true; });
|
|
3365
|
+
|
|
3366
|
+
/* ITS SHARED MACHINE'S MEMORY (#221): asked first, naming every conversation it interrupts. */
|
|
3268
3367
|
$('shared-size').addEventListener('submit', (event) => {
|
|
3269
3368
|
event.preventDefault();
|
|
3270
3369
|
const name = current;
|
|
@@ -8800,7 +8899,7 @@
|
|
|
8800
8899
|
$('server-memory-note').textContent = aboveWords(mem.freeMb - r.reserve.memoryMb, r.reserve.memoryMb);
|
|
8801
8900
|
const held = r.machines.reduce((a, x) => a + x.rssMb, 0);
|
|
8802
8901
|
const rest = Math.max(0, mem.totalMb - mem.freeMb - held);
|
|
8803
|
-
const named = r.machines.map((x, i) => ({ key: x.name ?? `vm-${i}`, label: x.shelf ? 'ready-made machine (being made)' :
|
|
8902
|
+
const named = r.machines.map((x, i) => ({ key: x.name ?? `vm-${i}`, label: x.shelf ? 'ready-made machine (being made)' : x.name ? machineTitle(x.name) : x.shared ? uiSaid('set-mem-shared', 'Shared « {m} »: {who}', { m: x.shared, who: (x.who ?? []).join(', ') }) : 'another machine', mb: x.rssMb, x }));
|
|
8804
8903
|
const share = shareOf(named, rest, mem.freeMb);
|
|
8805
8904
|
$('server-memory-share').replaceChildren(...(r.machines.length ? [shareDonut(share.slices, uiSaid('set-share-memory', 'Memory by machine'), mem.totalMb - mem.freeMb, mem.totalMb)] : []));
|
|
8806
8905
|
parts($('server-memory-parts'), [
|
package/web/index.html
CHANGED
|
@@ -199,13 +199,14 @@
|
|
|
199
199
|
<details class="chapter" id="chapter-machine" data-chapter="machine">
|
|
200
200
|
<summary><span class="chapter-title" data-said="set-ch-machine">Machine</span><span class="chapter-about">Health, size, restart.</span></summary>
|
|
201
201
|
<div class="chapter-body">
|
|
202
|
+
<!-- WHERE IT RUNS (#221, 14-11): its own machine, or a shared one and who else lives there -- its stop or
|
|
203
|
+
restart stops them too; Copy... and Move... open the wizard (#cm, below). -->
|
|
204
|
+
<div class="set-row" id="where-row" hidden><div class="set-what"><b data-said="set-where">Where it runs</b><small id="where-now"></small></div><div class="set-control"><button type="button" id="where-copy" data-said="set-where-copy">Copy…</button><button type="button" id="where-move" data-said="set-where-move">Move…</button></div></div>
|
|
202
205
|
<!-- ITS CURVES: memory, CPU and disk over time (server/history.mjs). -->
|
|
203
206
|
<div class="curves" id="machine-curves" data-of="" hidden>
|
|
204
207
|
<div class="curves-head"><b>Over time</b><div class="levels curves-span" role="group" aria-label="Over"><button type="button" data-span="1h" aria-pressed="true">1 h</button><button type="button" data-span="24h" aria-pressed="false">24 h</button><button type="button" data-span="7d" aria-pressed="false">7 days</button></div></div>
|
|
205
208
|
<div class="curves-row"></div>
|
|
206
209
|
</div>
|
|
207
|
-
<!-- IN A SHARED MACHINE (#221): which, and who else lives in it -- its stop or restart stops them too. -->
|
|
208
|
-
<p id="machine-shared" class="hint machine-shared" hidden></p>
|
|
209
210
|
<p id="machine-restarted" class="hint" role="status" hidden></p>
|
|
210
211
|
<div id="resume-box" hidden>
|
|
211
212
|
<div class="set-row"><div class="set-what"><b>When its tool starts</b><small id="resume-hint">After a wake or restart</small></div><div class="set-control"><div class="levels" id="resume-on" role="group" aria-label="When its tool starts"><button type="button" data-on="true">Resume its last session</button><button type="button" data-on="false">Start fresh</button></div></div></div>
|
|
@@ -235,26 +236,6 @@
|
|
|
235
236
|
<p class="hint" id="shared-size-hint">Restarts every conversation in it</p>
|
|
236
237
|
<div class="row"><button type="submit" id="shared-size-apply">Change...</button></div>
|
|
237
238
|
</form>
|
|
238
|
-
<!-- MOVED INTO A SHARED MACHINE (#221, 12-11): its work and its tool's state along, its own machine deleted. -->
|
|
239
|
-
<form id="into-shared" autocomplete="off" hidden>
|
|
240
|
-
<label for="into-shared-name">Into a shared machine</label>
|
|
241
|
-
<input id="into-shared-name" maxlength="32" list="machine-names" placeholder="assistants" spellcheck="false" autocapitalize="off" autocomplete="off">
|
|
242
|
-
<label for="into-shared-mb" id="into-shared-mb-label">Its memory</label>
|
|
243
|
-
<select id="into-shared-mb"><option value="2048">2 GB</option><option value="4096" selected>4 GB</option><option value="6144">6 GB</option><option value="8192">8 GB</option><option value="12288">12 GB</option><option value="16384">16 GB</option></select>
|
|
244
|
-
<p class="hint" id="into-shared-hint">Trial · work and tool state come along</p>
|
|
245
|
-
<div class="row"><button type="submit" id="into-shared-apply">Move...</button></div>
|
|
246
|
-
</form>
|
|
247
|
-
<!-- A COPY OF IT (#221): its work, its AI's memory, its accesses; the original untouched. -->
|
|
248
|
-
<form id="copy-it" autocomplete="off" hidden>
|
|
249
|
-
<label for="copy-title">A copy of it</label>
|
|
250
|
-
<input id="copy-title" maxlength="60">
|
|
251
|
-
<label for="copy-where">Its machine</label>
|
|
252
|
-
<select id="copy-where"><option value="">Its own</option><option value="shared">A shared machine</option></select>
|
|
253
|
-
<input id="copy-machine" maxlength="32" list="machine-names" placeholder="assistants" spellcheck="false" autocapitalize="off" autocomplete="off" aria-label="Shared machine" hidden>
|
|
254
|
-
<select id="copy-mb" aria-label="Its memory" hidden><option value="2048">2 GB</option><option value="4096" selected>4 GB</option><option value="6144">6 GB</option><option value="8192">8 GB</option><option value="12288">12 GB</option><option value="16384">16 GB</option></select>
|
|
255
|
-
<p class="hint" id="copy-hint">Work, AI memory and accesses · the original untouched</p>
|
|
256
|
-
<div class="row"><button type="submit" id="copy-apply">Copy...</button></div>
|
|
257
|
-
</form>
|
|
258
239
|
<div id="work-box">
|
|
259
240
|
<div class="panel-top"><b>Where the tool works</b></div>
|
|
260
241
|
<p id="work-now" class="hint"><span><span id="work-now-text"></span></span><span id="work-now-why" class="tip" hidden></span></p>
|
|
@@ -1509,6 +1490,42 @@
|
|
|
1509
1490
|
<script src="/gitgraph.js"></script>
|
|
1510
1491
|
<script src="/links.js"></script>
|
|
1511
1492
|
<div id="jobs" class="jobs-pop" role="dialog" aria-label="Under way" hidden></div>
|
|
1493
|
+
<!-- COPY OR MOVE (#221, 14-11): a two-screen wizard over the page -- what and where, then what it does. Confirmed,
|
|
1494
|
+
it closes at once and the job goes on in « under way »; its end said by the toast below. -->
|
|
1495
|
+
<dialog id="cm" aria-labelledby="cm-title">
|
|
1496
|
+
<div class="cm-head"><div class="mascot cm-sheep" id="cm-sheep" aria-hidden="true"></div><h2 id="cm-title"></h2></div>
|
|
1497
|
+
<div id="cm-choose">
|
|
1498
|
+
<div class="cm-kinds" role="radiogroup" aria-label="Copy or move">
|
|
1499
|
+
<button type="button" class="cm-card" data-kind="copy" role="radio" aria-checked="true"><b data-said="set-cm-copy">Copy</b><small data-said="set-cm-copy-what">This one stays as it is</small></button>
|
|
1500
|
+
<button type="button" class="cm-card" data-kind="move" role="radio" aria-checked="false"><b data-said="set-cm-move">Move</b><small data-said="set-cm-move-what">The same conversation, another machine</small></button>
|
|
1501
|
+
</div>
|
|
1502
|
+
<p class="cm-label" data-said="set-where">Where it runs</p>
|
|
1503
|
+
<div id="cm-places" class="cm-places" role="radiogroup" aria-label="Where it runs"></div>
|
|
1504
|
+
<div id="cm-new" class="cm-new" hidden>
|
|
1505
|
+
<input id="cm-new-name" maxlength="32" list="machine-names" placeholder="assistants" spellcheck="false" autocapitalize="off" autocomplete="off" aria-label="Its name">
|
|
1506
|
+
<select id="cm-new-mb" aria-label="Its memory"><option value="2048">2 GB</option><option value="4096" selected>4 GB</option><option value="6144">6 GB</option><option value="8192">8 GB</option><option value="12288">12 GB</option><option value="16384">16 GB</option></select>
|
|
1507
|
+
</div>
|
|
1508
|
+
<p class="cm-why" id="cm-why" role="alert" hidden></p>
|
|
1509
|
+
<div class="cm-acts"><button type="button" id="cm-cancel" data-said="set-cm-cancel">Cancel</button><button type="button" class="primary" id="cm-next" data-said="set-cm-next">Next</button></div>
|
|
1510
|
+
</div>
|
|
1511
|
+
<div id="cm-check" hidden>
|
|
1512
|
+
<div id="cm-copy-part">
|
|
1513
|
+
<label class="cm-label" for="cm-copy-title" data-said="set-cm-copy-name">Name of the copy</label>
|
|
1514
|
+
<input id="cm-copy-title" maxlength="60">
|
|
1515
|
+
<ul class="cm-goes"><li data-said="set-cm-goes-work">Its work folder</li><li data-said="set-cm-goes-memory">Its AI's memory</li><li data-said="set-cm-goes-access">Its accesses</li></ul>
|
|
1516
|
+
<p class="cm-not" data-said="set-cm-not">Not its devices, nor its reminders</p>
|
|
1517
|
+
<p class="cm-box" data-said="set-cm-untouched">This one: untouched (woken or started to read it, then put back as it was)</p>
|
|
1518
|
+
<p class="cm-box" data-said="set-cm-stay">You stay here · « Open it » when it is ready</p>
|
|
1519
|
+
</div>
|
|
1520
|
+
<div id="cm-move-part">
|
|
1521
|
+
<p class="cm-box" data-said="set-cm-stops">Its tool stops for about a minute</p>
|
|
1522
|
+
<p class="cm-box cm-danger" data-said="set-cm-deleted">Its own machine is deleted</p>
|
|
1523
|
+
</div>
|
|
1524
|
+
<div class="cm-acts"><button type="button" id="cm-back" data-said="set-cm-back">Back</button><button type="button" class="primary" id="cm-go"></button></div>
|
|
1525
|
+
</div>
|
|
1526
|
+
</dialog>
|
|
1527
|
+
<!-- A COPY'S END (14-11): one line under the top bar, « Open it » or « See why ». -->
|
|
1528
|
+
<div id="cm-toast" class="cm-toast" role="status" hidden><span id="cm-toast-text"></span><button type="button" id="cm-toast-go" class="primary"></button><button type="button" id="cm-toast-close" class="quiet" aria-label="Close">×</button></div>
|
|
1512
1529
|
<script src="/features.js"></script>
|
|
1513
1530
|
<script src="/kit.js"></script>
|
|
1514
1531
|
<script src="/mail-view.js"></script>
|
package/web/style.css
CHANGED
|
@@ -498,9 +498,9 @@ details.chapter.reached { outline: 2px solid var(--brass); outline-offset: 2px;
|
|
|
498
498
|
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
|
|
499
499
|
.facts dt { color: var(--ink2); }
|
|
500
500
|
.facts dd { margin: 0; overflow-wrap: anywhere; }
|
|
501
|
-
#machine-size, #shared-size
|
|
502
|
-
#machine-size label, #shared-size label
|
|
503
|
-
#machine-size select, #shared-size select, #
|
|
501
|
+
#machine-size, #shared-size { display: flex; flex-direction: column; gap: 6px; max-width: 30rem; }
|
|
502
|
+
#machine-size label, #shared-size label { font-size: .8125rem; color: var(--ink2); }
|
|
503
|
+
#machine-size select, #shared-size select, #cm :is(select, input) { width: 100%; min-height: 40px; font: .875rem var(--sans); color: var(--ink); background-color: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
|
|
504
504
|
.health-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
|
|
505
505
|
.health-lines li { padding-left: 1.3em; position: relative; }
|
|
506
506
|
.health-lines li::before { content: ""; position: absolute; left: .2em; top: .45em; width: .55em; height: .55em; border-radius: 50%; background: var(--ok); }
|
|
@@ -1939,13 +1939,12 @@ button.tip-btn:hover, button.tip-btn[aria-expanded="true"] { color: var(--brass-
|
|
|
1939
1939
|
:is(#settings, #panel) .chapter-body .panel-top { border: 0; }
|
|
1940
1940
|
:is(#settings, #panel) .chapter-body .panel-top > b { font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
|
|
1941
1941
|
/* The machine's size: each a row, its name on the left, its choice on the right. */
|
|
1942
|
-
#panel :is(#machine-size, #shared-size
|
|
1943
|
-
#panel :is(#machine-size, #shared-size
|
|
1944
|
-
#panel :is(#machine-size, #shared-size
|
|
1945
|
-
#panel :is(#machine-size, #shared-size
|
|
1946
|
-
#shared-size[hidden]
|
|
1947
|
-
|
|
1948
|
-
@media (max-width: 560px) { #panel :is(#machine-size, #into-shared, #copy-it) > :is(#copy-machine, #copy-mb) { grid-column: 1; } #panel :is(#machine-size, #into-shared, #copy-it) { grid-template-columns: minmax(0, 1fr); } }
|
|
1942
|
+
#panel :is(#machine-size, #shared-size) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 16rem); gap: 10px 16px; align-items: center; max-width: none; }
|
|
1943
|
+
#panel :is(#machine-size, #shared-size) > label { font-size: .875rem; font-weight: 600; color: var(--ink); }
|
|
1944
|
+
#panel :is(#machine-size, #shared-size) > :is(p, .row) { grid-column: 1 / -1; }
|
|
1945
|
+
#panel :is(#machine-size, #shared-size) > .row { justify-content: flex-end; }
|
|
1946
|
+
#shared-size[hidden] { display: none; }
|
|
1947
|
+
@media (max-width: 560px) { #panel #machine-size { grid-template-columns: minmax(0, 1fr); } }
|
|
1949
1948
|
/* A chapter whose body is one block (Updates, Network): its pieces are the rows, not the block. */
|
|
1950
1949
|
:is(#settings, #panel) .chapter-body > :is(#updates, #wifi) { padding: 0; }
|
|
1951
1950
|
:is(#updates, #wifi) > * { margin: 0; padding: 12px 16px; }
|
|
@@ -3098,3 +3097,57 @@ a.button[aria-disabled] { opacity: .5; pointer-events: none; }
|
|
|
3098
3097
|
@keyframes m-q { 0% { opacity: 0; transform: translateY(6px) rotate(-8deg); } 30%, 70% { opacity: 1; transform: translateY(0) rotate(6deg); } 100% { opacity: 0; transform: translateY(-4px) rotate(-4deg); } }
|
|
3099
3098
|
.fading-out { transition: opacity .15s ease-out; opacity: 0; }
|
|
3100
3099
|
@media (prefers-reduced-motion: reduce) { .mascot.wondering .m-q { animation: none; opacity: 1; } }
|
|
3100
|
+
|
|
3101
|
+
/* COPY OR MOVE (#221, 14-11): a wizard over the page, a sheet of the whole screen on a phone. Its cards are
|
|
3102
|
+
choices (radios): the one chosen in brass. Its sheep: a clone sliding out of it, or walking along. */
|
|
3103
|
+
#where-row .set-control button { white-space: nowrap; }
|
|
3104
|
+
#cm { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 14px 14px 12px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .35); }
|
|
3105
|
+
#cm::backdrop { background: rgb(0 0 0 / .45); }
|
|
3106
|
+
#cm > div { display: flex; flex-direction: column; gap: 8px; }
|
|
3107
|
+
#cm #cm-copy-part, #cm #cm-move-part { display: flex; flex-direction: column; gap: 8px; }
|
|
3108
|
+
#cm [hidden] { display: none !important; }
|
|
3109
|
+
#cm .cm-head { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 4px; }
|
|
3110
|
+
#cm h2 { margin: 0; font-size: 1rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
|
|
3111
|
+
.cm-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
|
|
3112
|
+
.cm-places { display: grid; gap: 8px; }
|
|
3113
|
+
.cm-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 8px 11px; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
|
|
3114
|
+
.cm-card:hover:not(:disabled) { border-color: var(--ink2); }
|
|
3115
|
+
.cm-card[aria-checked="true"] { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 10%, transparent); }
|
|
3116
|
+
.cm-card small { font-size: .75rem; font-weight: 400; color: var(--ink2); overflow-wrap: anywhere; }
|
|
3117
|
+
.cm-label { margin: 2px 0 0; font-size: .75rem; color: var(--ink2); }
|
|
3118
|
+
.cm-new { display: flex; gap: 8px; }
|
|
3119
|
+
#cm .cm-new input { flex: 1; width: auto; min-width: 0; }
|
|
3120
|
+
#cm .cm-new select { flex: none; width: auto; }
|
|
3121
|
+
.cm-why { margin: 0; font-size: .8125rem; color: var(--danger); }
|
|
3122
|
+
.cm-goes { list-style: none; margin: 2px 0 0; padding: 0; font-size: .875rem; color: var(--ok); }
|
|
3123
|
+
.cm-goes li::before { content: "\2713\00a0"; }
|
|
3124
|
+
.cm-not { margin: 0; font-size: .75rem; color: var(--ink2); }
|
|
3125
|
+
.cm-box { margin: 0; padding: 8px 11px; font-size: .875rem; border: 1px solid var(--line); border-radius: 8px; }
|
|
3126
|
+
.cm-box.cm-danger { color: var(--danger); border-color: var(--danger); font-weight: 600; }
|
|
3127
|
+
.cm-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
|
|
3128
|
+
@media (max-width: 480px) {
|
|
3129
|
+
#cm { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: 16px; }
|
|
3130
|
+
#cm[open] { display: flex; flex-direction: column; }
|
|
3131
|
+
#cm > div:not(.cm-head) { flex: 1; }
|
|
3132
|
+
#cm .cm-acts { margin-top: auto; padding-top: 8px; }
|
|
3133
|
+
#cm .cm-acts button { flex: 1; padding: 10px; }
|
|
3134
|
+
}
|
|
3135
|
+
.cm-sheep { position: relative; flex: none; width: 76px; height: 34px; margin: 0; overflow: hidden; }
|
|
3136
|
+
.cm-sheep .cm-one { position: absolute; left: 0; top: 0; width: 45px; height: 34px; margin: 0; }
|
|
3137
|
+
.cm-sheep .m-fill { fill: var(--panel); }
|
|
3138
|
+
.cm-sheep .cm-one:first-child { z-index: 1; }
|
|
3139
|
+
.cm-sheep[data-kind="move"] .cm-one + .cm-one { display: none; }
|
|
3140
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
3141
|
+
.cm-sheep[data-kind="copy"] .cm-one + .cm-one { animation: cm-clone 2.5s ease-in-out infinite; }
|
|
3142
|
+
.cm-sheep[data-kind="move"] .cm-one:first-child { animation: cm-walk 2.5s linear infinite; }
|
|
3143
|
+
.cm-sheep[data-kind="move"] .m-legs { animation: cm-step .3s ease-in-out infinite alternate; }
|
|
3144
|
+
}
|
|
3145
|
+
@keyframes cm-clone { 0%, 15% { transform: translateX(0); opacity: 0; } 25% { opacity: 1; } 60%, 85% { transform: translateX(30px); opacity: 1; } 100% { transform: translateX(30px); opacity: 0; } }
|
|
3146
|
+
@keyframes cm-walk { 0% { transform: translateX(-24px); opacity: 0; } 15%, 80% { opacity: 1; } 100% { transform: translateX(56px); opacity: 0; } }
|
|
3147
|
+
@keyframes cm-step { to { transform: translateY(-2px); } }
|
|
3148
|
+
/* A copy's end: one line under the top bar, clear of the keys at the bottom. */
|
|
3149
|
+
.cm-toast { position: fixed; z-index: 70; left: 50%; top: 60px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 6px 6px 6px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .35); font-size: .875rem; }
|
|
3150
|
+
.cm-toast > span { min-width: 0; overflow-wrap: anywhere; }
|
|
3151
|
+
.cm-toast[data-tone="ok"] > span { color: var(--ok); }
|
|
3152
|
+
.cm-toast[data-tone="bad"] > span { color: var(--danger); }
|
|
3153
|
+
.cm-toast button { flex: none; }
|