mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
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:
@@ -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{
|
||||
|
||||
@@ -331,6 +331,7 @@ export interface SkillFileContent {
|
||||
export interface DiscoveredSkill {
|
||||
name: string;
|
||||
path: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface DiscoverResult {
|
||||
|
||||
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user