Commit Graph
676 Commits
Author SHA1 Message Date
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
Willie 7cdec347ec refactor(ui): use the keyed-text helper where the rule was still inline
Two places still wrote out 'translate the backend key, else show its
text' by hand next to keyedText, so the rule had three copies. The Pi
package test also rebuilt the set of Pi targets for every package on
every render; it is now built once per inventory, as before the flow
moved out of the page.

Refs #446
2026-10-07 00:23:02 +08:00
Willie 19c670df12 refactor(ui): drop the audit key no query uses any more
The audit query of a skill is keyed by name and kind, and its cache is
cleared by the ['audit', 'skill'] prefix. The name-only key lost its last
caller when the key literals moved into queryKeys.ts, and read as the real
query key while matching none exactly.

Refs #445
2026-10-07 00:23:02 +08:00
Willie 1de30fbc38 feat(instructions): tint managed blocks in the target file dialog
The source view of a target's file showed the block markers as plain
comments, so which lines skillshare manages, and which block had been
edited by hand, took reading the markers. Each managed block is now
tinted, a block the target reports as modified in the warning tone, and
the dialog says what the block is or offers Collect and Reapply for the
edited one, as the row does.

Refs #436
2026-10-07 00:18:40 +08:00
Willie f0270c371b refactor(ui): let i18n own key validity and plural selection
The i18n module guaranteed parity between locales and left the rest to
callers. `t` takes any string, so a mistyped key rendered as the key and
nothing caught it; internal/plugin sends translation keys that nothing
compared with en.json; and about 130 call sites chose between `.one` and
`.other` by hand.

- keys.test.ts reads the dashboard source and fails on a key that is not
  in en.json. A key built at run time is checked by its fixed head, and a
  string that only looks like a key is named in a short documented list.
- internal/plugin/i18n_keys_test.go fails when a "plugins." literal the
  package emits is missing from en.json; the one key completed at run
  time lists its values.
- plural(key, count) in the i18n module picks the form, with the same
  "exactly 1" split the call sites used, so every rendered string is
  unchanged. No locale file changed.

Refs #448
2026-10-07 00:12:35 +08:00
Willie 443e590d29 feat(instructions): open a target's file from its row on the AGENTS.md tab
A target row showed only the path of the file the tool reads, so seeing
what a prepend or append block actually did to that file meant leaving
the tab for the target page. The path now opens a read-only dialog with
the same preview and source views, and a link to the target page for
editing. Riders keep a plain path: they have no file of their own.

Refs #436
2026-10-07 00:11:45 +08:00
Willie c0a0c11a6d refactor(ui): move the plugins preview → review → apply flow out of the page
PluginsPage held the whole flow in one component: the busy, working,
failure, review, result and updates state, the rule that apply sends the
revision its preview returned, and the lists derived from the inventory.
Those rules could only be tested by rendering the page with five mocks,
so the test file changed whenever the page did.

components/plugins/pluginsFlow.ts now owns the state and the derived
lists (todo, active, idle, changed, Pi packages), and the page renders
what it returns. The rules are tested there with only pluginsApi faked;
the page test keeps rendering and wiring, and loses the four cases that
only checked a rule through the DOM.

The "use the backend key if present, else the text as sent" helper
existed three times; keyedText in outcomeText.ts is now the only one.

No text or markup changed.

Refs #446
2026-10-07 00:08:11 +08:00
Willie 15922be060 refactor(ui): share one reviewed-write dialog between Pi and OMP extensions
The Pi and Oh My Pi extension tabs each carried a ReviewDialog with the
same flow, nearly line for line: preview once, apply only that plan's
revision, show busy and stale refusals, and offer "review again" when the
server reports the plan stale. A third target of this kind would have
added a third copy.

ExtensionsReviewDialog now owns that flow and the dialog frame. Each
target supplies its plan rows, texts and endpoints, so the two protocols
stay as they were: Pi previews without a revision, OMP previews against
the view's revision, and both apply the previewed plan's revision.

Hooks, MCP and Plugins use different protocols and are left alone.

Refs #447
2026-10-07 00:04:57 +08:00