clavarium 0.2.45-next.1 → 0.2.49-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,17 +1,17 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.45-next.1",
3
+ "version": "0.2.49-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.45-next.1",
9
+ "version": "0.2.49-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
- "clavarium-binder": "0.1.6-next.1",
14
+ "clavarium-binder": "0.1.8-next.1",
15
15
  "clavarium-docket": "0.1.1",
16
16
  "clavarium-parley": "0.17.4-next.1",
17
17
  "mermaid": "11.17.2",
@@ -688,9 +688,9 @@
688
688
  }
689
689
  },
690
690
  "node_modules/clavarium-binder": {
691
- "version": "0.1.6-next.1",
692
- "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.6-next.1.tgz",
693
- "integrity": "sha512-urE1ZZCYq9svQmQR1ailNX6r5OeBcT0wNDea498PMDRbmcUCOciqoF/1C3IGLT7z133eb4dOUEhVcbRE42/h3A==",
691
+ "version": "0.1.8-next.1",
692
+ "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.8-next.1.tgz",
693
+ "integrity": "sha512-0ZvTgn4z3IzLWjVyt5H82tnrE4g4Zdh0eb0kKrpVYjJ8vEfun6CmzHFclce9lb7vH+CC5ozKETuTAmSVYkk+lg==",
694
694
  "license": "MIT",
695
695
  "bin": {
696
696
  "binder": "bin/binder.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.45-next.1",
3
+ "version": "0.2.49-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.",
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@xterm/addon-fit": "^0.11.0",
46
46
  "@xterm/xterm": "^6.0.0",
47
- "clavarium-binder": "0.1.6-next.1",
47
+ "clavarium-binder": "0.1.8-next.1",
48
48
  "clavarium-docket": "0.1.1",
49
49
  "clavarium-parley": "0.17.4-next.1",
50
50
  "mermaid": "11.17.2",
package/web/app.js CHANGED
@@ -835,6 +835,11 @@
835
835
  if (noTerminal()) $('files-open').hidden = deviceShared.length === 0;
836
836
  $('sleep').hidden = !usable || c.asleep === true;
837
837
  $('restart').hidden = DEVICE || !usable;
838
+ /* The same gestures, surfaced at the top of the panel: wake when asleep, else restart and sleep. */
839
+ $('quick-sleep').hidden = !usable || c.asleep === true;
840
+ $('quick-restart').hidden = DEVICE || !usable;
841
+ $('quick-wake').hidden = !c || c.asleep !== true;
842
+ $('panel-actions').hidden = DEVICE || !c || !(usable || c.asleep === true);
838
843
  /* Its own sheet is there as soon as it exists: archiving one that failed is done from it. */
839
844
  $('folders').hidden = DEVICE || !c;
840
845
  }
@@ -1127,7 +1132,9 @@
1127
1132
  /* One in Needs you just above is not said twice. */
1128
1133
  /* The last day only: what is older is found in its group. */
1129
1134
  const dayAgo = Date.now() - 24 * 3600_000;
1130
- const recent = conversations.filter((c) => (c.hidden !== true || c.name === current) && !needsYou(c) && activityOf(c) >= dayAgo).sort((a, b) => activityOf(b) - activityOf(a));
1135
+ /* Asleep ones go to the bottom of Recent: they are frozen, not what you came back to. */
1136
+ const recent = conversations.filter((c) => (c.hidden !== true || c.name === current) && !needsYou(c) && activityOf(c) >= dayAgo)
1137
+ .sort((a, b) => (Number(a.asleep === true) - Number(b.asleep === true)) || (activityOf(b) - activityOf(a)));
1131
1138
  const few = 4;
1132
1139
  if (recent.length && groups.length && section(RECENT, 'Recent', recent)) {
1133
1140
  top.append(...unfolding(RECENT, recent.slice(0, showAllRecent ? recent.length : few).map((c) => itemButton(c, true))));
@@ -7712,7 +7719,7 @@
7712
7719
  $('share-done').addEventListener('click', leaveCompose);
7713
7720
 
7714
7721
  /* ---------- resting and archiving ---------- */
7715
- $('sleep').addEventListener('click', async () => {
7722
+ async function sleepMachine() {
7716
7723
  const name = current;
7717
7724
  leavePanel();
7718
7725
  disconnect();
@@ -7720,7 +7727,12 @@
7720
7727
  show('Going to sleep...');
7721
7728
  try { await post(`${API}/conversations/${encodeURIComponent(name)}/sleep`); await refresh(); enter(); }
7722
7729
  catch (error) { say('awake', 'ended'); show(error.message, 'Back to the terminal', connect); }
7723
- });
7730
+ }
7731
+ $('sleep').addEventListener('click', () => void sleepMachine());
7732
+ /* The quick actions at the top of the panel do the same as the Machine chapter's. */
7733
+ $('quick-sleep').addEventListener('click', () => void sleepMachine());
7734
+ $('quick-restart').addEventListener('click', () => { leavePanel(); void restartMachine(false); });
7735
+ $('quick-wake').addEventListener('click', () => { leavePanel(); seeTerminal(); });
7724
7736
  async function rebuild() {
7725
7737
  const name = current;
7726
7738
  disconnect();
package/web/index.html CHANGED
@@ -111,6 +111,12 @@
111
111
  <div id="clists" class="sheet as-room" hidden><div id="clists-binder" class="binder-holder"></div></div>
112
112
  <div id="panel" class="sheet" hidden>
113
113
  <div class="panel-top"><b id="panel-title">This conversation</b></div>
114
+ <!-- The gestures done often on the machine, without opening the Machine chapter (app.js, paintMachine). -->
115
+ <div class="row panel-actions" id="panel-actions" hidden>
116
+ <button type="button" id="quick-wake" class="primary" hidden>Wake it</button>
117
+ <button type="button" id="quick-restart" hidden>Restart&hellip;</button>
118
+ <button type="button" id="quick-sleep" hidden title="Freezes the tool as it is; it wakes when you open the conversation">Sleep</button>
119
+ </div>
114
120
  <p id="panel-error" class="error" role="alert" hidden></p>
115
121
  <details class="chapter" id="chapter-general" data-chapter="general">
116
122
  <summary><span class="chapter-title">General</span><span class="chapter-about">Name, group, chat.</span></summary>
@@ -372,6 +378,12 @@
372
378
  <!-- THE MAP (once "Who gets what"): every device, conversation and asset, and the rights between them (links.js). -->
373
379
  <div id="links" class="pane">
374
380
  <div id="links-legend" class="lk-legend"></div>
381
+ <!-- The column filters, kept out of the board's zoom so a crowded map does not shrink them (links.js). -->
382
+ <div id="links-filters" class="lk-filters">
383
+ <label class="lk-filter"><span>Devices</span><input type="search" class="lk-find" data-k="device" placeholder="Filter&hellip;" aria-label="Filter devices"></label>
384
+ <label class="lk-filter"><span>Conversations</span><input type="search" class="lk-find" data-k="conversation" placeholder="Filter&hellip;" aria-label="Filter conversations"></label>
385
+ <label class="lk-filter"><span>Assets</span><input type="search" class="lk-find" data-k="asset" placeholder="Filter&hellip;" aria-label="Filter assets"></label>
386
+ </div>
375
387
  <p id="links-hint" class="hint" aria-live="polite"></p>
376
388
  <p id="links-error" class="error" role="alert" hidden></p>
377
389
  <div id="links-card" class="lk-card" hidden aria-live="polite"></div>
package/web/links.js CHANGED
@@ -202,7 +202,7 @@
202
202
  const col = h('div', { class: 'lk-col' });
203
203
  cols.forEach((k, i) => {
204
204
  if (i) col.append(h('div', { class: 'lk-gap' }));
205
- col.append(h('h3', { class: 'lk-colh' }, h('span', { class: 'lk-colt', text: TITLES[k] }), find(k), plus(k)));
205
+ col.append(h('h3', { class: 'lk-colh' }, h('span', { class: 'lk-colt', text: TITLES[k] }), plus(k)));
206
206
  const whole = lists[ci][i];
207
207
  const list = whole.filter((n) => matches(n, k));
208
208
  for (const n of list) col.append(nodeEl(n));
@@ -212,15 +212,11 @@
212
212
  });
213
213
  fit(); draw(); hint(); paintPhone();
214
214
  }
215
- /* A box in each column's title to narrow it: it filters only what is shown, kept while typing. */
216
- const onFind = (e) => {
217
- const k = e.target.dataset.k; const at = e.target.selectionStart;
218
- filters[k] = e.target.value;
219
- paint(false);
220
- const ni = board().querySelector(`.lk-find[data-k="${k}"]`);
221
- if (ni) { ni.focus(); try { ni.setSelectionRange(at, at); } catch { /* a search input may refuse it */ } }
222
- };
223
- const find = (k) => h('input', { type: 'search', class: 'lk-find', 'data-k': k, value: filters[k], placeholder: 'Filter…', 'aria-label': `Filter ${TITLES[k]}`, oninput: onFind });
215
+ /* The filters sit in a bar of their own, ABOVE the board and out of its zoom, so that fitting
216
+ a crowded map (which zooms it down) never shrinks them. Each narrows its column; the board
217
+ is repainted without a relayout (the inputs are not rebuilt, so the caret stays). */
218
+ const onFind = (e) => { filters[e.target.dataset.k] = e.target.value; paint(false); };
219
+ for (const inp of document.querySelectorAll('#links-filters .lk-find')) inp.addEventListener('input', onFind);
224
220
  /* How each kind is made: a device paired, a conversation created, an asset added. The same,
225
221
  from the small round "+" by each column's title (always there, however many it holds)
226
222
  and from an empty column. */
package/web/style.css CHANGED
@@ -127,6 +127,7 @@ footer button.wide { flex: 1 0 auto; background: var(--brass); border-color: var
127
127
  .chip[data-access="write"] { color: var(--ok); border-color: var(--ok); }
128
128
  .sheet { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--panel); overflow-y: auto; }
129
129
  .panel-top { display: flex; align-items: center; justify-content: space-between; }
130
+ .panel-actions { margin: 2px 0 12px; }
130
131
  #panel-rows { display: flex; flex-direction: column; }
131
132
  .folder { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
132
133
  .folder b { flex: 1; min-width: 100px; overflow: hidden; text-overflow: ellipsis; }
@@ -190,6 +191,8 @@ a.button { font: 600 .8125rem var(--sans); text-decoration: none; border-radius:
190
191
  #mic { flex-basis: 55%; padding-block: 12px; }
191
192
  }
192
193
  .item[data-asleep="true"] .dot { background: var(--ink2); }
194
+ /* Asleep: faded in the list (and sorted to the bottom of Recent, app.js), so it is plainly not where you are. */
195
+ .item[data-asleep="true"]:not([aria-current="true"]) { opacity: .62; }
193
196
  footer button.careful { border-style: dashed; color: var(--ink2); }
194
197
  /* On a touch screen every control is at least a fingertip high. */
195
198
  @media (max-width: 700px) {
@@ -1280,10 +1283,15 @@ select.pill { appearance: auto; }
1280
1283
  #copy-close, #files-close, #preview-close { font-size: 1.375rem; line-height: 1; min-width: 40px; padding: 4px 10px; }
1281
1284
  /* The title of a column of the map, and its round "+" (a new device, conversation, asset): always there. */
1282
1285
  .lk-col h3.lk-colh, .lk-phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
1283
- .lk-col h3.lk-colh .lk-colt { flex: none; }
1284
- .lk-col h3.lk-colh .lk-find { flex: 1 1 auto; min-width: 0; width: auto; font: inherit; font-size: .72rem; letter-spacing: 0; text-transform: none; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); }
1285
- .lk-col h3.lk-colh .lk-find::placeholder { color: var(--ink2); }
1286
1286
  .lk-col h3.lk-colh .lk-add { width: 26px; height: 26px; font-size: .95rem; letter-spacing: 0; }
1287
+ /* The filters: their own bar above the board, out of its zoom, so they stay a usable size. */
1288
+ .lk-filters { display: flex; gap: 10px 16px; flex-wrap: wrap; margin: 2px 0 10px; }
1289
+ .lk-filter { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 160px; }
1290
+ .lk-filter > span { flex: none; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
1291
+ .lk-filters .lk-find { flex: 1 1 auto; min-width: 0; font: inherit; font-size: .9rem; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); }
1292
+ .lk-filters .lk-find::placeholder { color: var(--ink2); }
1293
+ /* The phone shows a list of its own, not the board: the column filters do not apply there. */
1294
+ @media (max-width: 600px) { #links-filters { display: none; } }
1287
1295
  .lk-phead { margin: 4px 0 6px; }
1288
1296
  .as-kinds { display: flex; flex-wrap: wrap; gap: 8px; } .as-kinds button { display: inline-flex; align-items: center; gap: 8px; }
1289
1297