mirror of
https://github.com/open-webui/open-webui
synced 2025-02-20 12:00:22 +00:00
enh: ctrl+shift+delete chat delete support
This commit is contained in:
parent
99f70cac8b
commit
0556479cbe
@ -1,12 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { onMount, getContext, createEventDispatcher } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
import { flyAndScale } from '$lib/utils/transitions';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
import { fade } from 'svelte/transition';
|
||||
import { flyAndScale } from '$lib/utils/transitions';
|
||||
|
||||
export let title = '';
|
||||
export let message = '';
|
||||
|
||||
@ -27,6 +26,12 @@
|
||||
console.log('Escape');
|
||||
show = false;
|
||||
}
|
||||
|
||||
if (event.key === 'Enter') {
|
||||
console.log('Enter');
|
||||
show = false;
|
||||
dispatch('confirm', inputValue);
|
||||
}
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
@ -56,7 +61,7 @@
|
||||
}}
|
||||
>
|
||||
<div
|
||||
class=" m-auto rounded-2xl max-w-full w-[32rem] mx-2 bg-gray-50 dark:bg-gray-950 max-h-[100dvh] shadow-3xl border border-gray-850"
|
||||
class=" m-auto rounded-2xl max-w-full w-[32rem] mx-2 bg-gray-50 dark:bg-gray-950 max-h-[100dvh] shadow-3xl"
|
||||
in:flyAndScale
|
||||
on:mousedown={(e) => {
|
||||
e.stopPropagation();
|
||||
|
@ -58,13 +58,7 @@
|
||||
let shiftKey = false;
|
||||
|
||||
let selectedChatId = null;
|
||||
let deleteChat = null;
|
||||
|
||||
let showDeleteConfirm = false;
|
||||
let showDropdown = false;
|
||||
|
||||
let selectedTagName = null;
|
||||
|
||||
let showPinnedChat = true;
|
||||
|
||||
// Pagination variables
|
||||
|
@ -389,7 +389,7 @@
|
||||
id="delete-chat-button"
|
||||
class="hidden"
|
||||
on:click={() => {
|
||||
dispatch('delete');
|
||||
showDeleteConfirm = true;
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
|
@ -165,7 +165,11 @@
|
||||
}
|
||||
|
||||
// Check if Ctrl + Shift + Backspace is pressed
|
||||
if (isCtrlPressed && isShiftPressed && event.key === 'Backspace') {
|
||||
if (
|
||||
isCtrlPressed &&
|
||||
isShiftPressed &&
|
||||
(event.key === 'Backspace' || event.key === 'Delete')
|
||||
) {
|
||||
event.preventDefault();
|
||||
console.log('deleteChat');
|
||||
document.getElementById('delete-chat-button')?.click();
|
||||
|
Loading…
Reference in New Issue
Block a user