fix(ui): refine tracked repo row — add xs button size, move status to info group

- Add 'xs' button size tier (px-2 py-1 text-xs) to Button component
- Use xs buttons for tracked repo Update/Uninstall actions to reduce
  visual weight in row-level controls
- Move clean/modified status from action area to info group (left side)
  as Badge — status is metadata, not an action
- clean: subtle default Badge; modified: warning Badge with dot
- Remove unused Check icon import
This commit is contained in:
Willie
2026-04-04 17:05:22 +08:00
parent 814e14c88b
commit 603f7e86fa
2 changed files with 11 additions and 17 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ import Spinner from './Spinner';
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
children: ReactNode;
variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'link';
size?: 'sm' | 'md' | 'lg';
size?: 'xs' | 'sm' | 'md' | 'lg';
loading?: boolean;
ref?: Ref<HTMLButtonElement>;
}
@@ -18,6 +18,7 @@ const variantClasses = {
};
const sizeClasses = {
xs: 'px-2 py-1 text-xs',
sm: 'px-3 py-1.5 text-sm',
md: 'px-5 py-2.5 text-sm',
lg: 'px-6 py-3 text-base',
+9 -16
View File
@@ -11,7 +11,6 @@ import {
Download,
GitBranch,
AlertTriangle,
Check,
Trash2,
Package,
Zap,
@@ -513,36 +512,30 @@ function TrackedReposSection({ repos }: { repos: { name: string; skillCount: num
{displayName}
</span>
<Badge variant="info">{repo.skillCount} skills</Badge>
{repo.dirty ? (
<Badge variant="warning" dot>modified</Badge>
) : (
<Badge variant="default">clean</Badge>
)}
</div>
<div className="flex flex-wrap items-center gap-2 shrink-0">
{repo.dirty ? (
<span className="flex items-center gap-1 text-warning text-sm">
<AlertTriangle size={14} strokeWidth={2.5} />
<span>modified</span>
</span>
) : (
<span className="flex items-center gap-1 text-success text-sm">
<Check size={14} strokeWidth={2.5} />
<span>clean</span>
</span>
)}
<Button
variant="secondary"
size="sm"
size="xs"
onClick={() => handleUpdateRepo(repo.name)}
loading={isUpdating}
disabled={hasAnyDeleteInProgress}
>
<RefreshCw size={14} />
<RefreshCw size={12} />
Update
</Button>
<Button
variant="danger"
size="sm"
size="xs"
onClick={() => setRepoToDelete(repo.name)}
disabled={isBusy || repoToDelete !== null || updatingRepos.size > 0}
>
<Trash2 size={14} />
<Trash2 size={12} />
Uninstall
</Button>
</div>