Skip to content

Commit 2f603e1

Browse files
committed
Polish skill detail dialog layout
- Add icon, tag chips, and improved command/path presentation - Make dialog content and skills page scrollable within available height
1 parent 596defe commit 2f603e1

2 files changed

Lines changed: 46 additions & 17 deletions

File tree

apps/web/src/components/skills/SkillsPage.tsx

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,30 +138,53 @@ function SkillDetailDialog(props: {
138138
const mutable = isCatalog ? !skill.immutable && skill.installed : skill.mutable;
139139
const pathValue = skill.path;
140140
const slashName = isCatalog ? skill.name.toLowerCase().replace(/\s+/g, "-") : skill.name;
141+
const tags = "tags" in skill ? skill.tags : [];
142+
const Icon = skillIcon("icon" in skill ? skill.icon : "file");
141143
return (
142144
<Dialog open={props.open} onOpenChange={props.onOpenChange}>
143145
<DialogPopup>
144146
<DialogHeader>
145-
<DialogTitle>{skill.name}</DialogTitle>
146-
<DialogDescription>{skill.description}</DialogDescription>
147-
</DialogHeader>
148-
<DialogPanel className="space-y-4">
149-
<div className="flex flex-wrap gap-2">
150-
{("tags" in skill ? skill.tags : []).map((tag) => (
151-
<Badge key={tag} variant="secondary">
152-
{tag}
153-
</Badge>
154-
))}
147+
<div className="flex items-center gap-3">
148+
<div className="flex size-10 shrink-0 items-center justify-center rounded-xl bg-accent/70 text-foreground">
149+
<Icon className="size-5" />
150+
</div>
151+
<div className="min-w-0">
152+
<DialogTitle>{skill.name}</DialogTitle>
153+
<DialogDescription className="mt-1">{skill.description}</DialogDescription>
154+
</div>
155155
</div>
156+
{tags.length > 0 && (
157+
<div className="flex flex-wrap gap-1.5 pt-1">
158+
{tags.map((tag) => (
159+
<Badge key={tag} variant="secondary" className="text-xs">
160+
{tag}
161+
</Badge>
162+
))}
163+
</div>
164+
)}
165+
</DialogHeader>
166+
<DialogPanel className="space-y-3">
156167
<div className="rounded-xl border bg-muted/35 p-3 text-sm">
157-
<p className="font-medium text-foreground">Slash commands</p>
158-
<p className="mt-2 font-mono text-xs text-muted-foreground">/{slashName}</p>
159-
<p className="mt-1 font-mono text-xs text-muted-foreground">/skill read {slashName}</p>
168+
<p className="font-medium text-foreground text-xs uppercase tracking-wider text-muted-foreground">
169+
Slash commands
170+
</p>
171+
<div className="mt-2 space-y-1">
172+
<p className="rounded-md bg-muted/50 px-2 py-1 font-mono text-xs text-foreground">
173+
/{slashName}
174+
</p>
175+
<p className="rounded-md bg-muted/50 px-2 py-1 font-mono text-xs text-foreground">
176+
/skill read {slashName}
177+
</p>
178+
</div>
160179
</div>
161180
{pathValue ? (
162181
<div className="rounded-xl border bg-muted/35 p-3 text-sm">
163-
<p className="font-medium text-foreground">Path</p>
164-
<p className="mt-1 break-all font-mono text-xs text-muted-foreground">{pathValue}</p>
182+
<p className="font-medium text-xs uppercase tracking-wider text-muted-foreground">
183+
Installed path
184+
</p>
185+
<p className="mt-2 break-all rounded-md bg-muted/50 px-2 py-1 font-mono text-xs text-foreground">
186+
{pathValue}
187+
</p>
165188
</div>
166189
) : null}
167190
</DialogPanel>
@@ -422,7 +445,7 @@ export function SkillsPage(props: {
422445
<SkillLibraryTabs current="skills" />
423446
</div>
424447
</div>
425-
<div className="mx-auto flex w-full max-w-6xl flex-1 flex-col gap-8 px-4 py-8 sm:px-6">
448+
<div className="mx-auto flex w-full max-w-6xl flex-1 flex-col gap-8 overflow-y-auto px-4 py-8 sm:px-6">
426449
<div className="space-y-6">
427450
<div className="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
428451
<div className="space-y-2">

apps/web/src/components/ui/dialog.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
9090
}
9191

9292
function DialogPanel({ className, ...props }: React.ComponentProps<"div">) {
93-
return <div className={cn("px-6 pb-6", className)} data-slot="dialog-panel" {...props} />;
93+
return (
94+
<div
95+
className={cn("min-h-0 overflow-y-auto px-6 pb-6", className)}
96+
data-slot="dialog-panel"
97+
{...props}
98+
/>
99+
);
94100
}
95101

96102
function DialogFooter({

0 commit comments

Comments
 (0)