@ai-ecoverse/slicc-spectrum 1.89.1 → 1.89.2

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/README.md CHANGED
@@ -449,6 +449,7 @@ It closes, clearing the field, when the request leaves `waiting` or while the va
449
449
  #### `<slicc-updates>`
450
450
 
451
451
  Install / Update: component states, version changes, last checks, download and link counts, action buttons, failures with Retry, and collapsible install logs behind a quiet chevron, which stay open across a layout switch.
452
+ An install shows one bar for update rows and package rows alike: it fills 0–50% while downloading and 50–100% while linking (`value` against `max-value="100"`). While the row runs it never goes back, not when pnpm's total grows and not when progress drops out between passes. Its value label stays the phase's "n of m" count, and it starts at 0 again once the row settles.
452
453
  Opens at boot until the agent is ready without failures.
453
454
  Background updates stay in the header's update status; new failures reopen the panel, and after a reload into a boot that isn't ready yet such a panel closes once the agent is ready.
454
455
  Every automatic close is saved to the layout.
package/dist/slicc-ui.js CHANGED
@@ -34906,6 +34906,9 @@ function requiresText(item2, all2) {
34906
34906
  ].filter(Boolean);
34907
34907
  return parts2.length ? parts2.join("; ") : null;
34908
34908
  }
34909
+ var phased = ({ phase, done: done2, total }) => Math.round(((phase === "link" ? 1 : 0) + (total ? Math.min(done2 / total, 1) : 0)) * 50);
34910
+ var itemBusy = (item2) => running.has(item2.state) || item2.state === "starting" || item2.progress !== null;
34911
+ var packageBusy = (item2) => packageRunning.has(item2.state) || item2.progress !== null;
34909
34912
  var snapshot = (items) => new Map(items.map(({ id, state: state2, error }) => [id, { state: state2, error }]));
34910
34913
  function settled2(failures, before, after) {
34911
34914
  return new Map(
@@ -34963,6 +34966,7 @@ var SliccUpdates = class extends ModelElement {
34963
34966
  problems: { state: true }
34964
34967
  };
34965
34968
  #logs = new ViewSet(this, "updates");
34969
+ #reached = /* @__PURE__ */ new Map();
34966
34970
  constructor() {
34967
34971
  super();
34968
34972
  this.pending = /* @__PURE__ */ new Set();
@@ -35199,6 +35203,7 @@ var SliccUpdates = class extends ModelElement {
35199
35203
  this.failures = /* @__PURE__ */ new Map();
35200
35204
  this.busy = /* @__PURE__ */ new Map();
35201
35205
  this.problems = /* @__PURE__ */ new Map();
35206
+ this.#reached.clear();
35202
35207
  const port = model.updates;
35203
35208
  if (!port) return [];
35204
35209
  let previous = snapshot(port.list());
@@ -35207,6 +35212,7 @@ var SliccUpdates = class extends ModelElement {
35207
35212
  const next = snapshot(items);
35208
35213
  this.failures = settled2(this.failures, previous, next);
35209
35214
  previous = next;
35215
+ this.#prune("item", items, itemBusy);
35210
35216
  this.requestUpdate();
35211
35217
  })
35212
35218
  ];
@@ -35218,6 +35224,7 @@ var SliccUpdates = class extends ModelElement {
35218
35224
  const next = snapshot(items);
35219
35225
  this.problems = settled2(this.problems, packages, next);
35220
35226
  packages = next;
35227
+ this.#prune("package", items, packageBusy);
35221
35228
  this.requestUpdate();
35222
35229
  })
35223
35230
  ];
@@ -35271,25 +35278,43 @@ var SliccUpdates = class extends ModelElement {
35271
35278
  }
35272
35279
  }
35273
35280
  }
35274
- #progress(item2) {
35275
- const progress = item2.progress;
35276
- if (progress) {
35277
- return b`<swc-progress-bar
35278
- size="s"
35279
- min-value="0"
35280
- max-value=${progress.total}
35281
- value=${progress.done}
35282
- value-label=${`${progress.done} of ${progress.total}`}
35283
- accessible-label=${`${item2.label}: ${progress.phase === "download" ? "downloading" : "linking"}`}
35284
- ></swc-progress-bar>`;
35285
- }
35286
- if (!running.has(item2.state) && item2.state !== "starting") return A;
35281
+ #prune(kind, items, busy) {
35282
+ const live = new Set(items.filter(busy).map((item2) => `${kind}:${item2.id}`));
35283
+ for (const key2 of this.#reached.keys()) {
35284
+ if (key2.startsWith(`${kind}:`) && !live.has(key2)) this.#reached.delete(key2);
35285
+ }
35286
+ }
35287
+ #bar(key2, busy, progress, count2, accessible) {
35288
+ if (!busy) {
35289
+ this.#reached.delete(key2);
35290
+ return A;
35291
+ }
35292
+ const before = this.#reached.get(key2);
35293
+ const shown4 = progress ? { value: Math.max(before?.value ?? 0, phased(progress)), label: count2 } : before;
35294
+ if (!shown4) {
35295
+ return b`<swc-progress-bar size="s" indeterminate accessible-label=${accessible}></swc-progress-bar>`;
35296
+ }
35297
+ this.#reached.set(key2, shown4);
35287
35298
  return b`<swc-progress-bar
35288
35299
  size="s"
35289
- indeterminate
35290
- accessible-label=${`${item2.label}: ${states[item2.state][1].toLowerCase()}`}
35300
+ min-value="0"
35301
+ max-value="100"
35302
+ value=${shown4.value}
35303
+ value-label=${shown4.label}
35304
+ accessible-label=${accessible}
35291
35305
  ></swc-progress-bar>`;
35292
35306
  }
35307
+ #progress(item2) {
35308
+ const progress = item2.progress;
35309
+ const phase = progress ? progress.phase === "download" ? "downloading" : "linking" : null;
35310
+ return this.#bar(
35311
+ `item:${item2.id}`,
35312
+ itemBusy(item2),
35313
+ progress,
35314
+ progress ? `${progress.done} of ${progress.total}` : "",
35315
+ `${item2.label}: ${phase ?? states[item2.state][1].toLowerCase()}`
35316
+ );
35317
+ }
35293
35318
  #actions(item2) {
35294
35319
  if (!item2.actions.length) return A;
35295
35320
  const busy = this.pending.has(item2.id);
@@ -35353,22 +35378,14 @@ var SliccUpdates = class extends ModelElement {
35353
35378
  }
35354
35379
  #packageProgress(item2) {
35355
35380
  const progress = item2.progress;
35356
- if (progress) {
35357
- return b`<swc-progress-bar
35358
- size="s"
35359
- min-value="0"
35360
- max-value=${progress.total}
35361
- value=${progress.done}
35362
- value-label=${`${progress.done} of ${progress.total} packages`}
35363
- accessible-label=${`${item2.label}: ${progress.phase === "download" ? "downloading" : "linking"}`}
35364
- ></swc-progress-bar>`;
35365
- }
35366
- if (!packageRunning.has(item2.state)) return A;
35367
- return b`<swc-progress-bar
35368
- size="s"
35369
- indeterminate
35370
- accessible-label=${`${item2.label}: ${packageLight(item2)?.[1].toLowerCase()}`}
35371
- ></swc-progress-bar>`;
35381
+ const phase = progress ? progress.phase === "download" ? "downloading" : "linking" : null;
35382
+ return this.#bar(
35383
+ `package:${item2.id}`,
35384
+ packageBusy(item2),
35385
+ progress,
35386
+ progress ? `${progress.done} of ${progress.total} packages` : "",
35387
+ `${item2.label}: ${phase ?? packageLight(item2)?.[1].toLowerCase()}`
35388
+ );
35372
35389
  }
35373
35390
  #package(item2, all2, act2) {
35374
35391
  const light = packageLight(item2);