Commit Graph
683 Commits
Author SHA1 Message Date
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
Willie 5e85f5313b feat(ui): move installed skills and folders from the dashboard (#519)
Add a Move dialog with entry points in the selection bar, the skill and
folder menus, the tree pane and the detail page. It previews the move
with a dry run, blocks a whole-folder move when any item is refused,
offers Move anyway only for a name collision and Sync now on the
result, and animates the new-folder step and dialog transitions.

Refs #510
2026-10-11 00:44:28 +08:00
Willie 049c2d68f5 feat(ui): pick an existing folder when installing into a folder (#517)
* feat(ui): pick an existing folder when installing into a folder

The "Into folder" field in the install dialog was free text, so users
mistyped paths or could not see which folders already exist. Replace it
with a picker listing the source root, every existing folder, and a
"New folder..." entry that reveals an input validated like
validate.IntoPath. The `into` value sent to the API is unchanged, so no
backend change is needed.

Existing folders are derived client-side from the resource list and
exclude tracked repos, followed source links, folders that are skills
and names the server would reject. FolderPicker takes a disabledFolder
prop so a later move dialog can reuse it.

Refs #510

* fix(ui): block install while the picked folder is not a usable path

Two paths let an unusable `into` through:

- Choosing "New folder..." cleared the value but still counted as
  valid, so install silently went to the source root. The picker now
  reports validity with each change and an empty new folder is invalid.
- Validity was ignored once Advanced was collapsed, and the server does
  not run IntoPath on install, so a bad path could still be installed.
  The dialog now keeps the picker's validity regardless of the panel.

* feat(ui): make new folder a step in the folder picker

Typing a new folder path inline gave no sense of where it would land or
what the skill's link would be called. Align the picker with the
approved design:

- Picker rows show a folder icon, the path in monospace, and how many
  skills are under it; "New folder..." sits below a separator.
- "New folder..." opens a step in the dialog with a parent folder,
  a name, and a result box with the folder path and the link name
  (path with / as __ in front of the skill name). Using it returns
  to the picker with the new path selected and tagged as new.
- A caption under the picker says where the skill installs and what
  its link is called, using the skill name from the source when known.
- Escape and the back arrow in the step return to the picker instead
  of closing the install dialog.

The `into` sent to the API is still a plain path. FolderPicker takes
disabledPaths (a folder and everything below it) for the move dialog.

Refs #510
2026-10-10 23:37:03 +08:00
Willie b6b51306b7 fix(ui): refresh instruction queries after target changes
Invalidate instruction queries when targets change or config.yaml is saved so AGENTS.md target lists and instruction paths do not remain cached until reload or expiry.
2026-10-10 01:55:06 +08:00
Willie c638b46096 fix(sync): replace copy-mode copies with links when switching back to merge (#506)
* fix(sync): replace copy-mode copies with links when switching back to merge

Switching a target from copy back to merge left every copy whose entry name
did not change as a real folder. Merge sync treated it as the user's own
folder, so status and doctor kept saying "run skillshare sync" while sync
changed nothing, and only `sync --force` turned it into a link.

Copy mode already replaces merge-mode links with copies on its own, so merge
sync now replaces a folder the manifest records with a checksum (a copy-mode
copy) with a link, without --force. Folders the manifest does not record, or
records as a link, stay untouched. The pre-sync target backup is unchanged.

The CLI and dashboard diffs name these entries as copies sync replaces
instead of suggesting --force, and the sync-modes docs describe the switch.

* fix(sync): keep copy-mode copies the user edited when switching to merge

The first version replaced any folder the manifest recorded as a copy-mode
copy. The manifest checksum is only a record, so a copy edited since copy
mode made it was deleted too, and `sync --json` and project-mode dashboard
sync take no pre-sync backup to restore it from.

Replace the folder only while it still hashes to the recorded checksum
(Manifest.OwnsCopy). An edited copy is kept and `sync --force` still
replaces it; diff keeps suggesting --force for it. A copy whose name: was
rewritten by prefixed naming, or that was made with custom ignore patterns,
no longer hashes to the source checksum and is kept the same way.

* fix(ui): say a copy-mode copy in a merge target is replaced by a link

The Sync page picks a row's text from the diff item's action alone. The
copy-mode copy that merge sync now replaces comes from the server as an
update, which the page worded as "Link is broken or points elsewhere. Will
be relinked" even though no link exists yet.

Match the server's reason and show "Copy made by copy mode. Will be replaced
by a link" instead, in all eleven dashboard languages.

* docs(sync): say only unedited copy-mode copies are replaced on merge sync

The sync-modes paragraph promised that copies copy mode made are replaced
with links without --force. Merge sync keeps a copy that no longer hashes to
the checksum copy mode recorded, so an edited copy, or one whose name: copy
mode rewrote for prefixed naming, still needs --force.

State the three cases in sync-modes and qualify the diff Modified and Local
override labels, in English and the ja, ko, zh-Hans and zh-Hant copies.

* fix(sync): keep the copy until its replacement link exists

Replacing a copy-mode copy removed the folder first and then created the
link. If creating the link failed (no symlink or junction rights on a
Windows or network filesystem), sync returned an error with the skill gone
from the target. This path now also runs on a plain sync, not only on
--force.

Park the folder beside the entry, create the link, then delete the parked
folder; on failure the folder is moved back. A parked folder left by a run
that died mid-way may be the only copy, so the next sync stops with a message
instead of deleting it. The manifest also forgets the copy-mode mtime and
naming records of an entry that is now a link.

* test(sourcefs): register replaceWithLink's target writes in the raw-write ratchet

The previous commit moved the merge-mode folder replacement into
replaceWithLink, which the ratchet reports as new raw os calls and the old
os.RemoveAll allowance as stale. All of them act on the sync target, not the
skills source, like the neighbouring entries.

* fix(sync): bound the parked copy's name and document the naming exception

The folder parked while a link is created was named after the entry, so an
entry near the 255-byte filename limit (a long flattened nested skill)
could not be moved aside and its replacement failed. The parked name is now
a fixed-length hash of the entry name.

sync-modes also says what happens when `target_naming` changes in the same
sync: the copy gets a new entry name and the prune pass removes it as an
orphan whether or not it was edited, as it did before this change.
2026-10-10 00:13:29 +08:00
Willie ec2a8ab3aa fix(sync): close gaps found while simulating the prefixed naming switch (#504)
* fix(sync): close gaps found while simulating the prefixed naming switch

Simulating the #497 reporter's switch from merge + flat to copy + prefixed
turned up four problems:

- `target X --mode copy --target-naming prefixed` applied only --mode, since
  the setter dispatch returned after the first flag. Both flags given
  together now check the final pair, then apply in an order that keeps the
  saved pair valid (copy mode first, any other mode last).
- Skipped skills were only counted, so a prefixed name over 64 characters
  vanished with "1 skill(s) skipped". Sync now names the first five with
  their reason; the cap keeps huge sources from flooding the output.
- In copy mode a merge-mode link to the skill was not a managed entry, so
  when a local folder held the new name the old link was pruned and the
  skill left the target, contrary to the documented "old managed entry is
  preserved". Copy mode now migrates such links like managed copies.
- PATCH /api/targets validated the mode/naming pair against the current
  skills state, so disabling skills while changing mode was rejected. It now
  checks the state the request leaves the target in.

* docs(target): drop stray space in the Japanese mode+naming sentence

* fix(diff): save paired target settings once and report kept legacy entries

- `target X --mode M --target-naming N` ran the two setters, each saving
  the config, so a failed second save left half the change behind (Codex
  on #504). Both fields are now set and saved once, after the final pair
  is checked.
- When a local folder holds the name a skill's naming now gives it, sync
  keeps the skill under its old entry and leaves the folder alone, even
  with --force. diff still called the folder a "local copy" and suggested
  `sync --force`, which does nothing for it. CLI and Web API diff, copy
  and merge mode, now report the folder and the entry the skill stays at.

* fix(sync): migrate only links the manifest records as merge-made

Copy mode treated any link to the skill's source at an old naming's name as
the entry merge mode left behind, so a user's own link was renamed and
replaced with a copy (Codex on #504). A link now migrates only when the
manifest records it as "symlink", which merge mode writes for links it makes;
other links stay as the user left them. The value is now a named constant.

* fix(diff): mark kept legacy entries as unaffected by force

Two problems Codex found on #504:

- The Web API diff sent a local folder on a skill's new name as a "skip",
  which the dashboard shows as an edited entry that Force replaces. Sync
  keeps that folder and the legacy entry even with force, so the preview
  promised a change that never happens. It is now its own "kept" action,
  shown with its reason and not counted.
- `target X --mode M --target-naming N` printed the target's own naming as
  the old value, so a target inheriting standard or prefixed showed
  "flat -> ...". It now prints the naming the target had in effect.

* fix(diff): keep kept-name conflicts out of the sync count

Two problems Codex found on #504:

- A local folder on a skill's new name counted toward "N to sync" and
  fell through to the plain `skillshare sync` hint, though sync changes
  nothing there until the folder is renamed or removed. Such rows now
  carry a kept flag, count as neither sync nor local, and print their own
  hint; a target whose only row is kept still shows that row.
- The dashboard grouped targets by row name and icon only, so two targets
  keeping the same skill at different old entries merged and showed one
  target's old location for both. The row detail is now part of the key.

* fix(diff): do not list a kept local folder's files as deletions

A kept row (a local folder on a skill's new name) still pointed at that
folder, so `diff --stat` and `--patch` listed each of its files as removed,
though sync never touches the folder (Codex on #504). Kept rows no longer
point at a target directory, so no file-level diff is built for them in the
CLI or the TUI.

* fix(diff): report kept skills consistently in every diff view

An exhaustive review of the kept-row change (prompted by two Codex findings
on #504) found the same gap in several places:

- A target whose only rows were kept was summarized as "in sync", and mixed
  summaries left it out of every count. Such targets now count as "N kept
  under old name" with a warning mark, and the scan progress counts them.
- Plain output and the TUI hid where the skill stays; rows now read
  "name (stays at old-name)". The TUI also lacked the kept Next hint and
  called kept-only targets "differs"; it now matches the plain output.
- `diff --json` emitted kept rows as "remove", indistinguishable from
  local-only folders; it now emits "kept", as the Web API does. The diff
  docs' JSON example also showed actions the CLI never emits.
- Renamed rows whose old entry is a merge-made link showed a bogus file
  stat, because the link was walked as a file; a link now stands for the
  folder it points to.
- A dry-run migration printed "Would copy" to the old path; it now names
  the new one.

* fix(sync): stop reporting kept folders and skipped skills as pending work (#509)

Three reports told users to do something sync cannot do, or hid what it
did:

- Copy and merge sync kept a folder the user made on a skill's name but
  counted it as "up to date" with no hint. Sync now counts it as local and
  adds one capped line per target naming the folders and saying that
  `sync --force` replaces them. The line is added in SyncSkillTarget, so
  the dashboard gets it too.
- status and doctor counted skills that sync skips on purpose (invalid
  names under standard or prefixed naming, name collisions) as "not
  synced — run skillshare sync". Running sync can never add them, so the
  advice looped. They now compare against the skills sync places.
- diff marked a target whose only items were local-only folders as "to
  sync" and `synced: false`. Those items are still listed, but they no
  longer make the target pending.

* fix(target): apply every setting flag, require flag values, report no-ops as unchanged (#507)

* fix(target): apply every setting flag, require flag values, report no-ops as unchanged

`skillshare target <name>` dispatched --mode, --agent-mode and
--target-naming through an if-chain that returned after the first match,
so `--agent-mode copy --target-naming prefixed` applied one setting and
silently dropped the other. Filters, --skills and --dry-run had the same
early-return problem.

- Check --mode, --agent-mode and --target-naming as a whole and save
  once, in global and project mode (one targetSettingsUpdate replaces six
  per-flag functions).
- Reject --mode/--agent-mode/--target-naming combined with filters or
  --skills, and --dry-run without --skills, instead of dropping them.
- A value flag followed by another flag (or an empty string) now reports
  "<flag> requires a value"; `--target-naming -p` used to report an
  invalid naming '-p'.
- A value the target already has is reported as unchanged and the config
  is not rewritten.

* fix(target): leave the skills pair alone on agents-only changes

A target with skills off may keep target_naming prefixed with a merge
mode it cannot sync; validateGlobalTarget and validateProjectTarget only
check that pair for enabled skills. The combined settings update ran the
pair check for every setting, so `target claude --agent-mode copy` was
refused on such a target although the old agent-mode handler never looked
at skills settings. Check the pair only when --mode or --target-naming is
given.

* docs(target): show combined settings in --help and the built-in skill

The combined --mode/--agent-mode/--target-naming form is now the way to
move a target to copy + prefixed in one step, but neither the help
examples nor the built-in skill's target reference showed it.
2026-10-09 23:59:47 +08:00
Willie 9c994faa17 fix(frontmatter): read and rewrite SKILL.md that starts with a UTF-8 BOM (#505)
* fix(frontmatter): read and rewrite SKILL.md that starts with a UTF-8 BOM

Windows editors such as Notepad write a BOM before the opening ---. The
lenient readers (ParseSkillName, ParseFrontmatterField/Fields/List, ReadSkillBody)
did not skip it, so under target_naming standard/prefixed the skill had no
readable name and was silently skipped. Strip the BOM in the shared frontmatter
locator and the line scanner, and in the hub, search, audit and sync/context
readers that split lines themselves (utils.TrimBOM).

The writers kept working on the unstripped text, so SetFrontmatterValue
prepended a second block and ToggleFrontmatterFlag/RewriteFrontmatterList
could leave a BOM in the middle of the file. They now split the BOM off and
put it back in front, rewriting only the name value (or flag/list) as before.

* fix(frontmatter): cover the dashboard parser and stop auditing a leading BOM

A consumer sweep after the first BOM commit found two more places that
mishandled a SKILL.md written by Notepad:

- audit reported the leading BOM as a HIGH hidden-unicode finding (U+FEFF is
  in the zero-width rule), so every such skill showed a risk score. A BOM at
  the very start of a file is its encoding mark and hides nothing; one past
  the start is still reported.
- the dashboard's parseSkillMarkdown saw no frontmatter, so the skill editor
  would treat the whole file as body and write a second block on save.

The audit-engine page and its four translations note the exemption.

* fix(ui): keep the BOM when the skill editor saves a SKILL.md

parseSkillMarkdown dropped the BOM so the editor could see the frontmatter,
but SkillEditor writes the composed text back through PUT .../content, so every
dashboard edit silently removed the marker from a Notepad-written file. The
parse result now carries the BOM and composeSkillMarkdown puts it back in front,
matching the Go rewrite paths.
2026-10-09 23:58:56 +08:00
Willie 64a85d4348 docs(target): limit "ignored in symlink mode" to flat and standard
The command reference, both schemas and the dashboard field help still
said skills target naming is ignored in symlink mode, while prefixed is
refused there.
2026-10-09 10:46:00 +08:00
Willie 73eb44ee36 Merge remote-tracking branch 'origin/main' into runkids/feat-497-prefixed-naming
# Conflicts:
#	ui/src/i18n/locales/de.json
#	ui/src/i18n/locales/en.json
#	ui/src/i18n/locales/es.json
#	ui/src/i18n/locales/fa.json
#	ui/src/i18n/locales/fr.json
#	ui/src/i18n/locales/id.json
#	ui/src/i18n/locales/ja.json
#	ui/src/i18n/locales/ko.json
#	ui/src/i18n/locales/pt-BR.json
#	ui/src/i18n/locales/zh-CN.json
#	ui/src/i18n/locales/zh-TW.json
#	ui/src/pages/TargetDetailPage.test.tsx
#	ui/src/pages/TargetDetailPage.tsx
2026-10-09 09:48:45 +08:00
Willie ea45a45bda refactor(ui): let SegmentedControl name icon options by title alone
The aria-label branch special-cased string labels, but lucide icons are
aria-hidden, so an icon-only button already takes its accessible name
from title and a text label wins over it; the attribute was redundant.
A disabled segment also still brightened on hover, so the hover rule now
skips disabled segments. In TargetDetailPage the mode reset and the
naming options move out of one-line expressions so they read at a glance.
2026-10-09 02:25:40 +08:00
Willie 3d55f4cb1a feat(ui): show prefixed naming disabled outside copy mode
Hiding prefixed unless the draft mode was copy made the option hard to
discover, and a user who left copy mode with prefixed drafted kept a
naming the server would reject on save. Following the approved design,
the naming control now always lists flat, standard and prefixed;
prefixed is a disabled segment with a "Needs copy mode" tooltip and an
info line saying why. Leaving copy mode resets a drafted prefixed back
to the saved naming (or flat when prefixed was saved), and a pending tag
marks an unsaved naming change.

SegmentedControl gains a per-option disabled flag. Its title no longer
replaces a text label's accessible name, so the disabled segment is
still announced as "prefixed"; icon-only options keep title as name.
2026-10-09 02:23:46 +08:00
Willie dd3cc06e2b fix(ui): warn on the target page when only the shared filters differ
Codex review on #499: when two targets on one skills folder agreed on
mode and naming but had different include/exclude, the target page showed
no note, so it looked settled while the Sync page still reported the
conflict and each sync kept pruning the other's entries. Compare the
draft filters with every target sharing the folder (outside symlink mode,
which ignores them) and offer to copy the other target's filters.
2026-10-09 01:41:24 +08:00
Willie 5f81209c6c feat(ui): warn on the target page when settings clash with a shared folder
Changing sync mode or naming on a target whose skills folder another
target also writes silently set up the conflict that the Sync page only
reported after saving. The target page now compares the draft with each
sharing target and, under the control that causes it, says the other
target's value and offers "Use <value> like <target>". Nothing shows when
both resolve to symlink or the draft matches. The symlink mode copy now
also says naming does not apply there.
2026-10-09 01:25:09 +08:00
Willie c7905decde feat(ui): show which settings differ in the Sync page folder conflict
The notice said two targets sync into one folder "with different
settings" but not which ones, so users could not tell what to change
(mode, naming or filters) to keep both. Under the existing sentence and
stop buttons it now lists only the settings that differ as a small grid,
keep target first, with a link to the target page to change them.
Symlink targets show n/a for naming and filters, matching the server rule
that those settings do not apply there. The names-as-links sentence is
shared with the target page's reader notes.
2026-10-09 01:25:09 +08:00
Willie 06b37d0fcf feat(api): list the targets that share a target's skills folder
The target page needs to know which other targets write to the same
skills folder to warn when an unsaved mode or naming change would make
their syncs undo each other. Re-implementing the server's folder
normalisation (home expansion, path cleaning) in TypeScript would drift
from config.SkillsFolderConflicts, so the targets API now returns
skillsSharedWith, built from the same skillsFolder helper.
2026-10-09 01:25:04 +08:00
Willie 226c5c9a74 feat(target): offer prefixed naming in the CLI, dashboard and schemas
The new naming has to be choosable wherever naming already is: target
--target-naming, the target list TUI, the dashboard target page, shell
completions and the config schemas. Each setter checks the copy-only rule
before saving, for a naming change and for a mode change on a prefixed
target, so an invalid pair never reaches the config file and only surfaces
later as a failed sync.
2026-10-09 00:47:20 +08:00
Willie 366fb236c1 fix(sync): flag shared skills folders whose mode or naming differ
Two targets writing one skills folder with different target_naming or
mode undo each other on every sync (flat links vs standard names, merge
vs copy), but only include/exclude were compared, so sync and doctor
fell back to the generic shared-path hint.

Compare the effective mode and target naming too, so an unset value
equals the default it resolves to. The global default mode is not
carried on the target, so SkillsFolderConflicts takes it from its three
callers. The warning now says "different settings" instead of "different
filters".

Fixes #498
2026-10-09 00:28:34 +08:00
Willie d17907ea05 style(ui): tighten the skills toolbar and pin the hub header like it
The skills toolbar sat about 60px under the tabs because its zero-height
stuck marker took its own flex gap. It now sits 16px from the tabs and the
list, and the marker keeps its old distance so the stuck state flips at the
same scroll position as before.

The hub header was a bare sticky div that pinned flush against the list.
It now uses the shared stuck bar, so it gets padding and a bottom line
once pinned while its resting layout stays the same.
2026-10-08 20:56:36 +08:00
Willie dd46034657 test(ui): keep only rendered tests that protect user data
Most .test.tsx files asserted layout, icons, collapse state, remembered
widths, toasts, focus or shown text. They broke on harmless UI changes
and missed real regressions, which screenshots catch better.

Keep rendered tests for write/delete payloads, confirmations before
destructive actions, drafts kept after errors, stale-version refusal and
sanitizing; logic stays tested in plain .ts modules.
2026-10-08 16:41:09 +08:00
Willie 8ccdc91b29 refactor(ui): share target field rules between Add and Edit target
Add target and the Edit target dialog each implemented the field rules
(an extension forces copy, symlink turns flatten off), and they had
drifted: the dialog kept flatten on through a switch to symlink and
back. applyDraftChange now holds the rules and both use it, so the
dialog clears flatten on symlink exactly like Add target.

Refs #490
2026-10-08 16:08:03 +08:00
Willie c979bf0701 fix(ui): keep a context submenu open after switching back to it quickly
Every submenu trigger closed whichever submenu was open when its 180ms
leave timer fired. Moving from Mode to Flatten and back let Flatten's late
timer close Mode's submenu a moment after it opened. A trigger's timer now
closes only its own submenu.
2026-10-08 15:44:39 +08:00
Willie a9ae5349a2 feat(extras): choose which files each target syncs, and edit targets in place
A directory extra used to sync every file to every target, so a tool that
only wanted a few docs got the whole folder. Each target can now set
gitignore-style include/exclude patterns, matched on the path inside the
source. Merge targets prune links to files that stop matching; copy targets
keep earlier copies, since nothing records which copied files are ours.
Filters are rejected for symlink mode and single-file extras, and sync warns
when an include matches nothing.

The dashboard previously forced users to delete and re-add a target or an
extra to change it. Edit target now changes the folder, file name, mode,
flatten and filters with a live preview; Edit extra renames an extra or
points it at another source folder. A moved target or source drops the
links left at the old place and syncs right away.

CLI: --include/--exclude on extras init, and --add-include, --add-exclude,
--remove-include, --remove-exclude on extras <name>.

Refs #435
2026-10-08 15:31:51 +08:00
Willie bd7e67fffd fix(git): report unmatched include filters from the sync after a pull
The pull response copied only the sync's warnings, so with unmatched
include filters moved to their own field, the Git Sync page stopped saying
that a filter selected nothing after its automatic sync. The pull response
now carries them and the page shows the same notice as the Sync page.
2026-10-08 15:06:59 +08:00
Willie 819ea634f5 fix(ui): show unmatched filter notices in every sync dialog
The project sync dialog and the sync preview modal show only the response's
warnings. With unmatched include filters moved to their own field, a sync
from those dialogs no longer said that a filter selected nothing. Both now
render the same notice as the Sync page.
2026-10-08 14:53:52 +08:00
Willie 47be5105f5 fix(sync): link each target's unmatched filter and ignore blank includes
Two global targets with the same unmatched filter were merged into one
notice whose Edit filter link opened only the first target, leaving the
other unfixed. Only a project's targets share a filter, so other targets
now keep their own notice and link.

A target whose includes were an unmatched pattern plus a blank entry was
not marked as getting no skills, because the check counted the raw list
while filtering drops blanks. It now counts the effective patterns.
2026-10-08 14:48:29 +08:00
Willie 5d5b0f3efb feat(sync): explain include filters that select no skill
The dashboard showed the CLI's raw line, "api-server@claude: include pattern
"*review*" matches no skill in the source", once per target. It named a
config field, did not say the target ends up with no skills, and gave no way
to fix it. Sync now returns these as structured entries; the Sync page
groups a project's targets into one localized notice that says what happens
and links to where the filter is edited. The CLI line also says the filter
adds nothing to the target.
2026-10-08 14:26:41 +08:00
Willie 1b1c8da5b4 feat(ui): keep Sync in reach on the Sync page
The Sync button sat in the sticky bar and the last-sync card started below
it, leaving the right column misaligned with the page header. The buttons
now sit on the card, which sticks with them, so Sync stays visible while the
change list scrolls. The Include bar keeps tight gaps at rest, gets more room
and a bottom line once it sticks.
2026-10-08 14:26:41 +08:00
Willie 66750ac4e5 fix(ui): leave collapsed groups out of the Skills list paging
A collapsed group's items still used up the 100-item page, so later groups
stayed hidden behind Show more and the footer counted rows nobody could see.
2026-10-08 12:54:45 +08:00
Willie 2188be740e fix(ui): require a fresh check before offering prune
Check statuses persist in one non-expiring localStorage entry shared by every
dashboard on the origin. A restored stale status could offer Prune for a
skill reinstalled since, or one in another project, and prune force-moves it
to trash. Stale is no longer restored from the cache, so Prune only appears
after a check in the current session.
2026-10-08 12:47:13 +08:00
Willie e84075dcec fix(ui): refresh the sync matrix after installing config entries
Newly installed skills had no target entries in the cached matrix while the
Skills page kept it mounted, so the Sync page could hide Discard all for them
until the cache went stale.
2026-10-08 12:40:30 +08:00
Willie e36c38abfc fix(ui): show a skill and an agent with the same name as two sync rows
The sync item grid indexed rows by display path, so a skill "reviewer" and
an agent "reviewer.md" collapsed into one entry while the header still
counted two changes. Keep every row under a shared path.
2026-10-08 12:34:59 +08:00
Willie 735c0fe876 fix(ui): key update check statuses by relative path
Statuses were stored under the skill's basename, so a/foo and b/foo shared
one entry. With Prune all acting on stale statuses, a stale b/foo also marked
a/foo stale and both would be sent to trash. Key statuses by relative path
and bump the cached format so old name-keyed entries are dropped.
2026-10-08 12:26:26 +08:00
Willie f56049d3d3 fix(ui): offer a tracked repo to Discard all only when all of it is new
Uninstalling any skill of a tracked repo removes the whole repo, so when a
repo update brought one new skill while its siblings were already synced,
Discard all would have trashed the synced siblings too. A repo now qualifies
only when every skill in it has never been synced.
2026-10-08 12:19:17 +08:00
Willie b09a068410 fix(ui): keep Discard all away from skills live in a symlink-mode target
The sync matrix marks symlink-mode targets `na` because filters don't apply,
so Discard all ignored them when deciding whether a skill had ever been
synced. A skill pending only for a merge target while already live through a
symlinked one was offered for discard, and trashing it would also pull it
from the symlinked target. Count those targets as receiving every skill.
2026-10-08 12:08:44 +08:00
Willie 535de2fced feat(ui): install missing entries, prune deleted skills, and calmer sync and skills pages
Installing what config records still needed the CLI, and skills deleted
upstream showed as updates with nothing to update. The Update page and
install dialog now offer Install all for missing entries, and stale skills
get Prune / Prune all, which move them to trash in one request.

A sync of hundreds of changes was a wall of identical rows per target. Sync
now groups targets that receive the same changes into one card listing names
by folder, keeps its action bar and summary sticky, and adds Discard all,
which moves skills that were never synced anywhere to trash after a
confirmation. The Skills page keeps its toolbar and group heads in view while
scrolling, folds New skill and Link folder into the Install menu, remembers
filters in the browser, and moves Update repo into the repo menu.
2026-10-08 12:01:42 +08:00
Willie 9234861fad fix(ui): label Pi packages as packages in the Pi Extensions tab
Every entry Skillshare manages was titled "Plugins · <name>" with a box
icon, so Pi packages installed through the Plugins page looked like
plugins. The tab now splits them the way the Plugins page does
(piPackageTest): a Pi package reads "Package · <name>" with Pi's black
and white mark, and a plugin reads "Plugin · <name>" with the box icon.
2026-10-08 01:22:20 +08:00
Willie 371561ef9f fix(ui): give a repo-root skill its tracked repo row in the tree
A tracked repo whose skill is its root SKILL.md has relPath equal to its
repo path (org/_team, or _team). buildTree placed the skill under the
parent folder only, so the repo node was never created: Tree view showed
no repo row, update action or repo context menu for it. The skill now
sits in its repo's own folder, which gives top-level repos with a root
SKILL.md that row as well.
2026-10-07 21:42:32 +08:00
Willie d15d9d794c fix: use the --into repo path in skill counts, list groups and the tree
Codex review of #472 found three views still deriving a skill's repo
from the first path segment:

- Skill counts in `list`, human-readable `status` and the dashboard
  overview matched `<repo>/` prefixes, so an `org/_team` repo whose only
  skill is its root SKILL.md counted zero, and `status` disagreed with
  `status --json`. They now compare RepoRelPath with the repo name.
- The list TUI took the group as the second path segment, so a skill at
  org/_team/skills/vue got group `_team` instead of `skills` and the
  `g:` filter missed it. The group is now the first segment below
  RepoName. Test fixtures that used a RepoName unrelated to RelPath now
  use the repo path, as real entries do.
- The dashboard tree treated only top-level `_` folders as repo roots,
  and merged `org / _team / skills` into one row, so an --into repo had
  no update or uninstall actions in Tree view. buildTree now marks repo
  roots from each skill's repo path, and a merged chain stops at one.
2026-10-07 21:35:05 +08:00
Willie c9b649143d refactor: return slash repo paths and simplify --into repo lookup
GetTrackedRepos returned OS-native paths, so every caller that compared
them with slash paths (RepoRelPath, dashboard repoPath, metadata keys)
had to convert first. Two callers in install_queries already did, and
this branch added four more. It now returns slash paths on every OS,
matching GetMissingTrackedRepos; filepath.Join and filepath.Base accept
them on Windows, and `update org/_repo` now also matches by full path
there. The per-call-site conversions are gone.

Smaller cleanups in the same code:
- repoOf takes the slash relPath and looks up prefixes by substring, so
  the walk no longer splits and joins per directory;
- repo .skillignore matchers are keyed by the same slash rel path, so
  isSkillIgnored no longer needs walkRoot;
- batch uninstall uses utils.IsTrackedRepoDir instead of a literal "_";
- the dashboard uses repoOf where it spelled out isInRepo && folderOf;
- the new tests reuse postBatchUninstall and share one --into sandbox.
2026-10-07 21:35:05 +08:00
Willie 4dd62d4ce5 fix: treat tracked repos installed with --into as repos
`install --track --into org` clones to org/_repo, but skill discovery
only marked a skill as in-repo when the first path segment started with
"_". Everything downstream also assumed the repo name was that first
segment. Skills of such a repo were therefore treated as loose skills:
no source in the dashboard, not grouped under the repo, a skill count of
0 in `status`, and an install hint that pointed at the wrong name.

Discovery now records each skill's tracked repo root (RepoRelPath). A
first-segment "_" folder still counts as before; a deeper one counts
only when the walk saw it as a git clone, so a plain org/_drafts folder
stays a folder. The repo's .skillignore is looked up by the same root.

Consumers move from "first segment" to that root:
- the API exposes it as repoPath, and the dashboard groups, updates and
  uninstalls repos by it;
- `list` and `status` use it for repo names and counts;
- batch uninstall accepts a nested repo name, so the dashboard can still
  remove an --into repo now that its skills are in-repo;
- repo names sent to the dashboard by check and update-all use slash
  paths, so they match repoPath on Windows too;
- the install hint suggests `skillshare update org/_repo`.

Fixes #470
2026-10-07 21:23:26 +08:00
Willie 6607b82e2b fix(install): escape submodule diagnostics and match ancestors by filesystem identity
Gitlink paths and .gitmodules URLs come from an untrusted repo, so quote them with %q to keep newlines and terminal escapes out of CLI output. Compare each ancestor of the subdir with the gitlink directory by os.SameFile instead of a byte-length prefix, so case and Unicode-normalization variants that open the same directory are caught.
2026-10-07 02:29:48 +08:00
Willie f1900251d3 fix(install): match submodule paths case-insensitively and warn on search installs
On Windows and macOS a case variant such as Vendor/Up opens the empty submodule checkout, so compare gitlink paths with EqualFold. Search results that install straight from discovery now show its warnings too.
2026-10-07 02:15:21 +08:00
Willie cdac248e96 fix(install): strip secrets from any submodule URL and show warnings in the dashboard
Redact query, fragment and userinfo from relative, scp-style and malformed .gitmodules URLs too, clean the subdir before matching gitlinks so vendor//up is caught, and return discovery warnings from /api/discover so the install dialog shows skipped submodules.
2026-10-07 02:10:03 +08:00
Willie 9ebee9b442 Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block
# Conflicts:
#	ui/src/components/instructions/ProjectSharedFiles.tsx
#	ui/src/components/instructions/SharedInstructions.tsx
2026-10-07 01:35:22 +08:00
Willie 748352e571 Merge branch 'main' into runkids/arch-dashboard 2026-10-07 01:22:49 +08:00
Willie 06ddca6689 Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block 2026-10-07 01:22:15 +08:00
Willie ec17ab71e3 fix(ui): keep the floating action bar on one line
The bar is position: fixed with left: 50%, so its shrink-to-fit width is
capped at the space right of its left edge, half the viewport. Content
wider than that wrapped inside the fixed 46px height, as seen on the Pi
and OMP pending-changes bars. Size it to its content and cap it at the
viewport instead.
2026-10-07 01:14:12 +08:00
Willie 0117161c8b Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block 2026-10-07 01:13:44 +08:00
Willie 2e9f14da49 feat(ui): let the dashboard force a refused tracked-repo uninstall
DELETE /api/repos/{name} now refuses a repo with uncommitted changes or
unreadable git status, and the Dashboard page never sent force, so those
repos could not be removed from it at all.

The two refusals force overrides now carry their own error code. The
page still sends the first request without force; on either code the
confirmation says why and retries with force only when the user
confirms. Other refusals, such as a linked folder that is itself a
skill, keep the plain error because force does not change them.

Refs #442
2026-10-07 00:35:03 +08:00
Willie e40c634d2b test(i18n): close the gaps review found in the key checks
Review showed three ways a missing key still passed:

- t('sync.changes') passed because the counted base was accepted for
  any string; a string passed straight to t() must now be a key itself.
- plural('typo.key', n) was only seen when its first word was a known
  namespace; strings passed straight to plural() are now checked for
  both forms.
- The Go test listed the values that complete "plugins.problem." by
  hand, so a new case in automationProblem passed; the values now come
  from that function's switch.

The files of config paths were also skipped by every check; they are
now skipped only where config paths look like keys, so their t() calls
are checked again.

Refs #448
2026-10-07 00:23:02 +08:00