Commit Graph
545 Commits
Author SHA1 Message Date
Willie d6be8057ed feat(ui): add API client types and methods for skill creation
Add SkillPattern, SkillCategory, TemplatesResponse, CreateSkillRequest,
and CreateSkillResponse types. Wire up getTemplates() and createSkill()
API methods. Add 'templates' query key for caching.
2026-03-18 22:35:02 +08:00
Willie da7dfd37cc test: add E2E runbook for UI base path reverse proxy
Covers: API routing with prefix, 404 without prefix, bare path redirect,
__BASE_PATH__ injection, SPA fallback, -b flag, env var fallback.

Also fix unused import in SyncPage.tsx (broke tsc).

Ref: #85
2026-03-18 22:35:02 +08:00
Willie f0e164ce9c refactor: simplify base path code after review
- Export NormalizeBasePath and reuse in ui.go (eliminate duplication)
- Use json.Marshal for safe __BASE_PATH__ injection (prevent XSS)
- Always cache index.html at startup (avoid per-request disk reads)
- Extract shared BASE_PATH module in frontend (single source of truth)

Ref: #85
2026-03-18 22:35:02 +08:00
Willie 214c8b993c feat(ui): support base path for reverse proxy deployments
- Vite base: './' for relative asset paths (works from any sub-path)
- API client reads window.__BASE_PATH__ for request prefix
- React Router uses basename for client-side routing

Ref: #85
2026-03-18 22:35:02 +08:00
Willie 92603f5be6 feat: add config save validation and sync safety checks
Validate config semantics (source path, sync modes, target paths) at
save time (API + CLI) instead of failing at sync time with cryptic
errors. Sync no longer auto-creates missing target directories — fails
fast to catch typos like ~/.cusor/skills. Dry-run also validates paths.

- ValidateConfig / ValidateProjectConfig with warnings + errors
- handlePutConfig returns 400 for invalid configs, 200 + warnings
- handleSync pre-checks via ValidateConfig
- ensureRealTargetDir shared helper (replaces duplicated blocks)
- UI: warning toast on config save, warning banners on sync/preview
- Dashboard shows full absolute source path
2026-03-18 22:35:02 +08:00
Willie a7ecc4010d fix(ui): move sync preview banner above editor to avoid toast overlap 2026-03-18 22:35:02 +08:00
Willie 0ff59638d5 refactor(ui): replace toast action with inline banner for sync preview
- Revert Toast.tsx to original (remove action/persistent/replaceKey)
- Remove detailed prop from SyncResultList (YAGNI, caused overflow)
- ConfigPage: show inline banner card after save instead of toast action
- Banner dismisses on edit or manual dismiss, opens sync preview modal
2026-03-18 22:35:02 +08:00
Willie f6ec0e9565 refactor(ui): extract shared sync helpers to eliminate duplication
- Create ui/src/lib/sync.ts with formatSyncToast(), invalidateAfterSync(),
  and summarizeSyncResults() utilities
- SyncPreviewModal and SyncPage now share the same toast message and
  query invalidation logic instead of duplicating it
- Clear stale results/error when SyncPreviewModal closes
2026-03-18 22:35:02 +08:00
Willie 0446711535 fix(ui): include pruned in hasChanges for SyncResultList
Prune-only targets need to show the detailed skill list and
the change icon in the sync preview modal so users can see
which symlinks will be removed before confirming.
2026-03-18 22:35:02 +08:00
Willie 75f35d2471 feat(ui): wire SyncPreviewModal into ConfigPage save handlers
Both handleConfigSave and handleIgnoreSave now show a persistent toast
with a "Preview Sync" action button that opens SyncPreviewModal. The
replaceKey 'config-save' deduplicates toasts when saving in quick
succession.
2026-03-18 22:35:02 +08:00
Willie 7b99d0f130 feat(ui): add SyncPreviewModal with dry-run preview and confirm 2026-03-18 22:35:02 +08:00
Willie 2dcd756f00 refactor(ui): extract SyncResultList component from SyncPage 2026-03-18 22:35:02 +08:00
Willie 6bd13140eb feat(ui): render Toast action button, hide progress bar when persistent 2026-03-18 22:35:02 +08:00
Willie 033521029c feat(ui): add action, persistent, replaceKey to Toast system 2026-03-18 22:35:02 +08:00
Willie 4d2d540127 refactor: simplify ignore payload and deduplicate formatting
- Remove dead nil check in ignorePayload() (repoFiles already initialized)
- Replace manual map merge loops with maps.Copy in 3 handler sites
- Deduplicate fmt.Sprintf + ui.Success in doctor checkSkillignore
- Extract extractIgnoreSources() helper in SyncPage to DRY two identical
  state-setting blocks
2026-03-18 00:19:30 +08:00
Willie cc68453eb1 feat(sync): pass .skillignore source files in API for accurate UI hints
Add ignore_root and ignore_repos fields to sync/diff/diff-stream API
responses from IgnoreStats. UI now uses real file paths instead of
heuristic (skill name starts with _) to determine ignore source.
2026-03-18 00:19:30 +08:00
Willie 9e90b9c30c fix(ui): show correct .skillignore source hint for repo-level ignores
Skills prefixed with _ are from tracked repos and excluded by
repo-level .skillignore (inside the repo), not the root-level one
editable in Config. Show distinct hints for each source.
2026-03-18 00:19:30 +08:00
Willie f17e5c5a9f style(ui): redesign ignored skills section on SyncPage
Replace bare text disclosure with a Card-based collapsible matching
DiffTargetCard style: EyeOff icon, ChevronDown/Right toggle, Badge
count, per-skill rows with icons, and a hint footer linking to Config.
2026-03-18 00:19:30 +08:00
Willie 6d66823f10 feat(ui): show ignored skills badge and collapsible section on SyncPage 2026-03-18 00:19:30 +08:00
Willie 2b2e119eb2 feat(ui): add ignored skills types to sync and diff API client 2026-03-18 00:19:30 +08:00
Willie 6698b5f69f style(ui): improve skillignore check details with grouped tag layout
Replace flat bullet list with two labeled sections:
- Patterns: monospace code badges with muted background
- Ignored Skills: warning-tinted tags for visual distinction
Other checks keep the default bullet list rendering.
2026-03-18 00:19:30 +08:00
Willie 4857135550 fix(ui): render --- separator as visual divider in Doctor check details
The skillignore check uses --- to separate patterns from ignored skills
in the details array. Render it as a labeled section divider instead
of a raw bullet point.
2026-03-18 00:19:30 +08:00
Willie 1c15f8baaa fix(ui): invalidate doctor query after saving .skillignore
Without this, the Doctor page shows stale skillignore check data
until its 1-minute staleTime expires or the user refreshes.
2026-03-18 00:19:30 +08:00
Willie 1fca4ce0e4 fix(ui+server): lazy-fetch skillignore tab, use typed response struct
- ConfigPage: add enabled: tab === 'skillignore' to skip unnecessary
  filesystem walk when Config page opens on the config.yaml tab
- handler_skillignore: replace map[string]any with typed structs
  (skillignoreResponse, skillignoreStats) for compile-time safety
2026-03-18 00:19:30 +08:00
Willie fc1b7aa0e3 fix(ui): guard against null ignored_skills in skillignore response
Go nil slices serialize to JSON null. Add null guard in both the
server handler (emit empty arrays) and the UI (null check before
.length access) to prevent crash after editing .skillignore.
2026-03-18 00:19:30 +08:00
Willie c1dc988744 feat(ui): add .skillignore tab to Config page with CodeMirror editor
Add SegmentedControl tabs to switch between config.yaml and .skillignore
editing. The .skillignore tab shows file path, ignored skills count badge,
CodeMirror editor (without YAML extensions), and a summary card listing
all ignored skills. Save button behavior adapts to the active tab.
2026-03-18 00:19:30 +08:00
Willie 9d09e52ea8 feat(ui): unify Doctor filter with SegmentedControl, add info status 2026-03-18 00:19:30 +08:00
Willie a46227c009 fix(ui): remove unused imports in DoctorPage to fix TypeScript build
Remove unused DoctorResponse type import, statusBadgeVariant function,
and useQueryClient — all flagged by tsc strict mode in CI.
2026-03-18 00:19:30 +08:00
Willie ed7722b5ef fix(ui): convert doctor check names to human-readable labels
Replace raw snake_case identifiers (source, symlink_support, etc.) with
friendly labels (Source Directory, Symlink Support, etc.). Remove redundant
status badge — the icon already conveys pass/warning/error.
2026-03-18 00:19:30 +08:00
Willie 8a46e85672 feat(ui): add Doctor Health Check page with status dashboard
Add /doctor route with a health check dashboard that displays:
- Summary cards for pass/warning/error counts
- "All checks passed" success banner
- Filter toggles to narrow by status
- Expandable check rows with detail lists
- Version info with update-available badge

Wired to GET /api/doctor via the typed API client.
2026-03-18 00:19:30 +08:00
Willie 4f079ba77c style(ui): use white bg for non-yellow sidebar cards, soften outlined border to pencil-light 2026-03-17 04:48:42 +08:00
Willie 5895f47ed5 fix(ui): pass undefined to useRef to satisfy strict TypeScript (TS2554) 2026-03-17 04:48:42 +08:00
Willie 28dee60d38 feat(ui): add Filter Studio page and target filter discoverability
- Filter Studio page (/targets/:name/filters) — two-column layout with
  pattern editing (left) and live preview with search (right). Click-to-
  toggle, 500ms debounced preview, unsaved changes detection
- TargetsPage: always-visible filter summary line with tag preview
  (max 3, +N more overflow) replacing hidden ghost Filters button
- SkillDetail: Target Distribution read-only sidebar card showing
  per-target sync status with links to Filter Studio
- SkillDetail: post-it pastel styling — semantic colors per card type
  (yellow/blue/cyan/green), thumbtack pins, tape decoration, hand-drawn
  borders (playful theme only). Clean theme uses white backgrounds
- useSyncMatrix hook wrapping GET /api/sync-matrix via React Query
- Unified input borders (border-2 border-muted) across all form controls
- FilterTagInput auto-commits on blur to prevent lost input
2026-03-17 04:48:42 +08:00
Willie 26804547b3 fix(ui): ensure extras-list tour target renders in empty state
Wrap both the empty state and extras list inside the data-tour
container so the guided tour can locate [data-tour='extras-list']
even when no extras are configured. Also add emptyDescription to
the extras tour step for a friendlier empty-state message.
2026-03-17 04:48:42 +08:00
Willie 7b65ffe60a fix(ui): improve network error message with actionable guidance
Wrap fetch() in try-catch to convert generic "Failed to fetch" TypeError
into a clear message directing users to restart "skillshare ui".
2026-03-17 04:48:42 +08:00
Willie f9a49c1a91 refactor(tui): unify all list delegates to prefix bar style
Replace list.DefaultDelegate + configureDelegate() with a new
prefixItemDelegate that renders the "▌" prefix bar consistently
across all 11 TUI list views (log, trash, search, install prompt,
checklist, restore, audit rules, diff).

- Add prefixItemDelegate (1-line) and renderPrefixRowWithDesc (2-line)
- Remove configureDelegate(), NormalTitle/Desc, SelectedTitle/Desc styles
- Remove hardcoded "  " indent from restore item Title() methods
- Fix AuditPage overflow handling with overflow prop and !overflow-clip
2026-03-14 04:01:10 +08:00
Willie 4726465f63 fix(ui): improve Backup page restore UX and add collapsible sidebar tools
Backup: replace individual restore buttons with a dropdown menu when
targets exceed 3, preventing horizontal overflow. Dropdown auto-detects
viewport edge to open upward or downward. Button component now supports
ref forwarding for position measurement.

Sidebar: make bottom tools section (theme, tour, shortcuts) collapsible
with localStorage persistence.
2026-03-14 04:01:10 +08:00
Willie 5fa5a78863 fix(ui): pin Push/Pull action footers to bottom and warm playful sidebar
- Push/Pull columns use flex-col + flex-1 so checkbox/button rows
  align at the same vertical position regardless of content height
- Result messages moved to content area above the action footer
- Playful theme sidebar uses --color-paper instead of plain white
2026-03-14 04:01:10 +08:00
Willie d572d1be25 feat: add branch switcher to Git Sync page
Allow non-technical users to switch git branches from the Web UI
without needing a terminal.

Backend:
- Add ListLocalBranches, ListRemoteBranches, Checkout to git layer
- Add GET /api/git/branches and POST /api/git/checkout endpoints
- Dirty-check guard prevents checkout with uncommitted changes

Frontend:
- Branch dropdown (HandSelect) with local/remote branch options
- Refresh button to fetch latest remote branches
- Repo Info Card restructured with status bar layout
- Push/Pull merged into single card with dashed grid divider
2026-03-14 04:01:10 +08:00
Willie 7d0952b8b6 feat(ui): add branch switcher to Git Sync page
Allow non-technical users to switch branches from the Web UI without
needing a terminal. The dropdown shows local branches first, then
remote-only branches tagged "(remote)".

Backend:
- Add ListLocalBranches, ListRemoteBranches, Checkout to internal/git
- Add GET /api/git/branches (?fetch=true for remote discovery)
- Add POST /api/git/checkout with dirty-check guard + fetch-before-switch
- Oplog instrumentation for checkout operations

Frontend:
- Branch Select dropdown replaces static text when >1 branch exists
- Refresh button to fetch new remote branches on demand
- Dirty state disables switching with visual hint
- Card overflow + z-index fix for playful theme dropdown clipping
2026-03-14 04:01:10 +08:00
Willie d842d7a871 feat(ui): add Repository Info Card to Git Sync page
Replace the minimal Repo Status Card with a full Repository Info Card
showing remote URL with platform detection (GitHub/GitLab/Bitbucket),
branch tracking info, HEAD commit hash and message, and status badges.

Backend: export GetRemoteURL, add GetHeadMessage and GetTrackingBranch
to internal/git, extend /api/git/status with 4 new fields.

Frontend: new parseRemoteURL utility parses SSH/HTTPS remote URLs and
detects platform by exact hostname match. RepoInfoCard displays parsed
owner/repo with platform icon, clickable link, copy button, and
graceful fallbacks for missing remote or unparseable URLs.
2026-03-14 04:01:10 +08:00
Willie 0a3305f617 fix(update): capture git stderr and show actionable error messages
The update handler used internal/git which ran git commands without
capturing stderr, so failures like divergent branches only showed
"exit status 128". Now runGitWithProgress captures stderr and pipes
it through install.WrapGitError for meaningful messages.

Also adds:
- extractGitFatal() strips verbose hint: lines from git output
- Force checkbox and per-item Force retry button in Update UI
- "(try force update)" / "(try --force)" hint on pull failures
2026-03-13 09:45:56 +08:00
Willie 6fb99035af feat(ui): add multi-theme system with Playful (hand-drawn) style
Add a two-dimensional theme system: Style (Clean/Playful) × Mode (Light/Dark/System).

Theme infrastructure:
- ThemeContext with style + mode state, matchMedia listener, localStorage persistence
- ThemePopover in sidebar for switching style and mode
- FOUC prevention via inline script in index.html
- CSS custom properties for radius, shadows, fonts (resolved per theme)
- design.ts migrated to CSS variable refs

Playful theme features:
- Wobbly border-radius on cards, buttons, badges, inputs, dialogs
- Hard offset shadows (no blur) for sketch aesthetic
- Caveat handwritten font for headings, DM Sans for body text
- Dotted paper texture background
- Skill cards as pastel sticky notes with masking tape strips
- Wavy underlines on links
- Dashed sidebar border with Caveat section headers
- Per-card wobble variety (6 unique border-radius patterns)

Component enhancements:
- ss-* CSS class hooks on all themed components for CSS-only overrides
- SegmentedControl: aria-pressed for theme targeting, clean defaults
- SkillDetailSkeleton: custom loading skeleton matching detail page layout
- Dashboard Quick Action cards: hover animations (pulse/bounce)
- AuditPage: fix tour step targeting

Clean theme unchanged — all Playful styles scoped under [data-theme="playful"].
2026-03-12 23:23:28 +08:00
Willie 405a2f907a feat(extras): add mode command for CLI, TUI, and Web UI
Add ability to change sync mode of an extra's target across all three
interfaces: CLI (`extras mode`/shorthand `extras <name> --mode`),
TUI (`M` key with mode picker overlay), and Web UI (inline Select
dropdown per target with PATCH /api/extras/{name}/mode endpoint).

Fix sync behavior so symlinks from a previous mode are auto-replaced
without --force, while regular files still require explicit --force.

Consolidate sync mode list into config.ExtraSyncModes single source
of truth. Fix Select component missing disabled prop and add viewport
collision detection with useLayoutEffect.

Includes 8 integration tests covering mode command happy path, error
cases, shorthand syntax, and mode-switch sync behavior.
2026-03-12 16:45:02 +08:00
Willie 09ccd14266 fix(extras): resolve tilde expansion, unify headers, add doctor target warnings
Extras commands had multiple issues with tilde (~) path handling — Go
doesn't expand ~ (that's shell behavior), so paths like ~/.claude/rules
were treated as literal relative paths, creating bogus ~/  directories.

Key fixes:
- Export config.ExpandPath() and call it before os.Stat / sync operations
  in extras_list, sync_extras, extras_collect, and doctor
- Unify extras output headers to match target list style (single "Extras"
  header instead of per-extra headers, fix double-icon bug in list)
- Add per-target reachability warning in doctor for unreachable extras
  targets with expanded path display

Update all 3 E2E runbooks to use extras/<name>/ path layout, add /tmp
cleanup for idempotent re-runs, add migration test step, and create new
comprehensive extras_commands_runbook (18 steps covering init/list/remove/
collect/doctor/tilde/project-mode).

Improve cli-e2e-test skill with 4 new checklist items and 2 rules learned
from test friction (/tmp isolation, symlink write-through, cat>>
idempotency, extras path layout).
2026-03-12 16:45:02 +08:00
Willie 28d35e8a77 fix(ui): align CopyButton to design system, fix sidebar scroll, update lockfile
- CopyButton: add focus ring, active:scale-95, remove unused style prop
- FileViewerModal: use IconButton for close, Spinner for loading state
- SkillDetailPage: fix sticky sidebar not scrollable when content overflows viewport
- Update pnpm-lock.yaml for test dependencies added by PR #76
- Add salmonumbrella and daylamtayari to README contributors
2026-03-12 16:45:02 +08:00
Willie be4c693df5 feat(ui): add step-by-step onboarding tour with spotlight overlay
Self-built tour engine: TourProvider (context + state machine),
TourOverlay (spotlight cutout via box-shadow), TourTooltip (positioned
bubble with arrow, progress dots, mobile bottom sheet).

14 steps covering all sidebar sections. Auto-adjusts for project mode
(skips Git Sync) and empty state (no skills). Keyboard accessible
(Escape/Arrow/Enter). Triggered via sidebar Quick Tour button.
2026-03-12 16:45:02 +08:00
Willie 3981bda6d1 feat(ui): add table view to SearchPage, fix Audit loading and alignment
- SearchPage: add card/table view toggle with pagination, sticky toolbar,
  and localStorage persistence for view preference
- AuditPage: replace generic PageSkeleton with StreamProgressBar for
  seamless loading-to-progress transition
- AuditPage: fix triage panel help text alignment with selector input
  by matching py-1.5 padding
- SkillsPage: add sticky thead and scrollable table body
- Change tag badges from accent to info variant
2026-03-12 16:45:02 +08:00
Willie bac2bc292f fix(ui): align GitSync, Search, Backup, Trash, AuditRules to design system
- GitSyncPage: space-y-5, animate-fade-in, PageHeader in loading/error states,
  Button loading prop replacing manual Spinner, remove Spinner import
- SearchPage: Card overflow prop, remove redundant disabled on loading buttons,
  hide icons during loading state
- BackupPage: space-y-5, actions into PageHeader, summary as inline text,
  remove unused isNewest/index props, add Refresh button, fix hook ordering
- TrashPage: space-y-5, actions into PageHeader, summary as inline text,
  remove unused index prop, add Refresh button
- AuditRulesPage: border-2 → border on accordion, fix sticky header shadow
  thickness, restructure sticky group to include controls bar
2026-03-12 16:45:02 +08:00
Willie d3b9890028 fix(ui): align pages to design system — loading props, spacing, borders, click-to-toggle
- SyncPage/CollectPage/UpdatePage: root container space-y-5, remove manual margins
- Replace manual Spinner with Button loading prop across Sync, Collect, Update pages
- Fix double-toggle bug: wrap Checkbox in stopPropagation span for row click-to-toggle
- CollectPage: native checkbox → Checkbox component, border-2 → border on skill rows
- SyncPage: separator border-muted-dark → border-pencil-light/30, DiffItemRow index key → composite key
- UpdatePage: Card rotation → tilt prop, border-pencil/10 → border-muted, EmptyState for up-to-date
- UpdatePage: remove dead UpdatePageHeader component, Spinner import, outlined Card summary
- InstallForm: restructure layout with grouped sections and dashed separators
- HubManagerModal/SkillPickerModal/SearchPage/InstallPage/AuditRulesPage: minor design token alignment
2026-03-12 16:45:02 +08:00