220 Commits
Author SHA1 Message Date
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
Willie bfec6c8b36 feat(ui): read URL ?theme= param to set style and mode
Read the ?theme= query parameter on page load and popstate events
to override the current theme. Supported values: dark, light (mode),
playful, clean (style). Persists to localStorage so the preference
survives navigation.
2026-03-20 18:29:05 +08:00
Willie 7e5a058f7b feat(ui): unify Force action with SplitButton component
Replace separate Force toggles (checkbox in Sync, button in Extras) with
a shared SplitButton component. Force is now an action variant inside a
dropdown, not a persistent toggle — one click to open, confirm before
executing.

- Add SplitButton with portal-based dropdown (escapes overflow-hidden)
- Sync page: replace Advanced options with SplitButton (Force Sync, Dry Run)
- Extras page: replace Force toggle with SplitButton on Sync All and per-card
- Add inline confirm step for destructive Force actions
- Add spring pop animation, hand-drawn theme support (ss-split-menu)
- Remove redundant indeterminate progress bar from Sync page
2026-03-20 18:29:05 +08:00
Willie 1c7bdcdd84 feat(ui): add Force toggle to Extras page and auto-reset after sync
- Add Force toggle button with tooltip in Extras PageHeader
- Pass force flag to syncExtras API for both Sync All and per-extra sync
- Show "enable Force to override" hint in toast when files are skipped
- Auto-reset Force to disabled after successful sync (Extras + Sync pages)
- Fix ExtrasSyncResult type to match server response (target field, errors array)
- Update v0.17.9 changelog entries
2026-03-20 18:29:05 +08:00
Willie 5198a74287 fix(ui): fix assistant panel scrolling, remove false target warnings, add virtual scroll
- Fix Config and Audit Rules assistant panels with fixed 500px content
  height to enable scrolling (matching CodeMirror editor height)
- Remove target name validation that produced false "Unknown target"
  warnings — target names are user-defined and freely configurable
- Enrich targets field docs example with all sub-fields
- Add react-virtuoso virtual scrolling to FilterStudioPage preview list
- Add v0.17.9 changelog and website changelog
2026-03-20 18:29:05 +08:00
Willie 34819c664b fix(ui): fix TypeScript build errors for tsc -b strict mode
- Add explicit undefined initial value to all useRef<setTimeout>
  calls (5 hooks) — tsc -b requires initial argument
- Remove unused ValidationError import in test file
2026-03-20 02:36:50 +08:00
Willie 4dbaf38668 refactor(ui): clean up audit panel after simplify review
- Remove structured mode dead code from AuditAssistantPanel
  (props, branch, imports — was unused after structured panel removal)
- Remove unused Save import from AuditRulesYaml
- Export SEVERITY_ORDER from severity.ts, remove duplicates
  in AuditOverview and PatternSummary
- Share lines memo in AuditRulesYaml (single split, not two)
- Fix onSaveStateChange firing every keystroke (use saveRef)
- Simplify useAuditYamlValidation (remove useCallback wrapper)
2026-03-20 02:36:50 +08:00
Willie faa73cd366 refactor(ui): remove structured view panel, move Save to PageHeader
Structured view doesn't benefit from an assistant panel — the
accordion already shows all rule details inline. Remove panel
from structured view, restoring full-width layout.

Move Save button from the YAML editor Card header to the
PageHeader actions (top-right), lifted via onSaveStateChange
callback.
2026-03-20 02:36:50 +08:00
Willie ae313a77b8 fix(ui): fix structured panel sticky position and overflow
Move overflow-hidden to only apply when collapsed, so sticky
positioning works. Panel now stays fixed while scrolling the
rule list.
2026-03-20 02:36:50 +08:00
Willie d9f1fe6924 feat(ui): add structured view panel with selection and cross-view jump
Wire RuleDetailCard, PatternSummary, and AuditOverview into the
AuditAssistantPanel structured mode. AuditRulesPage gains selection
state (selectedRuleId/selectedPattern) wired to accordion expand.

Cross-view jump: "Test Regex" fills the regex tester and switches
to YAML view; "Edit in YAML" jumps to the rule's line in the editor.
Panel collapses with Cmd+B in both views.
2026-03-20 02:36:50 +08:00
Willie 86f1fa8cd0 feat(ui): add structured view panel components for audit rules
- AuditOverview: stats + severity distribution (default panel)
- RuleDetailCard: source badge, override status, regex block,
  Test Regex / Edit in YAML quick actions
- PatternSummary: rule list with dots, bulk enable/disable
2026-03-20 02:36:50 +08:00
Willie 4f42740df4 fix(ui): convert (?i) inline flag to JS /i instead of Go-specific error
(?i) is the most common Go regex flag and can be safely converted
to JS RegExp's 'i' flag. Only flag (?im), (?ims), or \x{} are
now marked as Go-specific. Multi-flag combos and non-i flags
still show the Go-specific warning.
2026-03-20 02:36:50 +08:00
Willie 414f17756e fix(ui): use type import for FieldDoc in auditFieldDocs
Fixes Vite dev mode error: 'FieldDoc' is a type-only export and
must be imported with 'import type'.
2026-03-20 02:36:50 +08:00
Willie 3c5d39b3ec feat(ui): extract YAML view with audit assistant panel
Split AuditRulesPage (977 lines) by extracting the YAML editor
into AuditRulesYaml with full assistant panel integration:
real-time validation, field docs, inline regex tester with
auto-fill from cursor position, structure tree, and diff preview.

AuditRulesPage now only handles view switching, shared state,
and the structured rule browser.
2026-03-20 02:36:50 +08:00
Willie f51026a88d feat(ui): add RegexTester and AuditAssistantPanel components
RegexTester: inline regex testing with match highlighting, exclude
preview, Go-specific syntax detection.
AuditAssistantPanel: orchestrator for YAML view with auto-switch
(errors → regex tester → field docs → structure), 3 lock buttons
(Structure/Diff/Test). Structured mode placeholder for Phase 2.
2026-03-20 02:36:50 +08:00
Willie d9de54a331 refactor(ui): genericize FieldDocs and add audit mode to StatusBar
FieldDocs now accepts optional docs prop for reuse with different
field doc maps (audit rules). ConfigStatusBar adds 'audit' mode
that shows validation like config mode.
2026-03-20 02:36:50 +08:00
Willie d12a32886a feat(ui): add useRegexTester hook for inline regex testing
Computes regex matches per line with match positions, exclude
pattern support, and Go-specific regex detection. Debounced 100ms.
2026-03-20 02:36:50 +08:00
Willie 1f78559d70 feat(ui): add useAuditYamlValidation hook
Validates audit rules YAML: severity values (with aliases),
regex compilation via RegExp (skips Go-specific \x{} and (?im)
syntax), and YAML syntax errors. Debounced 300ms.
2026-03-20 02:36:50 +08:00
Willie e5b5095151 feat(ui): add audit rules field documentation map
8 entries covering the audit-rules.yaml schema: rules, id,
severity (with alias support), pattern, message, regex, exclude,
enabled.
2026-03-20 02:36:50 +08:00
Willie a4b69d6795 feat(ui): virtualize uninstall list and show results in modal dialog
Replace filtered.map() with react-virtuoso <Virtuoso> for smooth
scrolling with large skill counts. Move uninstall results from an
inline Card (easily missed at page bottom) to a DialogShell modal
that demands user attention. Add "Continue" button to dismiss the
dialog and stay on the uninstall page for further operations.
2026-03-20 02:36:50 +08:00
Willie a99b6a6087 fix(ui): use PageSkeleton for uninstall page loading state
Replace custom Loader2 spinner with PageSkeleton to match
the loading pattern used by all other pages.
2026-03-20 02:36:50 +08:00
Willie 72cfca6477 refactor(ui): simplify uninstall route from /skills/batch-uninstall to /uninstall 2026-03-20 02:36:50 +08:00
Willie 742c48be3f fix(ui): hide Cmd+S sync HUD on Config page
The modifier shortcut HUD showing "⌘S → Sync" is suppressed on
the Config page where Cmd+S means Save, not Sync.
2026-03-20 02:36:50 +08:00
Willie cd80e77922 fix(ui): Cmd+S saves in Config page instead of navigating to Sync
- Global Cmd+S shortcut now skips when focus is inside CodeMirror
  editor, letting the editor's own Mod-s handler trigger save
- .skillignore editor now also has Cmd+S save support (was missing)
- saveRef updates per active tab so both config and skillignore
  editors save correctly with the same keymap
2026-03-20 02:36:50 +08:00
Willie bf5255a6a5 fix(ui): validate top-level mode and audit config fields
Add validation for:
- top-level mode (was only checking legacy sync_mode)
- audit.block_threshold (CRITICAL/HIGH/MEDIUM/LOW/INFO)
- audit.profile (default/strict/permissive)
- audit.dedupe_mode (legacy/global)

Refactored repeated enum validation into a shared helper.
2026-03-20 02:36:50 +08:00
Willie 798d209977 fix(ui): add 'copy' to valid sync modes in config validation
The backend supports merge, symlink, and copy sync modes, but
the frontend validator only allowed merge and symlink.
2026-03-20 02:36:50 +08:00