Skip to content

Commit cf9f5cd

Browse files
committed
feat($skill): wire skill list to popover + skill selection via API
- skillFlat prop passes sync.data.skill as SkillOption[] to PromptPopover - onSkillSelect calls skillApi('POST', name) to add skill to session - Closes popover after selection - SkillOption import from slash-popover - This completes the $ → popover → select → API → sync → badge strip flow
1 parent ce04b10 commit cf9f5cd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/app/src/components/prompt-input.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import {
5252
promptLength,
5353
} from "./prompt-input/history"
5454
import { createPromptSubmit, type FollowupDraft } from "./prompt-input/submit"
55-
import { PromptPopover, type AtOption, type SlashCommand } from "./prompt-input/slash-popover"
55+
import { PromptPopover, type AtOption, type SlashCommand, type SkillOption } from "./prompt-input/slash-popover"
5656
import { PromptContextItems } from "./prompt-input/context-items"
5757
import { PromptImageAttachments } from "./prompt-input/image-attachments"
5858
import { PromptDragOverlay } from "./prompt-input/drag-overlay"
@@ -1401,6 +1401,12 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
14011401
onSlashSelect={handleSlashSelect}
14021402
commandKeybind={command.keybind}
14031403
t={(key) => language.t(key as Parameters<typeof language.t>[0])}
1404+
skillFlat={sync.data.skill.map((s): SkillOption => ({ type: "skill", name: s.name, description: s.description }))}
1405+
onSkillSelect={(skill) => {
1406+
// When a skill is selected from popover, add it via API
1407+
skillApi("POST", skill.name)
1408+
closePopover()
1409+
}}
14041410
/>
14051411
<DockShellForm
14061412
onSubmit={handleSubmit}

0 commit comments

Comments
 (0)