Files
Willie 819546f124 feat(herdr): answer "what needs me" first and preview every row (#836)
* feat(herdr): answer "what needs me" first and preview every row

The panel listed every resource in one long tab and put the detail of a
row in text under it, so the first screen never said whether anything
needed a sync, and a 400px column filled with wrapped lines.

Overview now leads with one headline, one Sync button and a map from the
source to every target, and lists only what needs attention. Library
holds the full lists. A row carries a name and one short state; clicking
it opens a preview dialog with its document, its targets and its
details, so nothing is crammed into the list. MCP previews show the
names of env, header and token entries, never their values.

Target names come from `status` as well as `diff`, because `diff` leaves
out targets that share another target's folder. A machine with
uncommitted or unpushed work offers Sync both ways, since a plain pull
would refuse there. Warnings and errors now clear after 8 s instead of
staying until closed. Dialogs draw their own card and fade in and out.

The map's lines, the target list and the machine's action live in
model.js with tests; rowSub and the hideDisabled filter had no caller
left and are removed.

* fix(herdr): list only the targets a previewed item can reach

The preview's Targets tab was wrong in two cases.

A skill already on some targets but new to one has the state "missing",
and the preview treated that state as "waits everywhere", so targets
already in sync were marked as needing a sync. Only the targets the
item's drift names wait now.

An agent's preview listed every configured target, including ones that
take no agents, as in sync. The loader now keeps the targets that take
skills and the ones `status` reports for agents apart, and the preview
uses the list for the item's kind.

* feat(herdr): sync from Library's waiting group

The redesign left Sync only on Overview, so someone reading the Library
list had to switch tabs to act on the rows in front of them. The
"NEEDS SYNC" header carries Sync again, for the scopes its rows wait in;
when only a hook notice has native changes, its header carries it.

* fix(herdr): keep Sync in Library's toolbar and stop the panel shrinking past its tabs

Sync on the "NEEDS SYNC" header only existed while something waited, so
with everything in sync Library had no way to sync at all. It now sits
in the toolbar beside the filter, primary while something waits.

The panel could be dragged down to 320px, where the tab row no longer
fits beside the scope switch and the switch is cut off. The column's
minimum is 380px, and the tab row is a little tighter.

* fix(herdr): sync every scope a target still waits in from Library

Library's Sync chose its scopes from the waiting rows alone. A target can
wait with no row left, as after uninstalling a project skill that a
copy-mode target still holds, so with All shown and one global row
waiting, Sync ran in the global scope only and left the project copy in
place. Overview already added the scopes with a waiting target.

Both now take their scopes from one model helper, syncScopes, which
covers waiting rows, waiting targets and the nothing-waiting fallback.

* refactor(herdr): finish the review's open findings on the panel

The first review left confirmed findings listed but unfixed, and the
commits after it were never reviewed. This closes both.

The map now counts a waiting MCP server, plugin or hook on the targets
it waits on, so its lines no longer stay green under a headline that
says something waits. A skill's Targets tab takes its targets from
status when status names them: diff also lists targets that take agents
alone. Library's Sync stays disabled until a scope has been read;
before that it sent an empty scope list and reported a sync that never
ran.

The map's trunk and lanes, the two pill switches, the placeholder block
and its pulse each had two or more copies in main.js and now have one.
The Overview headline, a machine's remote line and its waiting targets
move to model.js with tests. README's layout snippet names the 380px
minimum the layout file already has.
2026-11-10 22:25:13 +08:00
..
2026-02-05 14:15:05 +08:00