Commit Graph
545 Commits
Author SHA1 Message Date
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
Willie 1eca08a84d fix(ui): show available fields when config editor is empty
When the YAML editor has no structure to display (empty content),
show a list of available top-level config fields from fieldDocs
as a quick reference instead of a blank "No structure" message.
2026-03-20 02:36:50 +08:00
Willie 3400f14c48 fix(ui): unify editor and panel height with flex stretch
Replace fixed h-[558px] with h-full so the panel Card stretches
to match the editor Card height via flex items-stretch (default).
2026-03-20 02:36:50 +08:00
Willie 2fcb1b7536 fix(ui): don't show sync preview banner after .skillignore save
The sync preview banner is only relevant for config.yaml changes,
not .skillignore saves.
2026-03-20 02:36:50 +08:00
Willie 14a45ea264 fix(ui): move panel toggle into editor header, smooth CSS transition
Move the expand-panel button from floating position into the editor
Card's title bar (next to config.yaml / .skillignore path). Panel
collapse/expand uses CSS transition (flex/opacity/width) instead of
conditional rendering for smooth animation without layout jump.
2026-03-20 02:36:50 +08:00
Willie b8e31cf282 fix(ui): smooth panel collapse/expand with CSS transition
Replace conditional rendering with CSS transition-all on the panel
container (flex-[0]/w-0/opacity-0 ↔ flex-[2]/opacity-100). Editor
Card transitions flex smoothly with duration-300 ease-in-out.
Removes layout jump on toggle.
2026-03-20 02:36:50 +08:00
Willie cb07a6eaea feat(ui): add config editor assistant panel with polished UI
Right-side context-aware panel: errors → field docs → structure
tree (auto-switch by priority), manual lock to Structure or Diff.

Visual design uses project design system: Badge for status/types,
IconButton for collapse (PanelRightClose/Open), dashed separators,
animate-fade-in transitions, card-like error items, border-l-2
indicators on active tree nodes and diff lines, segmented-control
pills for bottom bar, memoized parsing and lookups.

ConfigPage: flex layout, stable CodeMirror extensions via refs,
Cmd+S save keymap, Cmd+B panel toggle, dirty state guard,
.skillignore simplified panel, floating IconButton collapse toggle.
2026-03-20 02:36:50 +08:00
Willie 5a11a5dddc feat(ui): add config editor assistant panel hooks and field docs
Dependencies: yaml (YAML parsing), @codemirror/lint (inline errors).

Hooks:
- useYamlValidation: real-time parse + schema validation + typo
  suggestions via Levenshtein. Source lines shared, debounced 300ms.
- useLineDiff: LCS line-level diff, debounced 500ms. Exports
  computeSimpleChangeCount for external reuse.
- useCursorField: stable CodeMirror extension tracking cursor field
  path. Handles list items (- key: value). Deferred doc.toString().

fieldDocs: 28 entries covering full config.yaml schema (source,
mode, targets, extras, audit, hub, log, tui, gitlab_hosts).
2026-03-20 02:36:50 +08:00
Willie 23224b5467 feat: extras source config in server API and Web UI
Server:
- GET /api/extras returns source_type field
- POST /api/extras accepts optional source field
- extrasSourceDir helper uses ResolveExtrasSourceDir
- Auto-backfill extras_source on create, auto-create dirs on sync
- Fix data race: snapshot ExtrasSource under RLock in handleExtrasDiff

Web UI:
- ExtraCard shows source type badge for non-default sources
- AddExtraModal includes optional source path input
- Comprehensive cache invalidation: config/extras/targets mutations
  invalidate all dependent queries across pages
2026-03-20 02:36:50 +08:00
Willie 0b5eba205d feat(ui): add batch uninstall route, nav entry, and link from SkillsPage
- Add lazy import and route for BatchUninstallPage in App.tsx
  (placed before skills/:name to avoid capturing as dynamic param)
- Add "Batch Uninstall" nav entry with Trash2 icon in Layout.tsx MANAGE group
- Add "Batch Uninstall" secondary button next to "New Skill" in SkillsPage header
2026-03-19 16:33:24 +08:00
Willie b6722ed785 feat(ui): add BatchUninstallPage with filter + multi-select + batch uninstall
Implements a full batch uninstall page with:
- Group dropdown, glob pattern input, and type segmented control filters
- Multi-select with tracked repo auto-grouping (select one skill in a
  repo selects all siblings)
- Confirmation dialog with force option for dirty tracked repos
- Result summary with per-item success/failure details
- Navigation to Skills and Sync pages after completion
2026-03-19 16:33:24 +08:00
Willie 4f628c5d82 feat(ui): add batchUninstall API client method and types
Add BatchUninstallRequest, BatchUninstallItemResult, and
BatchUninstallResult interfaces plus the batchUninstall() method
on the api object to call POST /uninstall/batch.
2026-03-19 16:33:24 +08:00
Willie f9e4666fef fix: prevent sidebar layout shift when scrolling to bottom of Skills page
Sidebar used `position: sticky` inside a flex container, which broke
when main content exceeded viewport height — the flex container grew
and sticky lost its anchor. Switch to `position: fixed` for all
screen sizes so the sidebar never participates in document flow.
Main content uses `margin-left` to offset for the sidebar width.

This preserves window scroll, keeping Virtuoso virtual scrolling,
sticky toolbar, and ScrollToTop all working correctly.
2026-03-19 16:33:24 +08:00
Willie dc82b93d05 fix: address code review findings for auto-create target dirs
- Remove early return in dry-run so linked/copied counts are populated
  correctly (P1: UI preview no longer hides Sync Now button)
- Use local quietDryRun flag instead of mutating global DiagOutput
  to suppress per-skill messages (P2: safe under parallel sync)
- Use "Will create" for dry-run, "Created" for actual sync (P3)
- Include dir_created in allUpToDate check so empty source + missing
  dir still shows Sync Now in the preview modal
2026-03-19 04:16:36 +08:00
Willie 643e3c5c07 fix: auto-create missing target directories with notification (#87)
v0.17.5 blocked sync when target directories didn't exist, which
prevented first-time users on fresh CLI installs from syncing.

Sync now auto-creates missing directories and reports what it did
in CLI output, dry-run preview, and the Web UI. Init also creates
target directories when it detects an installed CLI tool.

Web UI: Sync Preview modal stays open after sync with a success
banner instead of immediately closing, so users can review results.

Closes #87
2026-03-19 03:57:08 +08:00
Willie d9acaf23f3 fix(ui): remove plus icon from NewSkillPage header 2026-03-18 22:35:02 +08:00
Willie bc4658ea8e fix(ui): use bold border only for active card selection
Drop blue background — selected state is just border-pencil (thick
dark border) + shadow-md, unselected stays border-muted (light).
Clean and minimal.
2026-03-18 22:35:02 +08:00
Willie 02009b8168 fix(ui): use blue accent for active card selection in wizard
Previous border-pencil + bg-paper-warm was nearly invisible against
the light theme. Switch to border-blue + bg-info-light to match
the dashboard's established selected-state convention (TargetsPage,
CollectPage, AuditPage).
2026-03-18 22:35:02 +08:00
Willie 2eb6a79670 fix: address code review findings from simplify pass
- Add cleanup (os.RemoveAll) on scaffold dir creation failure
- Use skill.ValidNameRe in isValidSkillName (remove duplicate regex)
- Derive canAdvance from nameError instead of re-calling validateName
- Remove redundant total param from ProgressBar (derive from steps.length)
- Fix popstate handler to read event.state.step directly
- Use Plus icon for PageHeader (icon prop is required)
2026-03-18 22:35:02 +08:00
Willie 0e2b3237a1 fix(ui): remove icon from NewSkillPage header
Sub-pages with backTo arrow don't use title icons — matches
FilterStudioPage and AuditRulesPage convention.
2026-03-18 22:35:02 +08:00
Willie 1d03eead66 fix(ui): remove subtitle from NewSkillPage header
Pages with backTo arrow should be single-line (title only),
matching SkillDetailPage convention. The subtitle caused an
inconsistent two-line header layout.
2026-03-18 22:35:02 +08:00
Willie 7b3844bd2d fix(ui): align NewSkillPage layout with dashboard conventions
- Add space-y-5 to root container (matches all other pages)
- Remove redundant mt-6/mt-8 margins
- Redesign scaffold step from cramped inline checkboxes to
  card grid with folder icons (matches pattern/category style)
- Remove unused Checkbox import
2026-03-18 22:35:02 +08:00
Willie 0ed219bff7 fix(ui): normalize scaffoldDirs in getTemplates response
Go's omitempty serializes nil slices as absent, causing
undefined.length crash in the pattern card grid. Normalize
to empty array in the API client layer.
2026-03-18 22:35:02 +08:00
Willie bca6c641c5 fix(ui): use spec-compliant mode label in new skill wizard
Change subtitle from generic text to "Creating in: Global/Project"
to match the spec's mode badge requirement.
2026-03-18 22:35:02 +08:00
Willie fa6ad43f4a feat(ui): wire up NewSkillPage routing and add entry button
Add /skills/new route (before /:name to avoid param conflict),
lazy-import NewSkillPage, and add "+ New Skill" button to SkillsPage
header. Clean up unused imports and variables in NewSkillPage.
2026-03-18 22:35:02 +08:00
Willie 87bc3d35c4 feat(ui): add NewSkillPage wizard for creating skills from templates
Multi-step wizard with: name validation (regex + duplicate check),
pattern selection from API, optional category, scaffold dir checkboxes,
and confirmation summary. Uses browser history for back-navigation.
2026-03-18 22:35:02 +08:00