mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
feat(ui): install missing entries, prune deleted skills, and calmer sync and skills pages
Installing what config records still needed the CLI, and skills deleted upstream showed as updates with nothing to update. The Update page and install dialog now offer Install all for missing entries, and stale skills get Prune / Prune all, which move them to trash in one request. A sync of hundreds of changes was a wall of identical rows per target. Sync now groups targets that receive the same changes into one card listing names by folder, keeps its action bar and summary sticky, and adds Discard all, which moves skills that were never synced anywhere to trash after a confirmation. The Skills page keeps its toolbar and group heads in view while scrolling, folds New skill and Link folder into the Install menu, remembers filters in the browser, and moves Update repo into the repo menu.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { apiFetch, BASE, createSSEStream } from './http';
|
||||
import type { BatchInstallResult, CheckResult, DiscoverResult, DiscoveredSkill, HubConfigResponse, HubIndex, HubSavedEntry, InstallResult, SearchResult, SkillPreview } from './types/install';
|
||||
import type { BatchInstallResult, CheckResult, ConfigEntry, DiscoverResult, DiscoveredSkill, HubConfigResponse, HubIndex, HubSavedEntry, InstallFromConfigResult, InstallResult, SearchResult, SkillPreview } from './types/install';
|
||||
|
||||
export const installApi = {
|
||||
hubIndex: () => apiFetch<HubIndex>('/hub/index'),
|
||||
@@ -48,6 +48,9 @@ export const installApi = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(opts),
|
||||
}),
|
||||
// Entries recorded in config but not on disk (bare `skillshare install`)
|
||||
missingConfigEntries: () => apiFetch<{ entries: ConfigEntry[]; file: string }>('/install/missing'),
|
||||
installFromConfig: () => apiFetch<InstallFromConfigResult>('/install/from-config', { method: 'POST' }),
|
||||
installBatch: (opts: { source: string; skills: DiscoveredSkill[]; force?: boolean; skipAudit?: boolean; into?: string; name?: string; branch?: string; kind?: 'skill' | 'agent' }) =>
|
||||
apiFetch<BatchInstallResult>('/install/batch', {
|
||||
method: 'POST',
|
||||
|
||||
@@ -92,6 +92,21 @@ export interface SkillCheckResult {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface ConfigEntry {
|
||||
name: string;
|
||||
source: string;
|
||||
tracked: boolean;
|
||||
branch?: string;
|
||||
}
|
||||
|
||||
export interface InstallFromConfigResult {
|
||||
installed: number;
|
||||
installedRepos: number;
|
||||
installedRepoSkills: number;
|
||||
skipped: number;
|
||||
failed: string[];
|
||||
}
|
||||
|
||||
export interface CheckResult {
|
||||
linked_repos?: LinkedRepo[];
|
||||
tracked_repos: RepoCheckResult[];
|
||||
|
||||
@@ -8,23 +8,11 @@ export interface UpdateResultItem {
|
||||
auditRiskLabel?: string;
|
||||
}
|
||||
|
||||
export interface MissingTrackedRepo {
|
||||
name: string;
|
||||
source: string;
|
||||
branch?: string;
|
||||
}
|
||||
|
||||
export interface UpdateStreamSummary {
|
||||
updated: number;
|
||||
upToDate: number;
|
||||
blocked: number;
|
||||
errors: number;
|
||||
skipped: number;
|
||||
missingTrackedRepos?: MissingTrackedRepo[];
|
||||
}
|
||||
|
||||
export interface RehydrateResultItem {
|
||||
name: string;
|
||||
action: string; // "rehydrated" | "error"
|
||||
error?: string;
|
||||
}
|
||||
|
||||
+2
-10
@@ -1,9 +1,9 @@
|
||||
import { apiFetch, BASE, createSSEStream } from './http';
|
||||
import type { MissingTrackedRepo, RehydrateResultItem, UpdateResultItem, UpdateStreamSummary } from './types/update';
|
||||
import type { UpdateResultItem, UpdateStreamSummary } from './types/update';
|
||||
|
||||
export const updateApi = {
|
||||
update: (opts: { name?: string; kind?: 'skill' | 'agent'; force?: boolean; all?: boolean; skipAudit?: boolean }) =>
|
||||
apiFetch<{ results: UpdateResultItem[]; missingTrackedRepos?: MissingTrackedRepo[] }>('/update', {
|
||||
apiFetch<{ results: UpdateResultItem[] }>('/update', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(opts),
|
||||
}),
|
||||
@@ -24,12 +24,4 @@ export const updateApi = {
|
||||
done: onDone,
|
||||
}, onError, 'Update stream failed');
|
||||
},
|
||||
// Tracked repos declared in metadata but absent on disk (issue #212)
|
||||
missingTrackedRepos: () =>
|
||||
apiFetch<{ repos: MissingTrackedRepo[] }>('/update/missing-tracked-repos'),
|
||||
// Rehydrate tracked repos declared in metadata but absent on disk (issue #212)
|
||||
rehydrateTrackedRepos: () =>
|
||||
apiFetch<{ results: RehydrateResultItem[] }>('/update/rehydrate', {
|
||||
method: 'POST',
|
||||
}),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user