Commit Graph
8 Commits
Author SHA1 Message Date
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 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
salmonumbrella 1e07a77681 fix(ui): share copy button behavior 2026-03-12 09:38:31 +08:00
Willie b24a80f861 feat(ui): add dark theme with toggle, aligned to website color palette
- Add .dark CSS variable overrides (warm brown bg, gold primary, muted shadows)
- Add ThemeContext with localStorage persistence and prefers-color-scheme detection
- Add theme toggle button (sun/moon) fixed at top-right of main content
- Replace all bg-white with bg-surface for theme-aware backgrounds
- Rewrite CodeMirror theme to use @lezer/highlight HighlightStyle for proper
  syntax highlighting in both light and dark modes
- Convert design.ts shadows from hardcoded hex to CSS variable references
- Add dark: variants for elements that need different active states per theme
- Add postit/tracked CSS custom properties with dark mode translucent overrides
2026-02-28 19:15:57 +08:00
Willie 29e97fcb4b feat(ui): migrate to TanStack Query and virtualize SkillsPage
Replace custom useApi hook with @tanstack/react-query across all 14
pages and InstallForm. Add react-virtuoso VirtuosoGrid to SkillsPage
for handling 46K+ skills without freezing the browser.

Key changes:
- Add queryClient with shared defaults (staleTime, gcTime, retry)
- Add centralized queryKeys factory for prefix-based invalidation
- Wire QueryClientProvider + ReactQueryDevtools in App.tsx
- Migrate AppContext to useQuery (shares cache with DashboardPage)
- Migrate all pages: useApi → useQuery, handlers → invalidateQueries
- SkillsPage grid view: VirtuosoGrid with useWindowScroll, overscan,
  ScrollSeekPlaceholder, and React.memo on card components
- Add resolve.dedupe for React to prevent duplicate instance in dev
- Add vendor-tanstack-query manual chunk for build splitting
- Delete unused useApi.ts hook
2026-02-25 07:02:54 +08:00
Willie af43a57ae2 feat: add JavaScript/TypeScript syntax highlighting in file viewer
Install @codemirror/lang-javascript and support .js, .ts, .jsx, .tsx,
.mjs, .mts, .cjs, .cts with proper language modes (including JSX and
TypeScript flags).
2026-02-13 14:21:36 +08:00
Willie e0c9499c14 fix: parse YAML block scalars in frontmatter and use CodeMirror for all file types
Two related UI fixes for the skill detail page:

1. YAML block scalar parsing: description fields using >-, >, |, |-
   syntax showed the raw indicator instead of the parsed value. Fix
   both frontend (parseScalarValue) and backend (ParseFrontmatterField)
   to recognize block indicators and read indented continuation lines.

2. File viewer: non-markdown files (.py, .sh, etc.) rendered as plain
   <pre> without line numbers or highlighting. Now all non-markdown
   files use CodeMirror, with Python syntax highlighting via
   @codemirror/lang-python.
2026-02-13 14:21:36 +08:00
Willie 092fb14f8a feat: add web dashboard with embedded React SPA (skillshare ui)
Single-binary web UI for visual skill management — React 19 + Vite
frontend embedded via go:embed, Go net/http REST API backend (30+
endpoints). Includes dashboard, skills browser, targets, sync, collect,
search, install, config editor, backup/restore, and git sync pages.

Also adds Bitbucket/GitLab URL parsing for install, git operations
library, skill version checking, CI frontend build steps, Docker
sandbox support, and website docs for the ui command.
2026-02-08 05:08:30 +08:00