clavarium 0.2.47-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,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.47-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.47-next.1",
9
+ "version": "0.2.49-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.47-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.",
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>
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) {