Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(settings): add tabbed settings page layout

Steven Enamakel83fe95eb3f43
diff --git a/app/src/components/settings/layout/SettingsTabbedPage.tsx b/app/src/components/settings/layout/SettingsTabbedPage.tsx
index 36eb5836e2..335d759d6b 100644
--- a/app/src/components/settings/layout/SettingsTabbedPage.tsx
+++ b/app/src/components/settings/layout/SettingsTabbedPage.tsx
@@ -3,6 +3,13 @@ import type { ReactNode } from 'react';
import { cn } from '../../../lib/cn';
import ChipTabs, { type ChipTabItem } from '../../layout/ChipTabs';
+/**
+ * The one max-width + centring rule for a page's inner content. Applied to the
+ * header block and the body's inner wrapper (never the scroll container, so the
+ * scrollbar stays at the pane edge) so both share a left edge.
+ */
+export const PAGE_CONTENT_WIDTH_CLASS = 'mx-auto w-full max-w-5xl';
+
export interface SettingsTabbedPageProps<T extends string> {
title: ReactNode;
description?: ReactNode;
@@ -42,6 +49,13 @@ export interface SettingsTabbedPageProps<T extends string> {
* still gets rounded corners.
*/
bodyFullBleed?: boolean;
+ /**
+ * Opt out of the shared page width cap ({@link PAGE_CONTENT_WIDTH_CLASS}).
+ * Pages cap and centre their header and body at one max width on wide
+ * windows; Workflows (and Chat, which does not use this template) stay edge
+ * to edge.
+ */
+ fullWidth?: boolean;
children: ReactNode;
}
@@ -76,11 +90,14 @@ export default function SettingsTabbedPage<T extends string>({
tabsTestIdPrefix,
scrollable = true,
bodyFullBleed = false,
+ fullWidth = false,
children,
}: SettingsTabbedPageProps<T>) {
+ const widthClass = fullWidth || bodyFullBleed ? undefined : PAGE_CONTENT_WIDTH_CLASS;
+ const headerWidthClass = fullWidth ? undefined : PAGE_CONTENT_WIDTH_CLASS;
return (
<div className="flex h-full flex-col">
- <div className="space-y-4 pb-4">
+ <div className={cn('space-y-4 pb-4', headerWidthClass)}>
{/* `items-center`, not `items-start`. Top-aligning put the back button
and the action cluster against the `h1`'s line box while the
title+description block ran a row taller, so both read as sitting
@@ -124,13 +141,14 @@ export default function SettingsTabbedPage<T extends string>({
bodyFullBleed && '-mx-4 -mb-4 pr-0'
)}>
<div
- className={
+ className={cn(
bodyFullBleed
? 'h-full min-h-0'
: scrollable
? 'min-h-full pb-4 pt-4'
- : 'h-full min-h-0 pt-4'
- }>
+ : 'h-full min-h-0 pt-4',
+ widthClass
+ )}>
{children}
</div>
</div>
diff --git a/app/src/pages/FlowCanvasPage.tsx b/app/src/pages/FlowCanvasPage.tsx
index 745e2af05a..185e215646 100644
--- a/app/src/pages/FlowCanvasPage.tsx
+++ b/app/src/pages/FlowCanvasPage.tsx
@@ -303,6 +303,7 @@ function CanvasStatePage({ onBack, children }: { onBack: () => void; children: R
return (
<div className="h-full p-4" data-testid="flow-canvas-page">
<SettingsTabbedPage
+ fullWidth
title={t('flows.canvas.title')}
description={t('flows.canvas.description')}
leading={<CanvasBackButton onBack={onBack} />}
@@ -1265,6 +1266,7 @@ function FlowEditor({
</div>
</SidebarContent>
<SettingsTabbedPage
+ fullWidth
title={titleNode}
description={t('flows.canvas.description')}
headerAction={headerActions}
diff --git a/app/src/pages/FlowsPage.tsx b/app/src/pages/FlowsPage.tsx
index 0e544755f6..6bb424e0d6 100644
--- a/app/src/pages/FlowsPage.tsx
+++ b/app/src/pages/FlowsPage.tsx
@@ -570,6 +570,7 @@ export default function FlowsPage() {
which read as a different page depending on how it was reached. */}
<div className="h-full p-4" data-testid="flows-page">
<SettingsTabbedPage
+ fullWidth
title={t('flows.page.title')}
description={t('flows.page.description')}
headerAction={
diff --git a/app/src/pages/WorkflowDiscoveriesPage.tsx b/app/src/pages/WorkflowDiscoveriesPage.tsx
index 46d3a14f42..16b4df0c66 100644
--- a/app/src/pages/WorkflowDiscoveriesPage.tsx
+++ b/app/src/pages/WorkflowDiscoveriesPage.tsx
@@ -13,6 +13,7 @@ export default function WorkflowDiscoveriesPage() {
return (
<div className="h-full p-4">
<SettingsTabbedPage
+ fullWidth
title={t('flows.discoveries.title')}
description={t('flows.discoveries.description')}>
{/* No wrapper padding: SettingsTabbedPage's body already renders
diff --git a/app/src/pages/WorkflowRunsPage.tsx b/app/src/pages/WorkflowRunsPage.tsx
index bcdfe5e332..116b2fbc70 100644
--- a/app/src/pages/WorkflowRunsPage.tsx
+++ b/app/src/pages/WorkflowRunsPage.tsx
@@ -193,6 +193,7 @@ export default function WorkflowRunsPage() {
return (
<div className="h-full p-4" data-testid="workflow-runs-page">
<SettingsTabbedPage
+ fullWidth
title={t('flows.allRuns.title')}
description={t('flows.allRuns.description')}
scrollable={false}>