feat(ui): enhance install skill picker with descriptions and into-dir field

Include skill description from SKILL.md frontmatter in the discover API
response, add the optional description field to the DiscoveredSkill
TypeScript interface, and render it inline in the SkillPickerModal.
Filter search also matches against descriptions. The --into directory
input already existed in InstallForm, so no change was needed there.
This commit is contained in:
Willie
2026-02-28 20:56:34 +08:00
parent 6def2a254a
commit ba7752f85d
3 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ func (s *Server) handleDiscover(w http.ResponseWriter, r *http.Request) {
skills := make([]map[string]string, len(discovery.Skills))
for i, sk := range discovery.Skills {
skills[i] = map[string]string{"name": sk.Name, "path": sk.Path}
skills[i] = map[string]string{"name": sk.Name, "path": sk.Path, "description": sk.Description}
}
writeJSON(w, map[string]any{
+1
View File
@@ -331,6 +331,7 @@ export interface SkillFileContent {
export interface DiscoveredSkill {
name: string;
path: string;
description?: string;
}
export interface DiscoverResult {
+10 -2
View File
@@ -33,7 +33,10 @@ export default function SkillPickerModal({
if (!filter) return skills;
const q = filter.toLowerCase();
return skills.filter(
(s) => s.name.toLowerCase().includes(q) || s.path.toLowerCase().includes(q),
(s) =>
s.name.toLowerCase().includes(q) ||
s.path.toLowerCase().includes(q) ||
(s.description?.toLowerCase().includes(q) ?? false),
);
}, [skills, filter]);
@@ -162,7 +165,7 @@ export default function SkillPickerModal({
checked={selected.has(skill.path)}
onChange={() => toggle(skill.path)}
/>
<div className="min-w-0">
<div className="min-w-0 flex-1">
<span
className="font-bold text-pencil text-base"
style={{ fontFamily: 'var(--font-heading)' }}
@@ -177,6 +180,11 @@ export default function SkillPickerModal({
{skill.path}
</span>
)}
{skill.description && (
<span className="block text-sm text-pencil-light truncate">
{skill.description}
</span>
)}
</div>
</div>
))}