The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 07:30 UTC
Add resizable chat sidebar (#1347)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
shivam committed
Mar 24, 2026 at 07:56 UTC
2b08d8669646109ffa101b1b767f4c1922d2e072
1 file changed
+11
-1
apps/web/src/routes/_chat.tsx
+11
-1
@@ -10,11 +10,14 @@ import { serverConfigQueryOptions } from "../lib/serverReactQuery";
10
import { resolveShortcutCommand } from "../keybindings";
11
import { selectThreadTerminalState, useTerminalStateStore } from "../terminalStateStore";
12
import { useThreadSelectionStore } from "../threadSelectionStore";
13
-import { Sidebar, SidebarProvider } from "~/components/ui/sidebar";
13
import { resolveSidebarNewThreadEnvMode } from "~/components/Sidebar.logic";
14
import { useAppSettings } from "~/appSettings";
15
+import { Sidebar, SidebarProvider, SidebarRail } from "~/components/ui/sidebar";
16
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;
21
22
function ChatRouteGlobalShortcuts() {
23
const clearSelection = useThreadSelectionStore((state) => state.clearSelection);
@@ -116,8 +119,15 @@ function ChatRouteLayout() {
119
side="left"
120
collapsible="offcanvas"
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
+ }}
128
>
129
<ThreadSidebar />
130
+ <SidebarRail />
131
</Sidebar>
132
<Outlet />
133
</SidebarProvider>