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
Tests were failing because config validation now requires target paths
to exist before sync. Updated tests to create target directories
properly and adjusted expected error messages.
- TestExclude_GlobalSymlinkMode_Ignored: use CreateTarget instead of RemoveAll
- TestSync_SymlinkMode_CreatesSingleSymlink: same
- TestSync_SourceNotExist_ReturnsError: use CreateTarget, update error message
- TestLog_SyncPartialStatus: use read-only dir to trigger partial failure
- 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
Allows serving the UI under a URL prefix (e.g., skillshare ui --base-path /app).
The flag value is passed through to the server constructors and used for
browser URL construction. Falls back to SKILLSHARE_UI_BASE_PATH env var
when the flag is not provided.
When spaHandlerFromDisk receives a non-empty basePath, it pre-computes
a modified index.html with a <script> tag injecting window.__BASE_PATH__.
This allows the frontend to discover its base path at runtime without
build-time configuration. The injection applies to both direct index.html
requests and SPA fallback routes.
Add normalizeBasePath + wrapBasePath to Server so the UI and API can be
served under a URL prefix (e.g. /app). StripPrefix wraps outside
withConfigAutoReload; bare-path requests redirect to path + "/".
Dev mode (no uiDistDir) prints a warning and skips wrapping.
Includes HTTP routing tests for prefix routing, 404 without prefix,
bare-path redirect, multi-level paths, and empty basePath passthrough.
- 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
- 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
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.
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.
- 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
New entries: sync .skillignore visibility (CLI + JSON + UI), doctor
CLI text output for skillignore, doctor output readability, duplicate
names truncation, doctor global mode bug fix.
- sync: add ignored_count/ignored_skills to JSON example, note about
.skillignore filtering
- doctor: add Skillignore to environment checks table, update example
output with skillignore line and visual spacing
Separate the environment checks (config, source, skillignore, git)
from the skill validation checks (integrity, targets) with a blank
line for better readability.
The collision report dumped all 14000+ duplicate names on a single
line, making the sync output unreadable. Show the first 5 names
with "... and N more" so users can see examples without the flood.
The doctor handler shells out to the CLI binary. In global mode it
did not pass -g, so the subprocess auto-detected project mode when
the server's cwd contained .skillshare/config.yaml. This caused
the doctor to check the project source instead of the global source.
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.
Extract printIgnoredSkills helper that shows whether ignores come from
root-level, repo-level, or both .skillignore files. Helps users
understand why skills are excluded when they haven't configured the
root .skillignore.
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.
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.
Verify that sync command correctly reports ignored skills in text output,
includes ignored_count and ignored_skills in JSON output, and produces
no ignored output when .skillignore does not exist.
Switch from DiscoverSourceSkills to DiscoverSourceSkillsWithStats so
the sync, diff, and diff-stream endpoints can surface .skillignore
stats (ignored_count, ignored_skills) in their JSON responses.
Switch DiscoverSourceSkills → DiscoverSourceSkillsWithStats at both
global and project sync entry points. Thread IgnoreStats through to
text output (dim-styled list) and JSON output (ignored_count +
ignored_skills fields).
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.
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.
- 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
Add .skillignore Visibility section covering status/doctor CLI output,
Config page editor tab, Doctor page SegmentedControl unification,
and new API endpoints.
- doctor.md: add skillignore check to JSON example, document info status
- status.md: add skillignore field to JSON schema
- ui.md: update Config page description, add skillignore/doctor API endpoints
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.
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.
GET returns file existence, raw content, and ignore stats (patterns,
ignored skills). PUT accepts raw content to write or deletes the file
when raw is empty. Both endpoints are mode-aware via s.cfg.Source.