Commit Graph
932 Commits
Author SHA1 Message Date
Willie c69fd6ea67 fix(tui): align target list TUI with extras/skill TUI patterns
- Add help footer with full keybinding hints (match extras)
- Move filterBar above detail in vertical layout (match extras)
- Add "\n" prefix to detail panel in split view (match extras)
- Use rightWidth-1 for wrapAndScroll (match extras)
- Use "\n\n" after split body (match extras)
- Esc clears filter text (match extras)
- "/" returns textinput.Blink for cursor animation
- Add loading guard for key/mouse events
- Add ResetSelected after filter
- Use tc.Title for detail name (not inline style)
- Store lastActionMsg as plain text, render at display time
- Add renderTargetActionMsg with ✓/✗ color logic
- ctrl+d/u scroll step 5→8 (match extras/skill)
- Add width guard in delegate Render
2026-03-17 04:48:42 +08:00
Willie a4e21c1a60 docs(cli): add --no-tui to target list help text
Also gofmt the new TUI files.
2026-03-17 04:48:42 +08:00
Willie c7d96cf1e0 feat(tui): target list mode picker and include/exclude edit sub-panel 2026-03-17 04:48:42 +08:00
Willie 4a8563f85b feat(tui): target list View and Update with split layout, filter, and navigation 2026-03-17 04:48:42 +08:00
Willie 81b05b975a feat(tui): wire target list TUI dispatch with --no-tui fallback 2026-03-17 04:48:42 +08:00
Willie 177ebe0bb8 feat(tui): scaffold target list TUI model, constructor, and runner 2026-03-17 04:48:42 +08:00
Willie 5204ff9bad feat(tui): add target list item delegate 2026-03-17 04:48:42 +08:00
Willie b6061c53de Update install command in README
Removed unnecessary '--track' option from install command.
2026-03-15 14:55:59 +08:00
David StotijnandClaude Opus 4.6 b7f9185f0b fix(cli): reorder init --help flags to match docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:55:46 +08:00
David StotijnandClaude Opus 4.6 bfacb81331 fix(cli): show --subdir flag in init --help output
The --subdir flag was parsed and functional but missing from the
help text printed by `skillshare init --help`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:55:46 +08:00
Willie 3d58765953 fix(git): propagate error from GetRemoteURL instead of swallowing it
Callers can now distinguish between "no remote configured" and real
failures (e.g. git not in PATH). All existing callers already guard
with err == nil so behavior is unchanged.
v0.17.2
2026-03-14 04:01:10 +08:00
Willie 4cbaa5f3ab perf(tui): async dirSize and lazy loading in restore TUI
dirSize() was called synchronously for every backup version during list
population and on each cursor move, blocking the entire TUI event loop.

- Add ListBackupVersionsLite() that skips dirSize (TotalSize = -1)
- Compute size asynchronously via tea.Cmd, cache in versionSizeCache
- Replace redundant ListBackupVersions() in renderTargetDetail() with
  direct os.ReadDir() on the latest backup directory
- Cap per-skill I/O (readSkillDescription + listSkillFiles) to 20 items
  in both renderTargetDetail() and renderVersionDetail()
2026-03-14 04:01:10 +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 04b248ab92 feat(tui): convert trash TUI to left-right split panel layout
Replace vertical stack layout with horizontal split panel matching
list_tui and log_tui patterns. Reuses renderHorizontalSplit,
wrapAndScroll, and appendScrollInfo from tui_helpers.go.

Key changes:
- Add termHeight tracking and syncTrashListSize() for responsive layout
- Add detailScroll with Ctrl+d/u and mouse wheel support on right panel
- Split View() into viewTrashSplit() (≥80 cols) and viewTrashVertical()
- Render detail panel with bold header, metadata rows, path truncation
- Add renderTrashSummaryFooter with item count and total size
- Remove cachedDetailStr/cachedDetailIdx in favor of direct rendering
- Enable tea.WithMouseCellMotion() for mouse wheel scrolling
2026-03-14 04:01:10 +08:00
Willie ad34a5b384 fix(cli): add spinner to backup command and remove list indent
Backup operations had no loading indicator, making it appear frozen
during slow backups. Added a spinner that shows progress per target.

Also removed the 2-space left indent from "Recent backups" list items
by using direct formatting instead of the shared ListItem helper.
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 6a94c69e47 docs: update docs and changelog for v0.17.1
Add documentation for new features (UI theme system, init --subdir),
bug fixes (collect .git skip, actionable git errors), and release notes.
Update CHANGELOG.md, website changelog, and 6 doc pages.
v0.17.1
2026-03-13 14:09:40 +08:00
Willie 894b1b3793 fix(init): improve subdir prompt with TTY check, --subdir flag, and ui helpers
Follow-up to #78. Adding:
- TTY guard so the prompt is skipped in non-interactive/CI environments
- --subdir CLI flag for scriptable usage
- Consistent use of bufio.Reader (no mixed fmt.Scanln)
- ui.Info / ui.Success for prompt output aligned with other init steps
2026-03-13 14:02:26 +08:00
Willie 767ad31ec3 fix(collect): skip .git directories when pulling nested skills to source
copyDirectoryWithState did not skip .git/ dirs, causing collect to fail
on git-cloned repos (e.g. obra/superpowers) — filepath.Walk would abort
on .git pack files, leaving only empty directories in source.

Add copyDirectorySkipGit() variant and use it in PullSkill. Existing
copyDirectory (used by copy-mode sync) is unchanged.
2026-03-13 13:37:12 +08:00
Willie 9d837e943f fix(devcontainer): fix project mode UI and port cleanup
Two issues fixed:

1. Air's full_bin does not run through sh -c, so the previous
   "cd ... && /workspace/..." in SKILLSHARE_UI_EXEC_PREFIX was
   silently failing (cd exits 0, binary never runs). Replace with
   a wrapper script that does cd + exec.

2. Port cleanup relied on fuser which is missing in containers.
   Add pids_on_port() that reads /proc/net/tcp6 to find socket
   inodes and maps them back to PIDs. Three-layer cleanup:
   PID file → pkill pattern → port-level kill.

Also improve error messages: show the stuck PIDs and fix command
instead of the unhelpful "slow start" message.
2026-03-13 11:48:04 +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 c16dc22af6 fix(install): show actionable error messages when git stderr is empty
When git commands fail with an empty stderr (common in --progress mode),
wrapGitError() was returning the raw exec.ExitError which only produces
"exit status 128" — giving users no clue about the actual problem.

Now extracts the exit code and maps it to actionable messages:
- exit 128: "repository not found or authentication required"
- exit 128 + token: "authentication token was rejected"
- exit 1: "check network connectivity and repository URL"
2026-03-13 09:45:56 +08:00
Willie 7c4aa7bc5a feat(init): add subdirectory prompt for source path (#78)
Implemented Subdirectory Specification for Source
2026-03-13 09:44:47 +08:00
Daylam Tayari 4a8814ffcf Switched dir name reading to bufio for space sup 2026-03-12 13:15:15 -05:00
Daylam Tayari 06dae1c34f Added new line for spacing in prompts 2026-03-12 12:53:17 -05:00
Daylam Tayari 4fc7b4b885 Implemented source subdir specification 2026-03-12 12:46:37 -05: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
Daylam Tayari e23bea133f Switched existing usage of cmd.Output to cmd.Run 2026-03-12 23:22:35 +08:00
Daylam Tayari c08ed7f96c Switched git repo check to git rev-parse 2026-03-12 23:22:35 +08:00
Daylam Tayari 156e428baf Updated git initialization check in doctor cmd 2026-03-12 23:22:35 +08:00
Daylam Tayari f8ce3387d3 Integrated checkGitRepo in pull cmd 2026-03-12 23:22:35 +08:00
Daylam Tayari 57419a51b8 Updated checkGitRepo to use git status
Using git status as it will handle nested directories and git commands
are ultimately what is used throughout the code
2026-03-12 23:22:35 +08:00
Willie 43a64872ab fix(test): enable per-runbook isolation in mdproof config
Use mdproof v0.0.5 per-runbook isolation to give each runbook its own
HOME and TMPDIR, eliminating inter-runbook state leakage that caused
4 of 22 runbooks to fail when run sequentially.

Key changes:
- Add ensure-skillshare-linux-binary.sh to build step (creates ss symlink)
- Use direct binary path in setup/teardown (bypass wrapper overhead)
- Create target dirs (~/.claude, ~/.codex) so --all-targets detects them
- Clean shared /tmp/ paths between runbooks
v0.17.0
2026-03-12 16:45:02 +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 5b224a1f87 fix(extras): remove unused width params, load fresh config in doRemove
Address code review findings:
- Remove unused width parameter from renderExtrasDetail and
  renderExtrasContentPanelStr to eliminate dead code
- Load fresh config in doRemove to avoid mutating the TUI model's
  config copy in a background goroutine (prevents potential data race)
2026-03-12 16:45:02 +08:00
Willie a8e2f9c57c docs(extras): document interactive TUI and --no-tui flag for extras list 2026-03-12 16:45:02 +08:00
Willie 9b0146ab77 fix(extras): resolve lint warnings in extras list TUI
Replace WriteString(fmt.Sprintf(...)) with fmt.Fprintf for QF1012,
and use min/max builtins for tree scroll clamping.
2026-03-12 16:45:02 +08:00
Willie 947a5d33b3 feat(extras): add interactive TUI for extras list with browse, remove, sync, collect, and content viewer 2026-03-12 16:45:02 +08:00
Willie 2a9ddb0cf6 feat(extras): add TUI list item and delegate for extras list 2026-03-12 16:45:02 +08:00
Willie 4526b5a493 refactor(extras): extract buildExtrasListEntries for TUI reuse 2026-03-12 16:45:02 +08:00
Willie 9738e5238e refactor(extras): extract remove helpers for TUI reuse 2026-03-12 16:45:02 +08:00
Willie ee38d34513 refactor(diff): show extras by default, remove --extras/--all flags
Extras diff is now automatically included when extras are configured.
No need for explicit --extras or --all flags — simpler UX.

- Remove showExtras/showAll from diffRenderOpts
- Replace flag check with len(cfg.Extras) > 0
- Update integration test, built-in skill refs, website docs, changelog
2026-03-12 16:45:02 +08:00
Willie d756004e56 feat(extras): add extras reference docs, fix diff project mode, improve TUI
- Add references/extras.md covering all 4 subcommands (init, list,
  remove, collect) plus sync extras and diff --extras
- Update SKILL.md with dedicated Extras recipes section and reference link
- Update status.md with diff --extras/--all flags
- Fix sync.md: extras supports project mode (not global only), correct
  source path to include extras/ subdirectory
- Fix diff --extras not working in project mode (diff_project.go was
  missing collectExtrasDiff integration)
- Replace DefaultDelegate with custom diffItemDelegate so Extras
  separator renders as non-selectable group header (matching list TUI)
- Add skipDiffSeparator to prevent cursor landing on separator items
- Add Next Steps hints to extras detail panel in diff TUI
- Group Backup/Trash under "Storage" header in doctor output
- Remove extra leading spaces from doctor extras status lines
2026-03-12 16:45:02 +08:00
Willie cc93c4f0a4 fix(extras): add y/N confirm prompt to remove, clean up empty dirs
- extras remove: replace silent-exit warning with interactive [y/N]
  prompt; --force skips the prompt as before
- extras remove: after removing config entry, delete the source
  directory if empty and the parent extras/ directory if empty
- sync extras: clean up empty extras/ directory when no extras are
  configured (both global and project mode)
- Add removeEmptyDir helper and ExtrasParentDirProject path function
2026-03-12 16:45:02 +08:00
Willie 7a6e78783b fix(build): separate host and devcontainer binary output paths
Devcontainer `make build` previously wrote a Linux binary to
`bin/skillshare` via the shared volume mount, overwriting the host's
macOS binary and causing `exec format error`.

Introduce a `BINARY` variable (Makefile) / `SKILLSHARE_BINARY` env var
(mise) so devcontainer builds to `/usr/local/bin/skillshare` while the
host keeps `bin/skillshare`. Also update `scripts/test.sh` to respect
a pre-set `SKILLSHARE_TEST_BINARY` instead of unconditionally
overwriting it.
2026-03-12 16:45:02 +08:00
Willie 48f1d3767f fix(test): improve extras runbooks with jq assertions, idempotency, and init cleanup
- Replace python3 JSON parsing with native mdproof jq: assertions across
  extras_refactor_json_runbook (7 steps simplified)
- Add cat>> idempotency guards (sed -i cleanup) before YAML appends
- Add ssenv --init default extras cleanup in Step 1 of extras_commands
  and sync_extras runbooks to prevent false failures
- Rename runbook.json → mdproof.json (mdproof only reads mdproof.json)
- Move /tmp cleanup from step_setup to setup (per-runbook, not per-step)
  to avoid breaking cross-step dependencies
- Fix ensure-mdproof.sh to upgrade dev binary to latest release
- Add .mdproof/lessons-learned.md with 5 documented gotchas
- Update cli-e2e-test SKILL.md with assertion types, jq best practices,
  --init extras checklist item, and /mdproof skill collaboration
2026-03-12 16:45:02 +08:00