| ... | @@ -10,11 +10,14 @@ import { serverConfigQueryOptions } from "../lib/serverReactQuery"; | ... | @@ -10,11 +10,14 @@ import { serverConfigQueryOptions } from "../lib/serverReactQuery"; |
| 10 | import { resolveShortcutCommand } from "../keybindings"; | 10 | import { resolveShortcutCommand } from "../keybindings"; |
| 11 | import { selectThreadTerminalState, useTerminalStateStore } from "../terminalStateStore"; | 11 | import { selectThreadTerminalState, useTerminalStateStore } from "../terminalStateStore"; |
| 12 | import { useThreadSelectionStore } from "../threadSelectionStore"; | 12 | import { useThreadSelectionStore } from "../threadSelectionStore"; |
| 13 | import { Sidebar, SidebarProvider } from "~/components/ui/sidebar"; | | |
| 14 | import { resolveSidebarNewThreadEnvMode } from "~/components/Sidebar.logic"; | 13 | import { resolveSidebarNewThreadEnvMode } from "~/components/Sidebar.logic"; |
| 15 | import { useAppSettings } from "~/appSettings"; | 14 | import { useAppSettings } from "~/appSettings"; |
| | 15 | import { Sidebar, SidebarProvider, SidebarRail } from "~/components/ui/sidebar"; |
| 16 | | 16 | |
| 17 | const EMPTY_KEYBINDINGS: ResolvedKeybindingsConfig = []; | 17 | const EMPTY_KEYBINDINGS: ResolvedKeybindingsConfig = []; |
| | 18 | const THREAD_SIDEBAR_WIDTH_STORAGE_KEY = "chat_thread_sidebar_width"; |
| | 19 | const THREAD_SIDEBAR_MIN_WIDTH = 13 * 16; |
| | 20 | const THREAD_MAIN_CONTENT_MIN_WIDTH = 40 * 16; |
| 18 | | 21 | |
| 19 | function ChatRouteGlobalShortcuts() { | 22 | function ChatRouteGlobalShortcuts() { |
| 20 | const clearSelection = useThreadSelectionStore((state) => state.clearSelection); | 23 | const clearSelection = useThreadSelectionStore((state) => state.clearSelection); |
| ... | @@ -116,8 +119,15 @@ function ChatRouteLayout() { | ... | @@ -116,8 +119,15 @@ function ChatRouteLayout() { |
| 116 | side="left" | 119 | side="left" |
| 117 | collapsible="offcanvas" | 120 | collapsible="offcanvas" |
| 118 | className="border-r border-border bg-card text-foreground" | 121 | className="border-r border-border bg-card text-foreground" |
| | 122 | resizable={{ |
| | 123 | minWidth: THREAD_SIDEBAR_MIN_WIDTH, |
| | 124 | shouldAcceptWidth: ({ nextWidth, wrapper }) => |
| | 125 | wrapper.clientWidth - nextWidth >= THREAD_MAIN_CONTENT_MIN_WIDTH, |
| | 126 | storageKey: THREAD_SIDEBAR_WIDTH_STORAGE_KEY, |
| | 127 | }} |
| 119 | > | 128 | > |
| 120 | <ThreadSidebar /> | 129 | <ThreadSidebar /> |
| | 130 | <SidebarRail /> |
| 121 | </Sidebar> | 131 | </Sidebar> |
| 122 | <Outlet /> | 132 | <Outlet /> |
| 123 | </SidebarProvider> | 133 | </SidebarProvider> |