Files
skillshare/ui/src
Willie 5338d6a4c1 feat(ui): check plugin updates on load and update them in one batch (#527)
* feat(ui): check plugin updates on load and update them in one batch

Updating plugins took four steps each: press Check updates, press Update
on one row, review a second preview, apply, then check again because the
list did not know the update had happened. Six plugins meant six rounds.

The page now checks once in the background when it opens, so rows show
their new version without a click. The header's Check updates button
becomes "Update N" when something is behind and opens one dialog: every
plugin with an update is ticked, a plugin on several Agents is one row
whose Agents can be left out, and imported installs Skillshare cannot
update sit apart. One button runs them in turn through the existing
preview and apply, so no new API is needed. Progress, results, errors
and per-Agent retry stay in the same dialog, and the applied results
update the page state, so nothing has to be checked again.

The count and the dialog both come from what is still behind after the
last check, limited to Agents that can be updated from here, so a
partial batch is not offered again and Agents with check but no update
(OMP, Antigravity CLI, Grok) do not inflate the count.

* fix(ui): keep batch plugin updates to what the user reviewed

Codex review of #527 found four ways the batch update could act on
something other than what the dialog showed:

- A source that moved between the background check and the click was
  installed straight from the fresh preview, so a newer version or new
  components went in unreviewed. The batch now compares each fresh plan
  with the version and commit the check showed, applies nothing when
  they differ, says so on the row, and runs a quiet check so the next
  dialog shows the new version for review.
- A retry of the failed Agents that failed again lost that subset, so a
  third try re-sent Agents that had already updated. A failed row now
  always keeps the Agents it failed on.
- An update the server skipped (its marketplace gone, say) counted as
  done: the row said updated and the plugin left the update count.
  Skipped outcomes now keep the Agent pending and show as skipped.
- A plugin removed after the check stayed in the update count and
  failed with "not found" when picked. Pending updates now drop any
  plugin or Agent binding the inventory no longer has.

* fix(ui): show a manual check's result and each Agent's own version move

Codex's second review of #527 found two gaps:

- A check the user pressed that found nothing to update from here (only
  imported installs, or everything current) opened nothing, so the
  "update inside the Agent" guidance and the up-to-date result never
  showed. The check now reports whether it came back, and a check the
  user asked for opens the dialog; the background check on load stays
  quiet.
- A plugin on several Agents showed one version move built from the
  first Agent's installed version and the first new version found, which
  can mix Agents that come from different sources. The row now shows one
  move only when every Agent makes the same one, and each Agent's own
  move otherwise.

* fix(plugin): carry the source digest on a check so a batch update can tell it moved

Codex's third review of #527: a local-directory plugin has no commit,
so when its files changed again after the check while the manifest
version stayed the same, the batch's version and commit comparison
passed and the fresh preview was applied without the user seeing it.

The check copied the installed binding, so its digest was the one
already installed, not the source's. It now sets the discovered digest
alongside the version and commit, as the update preview already does.
The dashboard keeps that digest with each update it found and refuses
to apply when the fresh preview's digest differs, marking the row as
changed since the check. An npm package has no digest and is unaffected.

* fix(ui): list blocked check results and drop unticked Agents from the batch

Codex's fourth review of #527:

- A check can mark an Agent blocked when the updated source no longer
  offers a compatible plugin for it. The update dialog listed only
  updatable, native-check and up-to-date results, so it hid the block
  and could say everything was current. Blocked results now get their
  own section with the reason, and the empty state says nothing can be
  updated from here rather than that everything is up to date.
- An Agent unticked after the check stayed in the pending updates;
  picking it produced a no-op that the batch reported as updated.
  Pending updates now skip bindings with sync off, as the row's own
  behind count already does.

* fix(ui): count partly skipped plugins as updated and surface a failed re-check

Codex's fifth review of #527:

- When one Agent of a plugin updated and another came back skipped, the
  row was marked skipped, the summary counted no update, and the Agent
  that did update was not shown. A row now names which Agents updated
  and which were skipped, and the summary counts any plugin with an
  updated Agent.
- After a source moved since the check, the follow-up check ran quietly,
  so if it failed the stale update stayed offered and every retry hit
  the same skip. The moved plugin now leaves the found updates, and the
  follow-up check reports its failure like any check the user started.
2026-10-11 22:19:14 +08:00
..
2026-03-12 09:38:31 +08:00