diff --git a/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormInput/ChatFormInputRich.svelte b/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormInput/ChatFormInputRich.svelte index 5ce788d5a6..629001bb44 100644 --- a/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormInput/ChatFormInputRich.svelte +++ b/tools/ui/src/lib/components/app/chat/ChatForm/ChatFormInput/ChatFormInputRich.svelte @@ -625,7 +625,7 @@ } if (rootElement && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')) { - const isWordJump = (event.altKey || event.ctrlKey) && !event.metaKey; + const isWordJump = (event.altKey || event.ctrlKey) && !event.metaKey && !event.shiftKey; const isPlainLeft = event.key === 'ArrowLeft' && !event.altKey && !event.ctrlKey && !event.metaKey; diff --git a/tools/ui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte b/tools/ui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte index e025beff1b..7afb4c0cf0 100644 --- a/tools/ui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte +++ b/tools/ui/src/lib/components/app/chat/ChatScreen/ChatScreen.svelte @@ -73,9 +73,7 @@ }); const { handleKeydown } = useKeyboardShortcuts({ deleteActiveConversation: () => { - const conversation = conversationsStore.activeConversation; - - if (conversation) { + if (conversationsStore.activeConversation) { showDeleteDialog = true; } } diff --git a/tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte b/tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte index 8d19ff4fc2..763241c56d 100644 --- a/tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte +++ b/tools/ui/src/lib/components/app/chat/ChatTabs/ChatTabs.svelte @@ -35,7 +35,7 @@ let loadingIds = $derived(new Set(chatStore.getAllLoadingChats())); function handleClose(id: string) { - void tabsStore.close(id, activeId ?? null); + void tabsStore.close(id, activeId); } function handleStop(id: string, event: MouseEvent) { @@ -56,7 +56,7 @@ $effect(() => { const currentIds = new Set(tabs.map((t) => t.id)); - const addedIds = tabs.filter((t) => !previousTabIds.has(t.id)).map((t) => t.id); + const hasAddedTab = tabs.some((t) => !previousTabIds.has(t.id)); previousTabIds = currentIds; @@ -65,7 +65,7 @@ previousActiveId = activeId; // scroll when the active tab changes (a click) or when a new tab is added - if (addedIds.length === 0 && !activeChanged) return; + if (!hasAddedTab && !activeChanged) return; // wait for the new tab to be laid out before scrolling to it void tick().then(() => { @@ -73,7 +73,7 @@ `[${UI_DATA_ATTRS.ACTIVE_TAB}]` ); - if (el && activeId) { + if (el) { carousel.scrollToCenter(el); } }); @@ -82,8 +82,8 @@