@devries-cameron20 / t3code-1 / commits / 3faeb9e6f9
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

feat(web): Settings and Usage open as large modals over your thread (#24847)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 25, 2026 at 04:55 UTC 3faeb9e6f98f0f319be8de509de85af5597bd8b7
33 files changed +593 -465
apps/web/src/components/AppRouteModal.tsx new
+81
@@ -0,0 +1,81 @@
1 +import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2 +import { XIcon } from "lucide-react";
3 +import { useRef, useState, type ReactNode } from "react";
4 +
5 +import { useCloseAppModal } from "./sidebar/mainAppLocation";
6 +import { Button } from "./ui/button";
7 +import { DialogBackdrop } from "./ui/dialog";
8 +import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
9 +
10 +/**
11 + * Large modal for the Settings and Usage routes. Esc, the close button, or a press on the
12 + * backdrop returns to the page that opened it. Keyboard guards that skip dialogs exempt
13 + * `[data-app-modal]`, because these pages own their shortcuts.
14 + */
15 +export function AppRouteModal({ label, children }: { label: string; children: ReactNode }) {
16 + const closeAppModal = useCloseAppModal();
17 + const [open, setOpen] = useState(true);
18 + // Text selection that ends on the backdrop is not a dismissal.
19 + const backdropPressRef = useRef(false);
20 + // Focus the surface, not its first control: no stray focus ring, no phone keyboard.
21 + // On close, leave focus alone; returning it to the opener paints a focus ring.
22 + const popupRef = useRef<HTMLDivElement>(null);
23 +
24 + return (
25 + <DialogPrimitive.Root
26 + open={open}
27 + // Portaled layers outside this tree (toasts, Clerk, confirm dialogs) are not backdrop presses.
28 + disablePointerDismissal
29 + onOpenChange={(nextOpen) => {
30 + if (!nextOpen) setOpen(false);
31 + }}
32 + onOpenChangeComplete={(nextOpen) => {
33 + if (!nextOpen) void closeAppModal();
34 + }}
35 + >
36 + <DialogPrimitive.Portal>
37 + <DialogBackdrop />
38 + <DialogPrimitive.Viewport
39 + className="fixed inset-0 z-50 flex items-center justify-center sm:p-6 lg:p-10"
40 + onPointerDown={(event) => {
41 + backdropPressRef.current = event.target === event.currentTarget;
42 + }}
43 + onClick={(event) => {
44 + if (backdropPressRef.current && event.target === event.currentTarget) setOpen(false);
45 + backdropPressRef.current = false;
46 + }}
47 + >
48 + <DialogPrimitive.Popup
49 + ref={popupRef}
50 + initialFocus={popupRef}
51 + finalFocus={false}
52 + aria-label={label}
53 + data-slot="dialog-popup"
54 + data-app-modal=""
55 + className="relative flex size-full min-h-0 min-w-0 flex-col overflow-hidden bg-background max-sm:pt-safe max-sm:pb-safe text-foreground outline-none transition-[opacity,scale] duration-150 ease-out [-webkit-app-region:no-drag] data-ending-style:scale-[0.985] data-ending-style:opacity-0 data-starting-style:scale-[0.985] data-starting-style:opacity-0 sm:max-h-[60rem] sm:max-w-[80rem] sm:rounded-2xl sm:border sm:shadow-2xl/40"
56 + >
57 + {children}
58 + </DialogPrimitive.Popup>
59 + </DialogPrimitive.Viewport>
60 + </DialogPrimitive.Portal>
61 + </DialogPrimitive.Root>
62 + );
63 +}
64 +
65 +export function AppRouteModalClose() {
66 + return (
67 + <Tooltip>
68 + <TooltipTrigger
69 + render={
70 + <DialogPrimitive.Close
71 + aria-label="Close"
72 + render={<Button size="icon-sm" variant="ghost" />}
73 + />
74 + }
75 + >
76 + <XIcon />
77 + </TooltipTrigger>
78 + <TooltipPopup side="bottom">Close (Esc)</TooltipPopup>
79 + </Tooltip>
80 + );
81 +}
apps/web/src/components/AppSidebarLayout.tsx
+8 -24
@@ -41,12 +41,10 @@ import { BackgroundThreadAnnouncer } from "./BackgroundThreadAnnouncer";
41 import LegacyThreadSidebar from "./LegacySidebar";
42 import { useThreadVisitedMigration } from "../hooks/useThreadVisitedMigration";
43 import ThreadSidebar from "./Sidebar";
44 -import { SettingsSidebarNav } from "./settings/SettingsSidebarNav";
45 -import { SidebarBrandWidthProbe, SidebarChromeHeader } from "./sidebar/SidebarChrome";
46 -import { MainAppLocationTracker } from "./sidebar/mainAppLocation";
44 +import { SidebarBrandWidthProbe } from "./sidebar/SidebarChrome";
45 +import { isAppModalPage, MainAppLocationTracker } from "./sidebar/mainAppLocation";
46 import type { SidebarRouteReveal } from "./sidebar/routeReveal";
47 import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop";
49 -import { useProjects } from "../state/entities";
48 import {
49 clampThreadSidebarWidth,
50 resolveInitialThreadSidebarWidth,
@@ -261,8 +259,8 @@ export function NavigationHistoryShortcuts() {
259
260 const MODIFIER_KEYS = new Set(["Alt", "Control", "Meta", "Shift"]);
261
264 -// Undoes the thread actions in the sidebar's notice. Mounted wherever the
265 -// thread sidebar can show; Settings replaces it. Listens in the capture phase
262 +// Undoes the thread actions in the sidebar's notice. Settings and Usage own
263 +// mod+z while open. Listens in the capture phase
264 // so mod+z reaches it before the composer's own undo handler consumes the key.
265 function ThreadUndoShortcut() {
266 const keybindings = useAtomValue(primaryServerKeybindingsAtom);
@@ -320,14 +318,6 @@ function ThreadUndoShortcut() {
318 return null;
319 }
320
323 -// Settings swaps the thread sidebar out of the tree. Keep the lightweight
324 -// project projection subscribed so returning to a draft never renders the
325 -// zero-project state while the environment snapshot reconnects.
326 -function ProjectProjectionRetention() {
327 - useProjects();
328 - return null;
329 -}
330 -
321 export function AppSidebarLayout({ children }: { children: ReactNode }) {
322 const navigate = useNavigate();
323 const legacySidebarEnabled = useLegacySidebarEnabled();
@@ -341,7 +331,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
331 const pathname = useLocation({ select: (location) => location.pathname });
332 const panelAnimationsSuppressed = usePanelNavigationSuppression(pathname);
333 const routePanelAnimationsActive = panelAnimationsActive && !panelAnimationsSuppressed;
344 - const isOnSettings = pathname === "/settings" || pathname.startsWith("/settings/");
334 + const appModalOpen = isAppModalPage(pathname);
335 const isMacosDesktop = isElectron && isMacPlatform(navigator.platform);
336 const [sidebarWidth, setSidebarWidth] = useState(readInitialThreadSidebarWidth);
337 // A clamped drag may not change width, so viewport changes need a separate subscription.
@@ -401,13 +391,12 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
391 style={sidebarProviderStyle}
392 >
393 <SidebarBrandWidthProbe onWidthChange={setBrandWidth} />
404 - <ProjectProjectionRetention />
394 <Sidebar
395 side="left"
396 collapsible="offcanvas"
397 data-app-sidebar=""
398 role="navigation"
410 - aria-label={isOnSettings ? "Settings" : "Threads"}
399 + aria-label="Threads"
400 resizable={{
401 maxWidth: sidebarMaximumWidth,
402 minWidth: sidebarMinimumWidth,
@@ -419,12 +408,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
408 }}
409 style={windowControlsInsetStyle}
410 >
422 - {isOnSettings ? (
423 - <>
424 - <SidebarChromeHeader isElectron={isElectron} />
425 - <SettingsSidebarNav pathname={pathname} />
426 - </>
427 - ) : legacySidebarEnabled ? (
411 + {legacySidebarEnabled ? (
412 <LegacyThreadSidebar routeReveal={sidebarRouteReveal} />
413 ) : (
414 <ThreadSidebar routeReveal={sidebarRouteReveal} />
@@ -435,7 +419,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
419 <BackgroundThreadAnnouncer />
420 <SidebarControl />
421 <NavigationHistoryShortcuts />
438 - {isOnSettings ? null : <ThreadUndoShortcut />}
422 + {appModalOpen ? null : <ThreadUndoShortcut />}
423 <MainAppLocationTracker />
424 </SidebarProvider>
425 </PanelAnimationSuppressionProvider>
apps/web/src/components/ChatView.tsx
+5 -3
@@ -105,7 +105,8 @@ import { resolveProjectSettings } from "@t3tools/shared/projectSettings";
105 import { resolveThreadReferenceCopyTarget } from "@t3tools/client-runtime/thread-reference";
106 import { resolveTerminalSessionLabel } from "@t3tools/shared/terminalLabels";
107 import { useAtomValue } from "@effect/atom-react";
108 -import { type SetStateAction, useEffect, useLayoutEffect, useRef, useState } from "react";
108 +import { type SetStateAction, use, useEffect, useLayoutEffect, useRef, useState } from "react";
109 +import { BackgroundThreadContext } from "./chat/backgroundThread";
110 import { useLocation, useNavigate } from "@tanstack/react-router";
111 import { assistantCitationFromLocation } from "../lib/assistantCitationNavigation";
112 import type { AssistantCitationSourceAnchor } from "~/lib/assistantTextSelection";
@@ -1590,6 +1591,7 @@ export default function ChatView(props: ChatViewProps) {
1591 resourceKey: `git-status:${activeThreadKey ?? ""}:${gitStatusCwd ?? ""}`,
1592 });
1593 const keybindings = useAtomValue(primaryServerKeybindingsAtom);
1594 + const backgroundThread = use(BackgroundThreadContext);
1595 const scriptKeybindings =
1596 useAtomValue(serverEnvironment.configValueAtom(environmentId))?.keybindings ??
1597 DEFAULT_RESOLVED_KEYBINDINGS;
@@ -1602,7 +1604,7 @@ export default function ChatView(props: ChatViewProps) {
1604 remoteOpenMode: remoteOpenState.mode,
1605 });
1606 useOpenFavoriteEditorShortcut({
1605 - enabled: showOpenInPicker,
1607 + enabled: showOpenInPicker && !backgroundThread,
1608 environmentId: activeThread?.environmentId ?? environmentId,
1609 keybindings,
1610 availableEditors,
@@ -2683,7 +2685,7 @@ export default function ChatView(props: ChatViewProps) {
2685 const closeThreadFind = () => threadFindControlsRef.current?.close();
2686
2687 useChatShortcuts({
2686 - enabled: activeThreadId !== null,
2688 + enabled: activeThreadId !== null && !backgroundThread,
2689 keybindings,
2690 scriptKeybindings,
2691 getShortcutContext,
apps/web/src/components/ThreadRouteView.tsx
+23 -10
@@ -4,6 +4,7 @@ import { useNavigate } from "@tanstack/react-router";
4 import { useEffect, useState } from "react";
5
6 import ChatView from "./ChatView";
7 +import { BackgroundThreadContext } from "./chat/backgroundThread";
8 import { resolveDraftPromotionNavigationTarget, threadHasStarted } from "./ChatView.logic";
9 import { waitForDraftHeroTransition } from "./chat/draftHeroTransition";
10 import { SidebarInset } from "./ui/sidebar";
@@ -24,8 +25,17 @@ import {
25 type ThreadRouteTarget,
26 } from "../threadRoutes";
27
27 -/** Render in the shared layout to retain ChatView across route swaps; plain server threads remain unkeyed. */
28 -export function ThreadRouteView({ target }: { target: ThreadRouteTarget }) {
28 +/**
29 + * Render in the shared layout to retain ChatView across route swaps; plain server threads remain unkeyed.
30 + * `background` keeps the thread mounted, inert and in place under Settings or Usage.
31 + */
32 +export function ThreadRouteView({
33 + target,
34 + background = false,
35 +}: {
36 + target: ThreadRouteTarget;
37 + background?: boolean;
38 +}) {
39 const navigate = useNavigate();
40 const draftId = target.kind === "draft" ? target.draftId : null;
41 const draftSession = useComposerDraftStore((store) =>
@@ -111,7 +121,7 @@ export function ThreadRouteView({ target }: { target: ThreadRouteTarget }) {
121 }, [draftSession?.promotedTo, inferredThreadRef]);
122
123 useEffect(() => {
114 - if (!canonicalThreadRef) {
124 + if (!canonicalThreadRef || background) {
125 return;
126 }
127 let cancelled = false;
@@ -128,14 +138,14 @@ export function ThreadRouteView({ target }: { target: ThreadRouteTarget }) {
138 return () => {
139 cancelled = true;
140 };
131 - }, [canonicalThreadRef, navigate]);
141 + }, [background, canonicalThreadRef, navigate]);
142
143 useEffect(() => {
134 - if (target.kind !== "draft" || draftSession || canonicalThreadRef) {
144 + if (background || target.kind !== "draft" || draftSession || canonicalThreadRef) {
145 return;
146 }
147 void navigate({ to: "/", replace: true });
138 - }, [canonicalThreadRef, draftSession, navigate, target.kind]);
148 + }, [background, canonicalThreadRef, draftSession, navigate, target.kind]);
149
150 useEffect(() => {
151 if (target.kind !== "server" || !bootstrapComplete) {
@@ -144,11 +154,11 @@ export function ThreadRouteView({ target }: { target: ThreadRouteTarget }) {
154 if (renderState === "missing") {
155 const { clearPendingFileDropsForThread } = useSidebarPendingFileDropStore.getState();
156 clearPendingFileDropsForThread(target.threadRef);
147 - if (environmentHasAnyThreads) {
157 + if (environmentHasAnyThreads && !background) {
158 void navigate({ to: "/", replace: true });
159 }
160 }
151 - }, [bootstrapComplete, environmentHasAnyThreads, navigate, renderState, target]);
161 + }, [background, bootstrapComplete, environmentHasAnyThreads, navigate, renderState, target]);
162
163 useEffect(() => {
164 if (target.kind !== "server" || !serverThreadStarted || !draftThread) {
@@ -183,8 +193,11 @@ export function ThreadRouteView({ target }: { target: ThreadRouteTarget }) {
193 }
194
195 return (
186 - <SidebarInset className="h-svh min-h-0 overflow-hidden overscroll-y-none md:h-dvh">
187 - {view}
196 + <SidebarInset
197 + className="h-svh min-h-0 overflow-hidden overscroll-y-none md:h-dvh"
198 + inert={background}
199 + >
200 + <BackgroundThreadContext value={background}>{view}</BackgroundThreadContext>
201 </SidebarInset>
202 );
203 }
apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx
+5 -3
@@ -1,5 +1,6 @@
1 import { type RuntimeRequestId, type ScopedThreadRef } from "@t3tools/contracts";
2 -import { memo, useEffect, useEffectEvent, useRef, useState } from "react";
2 +import { memo, use, useEffect, useEffectEvent, useRef, useState } from "react";
3 +import { BackgroundThreadContext } from "./backgroundThread";
4 import { useStableCallback } from "~/hooks/useStableCallback";
5 import { type PendingUserInput } from "../../session-logic";
6 import {
@@ -142,9 +143,10 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
143 };
144
145 const selectOptionFromShortcut = useEffectEvent(handleOptionSelection);
146 + const backgroundThread = use(BackgroundThreadContext);
147
148 useEffect(() => {
147 - if (!activeQuestion || responseDisabled || isCollapsed) return;
149 + if (!activeQuestion || responseDisabled || isCollapsed || backgroundThread) return;
150 const handler = (event: globalThis.KeyboardEvent) => {
151 if (event.metaKey || event.ctrlKey || event.altKey) return;
152 const target = event.target;
@@ -168,7 +170,7 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
170 };
171 document.addEventListener("keydown", handler);
172 return () => document.removeEventListener("keydown", handler);
171 - }, [activeQuestion, isCollapsed, responseDisabled]);
173 + }, [activeQuestion, backgroundThread, isCollapsed, responseDisabled]);
174
175 if (!activeQuestion) {
176 return null;
apps/web/src/components/chat/OpenInPicker.tsx
+5 -2
@@ -6,7 +6,8 @@ import {
6 type EnvironmentId,
7 type ResolvedKeybindingsConfig,
8 } from "@t3tools/contracts";
9 -import { memo, useEffect, useRef } from "react";
9 +import { memo, use, useEffect, useRef } from "react";
10 +import { BackgroundThreadContext } from "./backgroundThread";
11 import { isOpenFavoriteEditorShortcut, shortcutLabelForCommand } from "../../keybindings";
12 import { usePreferredEditor } from "../../editorPreferences";
13 import { editorLabelForPlatform } from "../../editorLabels";
@@ -279,8 +280,9 @@ export const OpenInPicker = memo(function OpenInPicker({
280 "editor.openFavorite",
281 );
282
283 + const backgroundThread = use(BackgroundThreadContext);
284 useEffect(() => {
283 - if (!enableShortcut || !canOpenEditor) return;
285 + if (!enableShortcut || !canOpenEditor || backgroundThread) return;
286 const handler = (e: globalThis.KeyboardEvent) => {
287 if (e.defaultPrevented || !isOpenFavoriteEditorShortcut(e, keybindings)) return;
288 if (!openInCwd) return;
@@ -300,6 +302,7 @@ export const OpenInPicker = memo(function OpenInPicker({
302 window.addEventListener("keydown", handler, true);
303 return () => window.removeEventListener("keydown", handler, true);
304 }, [
305 + backgroundThread,
306 canOpenEditor,
307 enableShortcut,
308 environmentId,
apps/web/src/components/chat/backgroundThread.ts new
+4
@@ -0,0 +1,4 @@
1 +import { createContext } from "react";
2 +
3 +/** True for a thread kept mounted under Settings or Usage; its global shortcuts stand down. */
4 +export const BackgroundThreadContext = createContext(false);
apps/web/src/components/chat/useComposerStash.ts
+5
@@ -54,10 +54,12 @@ import {
54 type Dispatch,
55 type RefObject,
56 type SetStateAction,
57 + use,
58 useEffect,
59 useRef,
60 useState,
61 } from "react";
62 +import { BackgroundThreadContext } from "./backgroundThread";
63 import { useStableCallback } from "../../hooks/useStableCallback";
64
65 /**
@@ -691,7 +693,9 @@ export function useComposerStash(input: {
693 if (stashMenuClosesOn.prompt !== prompt || composerMenuOpen) setIsStashMenuOpen(false);
694 }
695
696 + const backgroundThread = use(BackgroundThreadContext);
697 useEffect(() => {
698 + if (backgroundThread) return;
699 const handler = (event: globalThis.KeyboardEvent) => {
700 const command = resolveShortcutCommand(event, keybindings, {
701 context: {
@@ -721,6 +725,7 @@ export function useComposerStash(input: {
725 return () => window.removeEventListener("keydown", handler, true);
726 }, [
727 activePendingProgress,
728 + backgroundThread,
729 isComposerModelPickerOpen,
730 keybindings,
731 pendingUserInputs.length,
apps/web/src/components/settings/SettingsSidebarNav.tsx
+49 -33
@@ -26,6 +26,7 @@ import {
26 } from "lucide-react";
27 import { useLocation, useNavigate } from "@tanstack/react-router";
28
29 +import { cn } from "../../lib/utils";
30 import { Button } from "../ui/button";
31 import { Kbd } from "../ui/kbd";
32 import {
@@ -35,10 +36,8 @@ import {
36 SidebarMenu,
37 SidebarMenuButton,
38 SidebarMenuItem,
38 - useSidebar,
39 SidebarInput,
40 } from "../ui/sidebar";
41 -import { SidebarUtilityMenu } from "../sidebar/SidebarChrome";
41 import { scrollToSettingsTarget } from "./settingsLayout";
42 import {
43 searchSettings,
@@ -117,9 +116,10 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
116 const navItems = SETTINGS_NAV_ITEMS.filter(
117 (item) => item.to !== "/settings/projects" || isSettingsOverviewVisible(scopeSearch),
118 );
120 - const { isMobile, setOpenMobile, open, setOpen } = useSidebar();
119 const searchInputRef = useRef<HTMLInputElement>(null);
120 const [query, setQuery] = useState("");
121 + // Below md the nav is an icon rail; searching expands it over the page.
122 + const [compactSearchOpen, setCompactSearchOpen] = useState(false);
123 const [activeResultIndex, setActiveResultIndex] = useState(0);
124 const searchableItems = useAvailableSettingsSearchItems(scopeSearch);
125 const results = searchSettings(query, searchableItems);
@@ -159,31 +159,26 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
159 target.tagName === "TEXTAREA" ||
160 target.isContentEditable)) ||
161 target.closest(
162 - '[role="dialog"], [aria-modal="true"], [data-slot$="popup"], [data-keybinding-capture]',
162 + '[role="dialog"]:not([data-app-modal]), [aria-modal="true"]:not([data-app-modal]), [data-slot$="popup"]:not([data-app-modal]), [data-keybinding-capture]',
163 ) !== null)
164 ) {
165 return;
166 }
167
168 event.preventDefault();
169 - if (isMobile) {
170 - setOpenMobile(true);
171 - } else if (!open) {
172 - setOpen(true);
173 - }
174 - requestAnimationFrame(() => {
175 - searchInputRef.current?.focus();
176 - searchInputRef.current?.select();
177 - });
169 + setCompactSearchOpen(true);
170 + searchInputRef.current?.focus();
171 + searchInputRef.current?.select();
172 };
173 window.addEventListener("keydown", handleKeyDown);
174 return () => window.removeEventListener("keydown", handleKeyDown);
181 - }, [isMobile, open, setOpen, setOpenMobile]);
175 + }, []);
176 +
177 + useEffect(() => {
178 + if (compactSearchOpen) searchInputRef.current?.focus();
179 + }, [compactSearchOpen]);
180
181 const handleSectionClick = (to: SettingsPath) => {
184 - if (isMobile) {
185 - setOpenMobile(false);
186 - }
182 void navigate({
183 to,
184 hash: "",
@@ -198,9 +193,7 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
193 };
194 const handleSearchResultClick = (item: SettingsSearchItem) => {
195 clearSearch();
201 - if (isMobile) {
202 - setOpenMobile(false);
203 - }
196 + setCompactSearchOpen(false);
197 const targetId = item.targetId ?? item.id;
198 if (pathname === item.to && currentHash.replace(/^#/, "") === targetId) {
199 scrollToSettingsTarget(targetId);
@@ -241,11 +234,23 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
234 };
235
236 return (
244 - <>
237 + <nav
238 + aria-label="Settings sections"
239 + className={cn(
240 + "flex w-60 shrink-0 flex-col border-e bg-sidebar text-sidebar-foreground max-md:w-14",
241 + compactSearchOpen &&
242 + "max-md:absolute max-md:inset-y-0 max-md:start-0 max-md:z-10 max-md:w-full",
243 + )}
244 + >
245 <SidebarContent className="overflow-x-hidden">
246 <SidebarGroup>
247 <div className="flex flex-col gap-2">
248 - <div className="flex h-8 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground">
248 + <div
249 + className={cn(
250 + "flex h-8 items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-sidebar-muted-foreground hover:bg-sidebar-row-hover hover:text-sidebar-foreground",
251 + !compactSearchOpen && "max-md:hidden",
252 + )}
253 + >
254 <SearchIcon className="size-4 shrink-0 text-sidebar-muted-foreground/80" />
255 <SidebarInput
256 ref={searchInputRef}
@@ -257,6 +262,10 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
262 setActiveResultIndex(0);
263 }}
264 onKeyDown={handleSearchKeyDown}
265 + onFocus={() => setCompactSearchOpen(true)}
266 + onBlur={() => {
267 + if (!isSearching) setCompactSearchOpen(false);
268 + }}
269 placeholder="Search"
270 aria-label="Search settings"
271 role="combobox"
@@ -330,6 +339,16 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
339 </SidebarMenu>
340 ) : (
341 <SidebarMenu>
342 + {compactSearchOpen ? null : (
343 + <SidebarMenuItem className="md:hidden">
344 + <SidebarMenuButton
345 + aria-label="Search settings"
346 + onClick={() => setCompactSearchOpen(true)}
347 + >
348 + <SearchIcon />
349 + </SidebarMenuButton>
350 + </SidebarMenuItem>
351 + )}
352 {navItems.map((item) => {
353 const Icon = item.icon;
354 const isGeneralDetailPage =
@@ -346,7 +365,9 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
365 onClick={() => handleSectionClick(item.to)}
366 >
367 <Icon />
349 - <span className="truncate">{item.label}</span>
368 + <span className={cn("truncate", !compactSearchOpen && "max-md:sr-only")}>
369 + {item.label}
370 + </span>
371 </SidebarMenuButton>
372 </SidebarMenuItem>
373 );
@@ -356,19 +377,14 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
377 </div>
378 </SidebarGroup>
379 </SidebarContent>
359 - <SidebarFooter>
380 + <SidebarFooter className="max-md:hidden">
381 <Suspense fallback={null}>
382 <T3ConnectSidebarSignIn />
383 </Suspense>
363 - <div className="flex items-center gap-1">
364 - <div className="min-w-0 flex-1">
365 - <SidebarUtilityMenu />
366 - </div>
367 - <Suspense fallback={null}>
368 - <T3ConnectSidebarAvatar />
369 - </Suspense>
370 - </div>
384 + <Suspense fallback={null}>
385 + <T3ConnectSidebarAvatar />
386 + </Suspense>
387 </SidebarFooter>
372 - </>
388 + </nav>
389 );
390 }
apps/web/src/components/sidebar/SidebarChrome.tsx
+1 -1
@@ -156,7 +156,7 @@ function SidebarUtilityItem({
156 );
157 }
158
159 -export const SidebarUtilityMenu = memo(function SidebarUtilityMenu() {
159 +const SidebarUtilityMenu = memo(function SidebarUtilityMenu() {
160 const navigate = useNavigate();
161 const navigateToMainApp = useNavigateToMainApp();
162 const { isMobile, setOpenMobile } = useSidebar();
apps/web/src/components/sidebar/mainAppLocation.ts
+19 -12
@@ -1,25 +1,26 @@
1 import { useLocation, useNavigate } from "@tanstack/react-router";
2 import { useEffect } from "react";
3
4 +/** Settings and Usage open as modals over the last main-app view. */
5 +export function isAppModalPage(pathname: string) {
6 + return pathname === "/settings" || pathname.startsWith("/settings/") || pathname === "/usage";
7 +}
8 +
9 export function isSidebarUtilityPage(pathname: string) {
5 - return (
6 - pathname === "/settings" ||
7 - pathname.startsWith("/settings/") ||
8 - pathname.startsWith("/projects/") ||
9 - pathname === "/usage" ||
10 - pathname === "/pull-requests"
11 - );
10 + return pathname.startsWith("/projects/") || pathname === "/pull-requests";
11 }
12
13 let mainAppHref: string | null = null;
14 +let appModalReturnHref: string | null = null;
15
16 export function MainAppLocationTracker() {
17 - const href = useLocation({
18 - select: (location) => (isSidebarUtilityPage(location.pathname) ? null : location.href),
19 - });
17 + const href = useLocation({ select: (location) => location.href });
18 + const pathname = useLocation({ select: (location) => location.pathname });
19 useEffect(() => {
21 - if (href !== null) mainAppHref = href;
22 - }, [href]);
20 + if (isAppModalPage(pathname)) return;
21 + appModalReturnHref = href;
22 + if (!isSidebarUtilityPage(pathname)) mainAppHref = href;
23 + }, [href, pathname]);
24 return null;
25 }
26
@@ -27,3 +28,9 @@ export function useNavigateToMainApp() {
28 const navigate = useNavigate();
29 return () => navigate({ href: mainAppHref ?? "/" });
30 }
31 +
32 +/** Leaves Settings or Usage for the page that opened it. */
33 +export function useCloseAppModal() {
34 + const navigate = useNavigate();
35 + return () => navigate({ href: appModalReturnHref ?? mainAppHref ?? "/" });
36 +}
apps/web/src/components/usage/UsagePage.tsx
+7 -10
@@ -33,7 +33,6 @@ import {
33 type MergedUsage,
34 } from "@t3tools/shared/usageMerge";
35
36 -import { isElectron } from "../../env";
36 import { cn } from "../../lib/utils";
37 import { usePrimarySettings } from "../../hooks/useSettings";
38 import { resolveHour12 } from "../../timestampFormat";
@@ -70,7 +69,7 @@ import {
69 } from "../ui/menu";
70 import { ScrollArea } from "../ui/scroll-area";
71 import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select";
73 -import { SidebarInset } from "../ui/sidebar";
72 +import { AppRouteModal, AppRouteModalClose } from "../AppRouteModal";
73 import { Skeleton } from "../ui/skeleton";
74 import { Toggle, ToggleGroup } from "../ui/toggle-group";
75 import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
@@ -82,7 +81,6 @@ import {
81 WorkspaceBreadcrumbText,
82 } from "../WorkspaceBreadcrumb";
83 import { WorkspacePageContainer } from "../WorkspacePageContainer";
85 -import { WorkspacePageHeader } from "../WorkspacePageHeader";
84 import { UsageLimitsSection } from "./UsageLimits";
85 import { UsagePriceOverrides } from "./UsagePriceOverrides";
86 import { UsageProviderChart } from "./UsageProviderChart";
@@ -101,7 +99,6 @@ import {
99 resolveUsageShortcut,
100 type UsageMetric,
101 } from "./usageShortcuts";
104 -import { useEscapeToGoBack } from "../../hooks/useNavigateBack";
102 import { PROVIDER_ORDER, PROVIDER_PRESENTATION, providersWithUsage } from "./usageProviders";
103 import {
104 readUsagePagePreferences,
@@ -177,7 +174,6 @@ function UsageModelDialogHost({
174
175 export function UsagePage() {
176 const [preferences, setPreferences] = useState(readUsagePagePreferences);
180 - useEscapeToGoBack();
177 const keybindings = useAtomValue(primaryServerKeybindingsAtom);
178 const hour12 = usePrimarySettings((settings) => resolveHour12(settings.timestampFormat));
179 const shortcutTitle = (
@@ -504,11 +500,12 @@ export function UsagePage() {
500 );
501
502 return (
507 - <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none isolate">
508 - <div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
509 - <WorkspacePageHeader electron={isElectron} className="@container/usage-header">
503 + <AppRouteModal label="Usage">
504 + <div className="flex min-h-0 min-w-0 flex-1 flex-col">
505 + <header className="@container/usage-header flex min-h-12 shrink-0 items-center gap-1 border-b ps-5 pe-2">
506 {topbarContent}
511 - </WorkspacePageHeader>
507 + <AppRouteModalClose />
508 + </header>
509
510 <ScrollArea className="min-h-0 flex-1">
511 <WorkspacePageContainer width="wide">
@@ -596,7 +593,7 @@ export function UsagePage() {
593 }}
594 />
595 ) : null}
599 - </SidebarInset>
596 + </AppRouteModal>
597 );
598 }
599
apps/web/src/components/usage/usageShortcuts.ts
+3 -1
@@ -27,7 +27,9 @@ export function resolveUsageShortcut(
27 target.tagName === "TEXTAREA" ||
28 target.tagName === "SELECT" ||
29 target.isContentEditable ||
30 - target.closest('[role="dialog"], [aria-modal="true"], [data-slot$="popup"]'))
30 + target.closest(
31 + '[role="dialog"]:not([data-app-modal]), [aria-modal="true"]:not([data-app-modal]), [data-slot$="popup"]:not([data-app-modal])',
32 + ))
33 ) {
34 return null;
35 }
apps/web/src/routeTree.gen.ts
+301 -298
@@ -10,32 +10,32 @@
10
11 import { Route as rootRouteImport } from './routes/__root'
12 import { Route as WelcomeRouteImport } from './routes/welcome'
13 -import { Route as UsageRouteImport } from './routes/usage'
14 -import { Route as SettingsRouteImport } from './routes/settings'
13 import { Route as PairRouteImport } from './routes/pair'
14 import { Route as GuestRouteImport } from './routes/guest'
15 import { Route as ConnectAgentRouteImport } from './routes/connect-agent'
16 import { Route as ConnectRouteImport } from './routes/connect'
17 import { Route as ChatRouteImport } from './routes/_chat'
18 import { Route as ChatIndexRouteImport } from './routes/_chat.index'
21 -import { Route as SettingsStorageRouteImport } from './routes/settings.storage'
22 -import { Route as SettingsSourceControlRouteImport } from './routes/settings.source-control'
23 -import { Route as SettingsSnapShotRouteImport } from './routes/settings.snap-shot'
24 -import { Route as SettingsScheduledTasksRouteImport } from './routes/settings.scheduled-tasks'
25 -import { Route as SettingsProvidersRouteImport } from './routes/settings.providers'
26 -import { Route as SettingsProjectsRouteImport } from './routes/settings.projects'
27 -import { Route as SettingsOpenSourceLicensesRouteImport } from './routes/settings.open-source-licenses'
28 -import { Route as SettingsKeybindingsRouteImport } from './routes/settings.keybindings'
29 -import { Route as SettingsIntegrationsRouteImport } from './routes/settings.integrations'
30 -import { Route as SettingsGeneralRouteImport } from './routes/settings.general'
31 -import { Route as SettingsDiagnosticsRouteImport } from './routes/settings.diagnostics'
32 -import { Route as SettingsConnectionsRouteImport } from './routes/settings.connections'
33 -import { Route as SettingsBetaRouteImport } from './routes/settings.beta'
34 -import { Route as SettingsArchivedRouteImport } from './routes/settings.archived'
35 -import { Route as SettingsAppearanceRouteImport } from './routes/settings.appearance'
19 import { Route as ProjectsProjectKeyRouteImport } from './routes/projects.$projectKey'
20 +import { Route as ChatUsageRouteImport } from './routes/_chat.usage'
21 +import { Route as ChatSettingsRouteImport } from './routes/_chat.settings'
22 import { Route as ChatPullRequestsRouteImport } from './routes/_chat.pull-requests'
23 import { Route as ChatNewRouteImport } from './routes/_chat.new'
24 +import { Route as ChatSettingsStorageRouteImport } from './routes/_chat.settings.storage'
25 +import { Route as ChatSettingsSourceControlRouteImport } from './routes/_chat.settings.source-control'
26 +import { Route as ChatSettingsSnapShotRouteImport } from './routes/_chat.settings.snap-shot'
27 +import { Route as ChatSettingsScheduledTasksRouteImport } from './routes/_chat.settings.scheduled-tasks'
28 +import { Route as ChatSettingsProvidersRouteImport } from './routes/_chat.settings.providers'
29 +import { Route as ChatSettingsProjectsRouteImport } from './routes/_chat.settings.projects'
30 +import { Route as ChatSettingsOpenSourceLicensesRouteImport } from './routes/_chat.settings.open-source-licenses'
31 +import { Route as ChatSettingsKeybindingsRouteImport } from './routes/_chat.settings.keybindings'
32 +import { Route as ChatSettingsIntegrationsRouteImport } from './routes/_chat.settings.integrations'
33 +import { Route as ChatSettingsGeneralRouteImport } from './routes/_chat.settings.general'
34 +import { Route as ChatSettingsDiagnosticsRouteImport } from './routes/_chat.settings.diagnostics'
35 +import { Route as ChatSettingsConnectionsRouteImport } from './routes/_chat.settings.connections'
36 +import { Route as ChatSettingsBetaRouteImport } from './routes/_chat.settings.beta'
37 +import { Route as ChatSettingsArchivedRouteImport } from './routes/_chat.settings.archived'
38 +import { Route as ChatSettingsAppearanceRouteImport } from './routes/_chat.settings.appearance'
39 import { Route as ChatDraftDraftIdRouteImport } from './routes/_chat.draft.$draftId'
40 import { Route as ChatEnvironmentIdThreadIdRouteImport } from './routes/_chat.$environmentId.$threadId'
41
@@ -44,16 +44,6 @@ const WelcomeRoute = WelcomeRouteImport.update({
44 path: '/welcome',
45 getParentRoute: () => rootRouteImport,
46 } as any)
47 -const UsageRoute = UsageRouteImport.update({
48 - id: '/usage',
49 - path: '/usage',
50 - getParentRoute: () => rootRouteImport,
51 -} as any)
52 -const SettingsRoute = SettingsRouteImport.update({
53 - id: '/settings',
54 - path: '/settings',
55 - getParentRoute: () => rootRouteImport,
56 -} as any)
47 const PairRoute = PairRouteImport.update({
48 id: '/pair',
49 path: '/pair',
@@ -83,96 +73,109 @@ const ChatIndexRoute = ChatIndexRouteImport.update({
73 path: '/',
74 getParentRoute: () => ChatRoute,
75 } as any)
86 -const SettingsStorageRoute = SettingsStorageRouteImport.update({
76 +const ProjectsProjectKeyRoute = ProjectsProjectKeyRouteImport.update({
77 + id: '/projects/$projectKey',
78 + path: '/projects/$projectKey',
79 + getParentRoute: () => rootRouteImport,
80 +} as any)
81 +const ChatUsageRoute = ChatUsageRouteImport.update({
82 + id: '/usage',
83 + path: '/usage',
84 + getParentRoute: () => ChatRoute,
85 +} as any)
86 +const ChatSettingsRoute = ChatSettingsRouteImport.update({
87 + id: '/settings',
88 + path: '/settings',
89 + getParentRoute: () => ChatRoute,
90 +} as any)
91 +const ChatPullRequestsRoute = ChatPullRequestsRouteImport.update({
92 + id: '/pull-requests',
93 + path: '/pull-requests',
94 + getParentRoute: () => ChatRoute,
95 +} as any)
96 +const ChatNewRoute = ChatNewRouteImport.update({
97 + id: '/new',
98 + path: '/new',
99 + getParentRoute: () => ChatRoute,
100 +} as any)
101 +const ChatSettingsStorageRoute = ChatSettingsStorageRouteImport.update({
102 id: '/storage',
103 path: '/storage',
89 - getParentRoute: () => SettingsRoute,
90 -} as any)
91 -const SettingsSourceControlRoute = SettingsSourceControlRouteImport.update({
92 - id: '/source-control',
93 - path: '/source-control',
94 - getParentRoute: () => SettingsRoute,
104 + getParentRoute: () => ChatSettingsRoute,
105 } as any)
96 -const SettingsSnapShotRoute = SettingsSnapShotRouteImport.update({
106 +const ChatSettingsSourceControlRoute =
107 + ChatSettingsSourceControlRouteImport.update({
108 + id: '/source-control',
109 + path: '/source-control',
110 + getParentRoute: () => ChatSettingsRoute,
111 + } as any)
112 +const ChatSettingsSnapShotRoute = ChatSettingsSnapShotRouteImport.update({
113 id: '/snap-shot',
114 path: '/snap-shot',
99 - getParentRoute: () => SettingsRoute,
115 + getParentRoute: () => ChatSettingsRoute,
116 } as any)
101 -const SettingsScheduledTasksRoute = SettingsScheduledTasksRouteImport.update({
102 - id: '/scheduled-tasks',
103 - path: '/scheduled-tasks',
104 - getParentRoute: () => SettingsRoute,
105 -} as any)
106 -const SettingsProvidersRoute = SettingsProvidersRouteImport.update({
117 +const ChatSettingsScheduledTasksRoute =
118 + ChatSettingsScheduledTasksRouteImport.update({
119 + id: '/scheduled-tasks',
120 + path: '/scheduled-tasks',
121 + getParentRoute: () => ChatSettingsRoute,
122 + } as any)
123 +const ChatSettingsProvidersRoute = ChatSettingsProvidersRouteImport.update({
124 id: '/providers',
125 path: '/providers',
109 - getParentRoute: () => SettingsRoute,
126 + getParentRoute: () => ChatSettingsRoute,
127 } as any)
111 -const SettingsProjectsRoute = SettingsProjectsRouteImport.update({
128 +const ChatSettingsProjectsRoute = ChatSettingsProjectsRouteImport.update({
129 id: '/projects',
130 path: '/projects',
114 - getParentRoute: () => SettingsRoute,
131 + getParentRoute: () => ChatSettingsRoute,
132 } as any)
116 -const SettingsOpenSourceLicensesRoute =
117 - SettingsOpenSourceLicensesRouteImport.update({
133 +const ChatSettingsOpenSourceLicensesRoute =
134 + ChatSettingsOpenSourceLicensesRouteImport.update({
135 id: '/open-source-licenses',
136 path: '/open-source-licenses',
120 - getParentRoute: () => SettingsRoute,
137 + getParentRoute: () => ChatSettingsRoute,
138 } as any)
122 -const SettingsKeybindingsRoute = SettingsKeybindingsRouteImport.update({
139 +const ChatSettingsKeybindingsRoute = ChatSettingsKeybindingsRouteImport.update({
140 id: '/keybindings',
141 path: '/keybindings',
125 - getParentRoute: () => SettingsRoute,
142 + getParentRoute: () => ChatSettingsRoute,
143 } as any)
127 -const SettingsIntegrationsRoute = SettingsIntegrationsRouteImport.update({
128 - id: '/integrations',
129 - path: '/integrations',
130 - getParentRoute: () => SettingsRoute,
131 -} as any)
132 -const SettingsGeneralRoute = SettingsGeneralRouteImport.update({
144 +const ChatSettingsIntegrationsRoute =
145 + ChatSettingsIntegrationsRouteImport.update({
146 + id: '/integrations',
147 + path: '/integrations',
148 + getParentRoute: () => ChatSettingsRoute,
149 + } as any)
150 +const ChatSettingsGeneralRoute = ChatSettingsGeneralRouteImport.update({
151 id: '/general',
152 path: '/general',
135 - getParentRoute: () => SettingsRoute,
153 + getParentRoute: () => ChatSettingsRoute,
154 } as any)
137 -const SettingsDiagnosticsRoute = SettingsDiagnosticsRouteImport.update({
155 +const ChatSettingsDiagnosticsRoute = ChatSettingsDiagnosticsRouteImport.update({
156 id: '/diagnostics',
157 path: '/diagnostics',
140 - getParentRoute: () => SettingsRoute,
158 + getParentRoute: () => ChatSettingsRoute,
159 } as any)
142 -const SettingsConnectionsRoute = SettingsConnectionsRouteImport.update({
160 +const ChatSettingsConnectionsRoute = ChatSettingsConnectionsRouteImport.update({
161 id: '/connections',
162 path: '/connections',
145 - getParentRoute: () => SettingsRoute,
163 + getParentRoute: () => ChatSettingsRoute,
164 } as any)
147 -const SettingsBetaRoute = SettingsBetaRouteImport.update({
165 +const ChatSettingsBetaRoute = ChatSettingsBetaRouteImport.update({
166 id: '/beta',
167 path: '/beta',
150 - getParentRoute: () => SettingsRoute,
168 + getParentRoute: () => ChatSettingsRoute,
169 } as any)
152 -const SettingsArchivedRoute = SettingsArchivedRouteImport.update({
170 +const ChatSettingsArchivedRoute = ChatSettingsArchivedRouteImport.update({
171 id: '/archived',
172 path: '/archived',
155 - getParentRoute: () => SettingsRoute,
173 + getParentRoute: () => ChatSettingsRoute,
174 } as any)
157 -const SettingsAppearanceRoute = SettingsAppearanceRouteImport.update({
175 +const ChatSettingsAppearanceRoute = ChatSettingsAppearanceRouteImport.update({
176 id: '/appearance',
177 path: '/appearance',
160 - getParentRoute: () => SettingsRoute,
161 -} as any)
162 -const ProjectsProjectKeyRoute = ProjectsProjectKeyRouteImport.update({
163 - id: '/projects/$projectKey',
164 - path: '/projects/$projectKey',
165 - getParentRoute: () => rootRouteImport,
166 -} as any)
167 -const ChatPullRequestsRoute = ChatPullRequestsRouteImport.update({
168 - id: '/pull-requests',
169 - path: '/pull-requests',
170 - getParentRoute: () => ChatRoute,
171 -} as any)
172 -const ChatNewRoute = ChatNewRouteImport.update({
173 - id: '/new',
174 - path: '/new',
175 - getParentRoute: () => ChatRoute,
178 + getParentRoute: () => ChatSettingsRoute,
179 } as any)
180 const ChatDraftDraftIdRoute = ChatDraftDraftIdRouteImport.update({
181 id: '/draft/$draftId',
@@ -192,59 +195,59 @@ export interface FileRoutesByFullPath {
195 '/connect-agent': typeof ConnectAgentRoute
196 '/guest': typeof GuestRoute
197 '/pair': typeof PairRoute
195 - '/settings': typeof SettingsRouteWithChildren
196 - '/usage': typeof UsageRoute
198 '/welcome': typeof WelcomeRoute
199 '/new': typeof ChatNewRoute
200 '/pull-requests': typeof ChatPullRequestsRoute
201 + '/settings': typeof ChatSettingsRouteWithChildren
202 + '/usage': typeof ChatUsageRoute
203 '/projects/$projectKey': typeof ProjectsProjectKeyRoute
201 - '/settings/appearance': typeof SettingsAppearanceRoute
202 - '/settings/archived': typeof SettingsArchivedRoute
203 - '/settings/beta': typeof SettingsBetaRoute
204 - '/settings/connections': typeof SettingsConnectionsRoute
205 - '/settings/diagnostics': typeof SettingsDiagnosticsRoute
206 - '/settings/general': typeof SettingsGeneralRoute
207 - '/settings/integrations': typeof SettingsIntegrationsRoute
208 - '/settings/keybindings': typeof SettingsKeybindingsRoute
209 - '/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
210 - '/settings/projects': typeof SettingsProjectsRoute
211 - '/settings/providers': typeof SettingsProvidersRoute
212 - '/settings/scheduled-tasks': typeof SettingsScheduledTasksRoute
213 - '/settings/snap-shot': typeof SettingsSnapShotRoute
214 - '/settings/source-control': typeof SettingsSourceControlRoute
215 - '/settings/storage': typeof SettingsStorageRoute
204 '/$environmentId/$threadId': typeof ChatEnvironmentIdThreadIdRoute
205 '/draft/$draftId': typeof ChatDraftDraftIdRoute
206 + '/settings/appearance': typeof ChatSettingsAppearanceRoute
207 + '/settings/archived': typeof ChatSettingsArchivedRoute
208 + '/settings/beta': typeof ChatSettingsBetaRoute
209 + '/settings/connections': typeof ChatSettingsConnectionsRoute
210 + '/settings/diagnostics': typeof ChatSettingsDiagnosticsRoute
211 + '/settings/general': typeof ChatSettingsGeneralRoute
212 + '/settings/integrations': typeof ChatSettingsIntegrationsRoute
213 + '/settings/keybindings': typeof ChatSettingsKeybindingsRoute
214 + '/settings/open-source-licenses': typeof ChatSettingsOpenSourceLicensesRoute
215 + '/settings/projects': typeof ChatSettingsProjectsRoute
216 + '/settings/providers': typeof ChatSettingsProvidersRoute
217 + '/settings/scheduled-tasks': typeof ChatSettingsScheduledTasksRoute
218 + '/settings/snap-shot': typeof ChatSettingsSnapShotRoute
219 + '/settings/source-control': typeof ChatSettingsSourceControlRoute
220 + '/settings/storage': typeof ChatSettingsStorageRoute
221 }
222 export interface FileRoutesByTo {
223 '/connect': typeof ConnectRoute
224 '/connect-agent': typeof ConnectAgentRoute
225 '/guest': typeof GuestRoute
226 '/pair': typeof PairRoute
224 - '/settings': typeof SettingsRouteWithChildren
225 - '/usage': typeof UsageRoute
227 '/welcome': typeof WelcomeRoute
228 '/new': typeof ChatNewRoute
229 '/pull-requests': typeof ChatPullRequestsRoute
230 + '/settings': typeof ChatSettingsRouteWithChildren
231 + '/usage': typeof ChatUsageRoute
232 '/projects/$projectKey': typeof ProjectsProjectKeyRoute
230 - '/settings/appearance': typeof SettingsAppearanceRoute
231 - '/settings/archived': typeof SettingsArchivedRoute
232 - '/settings/beta': typeof SettingsBetaRoute
233 - '/settings/connections': typeof SettingsConnectionsRoute
234 - '/settings/diagnostics': typeof SettingsDiagnosticsRoute
235 - '/settings/general': typeof SettingsGeneralRoute
236 - '/settings/integrations': typeof SettingsIntegrationsRoute
237 - '/settings/keybindings': typeof SettingsKeybindingsRoute
238 - '/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
239 - '/settings/projects': typeof SettingsProjectsRoute
240 - '/settings/providers': typeof SettingsProvidersRoute
241 - '/settings/scheduled-tasks': typeof SettingsScheduledTasksRoute
242 - '/settings/snap-shot': typeof SettingsSnapShotRoute
243 - '/settings/source-control': typeof SettingsSourceControlRoute
244 - '/settings/storage': typeof SettingsStorageRoute
233 '/': typeof ChatIndexRoute
234 '/$environmentId/$threadId': typeof ChatEnvironmentIdThreadIdRoute
235 '/draft/$draftId': typeof ChatDraftDraftIdRoute
236 + '/settings/appearance': typeof ChatSettingsAppearanceRoute
237 + '/settings/archived': typeof ChatSettingsArchivedRoute
238 + '/settings/beta': typeof ChatSettingsBetaRoute
239 + '/settings/connections': typeof ChatSettingsConnectionsRoute
240 + '/settings/diagnostics': typeof ChatSettingsDiagnosticsRoute
241 + '/settings/general': typeof ChatSettingsGeneralRoute
242 + '/settings/integrations': typeof ChatSettingsIntegrationsRoute
243 + '/settings/keybindings': typeof ChatSettingsKeybindingsRoute
244 + '/settings/open-source-licenses': typeof ChatSettingsOpenSourceLicensesRoute
245 + '/settings/projects': typeof ChatSettingsProjectsRoute
246 + '/settings/providers': typeof ChatSettingsProvidersRoute
247 + '/settings/scheduled-tasks': typeof ChatSettingsScheduledTasksRoute
248 + '/settings/snap-shot': typeof ChatSettingsSnapShotRoute
249 + '/settings/source-control': typeof ChatSettingsSourceControlRoute
250 + '/settings/storage': typeof ChatSettingsStorageRoute
251 }
252 export interface FileRoutesById {
253 __root__: typeof rootRouteImport
@@ -253,30 +256,30 @@ export interface FileRoutesById {
256 '/connect-agent': typeof ConnectAgentRoute
257 '/guest': typeof GuestRoute
258 '/pair': typeof PairRoute
256 - '/settings': typeof SettingsRouteWithChildren
257 - '/usage': typeof UsageRoute
259 '/welcome': typeof WelcomeRoute
260 '/_chat/new': typeof ChatNewRoute
261 '/_chat/pull-requests': typeof ChatPullRequestsRoute
262 + '/_chat/settings': typeof ChatSettingsRouteWithChildren
263 + '/_chat/usage': typeof ChatUsageRoute
264 '/projects/$projectKey': typeof ProjectsProjectKeyRoute
262 - '/settings/appearance': typeof SettingsAppearanceRoute
263 - '/settings/archived': typeof SettingsArchivedRoute
264 - '/settings/beta': typeof SettingsBetaRoute
265 - '/settings/connections': typeof SettingsConnectionsRoute
266 - '/settings/diagnostics': typeof SettingsDiagnosticsRoute
267 - '/settings/general': typeof SettingsGeneralRoute
268 - '/settings/integrations': typeof SettingsIntegrationsRoute
269 - '/settings/keybindings': typeof SettingsKeybindingsRoute
270 - '/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
271 - '/settings/projects': typeof SettingsProjectsRoute
272 - '/settings/providers': typeof SettingsProvidersRoute
273 - '/settings/scheduled-tasks': typeof SettingsScheduledTasksRoute
274 - '/settings/snap-shot': typeof SettingsSnapShotRoute
275 - '/settings/source-control': typeof SettingsSourceControlRoute
276 - '/settings/storage': typeof SettingsStorageRoute
265 '/_chat/': typeof ChatIndexRoute
266 '/_chat/$environmentId/$threadId': typeof ChatEnvironmentIdThreadIdRoute
267 '/_chat/draft/$draftId': typeof ChatDraftDraftIdRoute
268 + '/_chat/settings/appearance': typeof ChatSettingsAppearanceRoute
269 + '/_chat/settings/archived': typeof ChatSettingsArchivedRoute
270 + '/_chat/settings/beta': typeof ChatSettingsBetaRoute
271 + '/_chat/settings/connections': typeof ChatSettingsConnectionsRoute
272 + '/_chat/settings/diagnostics': typeof ChatSettingsDiagnosticsRoute
273 + '/_chat/settings/general': typeof ChatSettingsGeneralRoute
274 + '/_chat/settings/integrations': typeof ChatSettingsIntegrationsRoute
275 + '/_chat/settings/keybindings': typeof ChatSettingsKeybindingsRoute
276 + '/_chat/settings/open-source-licenses': typeof ChatSettingsOpenSourceLicensesRoute
277 + '/_chat/settings/projects': typeof ChatSettingsProjectsRoute
278 + '/_chat/settings/providers': typeof ChatSettingsProvidersRoute
279 + '/_chat/settings/scheduled-tasks': typeof ChatSettingsScheduledTasksRoute
280 + '/_chat/settings/snap-shot': typeof ChatSettingsSnapShotRoute
281 + '/_chat/settings/source-control': typeof ChatSettingsSourceControlRoute
282 + '/_chat/settings/storage': typeof ChatSettingsStorageRoute
283 }
284 export interface FileRouteTypes {
285 fileRoutesByFullPath: FileRoutesByFullPath
@@ -286,12 +289,14 @@ export interface FileRouteTypes {
289 | '/connect-agent'
290 | '/guest'
291 | '/pair'
289 - | '/settings'
290 - | '/usage'
292 | '/welcome'
293 | '/new'
294 | '/pull-requests'
295 + | '/settings'
296 + | '/usage'
297 | '/projects/$projectKey'
298 + | '/$environmentId/$threadId'
299 + | '/draft/$draftId'
300 | '/settings/appearance'
301 | '/settings/archived'
302 | '/settings/beta'
@@ -307,20 +312,21 @@ export interface FileRouteTypes {
312 | '/settings/snap-shot'
313 | '/settings/source-control'
314 | '/settings/storage'
310 - | '/$environmentId/$threadId'
311 - | '/draft/$draftId'
315 fileRoutesByTo: FileRoutesByTo
316 to:
317 | '/connect'
318 | '/connect-agent'
319 | '/guest'
320 | '/pair'
318 - | '/settings'
319 - | '/usage'
321 | '/welcome'
322 | '/new'
323 | '/pull-requests'
324 + | '/settings'
325 + | '/usage'
326 | '/projects/$projectKey'
327 + | '/'
328 + | '/$environmentId/$threadId'
329 + | '/draft/$draftId'
330 | '/settings/appearance'
331 | '/settings/archived'
332 | '/settings/beta'
@@ -336,9 +342,6 @@ export interface FileRouteTypes {
342 | '/settings/snap-shot'
343 | '/settings/source-control'
344 | '/settings/storage'
339 - | '/'
340 - | '/$environmentId/$threadId'
341 - | '/draft/$draftId'
345 id:
346 | '__root__'
347 | '/_chat'
@@ -346,30 +349,30 @@ export interface FileRouteTypes {
349 | '/connect-agent'
350 | '/guest'
351 | '/pair'
349 - | '/settings'
350 - | '/usage'
352 | '/welcome'
353 | '/_chat/new'
354 | '/_chat/pull-requests'
355 + | '/_chat/settings'
356 + | '/_chat/usage'
357 | '/projects/$projectKey'
355 - | '/settings/appearance'
356 - | '/settings/archived'
357 - | '/settings/beta'
358 - | '/settings/connections'
359 - | '/settings/diagnostics'
360 - | '/settings/general'
361 - | '/settings/integrations'
362 - | '/settings/keybindings'
363 - | '/settings/open-source-licenses'
364 - | '/settings/projects'
365 - | '/settings/providers'
366 - | '/settings/scheduled-tasks'
367 - | '/settings/snap-shot'
368 - | '/settings/source-control'
369 - | '/settings/storage'
358 | '/_chat/'
359 | '/_chat/$environmentId/$threadId'
360 | '/_chat/draft/$draftId'
361 + | '/_chat/settings/appearance'
362 + | '/_chat/settings/archived'
363 + | '/_chat/settings/beta'
364 + | '/_chat/settings/connections'
365 + | '/_chat/settings/diagnostics'
366 + | '/_chat/settings/general'
367 + | '/_chat/settings/integrations'
368 + | '/_chat/settings/keybindings'
369 + | '/_chat/settings/open-source-licenses'
370 + | '/_chat/settings/projects'
371 + | '/_chat/settings/providers'
372 + | '/_chat/settings/scheduled-tasks'
373 + | '/_chat/settings/snap-shot'
374 + | '/_chat/settings/source-control'
375 + | '/_chat/settings/storage'
376 fileRoutesById: FileRoutesById
377 }
378 export interface RootRouteChildren {
@@ -378,8 +381,6 @@ export interface RootRouteChildren {
381 ConnectAgentRoute: typeof ConnectAgentRoute
382 GuestRoute: typeof GuestRoute
383 PairRoute: typeof PairRoute
381 - SettingsRoute: typeof SettingsRouteWithChildren
382 - UsageRoute: typeof UsageRoute
384 WelcomeRoute: typeof WelcomeRoute
385 ProjectsProjectKeyRoute: typeof ProjectsProjectKeyRoute
386 }
@@ -393,20 +394,6 @@ declare module '@tanstack/react-router' {
394 preLoaderRoute: typeof WelcomeRouteImport
395 parentRoute: typeof rootRouteImport
396 }
396 - '/usage': {
397 - id: '/usage'
398 - path: '/usage'
399 - fullPath: '/usage'
400 - preLoaderRoute: typeof UsageRouteImport
401 - parentRoute: typeof rootRouteImport
402 - }
403 - '/settings': {
404 - id: '/settings'
405 - path: '/settings'
406 - fullPath: '/settings'
407 - preLoaderRoute: typeof SettingsRouteImport
408 - parentRoute: typeof rootRouteImport
409 - }
397 '/pair': {
398 id: '/pair'
399 path: '/pair'
@@ -449,131 +436,145 @@ declare module '@tanstack/react-router' {
436 preLoaderRoute: typeof ChatIndexRouteImport
437 parentRoute: typeof ChatRoute
438 }
452 - '/settings/storage': {
453 - id: '/settings/storage'
439 + '/projects/$projectKey': {
440 + id: '/projects/$projectKey'
441 + path: '/projects/$projectKey'
442 + fullPath: '/projects/$projectKey'
443 + preLoaderRoute: typeof ProjectsProjectKeyRouteImport
444 + parentRoute: typeof rootRouteImport
445 + }
446 + '/_chat/usage': {
447 + id: '/_chat/usage'
448 + path: '/usage'
449 + fullPath: '/usage'
450 + preLoaderRoute: typeof ChatUsageRouteImport
451 + parentRoute: typeof ChatRoute
452 + }
453 + '/_chat/settings': {
454 + id: '/_chat/settings'
455 + path: '/settings'
456 + fullPath: '/settings'
457 + preLoaderRoute: typeof ChatSettingsRouteImport
458 + parentRoute: typeof ChatRoute
459 + }
460 + '/_chat/pull-requests': {
461 + id: '/_chat/pull-requests'
462 + path: '/pull-requests'
463 + fullPath: '/pull-requests'
464 + preLoaderRoute: typeof ChatPullRequestsRouteImport
465 + parentRoute: typeof ChatRoute
466 + }
467 + '/_chat/new': {
468 + id: '/_chat/new'
469 + path: '/new'
470 + fullPath: '/new'
471 + preLoaderRoute: typeof ChatNewRouteImport
472 + parentRoute: typeof ChatRoute
473 + }
474 + '/_chat/settings/storage': {
475 + id: '/_chat/settings/storage'
476 path: '/storage'
477 fullPath: '/settings/storage'
456 - preLoaderRoute: typeof SettingsStorageRouteImport
457 - parentRoute: typeof SettingsRoute
478 + preLoaderRoute: typeof ChatSettingsStorageRouteImport
479 + parentRoute: typeof ChatSettingsRoute
480 }
459 - '/settings/source-control': {
460 - id: '/settings/source-control'
481 + '/_chat/settings/source-control': {
482 + id: '/_chat/settings/source-control'
483 path: '/source-control'
484 fullPath: '/settings/source-control'
463 - preLoaderRoute: typeof SettingsSourceControlRouteImport
464 - parentRoute: typeof SettingsRoute
485 + preLoaderRoute: typeof ChatSettingsSourceControlRouteImport
486 + parentRoute: typeof ChatSettingsRoute
487 }
466 - '/settings/snap-shot': {
467 - id: '/settings/snap-shot'
488 + '/_chat/settings/snap-shot': {
489 + id: '/_chat/settings/snap-shot'
490 path: '/snap-shot'
491 fullPath: '/settings/snap-shot'
470 - preLoaderRoute: typeof SettingsSnapShotRouteImport
471 - parentRoute: typeof SettingsRoute
492 + preLoaderRoute: typeof ChatSettingsSnapShotRouteImport
493 + parentRoute: typeof ChatSettingsRoute
494 }
473 - '/settings/scheduled-tasks': {
474 - id: '/settings/scheduled-tasks'
495 + '/_chat/settings/scheduled-tasks': {
496 + id: '/_chat/settings/scheduled-tasks'
497 path: '/scheduled-tasks'
498 fullPath: '/settings/scheduled-tasks'
477 - preLoaderRoute: typeof SettingsScheduledTasksRouteImport
478 - parentRoute: typeof SettingsRoute
499 + preLoaderRoute: typeof ChatSettingsScheduledTasksRouteImport
500 + parentRoute: typeof ChatSettingsRoute
501 }
480 - '/settings/providers': {
481 - id: '/settings/providers'
502 + '/_chat/settings/providers': {
503 + id: '/_chat/settings/providers'
504 path: '/providers'
505 fullPath: '/settings/providers'
484 - preLoaderRoute: typeof SettingsProvidersRouteImport
485 - parentRoute: typeof SettingsRoute
506 + preLoaderRoute: typeof ChatSettingsProvidersRouteImport
507 + parentRoute: typeof ChatSettingsRoute
508 }
487 - '/settings/projects': {
488 - id: '/settings/projects'
509 + '/_chat/settings/projects': {
510 + id: '/_chat/settings/projects'
511 path: '/projects'
512 fullPath: '/settings/projects'
491 - preLoaderRoute: typeof SettingsProjectsRouteImport
492 - parentRoute: typeof SettingsRoute
513 + preLoaderRoute: typeof ChatSettingsProjectsRouteImport
514 + parentRoute: typeof ChatSettingsRoute
515 }
494 - '/settings/open-source-licenses': {
495 - id: '/settings/open-source-licenses'
516 + '/_chat/settings/open-source-licenses': {
517 + id: '/_chat/settings/open-source-licenses'
518 path: '/open-source-licenses'
519 fullPath: '/settings/open-source-licenses'
498 - preLoaderRoute: typeof SettingsOpenSourceLicensesRouteImport
499 - parentRoute: typeof SettingsRoute
520 + preLoaderRoute: typeof ChatSettingsOpenSourceLicensesRouteImport
521 + parentRoute: typeof ChatSettingsRoute
522 }
501 - '/settings/keybindings': {
502 - id: '/settings/keybindings'
523 + '/_chat/settings/keybindings': {
524 + id: '/_chat/settings/keybindings'
525 path: '/keybindings'
526 fullPath: '/settings/keybindings'
505 - preLoaderRoute: typeof SettingsKeybindingsRouteImport
506 - parentRoute: typeof SettingsRoute
527 + preLoaderRoute: typeof ChatSettingsKeybindingsRouteImport
528 + parentRoute: typeof ChatSettingsRoute
529 }
508 - '/settings/integrations': {
509 - id: '/settings/integrations'
530 + '/_chat/settings/integrations': {
531 + id: '/_chat/settings/integrations'
532 path: '/integrations'
533 fullPath: '/settings/integrations'
512 - preLoaderRoute: typeof SettingsIntegrationsRouteImport
513 - parentRoute: typeof SettingsRoute
534 + preLoaderRoute: typeof ChatSettingsIntegrationsRouteImport
535 + parentRoute: typeof ChatSettingsRoute
536 }
515 - '/settings/general': {
516 - id: '/settings/general'
537 + '/_chat/settings/general': {
538 + id: '/_chat/settings/general'
539 path: '/general'
540 fullPath: '/settings/general'
519 - preLoaderRoute: typeof SettingsGeneralRouteImport
520 - parentRoute: typeof SettingsRoute
541 + preLoaderRoute: typeof ChatSettingsGeneralRouteImport
542 + parentRoute: typeof ChatSettingsRoute
543 }
522 - '/settings/diagnostics': {
523 - id: '/settings/diagnostics'
544 + '/_chat/settings/diagnostics': {
545 + id: '/_chat/settings/diagnostics'
546 path: '/diagnostics'
547 fullPath: '/settings/diagnostics'
526 - preLoaderRoute: typeof SettingsDiagnosticsRouteImport
527 - parentRoute: typeof SettingsRoute
548 + preLoaderRoute: typeof ChatSettingsDiagnosticsRouteImport
549 + parentRoute: typeof ChatSettingsRoute
550 }
529 - '/settings/connections': {
530 - id: '/settings/connections'
551 + '/_chat/settings/connections': {
552 + id: '/_chat/settings/connections'
553 path: '/connections'
554 fullPath: '/settings/connections'
533 - preLoaderRoute: typeof SettingsConnectionsRouteImport
534 - parentRoute: typeof SettingsRoute
555 + preLoaderRoute: typeof ChatSettingsConnectionsRouteImport
556 + parentRoute: typeof ChatSettingsRoute
557 }
536 - '/settings/beta': {
537 - id: '/settings/beta'
558 + '/_chat/settings/beta': {
559 + id: '/_chat/settings/beta'
560 path: '/beta'
561 fullPath: '/settings/beta'
540 - preLoaderRoute: typeof SettingsBetaRouteImport
541 - parentRoute: typeof SettingsRoute
562 + preLoaderRoute: typeof ChatSettingsBetaRouteImport
563 + parentRoute: typeof ChatSettingsRoute
564 }
543 - '/settings/archived': {
544 - id: '/settings/archived'
565 + '/_chat/settings/archived': {
566 + id: '/_chat/settings/archived'
567 path: '/archived'
568 fullPath: '/settings/archived'
547 - preLoaderRoute: typeof SettingsArchivedRouteImport
548 - parentRoute: typeof SettingsRoute
569 + preLoaderRoute: typeof ChatSettingsArchivedRouteImport
570 + parentRoute: typeof ChatSettingsRoute
571 }
550 - '/settings/appearance': {
551 - id: '/settings/appearance'
572 + '/_chat/settings/appearance': {
573 + id: '/_chat/settings/appearance'
574 path: '/appearance'
575 fullPath: '/settings/appearance'
554 - preLoaderRoute: typeof SettingsAppearanceRouteImport
555 - parentRoute: typeof SettingsRoute
556 - }
557 - '/projects/$projectKey': {
558 - id: '/projects/$projectKey'
559 - path: '/projects/$projectKey'
560 - fullPath: '/projects/$projectKey'
561 - preLoaderRoute: typeof ProjectsProjectKeyRouteImport
562 - parentRoute: typeof rootRouteImport
563 - }
564 - '/_chat/pull-requests': {
565 - id: '/_chat/pull-requests'
566 - path: '/pull-requests'
567 - fullPath: '/pull-requests'
568 - preLoaderRoute: typeof ChatPullRequestsRouteImport
569 - parentRoute: typeof ChatRoute
570 - }
571 - '/_chat/new': {
572 - id: '/_chat/new'
573 - path: '/new'
574 - fullPath: '/new'
575 - preLoaderRoute: typeof ChatNewRouteImport
576 - parentRoute: typeof ChatRoute
576 + preLoaderRoute: typeof ChatSettingsAppearanceRouteImport
577 + parentRoute: typeof ChatSettingsRoute
578 }
579 '/_chat/draft/$draftId': {
580 id: '/_chat/draft/$draftId'
@@ -592,9 +593,51 @@ declare module '@tanstack/react-router' {
593 }
594 }
595
596 +interface ChatSettingsRouteChildren {
597 + ChatSettingsAppearanceRoute: typeof ChatSettingsAppearanceRoute
598 + ChatSettingsArchivedRoute: typeof ChatSettingsArchivedRoute
599 + ChatSettingsBetaRoute: typeof ChatSettingsBetaRoute
600 + ChatSettingsConnectionsRoute: typeof ChatSettingsConnectionsRoute
601 + ChatSettingsDiagnosticsRoute: typeof ChatSettingsDiagnosticsRoute
602 + ChatSettingsGeneralRoute: typeof ChatSettingsGeneralRoute
603 + ChatSettingsIntegrationsRoute: typeof ChatSettingsIntegrationsRoute
604 + ChatSettingsKeybindingsRoute: typeof ChatSettingsKeybindingsRoute
605 + ChatSettingsOpenSourceLicensesRoute: typeof ChatSettingsOpenSourceLicensesRoute
606 + ChatSettingsProjectsRoute: typeof ChatSettingsProjectsRoute
607 + ChatSettingsProvidersRoute: typeof ChatSettingsProvidersRoute
608 + ChatSettingsScheduledTasksRoute: typeof ChatSettingsScheduledTasksRoute
609 + ChatSettingsSnapShotRoute: typeof ChatSettingsSnapShotRoute
610 + ChatSettingsSourceControlRoute: typeof ChatSettingsSourceControlRoute
611 + ChatSettingsStorageRoute: typeof ChatSettingsStorageRoute
612 +}
613 +
614 +const ChatSettingsRouteChildren: ChatSettingsRouteChildren = {
615 + ChatSettingsAppearanceRoute: ChatSettingsAppearanceRoute,
616 + ChatSettingsArchivedRoute: ChatSettingsArchivedRoute,
617 + ChatSettingsBetaRoute: ChatSettingsBetaRoute,
618 + ChatSettingsConnectionsRoute: ChatSettingsConnectionsRoute,
619 + ChatSettingsDiagnosticsRoute: ChatSettingsDiagnosticsRoute,
620 + ChatSettingsGeneralRoute: ChatSettingsGeneralRoute,
621 + ChatSettingsIntegrationsRoute: ChatSettingsIntegrationsRoute,
622 + ChatSettingsKeybindingsRoute: ChatSettingsKeybindingsRoute,
623 + ChatSettingsOpenSourceLicensesRoute: ChatSettingsOpenSourceLicensesRoute,
624 + ChatSettingsProjectsRoute: ChatSettingsProjectsRoute,
625 + ChatSettingsProvidersRoute: ChatSettingsProvidersRoute,
626 + ChatSettingsScheduledTasksRoute: ChatSettingsScheduledTasksRoute,
627 + ChatSettingsSnapShotRoute: ChatSettingsSnapShotRoute,
628 + ChatSettingsSourceControlRoute: ChatSettingsSourceControlRoute,
629 + ChatSettingsStorageRoute: ChatSettingsStorageRoute,
630 +}
631 +
632 +const ChatSettingsRouteWithChildren = ChatSettingsRoute._addFileChildren(
633 + ChatSettingsRouteChildren,
634 +)
635 +
636 interface ChatRouteChildren {
637 ChatNewRoute: typeof ChatNewRoute
638 ChatPullRequestsRoute: typeof ChatPullRequestsRoute
639 + ChatSettingsRoute: typeof ChatSettingsRouteWithChildren
640 + ChatUsageRoute: typeof ChatUsageRoute
641 ChatIndexRoute: typeof ChatIndexRoute
642 ChatEnvironmentIdThreadIdRoute: typeof ChatEnvironmentIdThreadIdRoute
643 ChatDraftDraftIdRoute: typeof ChatDraftDraftIdRoute
@@ -603,6 +646,8 @@ interface ChatRouteChildren {
646 const ChatRouteChildren: ChatRouteChildren = {
647 ChatNewRoute: ChatNewRoute,
648 ChatPullRequestsRoute: ChatPullRequestsRoute,
649 + ChatSettingsRoute: ChatSettingsRouteWithChildren,
650 + ChatUsageRoute: ChatUsageRoute,
651 ChatIndexRoute: ChatIndexRoute,
652 ChatEnvironmentIdThreadIdRoute: ChatEnvironmentIdThreadIdRoute,
653 ChatDraftDraftIdRoute: ChatDraftDraftIdRoute,
@@ -610,54 +655,12 @@ const ChatRouteChildren: ChatRouteChildren = {
655
656 const ChatRouteWithChildren = ChatRoute._addFileChildren(ChatRouteChildren)
657
613 -interface SettingsRouteChildren {
614 - SettingsAppearanceRoute: typeof SettingsAppearanceRoute
615 - SettingsArchivedRoute: typeof SettingsArchivedRoute
616 - SettingsBetaRoute: typeof SettingsBetaRoute
617 - SettingsConnectionsRoute: typeof SettingsConnectionsRoute
618 - SettingsDiagnosticsRoute: typeof SettingsDiagnosticsRoute
619 - SettingsGeneralRoute: typeof SettingsGeneralRoute
620 - SettingsIntegrationsRoute: typeof SettingsIntegrationsRoute
621 - SettingsKeybindingsRoute: typeof SettingsKeybindingsRoute
622 - SettingsOpenSourceLicensesRoute: typeof SettingsOpenSourceLicensesRoute
623 - SettingsProjectsRoute: typeof SettingsProjectsRoute
624 - SettingsProvidersRoute: typeof SettingsProvidersRoute
625 - SettingsScheduledTasksRoute: typeof SettingsScheduledTasksRoute
626 - SettingsSnapShotRoute: typeof SettingsSnapShotRoute
627 - SettingsSourceControlRoute: typeof SettingsSourceControlRoute
628 - SettingsStorageRoute: typeof SettingsStorageRoute
629 -}
630 -
631 -const SettingsRouteChildren: SettingsRouteChildren = {
632 - SettingsAppearanceRoute: SettingsAppearanceRoute,
633 - SettingsArchivedRoute: SettingsArchivedRoute,
634 - SettingsBetaRoute: SettingsBetaRoute,
635 - SettingsConnectionsRoute: SettingsConnectionsRoute,
636 - SettingsDiagnosticsRoute: SettingsDiagnosticsRoute,
637 - SettingsGeneralRoute: SettingsGeneralRoute,
638 - SettingsIntegrationsRoute: SettingsIntegrationsRoute,
639 - SettingsKeybindingsRoute: SettingsKeybindingsRoute,
640 - SettingsOpenSourceLicensesRoute: SettingsOpenSourceLicensesRoute,
641 - SettingsProjectsRoute: SettingsProjectsRoute,
642 - SettingsProvidersRoute: SettingsProvidersRoute,
643 - SettingsScheduledTasksRoute: SettingsScheduledTasksRoute,
644 - SettingsSnapShotRoute: SettingsSnapShotRoute,
645 - SettingsSourceControlRoute: SettingsSourceControlRoute,
646 - SettingsStorageRoute: SettingsStorageRoute,
647 -}
648 -
649 -const SettingsRouteWithChildren = SettingsRoute._addFileChildren(
650 - SettingsRouteChildren,
651 -)
652 -
658 const rootRouteChildren: RootRouteChildren = {
659 ChatRoute: ChatRouteWithChildren,
660 ConnectRoute: ConnectRoute,
661 ConnectAgentRoute: ConnectAgentRoute,
662 GuestRoute: GuestRoute,
663 PairRoute: PairRoute,
659 - SettingsRoute: SettingsRouteWithChildren,
660 - UsageRoute: UsageRoute,
664 WelcomeRoute: WelcomeRoute,
665 ProjectsProjectKeyRoute: ProjectsProjectKeyRoute,
666 }
apps/web/src/routes/_chat.settings.appearance.tsx renamed
+1 -1
@@ -6,6 +6,6 @@ function SettingsAppearanceRoute() {
6 return <AppearanceSettingsPanel />;
7 }
8
9 -export const Route = createFileRoute("/settings/appearance")({
9 +export const Route = createFileRoute("/_chat/settings/appearance")({
10 component: SettingsAppearanceRoute,
11 });
apps/web/src/routes/_chat.settings.archived.tsx renamed
+1 -1
@@ -2,6 +2,6 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { ArchivedThreadsPanel } from "../components/settings/ArchivedThreadsPanel";
4
5 -export const Route = createFileRoute("/settings/archived")({
5 +export const Route = createFileRoute("/_chat/settings/archived")({
6 component: ArchivedThreadsPanel,
7 });
apps/web/src/routes/_chat.settings.beta.tsx renamed
+1 -1
@@ -2,4 +2,4 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { BetaSettingsPanel } from "../components/settings/BetaSettingsPanel";
4
5 -export const Route = createFileRoute("/settings/beta")({ component: BetaSettingsPanel });
5 +export const Route = createFileRoute("/_chat/settings/beta")({ component: BetaSettingsPanel });
apps/web/src/routes/_chat.settings.connections.tsx renamed
+1 -1
@@ -2,6 +2,6 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { ConnectionsSettings } from "../components/settings/ConnectionsSettings";
4
5 -export const Route = createFileRoute("/settings/connections")({
5 +export const Route = createFileRoute("/_chat/settings/connections")({
6 component: ConnectionsSettings,
7 });
apps/web/src/routes/_chat.settings.diagnostics.tsx renamed
+1 -1
@@ -2,6 +2,6 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { DiagnosticsSettingsPanel } from "../components/settings/DiagnosticsSettings";
4
5 -export const Route = createFileRoute("/settings/diagnostics")({
5 +export const Route = createFileRoute("/_chat/settings/diagnostics")({
6 component: DiagnosticsSettingsPanel,
7 });
apps/web/src/routes/_chat.settings.general.tsx renamed
+1 -1
@@ -6,6 +6,6 @@ function SettingsGeneralRoute() {
6 return <GeneralSettingsPanel />;
7 }
8
9 -export const Route = createFileRoute("/settings/general")({
9 +export const Route = createFileRoute("/_chat/settings/general")({
10 component: SettingsGeneralRoute,
11 });
apps/web/src/routes/_chat.settings.integrations.tsx renamed
+1 -1
@@ -2,6 +2,6 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { IntegrationsSettingsPanel } from "../components/settings/IntegrationsSettings";
4
5 -export const Route = createFileRoute("/settings/integrations")({
5 +export const Route = createFileRoute("/_chat/settings/integrations")({
6 component: IntegrationsSettingsPanel,
7 });
apps/web/src/routes/_chat.settings.keybindings.tsx renamed
+1 -1
@@ -2,6 +2,6 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { KeybindingsSettingsPanel } from "../components/settings/KeybindingsSettings";
4
5 -export const Route = createFileRoute("/settings/keybindings")({
5 +export const Route = createFileRoute("/_chat/settings/keybindings")({
6 component: KeybindingsSettingsPanel,
7 });
apps/web/src/routes/_chat.settings.open-source-licenses.tsx renamed
+1 -1
@@ -2,6 +2,6 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { OpenSourceLicensesPanel } from "../components/settings/OpenSourceLicenses";
4
5 -export const Route = createFileRoute("/settings/open-source-licenses")({
5 +export const Route = createFileRoute("/_chat/settings/open-source-licenses")({
6 component: OpenSourceLicensesPanel,
7 });
apps/web/src/routes/_chat.settings.projects.tsx renamed
+1 -1
@@ -1,6 +1,6 @@
1 import { createFileRoute } from "@tanstack/react-router";
2 import { ProjectsSettings } from "../components/settings/ProjectsSettings";
3
4 -export const Route = createFileRoute("/settings/projects")({
4 +export const Route = createFileRoute("/_chat/settings/projects")({
5 component: ProjectsSettings,
6 });
apps/web/src/routes/_chat.settings.providers.tsx renamed
+1 -1
@@ -32,7 +32,7 @@ function SettingsProvidersRoute() {
32 );
33 }
34
35 -export const Route = createFileRoute("/settings/providers")({
35 +export const Route = createFileRoute("/_chat/settings/providers")({
36 validateSearch: (raw: Record<string, unknown>) => ({
37 ...(typeof raw.environmentId === "string" && raw.environmentId.trim()
38 ? { environmentId: EnvironmentId.make(raw.environmentId) }
apps/web/src/routes/_chat.settings.scheduled-tasks.tsx renamed
+1 -1
@@ -8,7 +8,7 @@ function SettingsScheduledTasksRoute() {
8 return <ScheduledTasksSettings {...target} />;
9 }
10
11 -export const Route = createFileRoute("/settings/scheduled-tasks")({
11 +export const Route = createFileRoute("/_chat/settings/scheduled-tasks")({
12 validateSearch: validateScheduledTasksSearch,
13 component: SettingsScheduledTasksRoute,
14 });
apps/web/src/routes/_chat.settings.snap-shot.tsx renamed
+1 -1
@@ -6,6 +6,6 @@ function SettingsSnapShotRoute() {
6 return <SnapShotSettings />;
7 }
8
9 -export const Route = createFileRoute("/settings/snap-shot")({
9 +export const Route = createFileRoute("/_chat/settings/snap-shot")({
10 component: SettingsSnapShotRoute,
11 });
apps/web/src/routes/_chat.settings.source-control.tsx renamed
+1 -1
@@ -2,6 +2,6 @@ import { createFileRoute } from "@tanstack/react-router";
2
3 import { SourceControlSettingsPanel } from "../components/settings/SourceControlSettings";
4
5 -export const Route = createFileRoute("/settings/source-control")({
5 +export const Route = createFileRoute("/_chat/settings/source-control")({
6 component: SourceControlSettingsPanel,
7 });
apps/web/src/routes/_chat.settings.storage.tsx renamed
+3 -1
@@ -1,4 +1,6 @@
1 import { createFileRoute } from "@tanstack/react-router";
2 import { StorageSettingsPanel } from "../components/settings/StorageSettings";
3
4 -export const Route = createFileRoute("/settings/storage")({ component: StorageSettingsPanel });
4 +export const Route = createFileRoute("/_chat/settings/storage")({
5 + component: StorageSettingsPanel,
6 +});
apps/web/src/routes/_chat.settings.tsx renamed
+21 -32
@@ -4,12 +4,9 @@ import { RotateCcwIcon } from "lucide-react";
4 import { Button } from "../components/ui/button";
5 import { useSettingsRestore } from "../components/settings/SettingsPanels";
6
7 +import { AppRouteModal, AppRouteModalClose } from "../components/AppRouteModal";
8 import { SettingsBreadcrumb } from "../components/settings/SettingsBreadcrumb";
8 -import { SidebarInset } from "../components/ui/sidebar";
9 -import { useNavigateToMainApp } from "../components/sidebar/mainAppLocation";
10 -import { WorkspacePageHeader } from "../components/WorkspacePageHeader";
11 -import { isElectron } from "../env";
12 -import { useEscapeToGoBack } from "../hooks/useNavigateBack";
9 +import { SettingsSidebarNav } from "../components/settings/SettingsSidebarNav";
10 import {
11 SettingsScopeProvider,
12 useSettingsScope,
@@ -38,7 +35,7 @@ function RestoreDeviceDefaultsButton({ onRestored }: { onRestored: () => void })
35 onClick={() => void restoreDefaults()}
36 >
37 <RotateCcwIcon className="mx-1 size-3.5" />
41 - Restore device defaults
38 + <span className="max-sm:sr-only">Restore device defaults</span>
39 </Button>
40 );
41 }
@@ -109,8 +106,6 @@ function SettingsScopeBoundary({ pathname, children }: { pathname: string; child
106
107 function SettingsContentLayout() {
108 const location = useLocation();
112 - const navigateToMainApp = useNavigateToMainApp();
113 - useEscapeToGoBack(navigateToMainApp);
109 const { search, environment } = useSettingsScope();
110 const contentScopeKey =
111 location.pathname === "/settings/diagnostics" || location.pathname === "/settings/providers"
@@ -119,28 +114,29 @@ function SettingsContentLayout() {
114 const [restoreSignal, setRestoreSignal] = useState(0);
115
116 return (
122 - <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none isolate">
123 - <div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
124 - <WorkspacePageHeader electron={isElectron}>
125 - <div className="flex w-full items-center gap-3">
117 + <AppRouteModal label="Settings">
118 + <div className="relative flex min-h-0 flex-1">
119 + <SettingsSidebarNav pathname={location.pathname} />
120 + <div className="flex min-h-0 min-w-0 flex-1 flex-col">
121 + <header className="flex h-12 shrink-0 items-center gap-3 border-b ps-5 pe-2">
122 <SettingsBreadcrumb pathname={location.pathname} />
127 - {location.pathname === "/settings/general" ? (
128 - <div className="ms-auto flex shrink-0 items-center">
123 + <div className="ms-auto flex shrink-0 items-center gap-1">
124 + {location.pathname === "/settings/general" ? (
125 <RestoreDeviceDefaultsButton
126 onRestored={() => setRestoreSignal((value) => value + 1)}
127 />
132 - </div>
133 - ) : null}
128 + ) : null}
129 + <AppRouteModalClose />
130 + </div>
131 + </header>
132 + <div key={`${contentScopeKey}:${restoreSignal}`} className="min-h-0 flex flex-1 flex-col">
133 + <SettingsScopeBoundary pathname={location.pathname}>
134 + <Outlet />
135 + </SettingsScopeBoundary>
136 </div>
135 - </WorkspacePageHeader>
136 -
137 - <div key={`${contentScopeKey}:${restoreSignal}`} className="min-h-0 flex flex-1 flex-col">
138 - <SettingsScopeBoundary pathname={location.pathname}>
139 - <Outlet />
140 - </SettingsScopeBoundary>
137 </div>
138 </div>
143 - </SidebarInset>
139 + </AppRouteModal>
140 );
141 }
142
@@ -171,17 +167,10 @@ function SettingsRouteLayout() {
167 );
168 }
169
174 -export const Route = createFileRoute("/settings")({
170 +export const Route = createFileRoute("/_chat/settings")({
171 validateSearch: validateSettingsRouteSearch,
172 search: { middlewares: [retainSettingsScope] },
177 - beforeLoad: async ({ context, location }) => {
178 - if (
179 - context.authGateState.status !== "authenticated" &&
180 - context.authGateState.status !== "hosted-static"
181 - ) {
182 - throw redirect({ to: "/pair", replace: true });
183 - }
184 -
173 + beforeLoad: async ({ location }) => {
174 if (location.pathname === "/settings") {
175 throw redirect({ to: "/settings/general", replace: true });
176 }
apps/web/src/routes/_chat.tsx
+32 -6
@@ -1,10 +1,14 @@
1 import { AuthPreviewOperateScope } from "@t3tools/contracts";
2 -import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
2 +import { scopedThreadKey } from "@t3tools/client-runtime/environment";
3 +import { Outlet, createFileRoute, redirect, useMatches } from "@tanstack/react-router";
4 import { useAtomValue } from "@effect/atom-react";
4 -import { useEffect } from "react";
5 +import { useEffect, useState } from "react";
6
7 import { isCommandPaletteOpen } from "../commandPaletteBus";
8 import { ThreadRouteView } from "../components/ThreadRouteView";
9 +import { isAppModalPage } from "../components/sidebar/mainAppLocation";
10 +import { SidebarInset } from "../components/ui/sidebar";
11 +import type { ThreadRouteTarget } from "../threadRoutes";
12 import { ThreadLinkPrompt } from "../components/promptLinks/ThreadLinkPrompt";
13 import { useClientSettings, useLegacySidebarEnabled } from "../hooks/useSettings";
14 import { openCommandPalette } from "../commandPaletteBus";
@@ -193,16 +197,38 @@ function ChatRouteGlobalShortcuts() {
197 return null;
198 }
199
200 +function threadRouteTargetKey(target: ThreadRouteTarget | null) {
201 + if (!target) return null;
202 + return target.kind === "server" ? scopedThreadKey(target.threadRef) : target.draftId;
203 +}
204 +
205 function ChatRouteLayout() {
206 // Render both routes here so draft promotion keeps the same ChatView mounted.
207 const threadTarget = useThreadRouteTarget();
208 + // Read matches, not location, so this agrees with the params useThreadRouteTarget reads.
209 + const modalOpen = useMatches({
210 + select: (matches) => matches.some((match) => isAppModalPage(match.pathname)),
211 + });
212 + // Settings and Usage render over the thread that opened them, so ChatView never remounts.
213 + const [backgroundTarget, setBackgroundTarget] = useState(threadTarget);
214 + if (!modalOpen && threadRouteTargetKey(backgroundTarget) !== threadRouteTargetKey(threadTarget)) {
215 + setBackgroundTarget(threadTarget);
216 + }
217 + const shownTarget = modalOpen ? backgroundTarget : threadTarget;
218 return (
219 <>
201 - <ChatRouteGlobalShortcuts />
202 - {threadTarget?.kind === "server" ? (
203 - <ThreadLinkPrompt threadRef={threadTarget.threadRef} />
220 + {modalOpen ? null : <ChatRouteGlobalShortcuts />}
221 + {shownTarget?.kind === "server" && !modalOpen ? (
222 + <ThreadLinkPrompt threadRef={shownTarget.threadRef} />
223 ) : null}
205 - {threadTarget ? <ThreadRouteView target={threadTarget} /> : <Outlet />}
224 + {shownTarget ? (
225 + <ThreadRouteView target={shownTarget} background={modalOpen} />
226 + ) : modalOpen ? (
227 + <SidebarInset className="h-dvh" />
228 + ) : (
229 + <Outlet />
230 + )}
231 + {modalOpen ? <Outlet /> : null}
232 </>
233 );
234 }
apps/web/src/routes/_chat.usage.tsx new
+7
@@ -0,0 +1,7 @@
1 +import { createFileRoute } from "@tanstack/react-router";
2 +
3 +import { UsagePage } from "../components/usage/UsagePage";
4 +
5 +export const Route = createFileRoute("/_chat/usage")({
6 + component: UsagePage,
7 +});
apps/web/src/routes/usage.tsx deleted
-15
@@ -1,15 +0,0 @@
1 -import { createFileRoute, redirect } from "@tanstack/react-router";
2 -
3 -import { UsagePage } from "../components/usage/UsagePage";
4 -
5 -export const Route = createFileRoute("/usage")({
6 - beforeLoad: async ({ context }) => {
7 - if (
8 - context.authGateState.status !== "authenticated" &&
9 - context.authGateState.status !== "hosted-static"
10 - ) {
11 - throw redirect({ to: "/pair", replace: true });
12 - }
13 - },
14 - component: UsagePage,
15 -});