Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

refactor(ui): move the standalone pages onto the shared page shell

Juan Denis4a21e52d1b27
diff --git a/frontend/src/pages/AppMap.jsx b/frontend/src/pages/AppMap.jsx
index 9fe1d0c1..a6783ce2 100644
--- a/frontend/src/pages/AppMap.jsx
+++ b/frontend/src/pages/AppMap.jsx
@@ -12,7 +12,7 @@ import {
Map as MapIcon, Layers, Compass, Network, Info,
} from 'lucide-react';
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
-import { PageTopbar } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import useTabParam from '../hooks/useTabParam';
const VIEWS = [
@@ -284,9 +284,7 @@ export default function AppMap() {
const view = VIEWS.find(v => v.id === activeView) || VIEWS[0];
return (
- <div className="app-map">
- <PageTopbar icon={<MapIcon size={18} />} title="App Map" />
-
+ <PageLayout className="app-map" icon={<MapIcon size={18} />} title="App Map">
<Tabs value={activeView} onValueChange={setActiveView}>
<TabsList>
{VIEWS.map(v => (
@@ -329,6 +327,6 @@ export default function AppMap() {
<Diagram viewId={activeView} />
</ReactFlowProvider>
</div>
- </div>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/CloudflareZoneSettings.jsx b/frontend/src/pages/CloudflareZoneSettings.jsx
index 757d6e49..0fb61900 100644
--- a/frontend/src/pages/CloudflareZoneSettings.jsx
+++ b/frontend/src/pages/CloudflareZoneSettings.jsx
@@ -1,7 +1,7 @@
import { useState, useEffect, useCallback } from 'react';
import { useParams, Link } from 'react-router-dom';
import { Cloud, ShieldCheck, Lock, Gauge, Database, Wand2, Eraser, Flame, Zap, Network, HardDrive } from 'lucide-react';
-import { PageTopbar } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import CloudflareWafPanel from '../components/cloudflare/CloudflareWafPanel';
import WorkersPanel from '../components/cloudflare/WorkersPanel';
import TunnelsPanel from '../components/cloudflare/TunnelsPanel';
@@ -153,8 +153,12 @@ const CloudflareZoneSettings = () => {
if (error) {
return (
- <div className="app-detail-page app-detail-page--wide cf-zone">
- <PageTopbar icon={<Cloud size={18} />} title={crumbs} />
+ <PageLayout
+ className="cf-zone"
+ contentClassName="app-detail-page app-detail-page--wide"
+ icon={<Cloud size={18} />}
+ title={crumbs}
+ >
<div className="cf-zone__body">
<EmptyState
icon={Cloud}
@@ -166,7 +170,7 @@ const CloudflareZoneSettings = () => {
<Link to="/dns"><Button variant="ghost">Back to DNS Zones</Button></Link>
</div>
</div>
- </div>
+ </PageLayout>
);
}
@@ -174,13 +178,13 @@ const CloudflareZoneSettings = () => {
const firstTab = tabGroups[0]?.key || 'actions';
return (
- <div className="app-detail-page app-detail-page--wide cf-zone">
- <PageTopbar
- icon={<Cloud size={18} />}
- title={crumbs}
- meta={zone?.provider_zone_id ? `Zone ${zone.provider_zone_id}` : undefined}
- />
-
+ <PageLayout
+ className="cf-zone"
+ contentClassName="app-detail-page app-detail-page--wide"
+ icon={<Cloud size={18} />}
+ title={crumbs}
+ meta={zone?.provider_zone_id ? `Zone ${zone.provider_zone_id}` : undefined}
+ >
<div className="cf-zone__body">
<Tabs defaultValue={firstTab} className="cf-zone__tabs">
<TabsList>
@@ -316,7 +320,7 @@ const CloudflareZoneSettings = () => {
variant="danger"
/>
)}
- </div>
+ </PageLayout>
);
};
diff --git a/frontend/src/pages/Coexistence.jsx b/frontend/src/pages/Coexistence.jsx
index f0c885ab..8b60a898 100644
--- a/frontend/src/pages/Coexistence.jsx
+++ b/frontend/src/pages/Coexistence.jsx
@@ -4,7 +4,8 @@ import {
Eye, ArrowRightLeft, ServerCog, ShieldCheck, RadioTower, Upload,
RefreshCw, ArrowRight,
} from 'lucide-react';
-import { PageTopbar, Pill } from '@/components/ds';
+import { Pill } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import EmptyState from '@/components/EmptyState';
import api from '../services/api';
@@ -91,19 +92,18 @@ export default function Coexistence() {
const observed = servers.filter(isObserved);
return (
- <div className="page-container coexistence">
- <PageTopbar
- icon={<RadioTower size={18} />}
- title="Coexistence"
- meta="Running alongside another panel"
- actions={
- <Button variant="outline" size="sm" onClick={load} disabled={loading}>
- <RefreshCw size={15} />
- Refresh
- </Button>
- }
- />
-
+ <PageLayout
+ className="coexistence"
+ icon={<RadioTower size={18} />}
+ title="Coexistence"
+ meta="Running alongside another panel"
+ actions={
+ <Button variant="outline" size="sm" onClick={load} disabled={loading}>
+ <RefreshCw size={15} />
+ Refresh
+ </Button>
+ }
+ >
<p className="coexistence__intro app-panel-hint">
ServerKit has three explicit adoption modes. Pick the one that matches where the
box is today — you can move between them as you migrate. The hard rule: keep exactly
@@ -212,6 +212,6 @@ export default function Coexistence() {
</div>
</section>
</div>
- </div>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/DeliveryLog.jsx b/frontend/src/pages/DeliveryLog.jsx
index 26732ea2..cc2d3b7b 100644
--- a/frontend/src/pages/DeliveryLog.jsx
+++ b/frontend/src/pages/DeliveryLog.jsx
@@ -1,7 +1,8 @@
import { useState, useEffect, useCallback, useRef } from 'react';
import { Send, RefreshCw, Inbox } from 'lucide-react';
import api from '../services/api';
-import { PageTopbar, MetricCard, KpiBand, FilterDrawer, FilterButton } from '@/components/ds';
+import { MetricCard, KpiBand, FilterDrawer, FilterButton } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import { useAuth } from '../contexts/AuthContext';
import { useToast } from '../contexts/ToastContext';
@@ -57,34 +58,31 @@ export default function DeliveryLog() {
if (!isAdmin) {
return (
- <>
- <PageTopbar icon={<Send size={18} />} title="Notification Delivery Log" />
+ <PageLayout icon={<Send size={18} />} title="Notification Delivery Log">
<div className="sk-dlog"><div className="sk-dlog__empty">Admins only.</div></div>
- </>
+ </PageLayout>
);
}
const byStatus = stats?.by_status || {};
return (
- <>
- <PageTopbar
- icon={<Send size={18} />}
- title="Notification Delivery Log"
- meta="Outbound deliveries across all channels"
- actions={(
- <>
- <FilterButton
- count={(status !== 'all' ? 1 : 0) + (channel !== 'all' ? 1 : 0)}
- onClick={() => setFiltersOpen(true)}
- />
- <Button variant="outline" size="sm" onClick={load}>
- <RefreshCw size={14} /> Refresh
- </Button>
- </>
- )}
- />
-
+ <PageLayout
+ icon={<Send size={18} />}
+ title="Notification Delivery Log"
+ meta="Outbound deliveries across all channels"
+ actions={(
+ <>
+ <FilterButton
+ count={(status !== 'all' ? 1 : 0) + (channel !== 'all' ? 1 : 0)}
+ onClick={() => setFiltersOpen(true)}
+ />
+ <Button variant="outline" size="sm" onClick={load}>
+ <RefreshCw size={14} /> Refresh
+ </Button>
+ </>
+ )}
+ >
<div className="sk-dlog">
<EmailProviders />
@@ -162,6 +160,6 @@ export default function DeliveryLog() {
setChannel(next.channel || 'all');
}}
/>
- </>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/Documentation.jsx b/frontend/src/pages/Documentation.jsx
index c8902e54..fa40a959 100644
--- a/frontend/src/pages/Documentation.jsx
+++ b/frontend/src/pages/Documentation.jsx
@@ -1,7 +1,7 @@
import { useMemo, useState } from 'react';
import { BookOpen, Search, ExternalLink, FileText } from 'lucide-react';
import { Input } from '@/components/ui/input';
-import { PageTopbar } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
const REPO_DOCS_URL = 'https://github.com/jhd3197/ServerKit/blob/main/docs';
@@ -82,23 +82,22 @@ export default function Documentation() {
const empty = !groups.length && !rootDocs.length;
return (
- <div className="page-container documentation">
- <PageTopbar
- icon={<BookOpen size={18} />}
- title="Documentation"
- meta={<>dev only</>}
- actions={(
- <div className="documentation__search">
- <Search size={14} />
- <Input
- placeholder="Filter docs…"
- value={query}
- onChange={(e) => setQuery(e.target.value)}
- />
- </div>
- )}
- />
-
+ <PageLayout
+ className="documentation"
+ icon={<BookOpen size={18} />}
+ title="Documentation"
+ meta={<>dev only</>}
+ actions={(
+ <div className="documentation__search">
+ <Search size={14} />
+ <Input
+ placeholder="Filter docs…"
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ />
+ </div>
+ )}
+ >
{empty && (
<div className="documentation__empty">No docs match “{query}”.</div>
)}
@@ -124,7 +123,7 @@ export default function Documentation() {
</ul>
</section>
))}
- </div>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/Email.jsx b/frontend/src/pages/Email.jsx
index 9a337e0b..77128dfd 100644
--- a/frontend/src/pages/Email.jsx
+++ b/frontend/src/pages/Email.jsx
@@ -14,7 +14,8 @@ import {
} from 'lucide-react';
import api from '../services/api';
import useTabParam from '../hooks/useTabParam';
-import { PageTopbar, Pill, MetricCard, KpiBand, DataTable } from '@/components/ds';
+import { Pill, MetricCard, KpiBand, DataTable } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import EmptyState from '../components/EmptyState';
@@ -109,17 +110,15 @@ export default function Email() {
}));
return (
- <>
- <PageTopbar
- navLabel="Email Server"
- tabs={tabs}
- actions={(
- <Button variant="outline" size="sm" onClick={() => { loadStatus(); loadDomains(); }}>
- <RefreshCw size={14} /> Refresh
- </Button>
- )}
- />
-
+ <PageLayout
+ navLabel="Email Server"
+ tabs={tabs}
+ actions={(
+ <Button variant="outline" size="sm" onClick={() => { loadStatus(); loadDomains(); }}>
+ <RefreshCw size={14} /> Refresh
+ </Button>
+ )}
+ >
<div className="sk-email">
{loading ? (
<div className="sk-email__empty">Loading…</div>
@@ -141,7 +140,7 @@ export default function Email() {
</>
)}
</div>
- </>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/ImportWizard.jsx b/frontend/src/pages/ImportWizard.jsx
index a0440dcb..4b830e19 100644
--- a/frontend/src/pages/ImportWizard.jsx
+++ b/frontend/src/pages/ImportWizard.jsx
@@ -9,7 +9,8 @@ import api from '../services/api';
import HtaccessConverter from '../components/apps/HtaccessConverter';
import { useToast } from '../contexts/ToastContext';
import { useConfirm } from '../hooks/useConfirm';
-import { PageTopbar, Pill } from '@/components/ds';
+import { Pill } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
@@ -366,24 +367,22 @@ function ImportWizard() {
const stepperIndex = step - 1;
return (
- <>
- <PageTopbar
- icon={<ArrowDownToLine size={18} />}
- title="Import a site"
- meta="Bring a site over from another control panel"
- actions={(
- <>
- {/* Imported sites often carry .htaccess rules — offer the translator here. */}
- <HtaccessConverter />
- {step > 1 && (
- <Button variant="outline" size="sm" onClick={resetWizard}>
- Start over
- </Button>
- )}
- </>
- )}
- />
-
+ <PageLayout
+ icon={<ArrowDownToLine size={18} />}
+ title="Import a site"
+ meta="Bring a site over from another control panel"
+ actions={(
+ <>
+ {/* Imported sites often carry .htaccess rules — offer the translator here. */}
+ <HtaccessConverter />
+ {step > 1 && (
+ <Button variant="outline" size="sm" onClick={resetWizard}>
+ Start over
+ </Button>
+ )}
+ </>
+ )}
+ >
<div className="import-wizard">
{/* Stepper */}
<ol className="import-wizard__stepper">
@@ -680,7 +679,7 @@ function ImportWizard() {
)}
</section>
</div>
- </>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/MonitorDetail.jsx b/frontend/src/pages/MonitorDetail.jsx
index 663d2c05..4f850486 100644
--- a/frontend/src/pages/MonitorDetail.jsx
+++ b/frontend/src/pages/MonitorDetail.jsx
@@ -18,8 +18,9 @@ import EmptyState from '../components/EmptyState';
import UptimeBars from '../components/monitoring/UptimeBars';
import { monitorStateOf } from '../components/monitoring/monitorShared';
import {
- AreaChart, DataTable, KpiBand, MetricCard, PageTopbar, Pill, SegControl,
+ AreaChart, DataTable, KpiBand, MetricCard, Pill, SegControl,
} from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
const POLL_MS = 15000;
@@ -112,24 +113,26 @@ export default function MonitorDetail() {
};
}, [series]);
+ // Both pre-load states keep the shell, so the bar is in place from the
+ // first paint rather than appearing once the monitor resolves.
if (loading && !monitor) {
return (
- <div className="page-container monitor-detail">
+ <PageLayout className="monitor-detail" icon={<ArrowLeft size={18} />} title="Monitor">
<EmptyState loading loadingVariant="detail" title="Loading monitor" />
- </div>
+ </PageLayout>
);
}
if (notFound || !monitor) {
return (
- <div className="page-container monitor-detail">
+ <PageLayout className="monitor-detail" icon={<ArrowLeft size={18} />} title="Monitor">
<EmptyState
icon={ShieldAlert}
title="Monitor not found"
description="It may have been deleted."
action={<Button onClick={() => navigate('/monitoring/monitors')}>Back to monitors</Button>}
/>
- </div>
+ </PageLayout>
);
}
@@ -189,30 +192,30 @@ export default function MonitorDetail() {
};
return (
- <div className="page-container monitor-detail">
- <PageTopbar
- icon={<ArrowLeft size={18} />}
- title={monitor.name}
- meta={`${monitor.check_type} · ${monitor.check_target || 'bound site'} · every ${monitor.check_interval}s`}
- actions={(
- <>
- <Pill kind={state.tone}>{state.label}</Pill>
- <Button variant="outline" size="sm" onClick={onCheckNow} disabled={busy}>
- <RefreshCw size={14} /> Check now
+ <PageLayout
+ className="monitor-detail"
+ icon={<ArrowLeft size={18} />}
+ title={monitor.name}
+ meta={`${monitor.check_type} · ${monitor.check_target || 'bound site'} · every ${monitor.check_interval}s`}
+ actions={(
+ <>
+ <Pill kind={state.tone}>{state.label}</Pill>
+ <Button variant="outline" size="sm" onClick={onCheckNow} disabled={busy}>
+ <RefreshCw size={14} /> Check now
+ </Button>
+ <Button variant="outline" size="sm" onClick={onTogglePause} disabled={busy}>
+ {monitor.is_paused ? <><Play size={14} /> Resume</> : <><Pause size={14} /> Pause</>}
+ </Button>
+ {isHttpish && monitor.check_target && (
+ <Button variant="outline" size="sm" asChild>
+ <a href={monitor.check_target} target="_blank" rel="noreferrer">
+ <ExternalLink size={14} />
+ </a>
</Button>
- <Button variant="outline" size="sm" onClick={onTogglePause} disabled={busy}>
- {monitor.is_paused ? <><Play size={14} /> Resume</> : <><Pause size={14} /> Pause</>}
- </Button>
- {isHttpish && monitor.check_target && (
- <Button variant="outline" size="sm" asChild>
- <a href={monitor.check_target} target="_blank" rel="noreferrer">
- <ExternalLink size={14} />
- </a>
- </Button>
- )}
- </>
- )}
- />
+ )}
+ </>
+ )}
+ >
<nav className="monitor-detail__crumb">
<Link to="/monitoring/monitors">Monitors</Link>
@@ -491,6 +494,6 @@ export default function MonitorDetail() {
</div>
</div>
)}
- </div>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/NotFound.jsx b/frontend/src/pages/NotFound.jsx
index bbd4f1e7..0c990bf5 100644
--- a/frontend/src/pages/NotFound.jsx
+++ b/frontend/src/pages/NotFound.jsx
@@ -1,9 +1,9 @@
import { useLocation, useNavigate } from 'react-router-dom';
import { FileQuestion, LayoutDashboard, Blocks } from 'lucide-react';
-import { PageTopbar } from '@/components/ds';
import { Button } from '@/components/ui/button';
import EmptyState from '@/components/EmptyState';
import { useContributions } from '@/plugins/contributions';
+import PageLayout from '../layouts/PageLayout';
// Catch-all route (App.jsx `path="*"`). Reached for a genuinely unknown URL and,
// importantly, for an extension route whose extension isn't installed/active
@@ -22,15 +22,14 @@ export default function NotFound() {
if (!__ready) {
return (
- <div className="page-container">
+ <PageLayout title="Loading">
<EmptyState loading title="Loading" />
- </div>
+ </PageLayout>
);
}
return (
- <div className="page-container">
- <PageTopbar title="Page not found" />
+ <PageLayout title="Page not found">
<EmptyState
icon={FileQuestion}
title="Page not found"
@@ -52,6 +51,6 @@ export default function NotFound() {
</div>
)}
/>
- </div>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/Notifications.jsx b/frontend/src/pages/Notifications.jsx
index 21873b05..b95da6a0 100644
--- a/frontend/src/pages/Notifications.jsx
+++ b/frontend/src/pages/Notifications.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import { Bell, CheckCheck, ScrollText, X } from 'lucide-react';
import api from '../services/api';
-import { PageTopbar } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import { useAuth } from '../contexts/AuthContext';
import { useNotifications } from '../contexts/NotificationsContext';
@@ -92,25 +92,23 @@ export default function Notifications() {
const noticeItems = (ctxItems || []).filter((it) => it.kind === 'notice');
return (
- <>
- <PageTopbar
- icon={<Bell size={18} />}
- title="Notifications"
- meta={unreadCount ? `${unreadCount} unread` : 'All caught up'}
- actions={(
- <>
- {isAdmin && (
- <Button variant="ghost" size="sm" onClick={() => navigate('/admin/notifications')}>
- <ScrollText size={15} /> Delivery log
- </Button>
- )}
- <Button variant="outline" size="sm" onClick={onMarkAll} disabled={!unreadCount}>
- <CheckCheck size={15} /> {category ? `Mark ${category} read` : 'Mark all read'}
+ <PageLayout
+ icon={<Bell size={18} />}
+ title="Notifications"
+ meta={unreadCount ? `${unreadCount} unread` : 'All caught up'}
+ actions={(
+ <>
+ {isAdmin && (
+ <Button variant="ghost" size="sm" onClick={() => navigate('/admin/notifications')}>
+ <ScrollText size={15} /> Delivery log
</Button>
- </>
- )}
- />
-
+ )}
+ <Button variant="outline" size="sm" onClick={onMarkAll} disabled={!unreadCount}>
+ <CheckCheck size={15} /> {category ? `Mark ${category} read` : 'Mark all read'}
+ </Button>
+ </>
+ )}
+ >
<div className="sk-notif-page">
<div className="sk-notif-page__filters" role="tablist" aria-label="Filter notifications">
<button
@@ -229,6 +227,6 @@ export default function Notifications() {
</div>
)}
</div>
- </>
+ </PageLayout>
);
}
diff --git a/frontend/src/pages/ProjectDetail.jsx b/frontend/src/pages/ProjectDetail.jsx
index 577a5b84..47dce9ff 100644
--- a/frontend/src/pages/ProjectDetail.jsx
+++ b/frontend/src/pages/ProjectDetail.jsx
@@ -14,7 +14,7 @@ import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
import EmptyState from '../components/EmptyState';
import { ConfirmDialog } from '../components/ConfirmDialog';
-import { PageTopbar } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
@@ -102,17 +102,19 @@ const ProjectDetail = () => {
}
}
+ // Loading / not-found take the same shell as the loaded page, so the top
+ // bar does not appear, move, or vanish as the project resolves.
if (loading) {
return (
- <div className="project-detail-page">
+ <PageLayout className="project-detail-page" icon={<FolderKanban size={20} />} title="Project">
<EmptyState loading loadingVariant="detail" title="Loading project" />
- </div>
+ </PageLayout>
);
}
if (error || !project) {
return (
- <div className="project-detail-page">
+ <PageLayout className="project-detail-page" icon={<FolderKanban size={20} />} title="Project">
<EmptyState
icon={FolderKanban}
title="Project not found"
@@ -123,7 +125,7 @@ const ProjectDetail = () => {
</Button>
}
/>
- </div>
+ </PageLayout>
);
}
@@ -132,23 +134,22 @@ const ProjectDetail = () => {
const unassignedApps = apps.filter(a => !a.environment_id);
return (
- <div className="project-detail-page">
- <PageTopbar
- icon={<FolderKanban size={20} />}
- title={project.name}
- meta={project.slug}
- actions={
- <>
- <Button variant="outline" asChild>
- <Link to="/projects"><ArrowLeft size={16} /> Projects</Link>
- </Button>
- <Button onClick={() => setShowCreateEnv(true)}>
- <Plus size={16} /> New Environment
- </Button>
- </>
- }
- />
-
+ <PageLayout
+ className="project-detail-page"
+ icon={<FolderKanban size={20} />}
+ title={project.name}
+ meta={project.slug}
+ actions={
+ <>
+ <Button variant="outline" asChild>
+ <Link to="/projects"><ArrowLeft size={16} /> Projects</Link>
+ </Button>
+ <Button onClick={() => setShowCreateEnv(true)}>
+ <Plus size={16} /> New Environment
+ </Button>
+ </>
+ }
+ >
<div className="project-detail-page__body">
{project.description && (
<p className="project-detail-page__description">{project.description}</p>
@@ -281,7 +282,7 @@ const ProjectDetail = () => {
onConfirm={handleDeleteEnvironment}
onCancel={() => setDeleteEnv(null)}
/>
- </div>
+ </PageLayout>
);
};
diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx
index c0c8a559..66bdbfbe 100644
--- a/frontend/src/pages/Settings.jsx
+++ b/frontend/src/pages/Settings.jsx
@@ -25,7 +25,8 @@ import AboutTab from '../components/settings/AboutTab';
import PluginSlot from '../components/PluginSlot';
import { Activity, Code, Database, Layers, Link2, PaintBucket, Sparkles, Webhook, Settings as SettingsIcon } from 'lucide-react';
import { Button } from '@/components/ui/button';
-import { PageTopbar, SegControl } from '@/components/ds';
+import { SegControl } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { useNavigate } from 'react-router-dom';
const VALID_TABS = ['profile', 'security', 'connections', 'appearance', 'sidebar', 'whitelabel', 'notifications', 'system', 'users', 'activity', 'site', 'sso', 'api', 'webhooks', 'ai', 'modules', 'migrations', 'developer', 'about'];
@@ -55,9 +56,11 @@ const Settings = () => {
}, [isAdmin]);
return (
- <div className="page-container settings-page">
- <PageTopbar icon={<SettingsIcon size={18} />} title="Settings" />
-
+ <PageLayout
+ icon={<SettingsIcon size={18} />}
+ title="Settings"
+ className="settings-page"
+ >
<div className="settings-layout">
<nav className="settings-nav">
{isAdmin && (
@@ -336,7 +339,7 @@ const Settings = () => {
<PluginSlot name="settings.section" context={{ tab: activeTab }} />
</div>
</div>
- </div>
+ </PageLayout>
);
};
diff --git a/frontend/src/pages/TestSandbox.jsx b/frontend/src/pages/TestSandbox.jsx
index ddc279c3..94b81837 100644
--- a/frontend/src/pages/TestSandbox.jsx
+++ b/frontend/src/pages/TestSandbox.jsx
@@ -2,7 +2,8 @@ import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
import EmptyState from '../components/EmptyState';
-import { Pill, PageTopbar } from '@/components/ds';
+import { Pill } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
import { timeAgo, formatDuration } from '../utils/time';
@@ -343,29 +344,28 @@ const TestSandbox = () => {
if (loading) {
return (
- <div className="page-container test-sandbox-page">
+ <PageLayout className="test-sandbox-page" icon={<FlaskConical size={18} />} title="Test Sandbox">
<EmptyState loading loadingVariant="table" size="lg" title="Loading test sandbox..." />
- </div>
+ </PageLayout>
);
}
return (
- <div className="page-container test-sandbox-page">
- <PageTopbar
- icon={<FlaskConical size={18} />}
- title="Test Sandbox"
- actions={(
- <Button
- variant="outline"
- onClick={() => { loadRuns(); }}
- disabled={runsLoading}
- >
- <RefreshCw size={15} />
- Refresh
- </Button>
- )}
- />
-
+ <PageLayout
+ className="test-sandbox-page"
+ icon={<FlaskConical size={18} />}
+ title="Test Sandbox"
+ actions={(
+ <Button
+ variant="outline"
+ onClick={() => { loadRuns(); }}
+ disabled={runsLoading}
+ >
+ <RefreshCw size={15} />
+ Refresh
+ </Button>
+ )}
+ >
{loadError && (
<div className="alert alert-danger">
{loadError}
@@ -549,7 +549,7 @@ const TestSandbox = () => {
</div>
)}
</section>
- </div>
+ </PageLayout>
);
};
diff --git a/frontend/src/pages/WorkspaceDetail.jsx b/frontend/src/pages/WorkspaceDetail.jsx
index af3d65a7..64595e1a 100644
--- a/frontend/src/pages/WorkspaceDetail.jsx
+++ b/frontend/src/pages/WorkspaceDetail.jsx
@@ -7,7 +7,8 @@ import { useAuth } from '../contexts/AuthContext';
import ConfirmDialog from '../components/ConfirmDialog';
import EmptyState from '../components/EmptyState';
import Modal from '@/components/Modal';
-import { Pill, ServiceTile, PageTopbar } from '@/components/ds';
+import { Pill, ServiceTile } from '@/components/ds';
+import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
import {
LayoutGrid, ChevronLeft, Server, Box, Globe,
@@ -180,14 +181,21 @@ const WorkspaceDetail = () => {
} catch (err) { toast.error(err.message); }
};
- if (loading) return <div className="page-container workspaces-page ws-detail"><EmptyState loading loadingVariant="detail" title="Loading workspace" /></div>;
+ // Pre-load states take the same shell as the loaded page.
+ if (loading) {
+ return (
+ <PageLayout className="ws-detail-page" icon={<LayoutGrid size={18} />} title="Workspace">
+ <EmptyState loading loadingVariant="detail" title="Loading workspace" />
+ </PageLayout>
+ );
+ }
if (!ws) {
return (
- <div className="page-container workspaces-page ws-detail">
+ <PageLayout className="ws-detail-page" icon={<LayoutGrid size={18} />} title="Workspace">
<Link className="ws-detail__back" to="/workspaces"><ChevronLeft size={14} /> All workspaces</Link>
<EmptyState icon={LayoutGrid} title="Workspace not found" description="It may have been deleted, or you may not have access." />
- </div>
+ </PageLayout>
);
}
@@ -200,18 +208,19 @@ const WorkspaceDetail = () => {
const since = formatSince(ws.created_at);
return (
- <div className="app-detail-page app-detail-page--wide ws-detail-page">
- <PageTopbar
- className="ws-detail-topbar"
- icon={<LayoutGrid size={18} />}
- title={(
- <span className="ws-crumbs">
- <Link to="/workspaces">Workspaces</Link>
- <span className="ws-crumbs__sep">/</span>
- <span className="ws-crumbs__cur">{ws.name}</span>
- </span>
- )}
- />
+ <PageLayout
+ className="ws-detail-page"
+ topbarClassName="ws-detail-topbar"
+ contentClassName="app-detail-page app-detail-page--wide"
+ icon={<LayoutGrid size={18} />}
+ title={(
+ <span className="ws-crumbs">
+ <Link to="/workspaces">Workspaces</Link>
+ <span className="ws-crumbs__sep">/</span>
+ <span className="ws-crumbs__cur">{ws.name}</span>
+ </span>
+ )}
+ >
<div className="app-detail-body">
<div className="app-detail-header">
@@ -364,7 +373,7 @@ const WorkspaceDetail = () => {
variant="danger"
/>
)}
- </div>
+ </PageLayout>
);
};
diff --git a/frontend/src/styles/pages/_workspaces.scss b/frontend/src/styles/pages/_workspaces.scss
index 625f76f8..8e1fd121 100644
--- a/frontend/src/styles/pages/_workspaces.scss
+++ b/frontend/src/styles/pages/_workspaces.scss
@@ -359,13 +359,10 @@
}
}
-.main-content:has(.ws-detail-page) {
- padding: 0;
-
- @media (max-width: $breakpoint-md) {
- padding: calc(#{$mobile-header-height} + env(safe-area-inset-top) + #{$space-5}) $space-5 $space-5;
- }
-}
+// No `.main-content:has(.ws-detail-page)` escape hatch here any more: the page
+// renders through layouts/PageLayout, so the shared full-bleed rule in
+// _main-content.scss already drops the frame (and keeps the mobile header
+// clearance). A second :has() rule would fight it on small screens.
// Workspace detail page using the shared app-detail-page chrome.
.ws-detail-page {