Skip to content

Commit 45150e3

Browse files
committed
feat: Adds Enter key support to delete dialogs
1 parent d99934a commit 45150e3

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessage.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,14 @@
288288
{/snippet}
289289

290290
<AlertDialog bind:open={showDeleteDialog}>
291-
<AlertDialogContent>
291+
<AlertDialogContent
292+
onkeydown={(e) => {
293+
if (e.key === 'Enter') {
294+
e.preventDefault();
295+
handleConfirmDelete();
296+
}
297+
}}
298+
>
292299
<AlertDialogHeader>
293300
<AlertDialogTitle>Delete Message</AlertDialogTitle>
294301
<AlertDialogDescription>

tools/server/webui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@
320320
</AlertDialog.Header>
321321

322322
<div class="space-y-4">
323-
<!-- Generally unsupported files -->
324323
{#if fileErrorData.generallyUnsupported.length > 0}
325324
<div class="space-y-2">
326325
<h4 class="text-destructive text-sm font-medium">Unsupported File Types</h4>
@@ -339,7 +338,6 @@
339338
</div>
340339
{/if}
341340

342-
<!-- Modality-restricted files -->
343341
{#if fileErrorData.modalityUnsupported.length > 0}
344342
<div class="space-y-2">
345343
<h4 class="text-destructive text-sm font-medium">
@@ -361,7 +359,6 @@
361359
</div>
362360
{/if}
363361

364-
<!-- Supported file types -->
365362
<div class="bg-muted/50 rounded-md p-3">
366363
<h4 class="mb-2 text-sm font-medium">This model supports:</h4>
367364
<p class="text-muted-foreground text-sm">
@@ -379,7 +376,6 @@
379376
</AlertDialog.Portal>
380377
</AlertDialog.Root>
381378

382-
<!-- Delete Chat Confirmation Dialog -->
383379
<AlertDialog.Root bind:open={showDeleteDialog}>
384380
<AlertDialog.Portal>
385381
<AlertDialog.Overlay />

tools/server/webui/src/lib/components/app/chat/ChatSidebar/ChatSidebarConversationItem.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,15 @@
115115
</DropdownMenu.Root>
116116

117117
<AlertDialog.Root bind:open={showDeleteDialog}>
118-
<AlertDialog.Content>
118+
<AlertDialog.Content
119+
onkeydown={(e) => {
120+
if (e.key === 'Enter') {
121+
e.preventDefault();
122+
handleConfirmDelete();
123+
showDeleteDialog = false;
124+
}
125+
}}
126+
>
119127
<AlertDialog.Header>
120128
<AlertDialog.Title>Delete Conversation</AlertDialog.Title>
121129
<AlertDialog.Description>

0 commit comments

Comments
 (0)