Commit Graph
13 Commits
Author SHA1 Message Date
Willie 188193d12d feat(extras): let collect overwrite source files with --force
In copy mode, sync --force can push source over target, but collect
skipped every file already in source, so edits made directly in a
copy-mode target could not be pulled back. collect --force now
overwrites those files; identical ones are still skipped.

Collect also replaced collected files with symlinks regardless of mode,
turning copy-mode targets into symlinks. Copy-mode targets now keep
their files, in the CLI and the extras TUI.

With flatten, two target files sharing a basename map to one source
file; the second is now reported instead of overwriting the first under
--force. --from paths are matched after expanding ~ and cleaning, so a
spelling that differs from config no longer drops the target's mode.

Refs #291
2026-09-24 00:05:55 +08:00
Willie 86b91efe95 feat(extras): refine per-target management UI and path resolution
UI (Extras page):
- Label per-target flatten/extension/mode controls with column headers
- Render flatten as a dropdown so it matches the adjacent selects
- Collapse the add-target form behind a button and widen the path input
- Confirm before removing a target
- Polish layout: tinted icon, inset source chip, hover rows, aligned columns

Components:
- Select: bound the dropdown width so long option descriptions wrap instead
  of stretching the popup across the page
- Toast: render messages multi-line, widen the container, and give
  error/warning toasts more time to read

Sync feedback:
- Restructure extras sync-failure toasts into readable lines and fix the
  contradictory "N more errors" count (new nMoreErrors translation)

CLI/server:
- Match extra target paths by resolved absolute path (handles ~ vs /home)
  when adding, removing, or updating targets
2026-06-02 18:40:00 +08:00
Willie 4435429ada fix(extras): detect target conflicts in transform sync dry-run
A transform-mode dry-run counted every file as synced without inspecting the target, so it claimed it would sync files that a real non-force sync would skip. Report an existing real file (under the transformed name) as a skip needing --force, mirroring the non-dry-run path. The dry-run still never spawns the extension subprocess, so content is compared conservatively by existence rather than by output.
2026-05-30 19:23:12 +08:00
Willie 157eddc3d9 fix(extras): never sync skillshare's .metadata.json store
Installed-skill source dirs carry a .metadata.json tracking store. Extras
discovery walked it like user content, so a transform extension renamed it
to .metadata.toml in the target. Skip the reserved file in
DiscoverExtraFiles so it is never synced or transformed in any mode.
2026-05-30 19:23:12 +08:00
Willie f88044e2cc fix(extras): report synced status for transform targets
CheckSyncStatus compared each source file against targetDir/<source-name>,
but a transform extension renames output (foo.md -> foo.toml), so the
.toml file was never found and the target was always reported as drift —
even right after a successful sync. Thread the extension's output_ext
through CheckSyncStatus so the expected target filename matches the
transformed output. The web list now resolves the spec to pass it.
2026-05-30 19:23:12 +08:00
Willie 425c32d489 refactor(sync): thread extension spec param through SyncExtra 2026-05-30 19:23:12 +08:00
Willie bbf2e4343e feat(sync): unify extras symlinks through createLink
Replace direct os.Symlink calls in extras.go with createLink, gaining:
- Relative symlink support in project mode
- Windows junction fallback for extras (previously missing)

Thread projectRoot through SyncExtra, CollectExtraFiles, and all callers.

Ref: #120
2026-04-07 17:26:37 +08:00
Willie 31ad27e966 test(extras): add FlattenRel and CheckSyncStatus unit tests
FlattenRel: 100% coverage (flatten, no-flatten, collision).
CheckSyncStatus: 0% → 84% (synced, drift, flatten synced, flatten
drift, flatten collision not drift, copy mode).
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 5d9dd0cdbb feat(extras): add flatten option to extras sync engine
When flatten=true, SyncExtra maps subdirectory files to target root
using filepath.Base(). First file wins on collision, subsequent are
skipped with warnings. Includes config validation, sync-time guard,
CheckSyncStatus collision handling, and CollectExtraFiles support.

Ref: #97
2026-03-25 21:14:16 +08:00
Willie a786c1fe79 feat(extras): add init TUI wizard, collect command, and sync --json
- extras init TUI: multi-step bubbletea wizard (name → target → mode → confirm)
- extras collect: reverse-sync local files from target back to extras source
  with --from, --dry-run flags and dual-mode (global/project) support
- sync extras --json: structured JSON output for sync extras command
- CollectExtraFiles in internal/sync with tests
2026-03-12 16:45:02 +08:00
Willie 65c7d75c41 style: fix gofmt alignment in extras_test.go and ui.go 2026-03-04 12:16:32 +08:00
Willie fbccdb9628 feat(sync): add extras sync engine — walk, symlink/copy, prune 2026-03-04 12:16:32 +08:00