Commit Graph
545 Commits
Author SHA1 Message Date
Willie 96b357bc20 fix(ui): prevent modal close when selecting text in input fields
Switch DialogShell backdrop detection from onClick to onMouseDown.

The click event's target resolves to the nearest common ancestor of
mousedown/mouseup positions, so dragging a text selection from an
input onto the backdrop would fire onClose. mousedown's target is
always the element directly pressed, so only an intentional press on
the backdrop itself triggers close.
2026-04-05 20:08:41 +08:00
Willie 5d9b3c5f4b feat(ui): optimistic batch target update with inline spinner and interaction lock
- Add onMutate to batchMutation for instant UI updates (mirrors
  server matchesFolder logic, skips disabled/tracked-repo skills)
- Show inline Spinner next to the folder badge during batch ops,
  derived from batchMutation.variables (no manual state sync)
- Block context menu and target selection while batch is pending
  to prevent conflicting mutations
- Extract normalizeTargets result into variables to avoid redundant
  calls in skill row rendering
2026-04-04 17:05:22 +08:00
Willie 8e4a8b18eb fix(ui): normalize wildcard targets and scope folder summary to direct skills
- Add normalizeTargets helper: treats ['*'], null, and [] as All
- Folder target summary now reflects direct skills only, not the
  entire subtree — child folders have their own visible badges
- Skill badges in grouped view also use normalizeTargets so '*'
  displays as 'All' instead of a literal asterisk
- Mixed display: shows 'Mixed' when some skills are All and others
  have specific targets (with tooltip showing the breakdown)
2026-04-04 17:05:22 +08:00
Willie 97fe0ebb11 fix(ui): show error toast when batch target edit hits only tracked-repo skills
When all skills in a folder are tracked-repo members (read-only), the
batch target mutation now shows an error toast instead of a misleading
'0 skills now available in X' success message.
2026-04-04 17:05:22 +08:00
Willie 343e29cfe5 fix(ui,server): harden target management, toggle, and tracked-repo UX
- Enable frontmatter parsing in DiscoverSourceSkillsAll so /api/skills
  returns saved targets (fixes target display reverting to All)
- Skip tracked-repo skills in batch/single target handlers to prevent
  dirty git state; reject with 400 for single-skill endpoint
- Add RefreshMetaHashes to recompute audit hashes after SKILL.md edits;
  batch handler refreshes outside the write lock
- Show 'Uninstall Repo' with confirm dialog for tracked-repo members
  instead of the always-failing individual uninstall action
- Return 409 Conflict when enabling a skill disabled by glob pattern
  in .skillignore/.skillignore.local instead of false success
- Preserve IsInRepo flag for root-skillignore-disabled skills so they
  remain visible in the Tracked tab after disable
- Update changelog and website changelog for v0.18.7
2026-04-04 17:05:22 +08:00
Willie a8f3aaf62f fix(ui): resolve TypeScript build errors in Docker sandbox CI
- Add explicit undefined initializer to useRef<T>() for React 19 compat
- Remove unused isProjectMode from DashboardPage (dead after refactor)
- Remove unused queryClient/toast from SkillsTable (moved to useSkillActions)
2026-04-04 17:05:22 +08:00
Willie 4e20a71e10 feat(ui): target display + context menu actions across all 3 skill views
Grouped view:
- FolderNode target aggregation (bottom-up O(n) computation)
- Target badges on folder rows (uniform/mixed) and skill rows
- Right-click context menu for batch (folder) and single (skill) editing

Grid view:
- Target badges on skill cards
- Right-click context menu for single skill editing

Table view:
- 'Available in' column with inline Select dropdown
- Simplified to 5 columns (merged Path/Source into Name)
- Actions column (⋯) with flat menu items
- Page size persisted in localStorage

All views:
- Shared useSkillActions hook with optimistic cache updates
- Context menu actions: Available in, View Detail, Enable/Disable, Uninstall
- ConfirmDialog for destructive actions
- Hover-matching highlight on active context menu item
- Clickable source globe icon linking to repo
- Dismissible right-click tip banner with playful theme

Config page:
- Panel wrapper overflow-visible when expanded (fixes dashed border clipping)

Closes #115.
2026-04-04 17:05:22 +08:00
Willie feaf086e91 feat(ui): add SkillContextMenu + TargetMenu with submenu pattern
SkillContextMenu: extensible right-click context menu with:
- Submenu support (hover-expand with 180ms intent delay)
- Portal rendering (escapes transform containing blocks)
- Dismiss overlay (prevents click-through to Links)
- Scroll/Escape close, viewport collision detection
- Spring pop + slide animations, playful theme integration

TargetMenu: convenience wrapper adding 'Available in...' submenu
with extraItems prop for additional actions (Uninstall, etc).

CSS: ss-context-menu + ss-context-submenu classes with playful
theme overrides (wobble radius, hard shadow, dashed borders).

Part of issue #115.
2026-04-04 17:05:22 +08:00
Willie 59e6e7137d feat(ui): add batchSetTargets and setSkillTargets API client methods
Part of issue #115.
2026-04-04 17:05:22 +08:00
Willie 603f7e86fa fix(ui): refine tracked repo row — add xs button size, move status to info group
- Add 'xs' button size tier (px-2 py-1 text-xs) to Button component
- Use xs buttons for tracked repo Update/Uninstall actions to reduce
  visual weight in row-level controls
- Move clean/modified status from action area to info group (left side)
  as Badge — status is metadata, not an action
- clean: subtle default Badge; modified: warning Badge with dot
- Remove unused Check icon import
2026-04-04 17:05:22 +08:00
Willie 814e14c88b fix(ui): show tracked repos section in project mode dashboard 2026-04-04 17:05:22 +08:00
amdoi7 b625b8ce9a Merge origin/main into fix/dashboard-tracked-repo-actions 2026-04-03 15:34:10 +08:00
amdoi7 e3ea2afb88 fix(ui): address tracked repo review feedback
Validate tracked repo names against path traversal and surface repository listing errors in the uninstall handler.
Track in-flight dashboard repo actions with sets so loading state stays correct during overlapping clicks.
2026-04-03 15:14:51 +08:00
amdoi7 14da64f33a fix(ui): manage tracked repos from dashboard
Add update and uninstall controls to the dashboard tracked repo list.
Handle nested tracked repo paths in the uninstall API so dashboard actions work for both top-level and nested repos.
2026-04-03 14:34:17 +08:00
Willie a570670a92 fix: registry cleanup after uninstall and sync, UI polish
- Fix UI batch uninstall not removing nested skill registry entries:
  handler used flat names (__) but registry stores path names (/),
  now tracks exact RelPath from discovered skills for matching

- Add stale entry pruning to ReconcileGlobalSkills and
  ReconcileProjectSkills using a live set built during disk walk,
  so skills deleted from source are removed from registry

- Trigger registry reconcile after sync in both UI handler (via defer
  for early-return safety) and CLI (global + project mode), writing
  warnings to stderr to avoid corrupting --json output

- UI: fix BatchUninstallPage search treating plain text as exact-match
  glob (now substring search when no * or ? present), display nested
  skill paths with / instead of __ in confirm and result dialogs

- UI: hide redundant 'X repo(s) and Y skill(s) already up to date'
  line on UpdatePage when everything is already current

- Fix test isolation: set XDG_CONFIG_HOME in server test helpers to
  prevent host agents dir leaking into test results, skip chmod-based
  oplog test when running as root

- Add README badge for Awesome Codex CLI
2026-04-01 22:30:39 +08:00
Willie f9163d717c fix(ui): reduce table tooltip delay from 1500ms to 1000ms 2026-04-01 00:32:49 +08:00
Willie 0424a690c4 fix(ui): improve table name truncation, tooltip positioning, and detail metadata layout
Table view:
- Add max-w-[300px] + truncate + tooltip on Name column
- Fix tooltip overflow clamping to slide instead of flip
- Add block prop to Tooltip for correct getBoundingClientRect in table cells
- Set tooltip delay to 1500ms for table columns

Tooltip component:
- Add block prop to render wrapper as block element
- Fix horizontal overflow: use vw - MARGIN - w instead of flipping left
- Add useEffect cleanup to prevent timer/RAF leak on unmount

Skill detail page:
- Switch metadata from stacked to horizontal label:value layout
- Move CopyButton from label to value side to prevent layout shift
- Reduce spacing (space-y-3 → space-y-2) and label size (text-sm → text-xs)
- Shorten Repository label to Repo
2026-04-01 00:32:49 +08:00
Willie 6f70e76758 fix(sync): accurate expectedSkillCount and surface skipped skills
Problem: Sync page showed 'in sync' but Targets page showed
39032/64075 — ~25000 skills silently dropped by name collisions
and SKILL.md validation in standard naming mode.

Root cause: expectedSkillCount used raw filtered count (pre-resolution)
while diff used post-resolution count. The gap was invisible.

Fix:
1. handler_targets.go: expectedSkillCount now uses resolution.Skills
   count (post-collision/validation), matching what sync actually does
2. handler_diff_stream.go: surfaces skippedCount and collisionCount
   in diff response so UI can explain why skills were dropped
3. handler_sync.go: diffTarget struct gains SkippedCount/CollisionCount
4. TargetsPage: shows warning when skills are skipped with collision count
5. SyncPage: shows naming conflict notice in 'in sync' cards
6. API client: Target and DiffTarget types gain optional fields
2026-04-01 00:32:49 +08:00
Willie c75ab36095 fix(ui): optimistic update for target mode/naming dropdowns
Apply setting change to React Query cache immediately on select,
then confirm via API. Rollback cache on error. Eliminates 2s lag
between dropdown change and UI update.
2026-04-01 00:32:49 +08:00
Willie 6e3f7ea124 feat(ui): branch support in web UI
- API client: branch field on Skill type, discover/install/installBatch
- InstallForm: branch input inline with Source (7:3 ratio), git detection
- SkillsPage: branch badge with GitBranch icon in all 3 view modes
- SkillDetailPage: branch metadata row in detail sidebar
2026-04-01 00:32:49 +08:00
Willie ccdafd3293 feat(sync): add target_naming config option (flat/standard)
Add per-target target_naming setting that controls how skill directories
are named in sync targets. 'flat' (default) preserves the existing
flattened __ separator behavior. 'standard' uses the SKILL.md name field
directly, following the Agent Skills specification.

Standard mode:
- Validates SKILL.md names match directory basenames
- Detects and skips name collisions with warnings
- Auto-migrates managed entries when switching from flat to standard
- Preserves legacy entries when bare name is already occupied

Also includes:
- Per-target toggle via CLI (--target-naming), TUI (N key), and Web UI
- Collision output redesigned as deduplicated compact summary
- Config inheritance: global target_naming → per-target override
- JSON schema + UI validation for the new field

Closes #110
2026-04-01 00:32:49 +08:00
Willie d2716e14b1 feat(ui): replace grouped view with folder tree view
Virtualized tree with multi-level expand/collapse, hover metadata
tooltips, Expand/Collapse All buttons, search-aware auto-expansion,
sticky folder header, indent guides, and localStorage persistence.

Also: Tooltip delay/followCursor fix, skill detail button layout fix.

Ref #108
2026-03-30 16:35:05 +08:00
Willie af1f62b62e feat: add enable/disable API, UI button, and disabled field 2026-03-29 04:59:23 +08:00
Willie 7a247dd086 chore(schemas/ui): update JSON schemas and fieldDocs for skills/agents format
- config.schema.json: inline skills definition with examples, agents
  marked as reserved, remove unused resourceTargetConfig def
- project-config.schema.json: same treatment for project targets
- registry.schema.json: add kind enum (skill|agent), reserved note
- fieldDocs.ts: new targets.skills.* entries, targets.agents.* reserved,
  legacy flat fields marked [Legacy]
2026-03-29 04:59:23 +08:00
Willie 80f5266e24 fix(ui): replace --- text with full-width hr in analyze tooltip
Tooltip content prop now accepts ReactNode instead of string only.
Analyze page skill tooltip uses an <hr> element for a clean separator.
2026-03-28 15:26:55 +08:00
Willie a5b2425565 refactor(ui): extract helpers in UpdatePage for reuse and correctness
- Extract patchItem() to deduplicate 6 setItemStatuses map calls
- Extract invalidateSkillData() to deduplicate 3 query invalidation pairs
- Extract isStaleError() checking both backend stale patterns
- Derive completedCount from individual counts instead of extra filter
2026-03-28 02:52:01 +08:00
Willie 56bffa7d25 feat(ui): improve update page with sticky progress bar, auto-scroll, and purge
- Replace static 'Updating...' text with sticky StreamProgressBar showing
  real-time progress (completed/total, percentage, ETA)
- Auto-scroll to the currently updating item via scrollIntoView
- Add visual distinction for failed (danger bg) and blocked (warning bg) items
- Show error messages in red with font-medium for better readability
- Add Purge button for skills whose subdirectory no longer exists in repo
- Change Force button to Force Retry with danger variant for other errors
2026-03-28 02:47:06 +08:00
Willie e2106ba06f fix(analyze): remove redundant path line from skill detail dialog
Title already shows skill.path, so the separate path paragraph
was duplicating information.
2026-03-28 02:33:15 +08:00
Willie 44420a8b84 feat(ui): improve analyze display, install picker, and tooltip UX
Analyze page:
- Display skill path (/) instead of flat name (__) in chart, table, dialog
- Widen chart name column from 150px to 220px
- Add skill path as first line in chart tooltip with separator
- Add hover highlight on chart rows

Tooltip component:
- Add followCursor mode that tracks mouse position
- Add viewport boundary detection to prevent clipping
- Measure natural size at (0,0) before clamping position
- Remove break-all to prevent mid-word breaks

Install page:
- Add singleSelect mode to SkillPickerModal (radio UI) when custom name is set
- Add custom name support to batch install API (backend + frontend)
- Remove cross-path duplicate check for batch installs
- Fix: don't show success summary toast when all skills failed
- Fix: keep picker open on install failure
- Preserve source input after install (don't clear on reset)
- Widen SkillPickerModal from md to 2xl
- Align severity badge and description text in warning dialogs

Toast: raise z-index above dialog overlay (z-50 → z-[60])
2026-03-28 02:30:50 +08:00
Willie bb029f7950 fix(analyze): handle null targets array in API response
Go nil slice serializes to JSON null instead of []. When no targets
match, buildGroups() receives null and for...of throws TypeError.

- Backend: use make([]..., 0) so JSON marshal produces []
- Frontend: add ?? [] guard and optional chaining for null safety
2026-03-28 01:55:25 +08:00
Willie 0f7f6101fb fix(analyze): pass icon component ref to EmptyState, not JSX element 2026-03-27 02:06:33 +08:00
Willie 8b8254d837 style(analyze): use EmptyState component for no-match state 2026-03-27 02:03:42 +08:00
Willie bb4787b198 style(analyze): add slide/fade animation to summary bar and table rows
Summary bar uses opacity + max-height transition (200ms ease-out)
for smooth appear/disappear. Table rows use fade-in animation (150ms)
when filter results change.
2026-03-27 00:43:42 +08:00
Willie 545b8c0728 style(analyze): fix table height to prevent layout shift on filter 2026-03-27 00:41:22 +08:00
Willie fb044d68a6 feat(analyze): add filtered token summary bar to Web UI
Shows always-loaded, on-demand, and total token sums for the current
search/filter result set using mini stat chips with icon + label + value.
Appears only when a filter is active. Search matches on path (relPath)
to support group filtering. Lint filter badge shows readable rule name.
2026-03-27 00:33:36 +08:00
Willie 64ed9b046e feat(analyze): add malformed-frontmatter lint rule and polish UI/TUI
- Surface YAML parse errors from calcContextFromContent as a new
  "malformed-frontmatter" lint issue instead of silently ignoring them
- Fix help text to say "Top 10" (was "Top 5") matching actual constant
- Shorten TUI list title to target name only; move skill count to
  stats line so the header no longer wraps on narrow terminals
- Truncate long skill names in TUI to keep token counts visible
- Change "All Skills" icon block to green (matches Skills summary card)
2026-03-26 19:20:52 +08:00
Willie 89df6d2904 fix(ui): center pin decoration on playful theme detail cards
Use percentage-based positioning (left: 50% + translateX) instead of
fixed pixel offsets (right: 18px / left: 22px) so pins stay centered
regardless of card width. Add nth-child variation at 40%/60%.
2026-03-26 19:20:52 +08:00
Willie ae3989276c feat(ui): add token breakdown to skill detail and polish AnalyzePage
AnalyzePage:
- Add "View Skill Detail" link in skill dialog for quick navigation
- Simplify subtitle (remove redundant useMemo with identical branches)
- Replace prevFiltered anti-pattern with useEffect for pagination reset
- Remove unused border/bg fields from summary card data

SkillDetailPage:
- Show estimated token count in stats bar with desc/body breakdown
- Hover tooltip shows full breakdown (~4 chars/token estimate)
2026-03-26 19:20:52 +08:00
Willie 9ecd78e157 feat(ui): redesign AnalyzePage and unify dialog styling across all modals
Redesign AnalyzePage with improved visual hierarchy, accessible colors,
and consistent styling. Unify all dialog/modal components to use a shared
DialogShell with border-2 border-pencil + hard-offset shadow pattern,
removing Card wrappers that caused inconsistent appearance.

AnalyzePage improvements:
- Summary cards with Audit-style icon blocks and semantic colors
- Bar chart uses info blue (not red) with uniform opacity
- Skill detail shown in dialog instead of inline expand
- Table matches Skills page table view (dashed borders, pagination)
- Quality Issues section with readable rule names and proportion bars
- Help dialog explaining page purpose and token calculation
- All colors use CSS variables for dark mode compatibility

Dialog unification (11 files):
- DialogShell: add bg-surface, border-2 border-pencil, padding prop,
  createPortal to body, CSS shadow rules
- Migrate KeyboardShortcutsModal from inline to DialogShell
- Remove Card wrappers from ConfirmDialog, SkillPickerModal,
  HubManagerModal, SyncPreviewModal, UpdateDialog, ExtrasPage
- FileViewerModal: padding=none with manual header padding
2026-03-26 19:20:52 +08:00
Willie 9f3832637a feat(ui): implement full AnalyzePage with dashboard, chart, and table
Replace placeholder with complete analyze dashboard:
- PageHeader with BarChart3 icon, dynamic subtitle, refresh button
- Loading/error/empty states using shared components
- Target group merging with SegmentedControl for multi-group switching
- 4 summary cards (skills, always-loaded, on-demand, quality issues)
- Top-10 heaviest skills horizontal bar chart with P25/P75 coloring
- Lint issues summary panel with clickable rule filtering
- Full skill table with sortable columns, search, lint filter badge
- Expandable rows showing token breakdown, metadata, and description
2026-03-26 19:20:52 +08:00
Willie 920feabff6 feat(ui): add analyze API types, route, and nav item
Wire up frontend infrastructure for the Analyze page:
- Add AnalyzeResponse/AnalyzeTarget/AnalyzeSkill/AnalyzeLintIssue types
- Add api.analyze() method calling GET /analyze
- Register /analyze route with lazy-loaded AnalyzePage
- Add Analyze nav item (BarChart3 icon) in SECURITY & MAINTENANCE group
- Create placeholder AnalyzePage component
2026-03-26 19:20:52 +08:00
Willie 977d76109e feat(ui): add sticky search filter to Update page
Add a search input with sticky positioning to filter the update list
when many skills have updates. Select All now operates on filtered
results only, and uses a shared toggleAll helper with Set-based lookup.
2026-03-26 19:20:52 +08:00
Willie d58b27219e refactor(ui): replace Update page action buttons with SplitButton
Use SplitButton dropdown for the update action, moving the Force
option into a dropdown menu item with confirmation step. This aligns
the Update page with the Sync and Extras page patterns.
2026-03-26 19:20:52 +08:00
Willie 0938797e41 feat(ui): add tooltip to Flatten checkbox on Extras page
Hovering shows: "Sync files from subdirectories directly into the
target root (e.g., for tools that only discover top-level files)"
2026-03-25 21:14:16 +08:00
Willie 7c913086d0 fix(ui): show correct field docs for target names in config editor
- name: claude under targets was showing mode doc (targets.mode)
  instead of target name doc. Fixed by adding targets.name fieldDoc
  entry which scores higher in subsequence matching.
- Bare list values like "- agents" (short-form target name) were
  invisible: extractKey, parseYamlTree, and lookupFieldDoc now
  handle them.
2026-03-25 21:14:16 +08:00
Willie 2ce1544dd1 docs: add flatten documentation, changelog, and contributor
Extras command docs, config reference, built-in skill, website
changelog, release notes. Add mk-imagine to README contributors.

Ref: #97
2026-03-25 21:14:16 +08:00
Willie 31db9fa36f test(extras): integration tests for flatten sync
Covers: flatten merge (files land flat), collision detection (warn and
skip), and config YAML round-trip.

Ref: #97
2026-03-25 21:14:16 +08:00
Willie b93f437d8e feat(ui): add update notification dialog to Web UI
Show a compact dialog on first visit when a newer CLI or skill version
is available. Queries /api/version (shared cache with Dashboard), displays
version diff with copyable upgrade command. Dismissed once per browser
session via sessionStorage. Supports ?update-test param for local testing.
2026-03-24 23:17:06 +08:00
Willie 053ecb428d fix(ui): equal-height skill cards and improved theme param handling
- Add h-full + flex-col to SkillPostit cards so grid rows align evenly
- Make ?theme=clean/playful also set light mode explicitly
- Add postMessage listener for theme-push from parent window (Tauri shell)
2026-03-21 00:48:42 +08:00
Willie 690a625b3a fix(ui): add missing data-tour attribute for skill-filters tour step
The Quick Tour's "Skill Filters" step targeted [data-tour='skill-filters']
but TargetsPage never rendered that attribute, causing a 3s hang and
auto-skip during the tour.
2026-03-20 22:54:53 +08:00