mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-01 09:49:03 -05:00
feat: create new message pair on cmd+shift+enter
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
export let transparentBackground = false;
|
||||
|
||||
export let submitPrompt: Function;
|
||||
export let createMessagePair: Function;
|
||||
export let stopResponse: Function;
|
||||
|
||||
export let autoScroll = false;
|
||||
@@ -554,6 +555,12 @@
|
||||
const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac
|
||||
const commandsContainerElement = document.getElementById('commands-container');
|
||||
|
||||
// Command/Ctrl + Shift + Enter to submit a message pair
|
||||
if (isCtrlPressed && e.key === 'Enter' && e.shiftKey) {
|
||||
e.preventDefault();
|
||||
createMessagePair(prompt);
|
||||
}
|
||||
|
||||
// Check if Ctrl + R is pressed
|
||||
if (prompt === '' && isCtrlPressed && e.key.toLowerCase() === 'r') {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user