fix(ui): label non-GitHub git sources as Remote instead of Local

SourceBadge only recognised github/github-subdir metadata types, so skills
installed from Gitea, GitLab, self-hosted or SSH git sources fell through
to the Local badge. Add a Remote badge for any non-local install source,
matching the CLI list view.

Refs #270
This commit is contained in:
Willie
2026-09-02 13:08:40 +08:00
parent 99fc3321b1
commit ec7f4e6fec
+6 -2
View File
@@ -1,6 +1,6 @@
import Badge from './Badge';
type SourceType = 'tracked' | 'github' | 'local';
type SourceType = 'tracked' | 'github' | 'remote' | 'local';
interface SourceBadgeProps {
type?: string;
@@ -8,15 +8,19 @@ interface SourceBadgeProps {
size?: 'sm' | 'md';
}
// Metadata `type` values: github, github-subdir, git-https, git-ssh
// (optionally -subdir), local, or empty for skills with no install source.
function resolveSource(type?: string, isInRepo?: boolean): SourceType {
if (isInRepo) return 'tracked';
if (type === 'github' || type === 'github-subdir') return 'github';
if (type?.startsWith('github')) return 'github';
if (type && !type.startsWith('local')) return 'remote';
return 'local';
}
const config: Record<SourceType, { label: string; variant: 'default' | 'info' }> = {
tracked: { label: 'Tracked', variant: 'default' },
github: { label: 'GitHub', variant: 'info' },
remote: { label: 'Remote', variant: 'info' },
local: { label: 'Local', variant: 'default' },
};