clavarium 0.2.281-next.1 → 0.2.283-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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.281-next.1",
3
+ "version": "0.2.283-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.281-next.1",
9
+ "version": "0.2.283-next.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.281-next.1",
3
+ "version": "0.2.283-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.",
package/web/app.js CHANGED
@@ -145,6 +145,18 @@
145
145
  const was = m.dataset.pose ?? '';
146
146
  /* Trying to wake (03-11): it lifts its head, and lies back, again, until it is up (a restart, a build). */
147
147
  if (pose === 'trying') { m.classList.remove('waking', 'stirring', 'asleep'); m.classList.add('trying'); m.dataset.pose = 'trying'; return; }
148
+ /* From trying to waking (03-11, no jolt): wait till its head lies down again -- the end of a try, the
149
+ very pose it wakes from -- then rise. At most one try's length (with less motion: no try, no wait). */
150
+ if (pose === 'waking' && was === 'trying') {
151
+ if (m.dataset.rising) return;
152
+ m.dataset.rising = 'yes';
153
+ /* Where it is in its try (2.6 s: lying until 15 %, lying again from 80 %), read from the animation itself. */
154
+ const tryNow = m.querySelector('.m-head')?.getAnimations?.().find((x) => x.animationName === 'm-try');
155
+ const at = Number(tryNow?.currentTime ?? 0) % 2600;
156
+ const rise = () => { delete m.dataset.rising; m.dataset.pose = 'tried'; mascot('waking'); };
157
+ if (at <= 390 || at >= 2080) rise(); else setTimeout(rise, 2080 - at);
158
+ return;
159
+ }
148
160
  m.classList.remove('trying');
149
161
  if (pose === 'waking') {
150
162
  if (was === 'waking') return;
@@ -261,8 +273,9 @@
261
273
  const s = Math.max(0, Math.floor((Date.now() - (Date.parse(p.since ?? '') || Date.now())) / 1000));
262
274
  $('notice-title').textContent = PROGRESS_TITLES[p.kind] ?? 'Starting';
263
275
  /* 03-11, less is more: the sheep trying to wake (a wake, a restart, a build), the step under way in one
264
- line; the list of the steps stays one tap away, and the usual time is said only when it is passed. */
265
- mascot(p.kind === 'wake' ? 'waking' : 'trying');
276
+ line; the list of the steps stays one tap away, and the usual time is said only when it is passed.
277
+ It wakes for real at the last step only (03-11, his idea): until then, it tries. */
278
+ mascot(at >= p.steps.length - 1 ? 'waking' : 'trying');
266
279
  $('notice-steps').hidden = !panel.open; $('notice-spin').hidden = true;
267
280
  $('notice-count').textContent = `${at + 1} / ${p.steps.length} \u00b7 ${clockOf(s)}`;
268
281
  $('notice-text').textContent = `${stepNow(p, tool)}${s >= 180 ? ` \u2014 ${usualFor(p.kind, s)}` : ''}`;
@@ -1280,7 +1293,7 @@
1280
1293
  /* NEEDS YOU: whatever its date, until its owner acts; hidden ones too (they said so). */
1281
1294
  const needs = conversations.filter(needsYou).sort((a, b) => activityOf(b) - activityOf(a));
1282
1295
  if (needs.length && section(NEEDS, 'Needs you', needs)) top.append(...unfolding(NEEDS, needs.map((c) => itemButton(c, true))));
1283
- /* RECENT: by when it was last used; the last four, then all. Never a hidden one. Only once there
1296
+ /* RECENT: by when it was last used; up to seven awake, then all. Never a hidden one. Only once there
1284
1297
  are groups: before, the one list below says the same, in the order chosen by hand. */
1285
1298
  /* One in Needs you just above is not said twice. */
1286
1299
  /* The last day only: what is older is found in its group. */
@@ -1288,9 +1301,14 @@
1288
1301
  /* Asleep ones go to the bottom of Recent: they are frozen, not what you came back to. */
1289
1302
  const recent = conversations.filter((c) => (c.hidden !== true || c.name === current) && !needsYou(c) && activityOf(c) >= dayAgo)
1290
1303
  .sort((a, b) => (Number(a.asleep === true) - Number(b.asleep === true)) || (activityOf(b) - activityOf(a)));
1291
- const few = 4;
1304
+ /* In sight (03-11, his rule): up to seven awake ones, and the one open even asleep (it never vanishes
1305
+ under the eyes); the rest -- asleep, or past seven -- under the arrow. */
1306
+ const inSight = recent.filter((c) => c.asleep !== true).slice(0, 7);
1307
+ const openOne = recent.find((c) => c.name === current);
1308
+ if (openOne && !inSight.includes(openOne)) inSight.push(openOne);
1309
+ const few = inSight.length;
1292
1310
  if (recent.length && groups.length && section(RECENT, 'Recent', recent)) {
1293
- top.append(...unfolding(RECENT, recent.slice(0, showAllRecent ? recent.length : few).map((c) => itemButton(c, true))));
1311
+ top.append(...unfolding(RECENT, (showAllRecent ? recent : recent.filter((c) => inSight.includes(c))).map((c) => itemButton(c, true))));
1294
1312
  if (recent.length > few) {
1295
1313
  const more = document.createElement('button'); more.type = 'button'; more.className = 'inline more-recent';
1296
1314
  /* A chevron, centred: the words for the pointer and for a screen reader. */