]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ui: restore Ctrl+B sidebar toggle shortcut (#25307)
authorPascal <redacted>
Mon, 6 Jul 2026 08:30:07 +0000 (10:30 +0200)
committerGitHub <redacted>
Mon, 6 Jul 2026 08:30:07 +0000 (10:30 +0200)
tools/ui/src/lib/components/app/navigation/SidebarNavigation/SidebarNavigation.svelte
tools/ui/src/lib/enums/keyboard.enums.ts
tools/ui/src/lib/hooks/use-keyboard-shortcuts.svelte.ts

index fe503f53baa1a0bc6b63d5a0bece8afa0266d964..a23f4682e5818b67f33417fc58188b6c4d2fcf00 100644 (file)
 
        let { onSearchClick = () => {} }: Props = $props();
 
-       const { handleKeydown } = useKeyboardShortcuts({ activateSearchMode: () => onSearchClick() });
+       const { handleKeydown } = useKeyboardShortcuts({
+               activateSearchMode: () => onSearchClick(),
+               toggleSidebar: () => toggleExpandedMode()
+       });
 
        let isExpandedMode = $state(false);
        let hoveredTooltip = $state<string | null>(null);
index 46cd4a77614f704adb86e473d286f43ec4e584fb..735d3e4b4684af5c4424b6f42333363ca3c68680 100644 (file)
@@ -9,6 +9,7 @@ export enum KeyboardKey {
        ARROW_LEFT = 'ArrowLeft',
        ARROW_RIGHT = 'ArrowRight',
        TAB = 'Tab',
+       B_LOWER = 'b',
        D_LOWER = 'd',
        D_UPPER = 'D',
        E_UPPER = 'E',
index 05966a1a1d127d59670bdd99e3ec1228dae83257..61df30b79a56a70ddd33e3bf8fdcbfed353138f3 100644 (file)
@@ -9,6 +9,7 @@ interface KeyboardShortcutsCallbacks {
        deleteActiveConversation?: () => void;
        navigateToPrevConversation?: () => void;
        navigateToNextConversation?: () => void;
+       toggleSidebar?: () => void;
 }
 
 export function useKeyboardShortcuts(callbacks: KeyboardShortcutsCallbacks) {
@@ -21,6 +22,11 @@ export function useKeyboardShortcuts(callbacks: KeyboardShortcutsCallbacks) {
                        callbacks.onSearchActivated?.();
                }
 
+               if (isCmdOrCtrl && event.key === KeyboardKey.B_LOWER) {
+                       event.preventDefault();
+                       callbacks.toggleSidebar?.();
+               }
+
                if (
                        isCmdOrCtrl &&
                        event.shiftKey &&