feat: Enable MCP prompt button in chat message edit form
This commit is contained in:
parent
184cb50148
commit
530868f5a1
|
|
@ -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 = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -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()}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@
|
|||
attachments={editCtx.editedExtras}
|
||||
uploadedFiles={editCtx.editedUploadedFiles}
|
||||
placeholder="Edit your message..."
|
||||
showMcpPromptButton={true}
|
||||
onValueChange={editCtx.setContent}
|
||||
onAttachmentRemove={handleAttachmentRemove}
|
||||
onUploadedFileRemove={handleUploadedFileRemove}
|
||||
|
|
|
|||
Loading…
Reference in New Issue