fix: shortcuts only block keyboard actions when needed, and change some keybinds
This commit is contained in:
@@ -258,32 +258,42 @@ const activeGeneration = computed(() => {
|
||||
|
||||
const { scrollToBottom } = useAutoScroll(chatPaneWrapper);
|
||||
|
||||
addShortcut(['ctrl', 'alt', 'n'], () => {
|
||||
addShortcut(['ctrl', 'alt', 'n'], (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
(document.activeElement as HTMLElement | undefined)?.blur();
|
||||
return navigateTo(`/agent/${route.params.id}`);
|
||||
});
|
||||
|
||||
addShortcut(['ctrl', 'shift', 'enter'], () => {
|
||||
addShortcut(['ctrl', 'shift', 'enter'], (event) => {
|
||||
const lastMessage = topic.value?.messages?.at(-1);
|
||||
if (lastMessage) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
handleRegenerate(lastMessage);
|
||||
}
|
||||
});
|
||||
|
||||
addShortcut(['ctrl', 'shift', 'backspace'], () => {
|
||||
addShortcut(['ctrl', 'shift', 'backspace'], (event) => {
|
||||
const lastMessage = topic.value?.messages?.at(-1);
|
||||
if (lastMessage) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
handleDelete(lastMessage);
|
||||
}
|
||||
});
|
||||
|
||||
addShortcut(['ctrl', 'c'], () => {
|
||||
addShortcut(['ctrl', 'shift', 'c'], (event) => {
|
||||
if (activeGeneration.value === null) return;
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
handleCancel();
|
||||
})
|
||||
|
||||
addShortcut(['alt', '['], async () => {
|
||||
console.log("left");
|
||||
addShortcut(['alt', '['], async (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const lastMessage = topic.value?.messages?.at(-1);
|
||||
if (lastMessage && lastMessage.children.length > 0) {
|
||||
@@ -293,8 +303,9 @@ addShortcut(['alt', '['], async () => {
|
||||
}
|
||||
})
|
||||
|
||||
addShortcut(['alt', ']'], async () => {
|
||||
console.log("right");
|
||||
addShortcut(['alt', ']'], async (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const lastMessage = topic.value?.messages?.at(-1);
|
||||
if (lastMessage && lastMessage.children.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user