feat: Enable MCP prompt button in chat message edit form

This commit is contained in:
Aleksander Grygier 2026-02-09 15:01:05 +01:00
parent 184cb50148
commit 530868f5a1
3 changed files with 7 additions and 4 deletions

View File

@ -365,8 +365,11 @@
promptInfo: MCPPromptInfo,
args?: Record<string, string>
) {
value = '';
onValueChange?.('');
// Only clear the value if the prompt was triggered by typing '/'
if (value.startsWith('/')) {
value = '';
onValueChange?.('');
}
isPromptPickerOpen = false;
promptSearchQuery = '';

View File

@ -350,7 +350,7 @@
}
}}
>
<Popover.Trigger class="pointer-events-none absolute top-0 right-0 left-0 h-0 w-full opacity-0">
<Popover.Trigger class="pointer-events-none absolute inset-0 opacity-0">
<span class="sr-only">Open prompt picker</span>
</Popover.Trigger>
@ -358,7 +358,6 @@
side="top"
align="start"
sideOffset={12}
avoidCollisions={false}
class="w-[var(--bits-popover-anchor-width)] max-w-none rounded-xl border-border/50 p-0 shadow-xl {className}"
onkeydown={handleKeydown}
onOpenAutoFocus={(e) => e.preventDefault()}

View File

@ -99,6 +99,7 @@
attachments={editCtx.editedExtras}
uploadedFiles={editCtx.editedUploadedFiles}
placeholder="Edit your message..."
showMcpPromptButton={true}
onValueChange={editCtx.setContent}
onAttachmentRemove={handleAttachmentRemove}
onUploadedFileRemove={handleUploadedFileRemove}