Skip to content

Commit c8d6048

Browse files
Merge branch 'main' into fix/opencode-hide-plan-agent
2 parents 154e563 + 07f8027 commit c8d6048

12 files changed

Lines changed: 167 additions & 194 deletions

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ import {
170170
WifiOffIcon,
171171
} from "lucide-react";
172172
import { cn, randomHex } from "~/lib/utils";
173-
import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
174173
import { stackedThreadToast, toastManager } from "./ui/toast";
175174
import { decodeProjectScriptKeybindingRule } from "~/lib/projectScriptKeybindings";
176175
import { type NewProjectScriptInput } from "./ProjectScriptsControl";
@@ -259,6 +258,7 @@ import { ChatHeader } from "./chat/ChatHeader";
259258
import { PanelLayoutControls, RightPanelMaximizeControl } from "./chat/PanelLayoutControls";
260259
import { type ExpandedImagePreview } from "./chat/ExpandedImagePreview";
261260
import { NoActiveThreadState } from "./NoActiveThreadState";
261+
import { WorkspacePageHeader } from "./WorkspacePageHeader";
262262
import {
263263
resolveEffectiveEnvMode,
264264
resolveLocalCheckoutBranchMismatch,
@@ -6240,20 +6240,11 @@ function ChatViewContent(props: ChatViewProps) {
62406240
data-chat-column-maximized-away={rightPanelMaximized ? "true" : "false"}
62416241
>
62426242
{/* Top bar */}
6243-
<header
6243+
<WorkspacePageHeader
62446244
data-chat-header
6245-
className={cn(
6246-
"bg-background transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none",
6247-
isElectron
6248-
? cn(
6249-
"drag-region relative flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center px-3 sm:px-5",
6250-
reserveTitleBarControlInset &&
6251-
!inlineRightPanelOwnsTitleBar &&
6252-
"wco:pr-[var(--workspace-native-controls-inset)]",
6253-
)
6254-
: "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)]",
6255-
COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
6256-
)}
6245+
electron={isElectron}
6246+
reserveNativeControls={reserveTitleBarControlInset && !inlineRightPanelOwnsTitleBar}
6247+
className="relative bg-background"
62576248
>
62586249
{!rightPanelOpen ? panelLayoutControls : null}
62596250
<ChatHeader
@@ -6284,7 +6275,7 @@ function ChatViewContent(props: ChatViewProps) {
62846275
onUpdateProjectScript={updateProjectScript}
62856276
onDeleteProjectScript={deleteProjectScript}
62866277
/>
6287-
</header>
6278+
</WorkspacePageHeader>
62886279

62896280
<ThreadErrorBanner
62906281
error={visibleThreadError}

‎apps/web/src/components/NoActiveThreadState.tsx‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,23 @@
11
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "./ui/empty";
22
import { SidebarInset } from "./ui/sidebar";
33
import { isElectron } from "../env";
4-
import { cn } from "~/lib/utils";
5-
import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "~/workspaceTitlebar";
4+
import { WorkspacePageHeader } from "./WorkspacePageHeader";
65

76
export function NoActiveThreadState() {
87
return (
98
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
109
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-background">
11-
<header
12-
className={cn(
13-
"border-b border-border px-3 transition-[padding-left] duration-200 ease-linear motion-reduce:transition-none sm:px-5",
14-
isElectron
15-
? "drag-region flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center"
16-
: "flex h-[var(--workspace-topbar-height)] min-h-[var(--workspace-topbar-height)] shrink-0 items-center",
17-
COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
18-
)}
19-
>
10+
<WorkspacePageHeader electron={isElectron} className="border-b border-border">
2011
{isElectron ? (
21-
<span className="text-xs text-muted-foreground/50 wco:pr-[var(--workspace-native-controls-inset)]">
22-
No active thread
23-
</span>
12+
<span className="text-xs text-muted-foreground/50">No active thread</span>
2413
) : (
2514
<div className="flex items-center gap-2">
2615
<span className="text-sm font-medium text-foreground md:text-muted-foreground/60">
2716
No active thread
2817
</span>
2918
</div>
3019
)}
31-
</header>
20+
</WorkspacePageHeader>
3221

3322
<Empty className="flex-1">
3423
<div className="w-full max-w-lg px-8 py-12">
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import type { ComponentPropsWithoutRef } from "react";
2+
3+
import { cn } from "../lib/utils";
4+
import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "../workspaceTitlebar";
5+
6+
/** Shared workspace top-bar geometry. */
7+
export function WorkspacePageHeader({
8+
electron = false,
9+
reserveNativeControls = electron,
10+
className,
11+
...props
12+
}: ComponentPropsWithoutRef<"header"> & {
13+
readonly electron?: boolean;
14+
readonly reserveNativeControls?: boolean;
15+
}) {
16+
return (
17+
<header
18+
className={cn(
19+
"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)]",
20+
electron && "drag-region",
21+
reserveNativeControls && "wco:pr-[var(--workspace-native-controls-inset)]",
22+
COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
23+
className,
24+
)}
25+
{...props}
26+
/>
27+
);
28+
}

‎apps/web/src/components/settings/DiagnosticsSettings.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ export function DiagnosticsSettingsPanel() {
992992
: false;
993993

994994
return (
995-
<SettingsPageContainer className="max-w-6xl gap-10">
995+
<SettingsPageContainer width="expanded" className="gap-10">
996996
<ResourceTelemetryDiagnostics />
997997

998998
<SettingsSection

‎apps/web/src/components/settings/KeybindingsSettings.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ export function KeybindingsSettingsPanel() {
11951195
);
11961196

11971197
return (
1198-
<SettingsPageContainer className="max-w-5xl">
1198+
<SettingsPageContainer width="wide">
11991199
<SettingsSection
12001200
{...searchableSetting("keybindings")}
12011201
headerAction={

‎apps/web/src/components/settings/ProjectSettingsPanel.tsx‎

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ import {
8181
type NewProjectScriptInput,
8282
type ProjectScriptEditorRequest,
8383
} from "../projectScriptEditor";
84-
import { cn } from "../../lib/utils";
85-
import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "../../workspaceTitlebar";
8684
import { Button } from "../ui/button";
8785
import { Input } from "../ui/input";
8886
import {
@@ -103,6 +101,7 @@ import {
103101
WorkspaceBreadcrumbItem,
104102
WorkspaceBreadcrumbSeparator,
105103
} from "../WorkspaceBreadcrumb";
104+
import { WorkspacePageHeader } from "../WorkspacePageHeader";
106105
import {
107106
SettingResetButton,
108107
SettingsPageContainer,
@@ -175,26 +174,9 @@ export function ProjectSettingsPage({ projectKey }: { projectKey: string }) {
175174
return (
176175
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
177176
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
178-
{!isElectron && (
179-
<header
180-
className={cn(
181-
"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",
182-
COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
183-
)}
184-
>
185-
<ProjectSettingsBreadcrumb projectKey={projectKey} />
186-
</header>
187-
)}
188-
{isElectron && (
189-
<div
190-
className={cn(
191-
"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)]",
192-
COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
193-
)}
194-
>
195-
<ProjectSettingsBreadcrumb projectKey={projectKey} />
196-
</div>
197-
)}
177+
<WorkspacePageHeader electron={isElectron}>
178+
<ProjectSettingsBreadcrumb projectKey={projectKey} />
179+
</WorkspacePageHeader>
198180
<ProjectSettingsPanel projectKey={projectKey} />
199181
</div>
200182
</SidebarInset>

‎apps/web/src/components/settings/SettingsSidebarNav.tsx‎

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
} from "react";
1010
import {
1111
ArchiveIcon,
12-
ArrowLeftIcon,
1312
BlocksIcon,
1413
BotIcon,
1514
GitBranchIcon,
@@ -20,7 +19,7 @@ import {
2019
Settings2Icon,
2120
XIcon,
2221
} from "lucide-react";
23-
import { useCanGoBack, useLocation, useNavigate } from "@tanstack/react-router";
22+
import { useLocation, useNavigate } from "@tanstack/react-router";
2423

2524
import { Button } from "../ui/button";
2625
import { Input } from "../ui/input";
@@ -35,6 +34,7 @@ import {
3534
useSidebar,
3635
} from "../ui/sidebar";
3736
import { T3ConnectSidebarAvatar, T3ConnectSidebarSignIn } from "../clerk/T3ConnectSidebarSignIn";
37+
import { SidebarUtilityMenu } from "../sidebar/SidebarChrome";
3838
import { scrollToSettingsTarget } from "./settingsLayout";
3939
import {
4040
searchSettings,
@@ -74,7 +74,6 @@ function SettingsSectionIcon({ to }: { to: SettingsPath }) {
7474
export function SettingsSidebarNav({ pathname }: { pathname: string }) {
7575
const navigate = useNavigate();
7676
const currentHash = useLocation({ select: (location) => location.hash });
77-
const canGoBack = useCanGoBack();
7877
const { isMobile, setOpenMobile, open, setOpen } = useSidebar();
7978
const searchInputRef = useRef<HTMLInputElement>(null);
8079
const [query, setQuery] = useState("");
@@ -178,17 +177,6 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
178177
},
179178
[activeResultIndex, clearSearch, handleSearchResultClick, isSearching, results],
180179
);
181-
const handleBackClick = useCallback(() => {
182-
if (isMobile) {
183-
setOpenMobile(false);
184-
}
185-
if (canGoBack) {
186-
window.history.back();
187-
return;
188-
}
189-
void navigate({ to: "/" });
190-
}, [canGoBack, isMobile, navigate, setOpenMobile]);
191-
192180
return (
193181
<>
194182
<SidebarContent className="overflow-x-hidden">
@@ -298,14 +286,9 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
298286
<SidebarFooter className="p-[var(--sidebar-content-inset)]">
299287
<T3ConnectSidebarSignIn />
300288
<div className="flex items-center gap-1">
301-
<SidebarMenu className="min-w-0 flex-1">
302-
<SidebarMenuItem>
303-
<SidebarMenuButton onClick={handleBackClick}>
304-
<ArrowLeftIcon />
305-
<span>Back</span>
306-
</SidebarMenuButton>
307-
</SidebarMenuItem>
308-
</SidebarMenu>
289+
<div className="min-w-0 flex-1">
290+
<SidebarUtilityMenu />
291+
</div>
309292
<T3ConnectSidebarAvatar />
310293
</div>
311294
</SidebarFooter>

‎apps/web/src/components/settings/settingsLayout.tsx‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ import { cn } from "../../lib/utils";
1515
import { Button } from "../ui/button";
1616
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
1717

18+
type SettingsPageWidth = "readable" | "wide" | "expanded";
19+
20+
const SETTINGS_PAGE_WIDTH_CLASS: Record<SettingsPageWidth, string> = {
21+
readable: "max-w-4xl",
22+
wide: "max-w-5xl",
23+
expanded: "max-w-6xl",
24+
};
25+
1826
interface SettingsSearchTargetContextValue {
1927
readonly targetId: string | null;
2028
readonly onTargetHandled: () => void;
@@ -233,9 +241,11 @@ export function SettingResetButton({
233241
export function SettingsPageContainer({
234242
children,
235243
className,
244+
width = "readable",
236245
}: {
237246
children: ReactNode;
238247
className?: string;
248+
width?: SettingsPageWidth;
239249
}) {
240250
const navigate = useNavigate();
241251
const hash = useLocation({ select: (location) => location.hash });
@@ -247,10 +257,16 @@ export function SettingsPageContainer({
247257
return (
248258
<SettingsSearchTargetProvider targetId={targetId} onTargetHandled={clearTargetHash}>
249259
<div
250-
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"
260+
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]"
251261
data-settings-page-scroll
252262
>
253-
<div className={cn("mx-auto flex w-full max-w-4xl flex-col gap-12", className)}>
263+
<div
264+
className={cn(
265+
"mx-auto flex w-full flex-col gap-12 px-5 pt-6 pb-12 sm:px-6",
266+
SETTINGS_PAGE_WIDTH_CLASS[width],
267+
className,
268+
)}
269+
>
254270
{children}
255271
</div>
256272
</div>

0 commit comments

Comments
 (0)