Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

feat(web): unify workspace navigation (#7153)

maria07f8027d9a54
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index 3ed1aa76b..8044db133 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -170,7 +170,6 @@ import {
WifiOffIcon,
} from "lucide-react";
import { cn, randomHex } from "~/lib/utils";
-import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
import { stackedThreadToast, toastManager } from "./ui/toast";
import { decodeProjectScriptKeybindingRule } from "~/lib/projectScriptKeybindings";
import { type NewProjectScriptInput } from "./ProjectScriptsControl";
@@ -259,6 +258,7 @@ import { ChatHeader } from "./chat/ChatHeader";
import { PanelLayoutControls, RightPanelMaximizeControl } from "./chat/PanelLayoutControls";
import { type ExpandedImagePreview } from "./chat/ExpandedImagePreview";
import { NoActiveThreadState } from "./NoActiveThreadState";
+import { WorkspacePageHeader } from "./WorkspacePageHeader";
import {
resolveEffectiveEnvMode,
resolveLocalCheckoutBranchMismatch,
@@ -6240,20 +6240,11 @@ function ChatViewContent(props: ChatViewProps) {
data-chat-column-maximized-away={rightPanelMaximized ? "true" : "false"}
>
{/* Top bar */}
- <header
+ <WorkspacePageHeader
data-chat-header
- className={cn(
- "bg-background transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none",
- isElectron
- ? cn(
- "drag-region relative flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center px-3 sm:px-5",
- reserveTitleBarControlInset &&
- !inlineRightPanelOwnsTitleBar &&
- "wco:pr-[var(--workspace-native-controls-inset)]",
- )
- : "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center pl-[calc(env(safe-area-inset-left)+0.75rem)] pr-[calc(env(safe-area-inset-right)+0.75rem)] sm:pl-[calc(env(safe-area-inset-left)+1.25rem)] sm:pr-[calc(env(safe-area-inset-right)+1.25rem)]",
- COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
- )}
+ electron={isElectron}
+ reserveNativeControls={reserveTitleBarControlInset && !inlineRightPanelOwnsTitleBar}
+ className="relative bg-background"
>
{!rightPanelOpen ? panelLayoutControls : null}
<ChatHeader
@@ -6284,7 +6275,7 @@ function ChatViewContent(props: ChatViewProps) {
onUpdateProjectScript={updateProjectScript}
onDeleteProjectScript={deleteProjectScript}
/>
- </header>
+ </WorkspacePageHeader>
<ThreadErrorBanner
error={visibleThreadError}
diff --git a/apps/web/src/components/NoActiveThreadState.tsx b/apps/web/src/components/NoActiveThreadState.tsx
index 82dddd8f4..3e7b0769d 100644
--- a/apps/web/src/components/NoActiveThreadState.tsx
+++ b/apps/web/src/components/NoActiveThreadState.tsx
@@ -1,26 +1,15 @@
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "./ui/empty";
import { SidebarInset } from "./ui/sidebar";
import { isElectron } from "../env";
-import { cn } from "~/lib/utils";
-import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
+import { WorkspacePageHeader } from "./WorkspacePageHeader";
export function NoActiveThreadState() {
return (
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
- <header
- className={cn(
- "border-b border-border px-3 transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none sm:px-5",
- isElectron
- ? "drag-region flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center"
- : "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center",
- COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
- )}
- >
+ <WorkspacePageHeader electron={isElectron} className="border-b border-border">
{isElectron ? (
- <span className="text-xs text-muted-foreground/50 wco:pr-[var(--workspace-native-controls-inset)]">
- No active thread
- </span>
+ <span className="text-xs text-muted-foreground/50">No active thread</span>
) : (
<div className="flex items-center gap-2">
<span className="text-sm font-medium text-foreground md:text-muted-foreground/60">
@@ -28,7 +17,7 @@ export function NoActiveThreadState() {
</span>
</div>
)}
- </header>
+ </WorkspacePageHeader>
<Empty className="flex-1">
<div className="w-full max-w-lg px-8 py-12">
diff --git a/apps/web/src/components/WorkspacePageHeader.tsx b/apps/web/src/components/WorkspacePageHeader.tsx
new file mode 100644
index 000000000..cd8a96273
--- /dev/null
+++ b/apps/web/src/components/WorkspacePageHeader.tsx
@@ -0,0 +1,28 @@
+import type { ComponentPropsWithoutRef } from "react";
+
+import { cn } from "../lib/utils";
+import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "../workspaceTitlebar";
+
+/** Shared workspace top-bar geometry. */
+export function WorkspacePageHeader({
+ electron = false,
+ reserveNativeControls = electron,
+ className,
+ ...props
+}: ComponentPropsWithoutRef<"header"> & {
+ readonly electron?: boolean;
+ readonly reserveNativeControls?: boolean;
+}) {
+ return (
+ <header
+ className={cn(
+ "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center gap-3 pl-[calc(env(safe-area-inset-left)+0.75rem)] pr-[calc(env(safe-area-inset-right)+0.75rem)] transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none sm:pl-[calc(env(safe-area-inset-left)+1.25rem)] sm:pr-[calc(env(safe-area-inset-right)+1.25rem)]",
+ electron && "drag-region",
+ reserveNativeControls && "wco:pr-[var(--workspace-native-controls-inset)]",
+ COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
+ className,
+ )}
+ {...props}
+ />
+ );
+}
diff --git a/apps/web/src/components/settings/DiagnosticsSettings.tsx b/apps/web/src/components/settings/DiagnosticsSettings.tsx
index a472c6a8d..9c36d32ff 100644
--- a/apps/web/src/components/settings/DiagnosticsSettings.tsx
+++ b/apps/web/src/components/settings/DiagnosticsSettings.tsx
@@ -992,7 +992,7 @@ export function DiagnosticsSettingsPanel() {
: false;
return (
- <SettingsPageContainer className="max-w-6xl gap-10">
+ <SettingsPageContainer width="expanded" className="gap-10">
<ResourceTelemetryDiagnostics />
<SettingsSection
diff --git a/apps/web/src/components/settings/KeybindingsSettings.tsx b/apps/web/src/components/settings/KeybindingsSettings.tsx
index 9e7936715..ccbd1f065 100644
--- a/apps/web/src/components/settings/KeybindingsSettings.tsx
+++ b/apps/web/src/components/settings/KeybindingsSettings.tsx
@@ -1195,7 +1195,7 @@ export function KeybindingsSettingsPanel() {
);
return (
- <SettingsPageContainer className="max-w-5xl">
+ <SettingsPageContainer width="wide">
<SettingsSection
{...searchableSetting("keybindings")}
headerAction={
diff --git a/apps/web/src/components/settings/ProjectSettingsPanel.tsx b/apps/web/src/components/settings/ProjectSettingsPanel.tsx
index 416df60c1..2c1933457 100644
--- a/apps/web/src/components/settings/ProjectSettingsPanel.tsx
+++ b/apps/web/src/components/settings/ProjectSettingsPanel.tsx
@@ -81,8 +81,6 @@ import {
type NewProjectScriptInput,
type ProjectScriptEditorRequest,
} from "../projectScriptEditor";
-import { cn } from "../../lib/utils";
-import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "../../workspaceTitlebar";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
import {
@@ -103,6 +101,7 @@ import {
WorkspaceBreadcrumbItem,
WorkspaceBreadcrumbSeparator,
} from "../WorkspaceBreadcrumb";
+import { WorkspacePageHeader } from "../WorkspacePageHeader";
import {
SettingResetButton,
SettingsPageContainer,
@@ -175,26 +174,9 @@ export function ProjectSettingsPage({ projectKey }: { projectKey: string }) {
return (
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
- {!isElectron && (
- <header
- className={cn(
- "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center px-3 transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none sm:px-5",
- COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
- )}
- >
- <ProjectSettingsBreadcrumb projectKey={projectKey} />
- </header>
- )}
- {isElectron && (
- <div
- className={cn(
- "drag-region flex h-[52px] shrink-0 items-center px-5 transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none wco:h-[env(titlebar-area-height)] wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]",
- COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
- )}
- >
- <ProjectSettingsBreadcrumb projectKey={projectKey} />
- </div>
- )}
+ <WorkspacePageHeader electron={isElectron}>
+ <ProjectSettingsBreadcrumb projectKey={projectKey} />
+ </WorkspacePageHeader>
<ProjectSettingsPanel projectKey={projectKey} />
</div>
</SidebarInset>
diff --git a/apps/web/src/components/settings/SettingsSidebarNav.tsx b/apps/web/src/components/settings/SettingsSidebarNav.tsx
index 5a5978487..734c2989d 100644
--- a/apps/web/src/components/settings/SettingsSidebarNav.tsx
+++ b/apps/web/src/components/settings/SettingsSidebarNav.tsx
@@ -9,7 +9,6 @@ import {
} from "react";
import {
ArchiveIcon,
- ArrowLeftIcon,
BlocksIcon,
BotIcon,
GitBranchIcon,
@@ -20,7 +19,7 @@ import {
Settings2Icon,
XIcon,
} from "lucide-react";
-import { useCanGoBack, useLocation, useNavigate } from "@tanstack/react-router";
+import { useLocation, useNavigate } from "@tanstack/react-router";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
@@ -35,6 +34,7 @@ import {
useSidebar,
} from "../ui/sidebar";
import { T3ConnectSidebarAvatar, T3ConnectSidebarSignIn } from "../clerk/T3ConnectSidebarSignIn";
+import { SidebarUtilityMenu } from "../sidebar/SidebarChrome";
import { scrollToSettingsTarget } from "./settingsLayout";
import {
searchSettings,
@@ -74,7 +74,6 @@ function SettingsSectionIcon({ to }: { to: SettingsPath }) {
export function SettingsSidebarNav({ pathname }: { pathname: string }) {
const navigate = useNavigate();
const currentHash = useLocation({ select: (location) => location.hash });
- const canGoBack = useCanGoBack();
const { isMobile, setOpenMobile, open, setOpen } = useSidebar();
const searchInputRef = useRef<HTMLInputElement>(null);
const [query, setQuery] = useState("");
@@ -178,17 +177,6 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
},
[activeResultIndex, clearSearch, handleSearchResultClick, isSearching, results],
);
- const handleBackClick = useCallback(() => {
- if (isMobile) {
- setOpenMobile(false);
- }
- if (canGoBack) {
- window.history.back();
- return;
- }
- void navigate({ to: "/" });
- }, [canGoBack, isMobile, navigate, setOpenMobile]);
-
return (
<>
<SidebarContent className="overflow-x-hidden">
@@ -298,14 +286,9 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
<SidebarFooter className="p-[var(--sidebar-content-inset)]">
<T3ConnectSidebarSignIn />
<div className="flex items-center gap-1">
- <SidebarMenu className="min-w-0 flex-1">
- <SidebarMenuItem>
- <SidebarMenuButton onClick={handleBackClick}>
- <ArrowLeftIcon />
- <span>Back</span>
- </SidebarMenuButton>
- </SidebarMenuItem>
- </SidebarMenu>
+ <div className="min-w-0 flex-1">
+ <SidebarUtilityMenu />
+ </div>
<T3ConnectSidebarAvatar />
</div>
</SidebarFooter>
diff --git a/apps/web/src/components/settings/settingsLayout.tsx b/apps/web/src/components/settings/settingsLayout.tsx
index 880e03e54..11d572fd2 100644
--- a/apps/web/src/components/settings/settingsLayout.tsx
+++ b/apps/web/src/components/settings/settingsLayout.tsx
@@ -15,6 +15,14 @@ import { cn } from "../../lib/utils";
import { Button } from "../ui/button";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
+type SettingsPageWidth = "readable" | "wide" | "expanded";
+
+const SETTINGS_PAGE_WIDTH_CLASS: Record<SettingsPageWidth, string> = {
+ readable: "max-w-4xl",
+ wide: "max-w-5xl",
+ expanded: "max-w-6xl",
+};
+
interface SettingsSearchTargetContextValue {
readonly targetId: string | null;
readonly onTargetHandled: () => void;
@@ -233,9 +241,11 @@ export function SettingResetButton({
export function SettingsPageContainer({
children,
className,
+ width = "readable",
}: {
children: ReactNode;
className?: string;
+ width?: SettingsPageWidth;
}) {
const navigate = useNavigate();
const hash = useLocation({ select: (location) => location.hash });
@@ -247,10 +257,16 @@ export function SettingsPageContainer({
return (
<SettingsSearchTargetProvider targetId={targetId} onTargetHandled={clearTargetHash}>
<div
- className="topbar-scroll-fade scrollbar-gutter-both flex-1 overflow-y-auto px-4 pt-10 pb-7 sm:px-8 sm:pt-12 sm:pb-10"
+ className="topbar-scroll-fade scrollbar-gutter-both flex-1 overflow-y-auto [--topbar-scroll-fade-height:1.5rem] sm:[--topbar-scroll-fade-height:1.5rem]"
data-settings-page-scroll
>
- <div className={cn("mx-auto flex w-full max-w-4xl flex-col gap-12", className)}>
+ <div
+ className={cn(
+ "mx-auto flex w-full flex-col gap-12 px-5 pt-6 pb-12 sm:px-6",
+ SETTINGS_PAGE_WIDTH_CLASS[width],
+ className,
+ )}
+ >
{children}
</div>
</div>
diff --git a/apps/web/src/components/sidebar/SidebarChrome.tsx b/apps/web/src/components/sidebar/SidebarChrome.tsx
index f4a98dec8..8fc6b835b 100644
--- a/apps/web/src/components/sidebar/SidebarChrome.tsx
+++ b/apps/web/src/components/sidebar/SidebarChrome.tsx
@@ -4,8 +4,9 @@ import {
GitPullRequestIcon,
SettingsIcon,
} from "lucide-react";
+import type { ReactNode } from "react";
import { memo, useCallback } from "react";
-import { Link, useLocation, useNavigate } from "@tanstack/react-router";
+import { Link, useCanGoBack, useLocation, useNavigate } from "@tanstack/react-router";
import { useEnvironmentIdentificationMode } from "../../hooks/useSettings";
import { cn } from "../../lib/utils";
@@ -117,16 +118,44 @@ function T3Wordmark() {
);
}
-export const SidebarChromeFooter = memo(function SidebarChromeFooter() {
+function SidebarUtilityItem({
+ icon,
+ label,
+ onClick,
+}: {
+ icon: ReactNode;
+ label: string;
+ onClick: () => void;
+}) {
+ return (
+ <SidebarMenuItem className="shrink-0">
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <SidebarMenuButton aria-label={label} onClick={onClick} size="icon">
+ {icon}
+ </SidebarMenuButton>
+ }
+ />
+ <TooltipPopup side="top">{label}</TooltipPopup>
+ </Tooltip>
+ </SidebarMenuItem>
+ );
+}
+
+export const SidebarUtilityMenu = memo(function SidebarUtilityMenu() {
const navigate = useNavigate();
+ const canGoBack = useCanGoBack();
const { isMobile, setOpenMobile } = useSidebar();
const currentFooterPage = useLocation({
select: (location) =>
- location.pathname === "/usage"
- ? "usage"
- : location.pathname === "/pull-requests"
- ? "pull-requests"
- : null,
+ /^\/settings(?:\/|$)/.test(location.pathname)
+ ? "settings"
+ : location.pathname === "/usage"
+ ? "usage"
+ : location.pathname === "/pull-requests"
+ ? "pull-requests"
+ : null,
});
const { environments } = useEnvironments();
// The page reads every connected server, so one of them offering pull requests is enough for
@@ -157,73 +186,54 @@ export const SidebarChromeFooter = memo(function SidebarChromeFooter() {
const handleBackClick = useCallback(() => {
closeMobileSidebar();
+ if (canGoBack) {
+ window.history.back();
+ return;
+ }
void navigate({ to: "/" });
- }, [closeMobileSidebar, navigate]);
+ }, [canGoBack, closeMobileSidebar, navigate]);
+ return (
+ <SidebarMenu className="flex-row items-center">
+ {currentFooterPage ? (
+ <SidebarMenuItem className="min-w-0 flex-1">
+ <SidebarMenuButton onClick={handleBackClick}>
+ <ArrowLeftIcon />
+ <span>Back</span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ ) : (
+ <>
+ <SidebarUtilityItem
+ icon={<SettingsIcon />}
+ label="Settings"
+ onClick={handleSettingsClick}
+ />
+ {pullRequestsSupported ? (
+ <SidebarUtilityItem
+ icon={<GitPullRequestIcon />}
+ label="Pull Requests"
+ onClick={handlePullRequestsClick}
+ />
+ ) : null}
+ <SidebarUtilityItem
+ icon={<ChartNoAxesColumnIcon />}
+ label="Usage"
+ onClick={handleUsageClick}
+ />
+ </>
+ )}
+ <SidebarUpdatePill />
+ </SidebarMenu>
+ );
+});
+
+export const SidebarChromeFooter = memo(function SidebarChromeFooter() {
return (
<SidebarFooter className="p-[var(--sidebar-content-inset)]">
<SidebarProviderUpdatePill />
<SidebarUpdateArchitectureWarning />
- <SidebarMenu className="flex-row items-center">
- {currentFooterPage ? (
- <SidebarMenuItem className="min-w-0 flex-1">
- <SidebarMenuButton onClick={handleBackClick}>
- <ArrowLeftIcon />
- <span>Back</span>
- </SidebarMenuButton>
- </SidebarMenuItem>
- ) : (
- <>
- <SidebarMenuItem className="shrink-0">
- <Tooltip>
- <TooltipTrigger
- render={
- <SidebarMenuButton
- aria-label="Settings"
- onClick={handleSettingsClick}
- size="icon"
- >
- <SettingsIcon />
- </SidebarMenuButton>
- }
- />
- <TooltipPopup side="top">Settings</TooltipPopup>
- </Tooltip>
- </SidebarMenuItem>
- {pullRequestsSupported ? (
- <SidebarMenuItem className="shrink-0">
- <Tooltip>
- <TooltipTrigger
- render={
- <SidebarMenuButton
- aria-label="Pull Requests"
- onClick={handlePullRequestsClick}
- size="icon"
- >
- <GitPullRequestIcon />
- </SidebarMenuButton>
- }
- />
- <TooltipPopup side="top">Pull Requests</TooltipPopup>
- </Tooltip>
- </SidebarMenuItem>
- ) : null}
- <SidebarMenuItem className="shrink-0">
- <Tooltip>
- <TooltipTrigger
- render={
- <SidebarMenuButton aria-label="Usage" onClick={handleUsageClick} size="icon">
- <ChartNoAxesColumnIcon />
- </SidebarMenuButton>
- }
- />
- <TooltipPopup side="top">Usage</TooltipPopup>
- </Tooltip>
- </SidebarMenuItem>
- </>
- )}
- <SidebarUpdatePill />
- </SidebarMenu>
+ <SidebarUtilityMenu />
</SidebarFooter>
);
});
diff --git a/apps/web/src/routes/-chatIndexTitlebar.test.ts b/apps/web/src/routes/-chatIndexTitlebar.test.ts
index 803ba7871..619e38ccb 100644
--- a/apps/web/src/routes/-chatIndexTitlebar.test.ts
+++ b/apps/web/src/routes/-chatIndexTitlebar.test.ts
@@ -15,9 +15,15 @@ describe("hosted static onboarding header", () => {
const onboardingHeader = routeSource.slice(onboardingStart, onboardingEnd);
- expect(onboardingHeader).toContain("h-[var(--workspace-topbar-height)]");
- expect(onboardingHeader).toContain("min-h-[var(--workspace-topbar-height)]");
- expect(onboardingHeader).toContain("COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS");
+ expect(onboardingHeader).toContain("<WorkspacePageHeader");
expect(onboardingHeader).not.toMatch(/(?:^|\s)(?:[\w-]+:)*py-/);
+
+ const headerSource = NodeFS.readFileSync(
+ new URL("../components/WorkspacePageHeader.tsx", import.meta.url),
+ "utf8",
+ );
+ expect(headerSource).toContain("h-[var(--workspace-topbar-height)]");
+ expect(headerSource).toContain("min-h-[var(--workspace-topbar-height)]");
+ expect(headerSource).toContain("COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS");
});
});
diff --git a/apps/web/src/routes/_chat.index.tsx b/apps/web/src/routes/_chat.index.tsx
index 4f4da0c75..ba96e8986 100644
--- a/apps/web/src/routes/_chat.index.tsx
+++ b/apps/web/src/routes/_chat.index.tsx
@@ -8,6 +8,7 @@ import { sortScopedProjectsForSidebar } from "../components/Sidebar.logic";
import { Button } from "../components/ui/button";
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "../components/ui/empty";
import { SidebarInset } from "../components/ui/sidebar";
+import { WorkspacePageHeader } from "../components/WorkspacePageHeader";
import { useNewThreadHandler } from "../hooks/useHandleNewThread";
import {
useAllEnvironmentShellsBootstrapped,
@@ -17,8 +18,6 @@ import {
import { useEnvironments } from "../state/environments";
import { APP_DISPLAY_NAME } from "~/branding";
import { hasCloudPublicConfig } from "~/cloud/publicConfig";
-import { cn } from "~/lib/utils";
-import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
function ChatIndexRouteView() {
const { authGateState } = Route.useRouteContext();
@@ -143,18 +142,13 @@ function HostedStaticOnboardingState() {
return (
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
- <header
- className={cn(
- "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center border-b border-border px-3 transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none sm:px-5",
- COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
- )}
- >
+ <WorkspacePageHeader className="border-b border-border">
<div className="flex items-center gap-2">
<span className="text-sm font-medium text-foreground md:text-muted-foreground/60">
{APP_DISPLAY_NAME}
</span>
</div>
- </header>
+ </WorkspacePageHeader>
<Empty className="flex-1">
<div className="w-full max-w-xl rounded-3xl border border-border/55 bg-card/20 px-8 py-12 shadow-sm/5">
diff --git a/apps/web/src/routes/settings.tsx b/apps/web/src/routes/settings.tsx
index a4b248c84..5e921fca5 100644
--- a/apps/web/src/routes/settings.tsx
+++ b/apps/web/src/routes/settings.tsx
@@ -13,9 +13,8 @@ import { useSettingsRestore } from "../components/settings/SettingsPanels";
import { SettingsBreadcrumb } from "../components/settings/SettingsBreadcrumb";
import { Button } from "../components/ui/button";
import { SidebarInset } from "../components/ui/sidebar";
+import { WorkspacePageHeader } from "../components/WorkspacePageHeader";
import { isElectron } from "../env";
-import { cn } from "~/lib/utils";
-import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
function RestoreDefaultsButton({ onRestored }: { onRestored: () => void }) {
const { changedSettingLabels, restoreDefaults } = useSettingsRestore(onRestored);
@@ -72,41 +71,16 @@ function SettingsContentLayout() {
return (
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
- {!isElectron && (
- <header
- className={cn(
- "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center px-3 transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none sm:px-5",
- COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
- )}
- >
- <div className="flex w-full items-center gap-2">
- <SettingsBreadcrumb pathname={location.pathname} />
- {showRestoreDefaults ? (
- <div className="ms-auto flex items-center gap-2">
- <RestoreDefaultsButton onRestored={handleRestored} />
- </div>
- ) : null}
- </div>
- </header>
- )}
-
- {isElectron && (
- <div
- className={cn(
- "drag-region flex h-[52px] shrink-0 items-center px-5 transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none wco:h-[env(titlebar-area-height)] wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]",
- COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
- )}
- >
- <div className="flex w-full items-center gap-2">
- <SettingsBreadcrumb pathname={location.pathname} />
- {showRestoreDefaults ? (
- <div className="ms-auto flex items-center gap-2">
- <RestoreDefaultsButton onRestored={handleRestored} />
- </div>
- ) : null}
- </div>
+ <WorkspacePageHeader electron={isElectron}>
+ <div className="flex w-full items-center gap-3">
+ <SettingsBreadcrumb pathname={location.pathname} />
+ {showRestoreDefaults ? (
+ <div className="ms-auto flex items-center gap-2">
+ <RestoreDefaultsButton onRestored={handleRestored} />
+ </div>
+ ) : null}
</div>
- )}
+ </WorkspacePageHeader>
<div key={restoreSignal} className="min-h-0 flex flex-1 flex-col">
<Outlet />