Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix(ui): keep page headers and navigation flush
picodotffa5d16b41f8
diff --git a/client/src/AGENTS.md b/client/src/AGENTS.mdindex 7c0e241279..9903691184 100644--- a/client/src/AGENTS.md+++ b/client/src/AGENTS.md@@ -43,7 +43,7 @@ These apply to React/Vite client code. Universal constraints (functional program- **Linkable routes for all views** - tabbed pages use URL params, not local state (e.g., `/devtools/history` not `/devtools` with tab state)- **ID-based deep linking for every selectable UI element** - any view that opens/selects a specific record (a project, item, scene, detail, editor, or master-detail selection) MUST encode that selection in the URL via a route param (`/music-video/:projectId`, `/media/timeline/:projectId`, `/media/creative-director/:id/:tab`) — never in local `useState`/`selectedId`. The URL is the single source of truth for "what is open," so every element is directly shareable, bookmarkable, and reachable from ⌘K, voice nav, and media job-completion hooks. Selection handlers `navigate()` to the id'd route; deletes/clears `navigate()` back to the index; render a "not found" fallback for stale/deleted ids. Add both the bare index route and the `:id` detail route in `App.jsx`, and keep the base path registered in `NAV_COMMANDS`.-- **New page → pick the right Layout scroll mode.** `Layout.jsx` has an `isFullWidth` route list: matched routes get a bare `relative overflow-hidden` `<main>` (the PAGE must own an internal `overflow-y-auto`, like the editor's `<section>`); unmatched routes get the default `overflow-auto p-4 md:p-6` scrolling+padded main. A list/index page (e.g. `/universes`, `/pipeline`) should usually be a plain `<div>` and stay OUT of `isFullWidth` so the main scrolls it; only full-bleed editors that manage their own scroll belong in the list. Match `/route/` (trailing slash) to scope full-width to detail/editor sub-routes without catching the bare index. A full-width page with no internal scroll container silently clips below the fold.+- **New page → pick the right Layout scroll mode.** `layoutRoutes.js` classifies the full-width routes used by `Layout.jsx`. Normal title/nav pages should use `PageLayout`: pass a `PageHeader` as `header`, optional `TabPills`/`RouteTabsHeader` as `navigation`, and keep content inside the padded, internally scrolling body. Register the route as full-width so Layout does not add a second gutter/scroller. Chrome has no outer margin or padding; its own label/button padding stays intact. Keep bounded reading widths inside the body. Editors may override `bodyClassName` only when their panes own scrolling (CoS is the example). Intentional document/form routes such as `/apps/create` may keep Layout's default padded scroller; do not classify them full-width without an internal scroll owner. Match path boundaries when adding rules so an index change does not silently change a different detail component. See `docs/PAGE_LAYOUT_AUDIT.md` for the audited exceptions.For the full "adding a new page" checklist (nav manifest entry shape, palette actions, voice aliases), invoke the `portos-add-page` skill.diff --git a/client/src/a11yConventions.test.js b/client/src/a11yConventions.test.jsindex 5d4ba32d74..37a1b7e18b 100644--- a/client/src/a11yConventions.test.js+++ b/client/src/a11yConventions.test.js@@ -4011,7 +4011,6 @@ function B() { const sensors = useSensors(useSensor(PointerSensor)); return <Dndconst ROUTE_HEADING_GAP_ALLOWLIST = new Set(['src/pages/Ambient.jsx', // chromeless ambient display — wants an sr-only h1, not a bar- 'src/pages/CapabilityMap.jsx','src/pages/MoodBoardDetail.jsx','src/pages/UniverseBuilder.jsx',]);diff --git a/client/src/components/Layout.test.jsx b/client/src/components/Layout.test.jsxindex 3398914403..517ab1c24d 100644--- a/client/src/components/Layout.test.jsx+++ b/client/src/components/Layout.test.jsx@@ -690,6 +690,12 @@ describe('Layout — isFullWidthRoute classification', () => {['/models', true], ['/models/performance', true], ['/models/llms', true],// Whole-section prefixes, and the default for an unlisted route.['/songbook', true], ['/', false],+ ['/devtools/runner', true], ['/devtools/runner/', true], ['/devtools/usage', true], ['/devtools/usage/', true], ['/devtools/usage-extra', false],+ ['/devtools/quota-burn', true], ['/devtools/quota-burn/example', true], ['/devtools/quota-burner', false],+ ['/system-resources/overview', true], ['/system-resources/storage', true], ['/system-resources/queues', true],+ ['/workspace-contexts', true], ['/workspace-contexts/example', true], ['/workspace-contexts-other', false],+ ['/instances', true], ['/capabilities', true], ['/loops', true], ['/templates', true],+ ['/cos/agents', true], ['/cos/mind', true], ['/cos/agents/example', true],])('%s -> %s', (pathname, expected) => {expect(isFullWidthRoute(pathname)).toBe(expected);});diff --git a/client/src/components/PageLayout.jsx b/client/src/components/PageLayout.jsxnew file mode 100644index 0000000000..d6fa70e770--- /dev/null+++ b/client/src/components/PageLayout.jsx@@ -0,0 +1,14 @@+// Keep page chrome outside the content gutters and scroll region. Editors may+// replace bodyClassName when their panes own scrolling; ordinary pages retain+// one padded scroll owner. PageHeader and TabPills keep their own touch spacing.+export default function PageLayout({ header, navigation, children, className = '', bodyClassName = 'overflow-auto p-4 md:p-6' }) {+ return (+ <div className={`flex h-full min-h-0 min-w-0 flex-col ${className}`}>+ {header}+ {navigation}+ <div className={`flex-1 min-h-0 min-w-0 ${bodyClassName}`}>+ {children}+ </div>+ </div>+ );+}diff --git a/client/src/components/agents/AgentDetail.jsx b/client/src/components/agents/AgentDetail.jsxindex 38c8599b29..ab0b94669f 100644--- a/client/src/components/agents/AgentDetail.jsx+++ b/client/src/components/agents/AgentDetail.jsx@@ -1,3 +1,4 @@+import TabPills from '../ui/TabPills';import { useState, useEffect, useCallback, useMemo, useRef } from 'react';import { Link, useParams, useNavigate } from 'react-router';import { ArrowLeft } from 'lucide-react';@@ -12,6 +13,10 @@ import PublishedTab from './tabs/PublishedTab';import SchedulesTab from './tabs/SchedulesTab';import ActivityTab from './tabs/ActivityTab';+const NAV_TABS = AGENT_DETAIL_TABS.map(({ icon, ...tab }) => ({+ ...tab, icon: () => <span aria-hidden="true">{icon}</span>,+}));+export default function AgentDetail() {const { agentId } = useParams();return <AgentDetailContent key={agentId} />;@@ -104,7 +109,7 @@ function AgentDetailContent() {);const visibleTabs = useMemo(- () => AGENT_DETAIL_TABS.filter(t =>+ () => NAV_TABS.filter(t =>(t.id !== 'tools' || hasMoltbookAccount) &&(t.id !== 'world' || hasMoltworldAccount)),@@ -195,26 +200,8 @@ function AgentDetailContent() {</div></div>- {/* Sub-tab Navigation */}- <div className="flex gap-1 px-4 py-2 border-b border-port-border bg-port-card/50">- {visibleTabs.map(tabDef => {- const isActive = activeTab === tabDef.id;- return (- <button- key={tabDef.id}- onClick={() => navigate(`/agents/${agentId}/${tabDef.id}`)}- className={`px-4 py-2 rounded-t flex items-center gap-2 transition-colors ${- isActive- ? 'bg-port-bg text-white border-t border-l border-r border-port-border -mb-px'- : 'text-gray-400 hover:text-white hover:bg-port-border/30'- }`}- >- <span>{tabDef.icon}</span>- <span>{tabDef.label}</span>- </button>- );- })}- </div>+ <TabPills tabs={visibleTabs} activeTab={activeTab} onChange={(tab) => navigate(`/agents/${agentId}/${tab}`)}+ ariaLabel="Social agent sections" mobileCompact className="shrink-0 min-w-0" />{/* Tab Content */}<div className="flex-1 overflow-auto bg-port-bg">diff --git a/client/src/components/agents/AgentDetail.test.jsx b/client/src/components/agents/AgentDetail.test.jsxindex 758f727608..5dfaf1a7b8 100644--- a/client/src/components/agents/AgentDetail.test.jsx+++ b/client/src/components/agents/AgentDetail.test.jsx@@ -81,8 +81,8 @@ describe('AgentDetail route lifecycle', () => {mockPlatformDeferreds['agent-b'].resolve([{ platform: 'moltworld' }]);});await waitFor(() => expect(screen.getByText('Agent Beta')).toBeInTheDocument());- expect(screen.getByRole('button', { name: /World/ })).toBeInTheDocument();- expect(screen.queryByRole('button', { name: /Moltbook/ })).not.toBeInTheDocument();+ expect(screen.getByRole('tab', { name: /World/ })).toBeInTheDocument();+ expect(screen.queryByRole('tab', { name: /Moltbook/ })).not.toBeInTheDocument();await act(async () => {mockAgentDeferreds['agent-a'].resolve({ id: 'agent-a', name: 'Agent Alpha', enabled: true });@@ -91,8 +91,8 @@ describe('AgentDetail route lifecycle', () => {expect(screen.getByText('Agent Beta')).toBeInTheDocument();expect(screen.queryByText('Agent Alpha')).not.toBeInTheDocument();- expect(screen.getByRole('button', { name: /World/ })).toBeInTheDocument();- expect(screen.queryByRole('button', { name: /Moltbook/ })).not.toBeInTheDocument();+ expect(screen.getByRole('tab', { name: /World/ })).toBeInTheDocument();+ expect(screen.queryByRole('tab', { name: /Moltbook/ })).not.toBeInTheDocument();});it('clears the old agent before loading the next route and toggles the active agent', async () => {diff --git a/client/src/lib/layoutRoutes.js b/client/src/lib/layoutRoutes.jsindex ed03d47f58..b06da73373 100644--- a/client/src/lib/layoutRoutes.js+++ b/client/src/lib/layoutRoutes.js@@ -155,6 +155,12 @@ const FULL_WIDTH_PATH_PREFIXES = [];const FULL_WIDTH_PATH_REGEXES = [+ // Shared PageLayout owns the scroll; accept React Router's trailing slash+ // without also claiming sibling paths or different detail components.+ /^\/(?:devtools\/(?:runner|usage)|templates|instances|capabilities|loops)\/?$/,+ /^\/devtools\/quota-burn(?:\/|$)/,+ /^\/workspace-contexts(?:\/|$)/,+ /^\/system-resources(?:\/|$)/,// Music mirrors the Media Gen page shell: title bar + tabs over a separately// scrolling body. Keep this boundary-specific so `/music-video` retains its// own route classification.diff --git a/client/src/pages/CapabilityMap.jsx b/client/src/pages/CapabilityMap.jsxindex 05cc23d38a..60b7641f31 100644--- a/client/src/pages/CapabilityMap.jsx+++ b/client/src/pages/CapabilityMap.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useState } from 'react';import toast from '../components/ui/Toast';import { Link } from 'react-router';@@ -56,7 +58,7 @@ function CapabilityRow({ cap, id }) {);}-export default function CapabilityMap() {+function CapabilityMapContent() {const [savedPreference, setSavedPreference] = useState(null);const [saving, setSaving] = useState(false);const { data, loading, error } = useSocketResource(@@ -157,10 +159,7 @@ export default function CapabilityMap() {<div className="space-y-4">{error && <p role="status" className="text-port-warning">Capability refresh failed. Showing the last available reading.</p>}<div className="flex items-center justify-between gap-3 flex-wrap">- <h2 className="text-xl font-bold text-white flex items-center gap-2">- <ListChecks size={20} />- Setup & Capabilities- </h2>+<div className={`flex items-center gap-2 px-3 py-1.5 rounded-lg border ${setup.complete ? STATUS_STYLE.ok.border : STATUS_STYLE.warn.border} ${setup.complete ? STATUS_STYLE.ok.color : STATUS_STYLE.warn.color} ${setup.complete ? STATUS_STYLE.ok.bg : STATUS_STYLE.warn.bg}`}>{setup.complete ? <CheckCircle size={16} /> : <AlertTriangle size={16} />}<span className="font-semibold">@@ -218,3 +217,11 @@ export default function CapabilityMap() {</div>);}++export default function CapabilityMap() {+ return (+ <PageLayout header={<PageHeader icon={ListChecks} title="Setup & Capabilities" />}>+ <CapabilityMapContent />+ </PageLayout>+ );+}diff --git a/client/src/pages/ChiefOfStaff.jsx b/client/src/pages/ChiefOfStaff.jsxindex ef0c27c92b..e353d0c8cc 100644--- a/client/src/pages/ChiefOfStaff.jsx+++ b/client/src/pages/ChiefOfStaff.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useState, useEffect, useCallback, useMemo, useRef, lazy, Suspense } from 'react';import { useParams, useNavigate, useSearchParams } from 'react-router';import { useSocket } from '../hooks/useSocket';@@ -1106,27 +1108,42 @@ export default function ChiefOfStaff() {return <CoSCharacter state={agentState} speaking={speaking} />;};+ const navigation = (+ <TabPills+ tabs={visibleTabs}+ activeTab={activeTab}+ onChange={(id) => navigate(`/cos/${id}`)}+ mobileCompact+ ariaLabel="Chief of Staff sections"+ controlsIdPrefix={loading ? undefined : 'tabpanel'}+ className="w-full min-w-0 shrink-0"+ />+ );+if (loading) {// Reserve the loaded two-pane shell (#4144) — `/cos` is an `isFullWidth`// route, so a centered spinner reserved nothing and the whole page jumped// into place on first paint. `desktopPanelCollapsed` comes from// localStorage, so the skeleton already knows which rail width to hold.return (- <PageSkeleton- layout="split"- label="Loading Chief of Staff"- fullHeight- padded- bodyClassName="p-3 lg:p-4"- sideCollapsed={desktopPanelCollapsed}- splitContainer- splitColsClass={desktopPanelCollapsed ? 'cos-wide:grid-cols-[0px_1fr]' : 'cos-wide:grid-cols-[320px_1fr]'}- sideClassName="flex flex-col gap-3 border-b cos-wide:border-b-0 cos-wide:border-r border-port-accent-2/20 bg-gradient-to-b from-port-card/80 to-port-card/40 p-3 cos-wide:px-4 cos-wide:py-6 cos-wide:h-full cos-wide:overflow-hidden"- sideHero- sideBlocks={4}- sideBlockColsClass="grid-cols-2"- tabs={visibleTabs.length}- />+ <PageLayout className="@container/cos" bodyClassName="overflow-hidden"+ header={<PageHeader icon={Brain} title="Chief of Staff" />}+ navigation={navigation}+ >+ <PageSkeleton+ layout="split"+ label="Loading Chief of Staff"+ fullHeight+ bodyClassName="p-3 lg:p-4"+ sideCollapsed={desktopPanelCollapsed}+ splitContainer+ splitColsClass={desktopPanelCollapsed ? 'cos-wide:grid-cols-[0px_1fr]' : 'cos-wide:grid-cols-[320px_1fr]'}+ sideClassName="flex flex-col gap-3 border-b cos-wide:border-b-0 cos-wide:border-r border-port-accent-2/20 bg-gradient-to-b from-port-card/80 to-port-card/40 p-3 cos-wide:px-4 cos-wide:py-6 cos-wide:h-full cos-wide:overflow-hidden"+ sideHero+ sideBlocks={4}+ sideBlockColsClass="grid-cols-2"+ />+ </PageLayout>);}@@ -1143,7 +1160,10 @@ export default function ChiefOfStaff() {);return (- <div className="@container/cos h-full">+ <PageLayout className="@container/cos" bodyClassName="overflow-hidden"+ header={<PageHeader icon={Brain} title="Chief of Staff" />}+ navigation={navigation}+ ><div className={`relative flex flex-col cos-wide:grid ${desktopPanelCollapsed ? 'cos-wide:grid-cols-[0px_1fr]' : 'cos-wide:grid-cols-[320px_1fr]'} h-full overflow-hidden transition-[grid-template-columns] duration-200`}>{/* Agent Panel */}{!statusKnown ? (@@ -1212,7 +1232,7 @@ export default function ChiefOfStaff() {aria-controls="cos-agent-panel"><div className="flex items-center gap-2">- <h1+ <h2className="text-base font-bold"style={{background: COS_TITLE_GRADIENT,@@ -1222,7 +1242,7 @@ export default function ChiefOfStaff() {}}>CoS- </h1>+ </h2><StatusIndicator running={status?.running} paused={status?.paused} /></div><div className="flex items-center gap-1.5 text-gray-400">@@ -1263,7 +1283,7 @@ export default function ChiefOfStaff() {aria-controls="cos-agent-panel"><div className="flex items-center gap-2">- <h1+ <h2className="text-base font-bold"style={{background: COS_TITLE_GRADIENT,@@ -1273,7 +1293,7 @@ export default function ChiefOfStaff() {}}>CoS- </h1>+ </h2><StatusIndicator running={status?.running} paused={status?.paused} /></div><div className="flex items-center gap-1.5 text-gray-400">@@ -1321,7 +1341,7 @@ export default function ChiefOfStaff() {<div className="hidden cos-wide:block text-sm font-semibold tracking-widest uppercase text-port-text-muted mb-1 font-mono">Digital Assistant</div>- <h1+ <h2className="hidden cos-wide:block text-lg sm:text-xl cos-wide:text-2xl xl:text-3xl font-bold mb-2 cos-wide:mb-4"style={{background: COS_TITLE_GRADIENT,@@ -1331,7 +1351,7 @@ export default function ChiefOfStaff() {}}>Chief of Staff- </h1>+ </h2>{isGenericStatusMessage(statusMessage) && <StatusPill state={agentState} message={statusMessage} />}{!hasCanvasAvatar && renderAvatar()}@@ -1415,19 +1435,6 @@ export default function ChiefOfStaff() {/></div>- {/* Tabs */}- <div className="relative mb-4 shrink-0 lg:mb-6">- <TabPills- tabs={visibleTabs}- activeTab={activeTab}- onChange={(id) => navigate(`/cos/${id}`)}- mobileCompact- ariaLabel="Chief of Staff sections"- controlsIdPrefix="tabpanel"- className="pb-px"- />- </div>-{/* Tab Content */}{activeTab === 'briefing' && (<div role="tabpanel" id="tabpanel-briefing" aria-labelledby="tab-briefing">@@ -1537,6 +1544,6 @@ export default function ChiefOfStaff() {)}</div></div>- </div>+ </PageLayout>);}diff --git a/client/src/pages/ChiefOfStaff.test.jsx b/client/src/pages/ChiefOfStaff.test.jsxindex 57e89aaf96..aef285d88d 100644--- a/client/src/pages/ChiefOfStaff.test.jsx+++ b/client/src/pages/ChiefOfStaff.test.jsx@@ -1255,7 +1255,7 @@ describe('CoS agent panel layout sizing', () => {// must retain cos-wide:w-full and min-w-0 when hasCanvasAvatar is false,// preventing child content like EventLog or StatCards from expanding// beyond the 320px rail.- const title = screen.getByRole('heading', { level: 1, name: 'Chief of Staff' });+ const title = screen.getByRole('heading', { level: 2, name: 'Chief of Staff' });const innerContainer = title.parentElement;expect(innerContainer?.className).toContain('cos-wide:w-full');expect(innerContainer?.className).toContain('min-w-0');diff --git a/client/src/pages/CodeAnimation.jsx b/client/src/pages/CodeAnimation.jsxindex 71c6f3af72..f21ba3d4be 100644--- a/client/src/pages/CodeAnimation.jsx+++ b/client/src/pages/CodeAnimation.jsx@@ -1,3 +1,4 @@+import PageLayout from '../components/PageLayout';import { useCallback, useEffect, useMemo, useRef, useState } from 'react';import { Copy, FileCode2, GitFork, Film, Globe, Images, ImagePlus, LoaderCircle, Music2, PenLine, Sparkles, Wand2, X } from 'lucide-react';import { useLocation, useNavigate, useParams, useSearchParams } from 'react-router';@@ -866,26 +867,26 @@ export default function CodeAnimation() {const mode = pathname.startsWith('/code-animation/production')? 'production': pathname === '/code-animation/gallery' || pathname.startsWith('/code-animation/gallery/') ? 'gallery' : 'fast';- return <div className="flex h-full min-h-0 flex-col">- <PageHeader+ return (+ <PageLayout+ header={<PageHeadericon={FileCode2}title="Code Animation"subtitle="Prompt an LLM to code an animated film, with no assets, in a universe's style, then preview it and record it to video."- />-- <RouteTabsHeader- ariaLabel="Animation mode"- activeTab={mode}- tabs={[- { id: 'fast', label: 'Fast HTML', to: '/code-animation', icon: FileCode2 },- { id: 'gallery', label: 'Gallery', to: '/code-animation/gallery', icon: Images },- { id: 'production', label: 'Production', to: '/code-animation/production', icon: Film },- ]}- />- <div className="flex-1 min-h-0 overflow-auto p-4 md:p-6">+ />}+ navigation={<RouteTabsHeader+ ariaLabel="Animation mode"+ activeTab={mode}+ tabs={[+ { id: 'fast', label: 'Fast HTML', to: '/code-animation', icon: FileCode2 },+ { id: 'gallery', label: 'Gallery', to: '/code-animation/gallery', icon: Images },+ { id: 'production', label: 'Production', to: '/code-animation/production', icon: Film },+ ]}+ />}+ ><div className="mx-auto max-w-7xl">{mode === 'production' ? <ProductionProjects /> : mode === 'gallery' ? <CodeAnimationGallery /> : <FastCodeAnimation />}</div>- </div>- </div>;+ </PageLayout>+ );}diff --git a/client/src/pages/FeatureAgentDetail.jsx b/client/src/pages/FeatureAgentDetail.jsxindex 9f653b71be..92179408d3 100644--- a/client/src/pages/FeatureAgentDetail.jsx+++ b/client/src/pages/FeatureAgentDetail.jsx@@ -1,3 +1,4 @@+import TabPills from '../components/ui/TabPills';import { useState, useEffect, useCallback, useRef } from 'react';import useMounted from '../hooks/useMounted';import { useParams, useNavigate, Link } from 'react-router';@@ -99,15 +100,12 @@ export default function FeatureAgentDetail() {label="Loading agent"fullHeightpadded- // Hand-rolled header block (not PageHeader) with the tab row inside it.- barClassName="px-6 pt-6 pb-4"bodyClassName="p-6"titleWidthClass="w-56"showSubtitlesubtitleOnMobileshowAction={false}tabs={isCreate ? 0 : TABS.length}- tabsInBarcards={3}sidebar={false}/>@@ -126,8 +124,8 @@ export default function FeatureAgentDetail() {return (<div className="flex flex-col h-full">{/* Header */}- <div className="shrink-0 px-6 pt-6 pb-4 border-b border-port-border">- <div className="flex items-center gap-3 mb-3">+ <div className="shrink-0 px-3 py-2 sm:px-4 sm:py-3 border-b border-port-border">+ <div className="flex items-center gap-3"><Link to="/feature-agents" className="p-1.5 text-gray-400 hover:text-white hover:bg-port-border/50 rounded-lg transition-colors"><ArrowLeft size={18} /></Link>@@ -141,26 +139,11 @@ export default function FeatureAgentDetail() {)}</div></div>-- {!isCreate && (- <div className="flex gap-1 overflow-x-auto">- {TABS.map(({ id: tabId, label, icon: Icon }) => (- <button- key={tabId}- onClick={() => navigate(`/feature-agents/${id}/${tabId}`)}- className={`flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium whitespace-nowrap transition-colors ${- activeTab === tabId- ? 'bg-port-accent/10 text-port-accent'- : 'text-gray-400 hover:text-white hover:bg-port-border/50'- }`}- >- <Icon size={16} />- {label}- </button>- ))}- </div>- )}</div>+ {!isCreate && (+ <TabPills tabs={TABS} activeTab={activeTab} onChange={(tab) => navigate(`/feature-agents/${id}/${tab}`)}+ ariaLabel="Feature agent sections" mobileCompact className="shrink-0 min-w-0" />+ )}{/* Content */}<div className="flex-1 overflow-auto p-6">diff --git a/client/src/pages/Instances.jsx b/client/src/pages/Instances.jsxindex 82046261c2..7b89b23f4c 100644--- a/client/src/pages/Instances.jsx+++ b/client/src/pages/Instances.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useState, useEffect, useCallback, useMemo, useRef } from 'react';import {Network, Plus, Trash2, RefreshCw, Edit3, Check, X,@@ -1561,10 +1563,6 @@ export function PeerCard({ peer, onRefresh, syncStatus, tailnetInfo, parityRepor);}-export default function Instances() {- return <TailcatServeProvider><InstancesContent /></TailcatServeProvider>;-}-function InstancesContent() {const peerAddressRef = useRef(null);const [searchParams, setSearchParams] = useSearchParams();@@ -1673,12 +1671,6 @@ function InstancesContent() {renderPanel={(forwardsPanel, orphanCount) => (<UnattendedRenderRouting peers={peers} renderPanel={(routingPanel, routeAttention) => (<div className="space-y-4">- <div className="flex items-center gap-3">- <Network size={24} className="text-port-accent" />- <h1 className="text-2xl font-bold text-white">Instances</h1>- <span className="text-sm text-gray-500">PortOS Federation</span>- </div>-<div className="flex flex-wrap gap-2"><button type="button" onClick={() => openDrawer('add')}className="min-h-[44px] inline-flex items-center gap-1 rounded-lg bg-port-accent px-3 text-sm text-white">@@ -1790,3 +1782,11 @@ function InstancesContent() {)} />);}++export default function Instances() {+ return (+ <PageLayout header={<PageHeader icon={Network} title="Instances" subtitle="PortOS Federation" />}>+ <TailcatServeProvider><InstancesContent /></TailcatServeProvider>+ </PageLayout>+ );+}diff --git a/client/src/pages/Loops.jsx b/client/src/pages/Loops.jsxindex 4d826bb908..604a275817 100644--- a/client/src/pages/Loops.jsx+++ b/client/src/pages/Loops.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useState, useEffect, useRef, useCallback, useId } from 'react';import {RefreshCw, Play, Square, Trash2, Plus, Clock, Zap, ChevronDown, ChevronRight,@@ -342,7 +344,7 @@ const LOOP_EVENTS = ['loop:iteration:start', 'loop:iteration:complete', 'loop:iteration:error',];-export default function Loops() {+function LoopsContent() {// The create form is always on screen above the list, so the empty state's// call to action focuses its prompt field rather than opening anything.const promptRef = useRef(null);@@ -377,11 +379,8 @@ export default function Loops() {return (<div className="space-y-4">- <div className="flex items-center justify-between">+ <div className="flex flex-wrap items-center justify-between gap-3"><div>- <h1 className="text-xl font-bold text-gray-100 flex items-center gap-2">- <RefreshCw size={20} className="text-port-accent" /> Loops- </h1><p className="text-xs text-gray-500 mt-0.5">Recurring AI tasks — like Claude Code's /loop, for any AI provider</p>@@ -425,3 +424,11 @@ export default function Loops() {</div>);}++export default function Loops() {+ return (+ <PageLayout header={<PageHeader icon={RefreshCw} title="Loops" />}>+ <LoopsContent />+ </PageLayout>+ );+}diff --git a/client/src/pages/PageLayout.browser.test.js b/client/src/pages/PageLayout.browser.test.jsnew file mode 100644index 0000000000..24d5f3a528--- /dev/null+++ b/client/src/pages/PageLayout.browser.test.js@@ -0,0 +1,193 @@+// @vitest-environment node+import { afterAll, beforeAll, describe, expect, it } from 'vitest';+import { mkdir } from 'node:fs/promises';+import { join } from 'node:path';+import { fileURLToPath } from 'node:url';+import { createServer } from 'vite';+import react from '@vitejs/plugin-react';+import { chromium } from 'playwright-core';+import { BROWSER_FIXTURE_STARTUP_MS, startBrowserFixture } from '../test/browserFixture.js';+import { resolveTestChrome } from '../../../scripts/lib/testChrome.js';++const chrome = resolveTestChrome();+const root = fileURLToPath(new URL('../..', import.meta.url));+const usage = {+ totalSessions: 12, totalMessages: 120, totalTokens: { input: 12000, output: 4000 },+ last7Days: [], hourlyActivity: Array(24).fill(0), topProviders: [], topModels: [],+ report: { providers: [{ id: 'example', name: 'Example provider', sessions: 12, tokensIn: 12000, tokensOut: 4000, estimatedCost: 0.12, source: 'measured', models: [{ model: 'example-long-model-name-for-card-layout-verification', sessions: 12, tokensIn: 12000, tokensOut: 4000, estimatedCost: 0.12 }] }], totals: { estimatedCost: 0, source: 'estimate' } },+};+const responses = {+ '/cos': { running: false, config: { avatarStyle: 'svg' }, stats: {} },+ '/cos/tasks': { user: [], cos: [] },+ '/cos/agents': [],+ '/cos/agents/completed': { items: [], total: 0, nextCursor: null },+ '/cos/agents/feedback/pending': { agents: [], count: 0 },+ '/cos/health': { issues: [] },+ '/cos/activity/today': { isRunning: false, stats: { completed: 0 } },+ '/cos/learning': null,+ '/cos/learning/durations': null,+ '/providers/status': { providers: {} },+ '/cos/learning/summary': null,+ '/cos/budget-usage': { usage: {} },+ '/cos/insights': { insights: [] },+ '/avatar/rigged': { records: [] },+ '/providers': { providers: [] },+ '/apps': [],+ '/instances': { peers: [] },+ '/settings/features': { features: [] },+ '/code-animation/jobs': { items: [], total: 0, counts: { running: 0, completed: 0 }, nextCursor: null },+ '/usage': usage,+ '/usage/backfill': { status: 'idle' },+ '/usage/rolling-cost': { windowDays: 30, instanceCount: 1, series: [], points: [] },+ '/usage/claude-code/models': { filesScanned: 0, models: [], totals: {} },+ '/usage/providers': { providers: ['claude', 'agy', 'codex', 'grok'].map(family => ({+ family, label: `Example ${family}`, supported: true,+ limits: [{ key: 'week', label: 'Weekly usage', percentUsed: 40, percentRemaining: 60 }],+ })) },+};++// Real route components and Tailwind, synthetic API only. Layout's classification+// test covers its main; this models the available space beside the global rail.+describe.skipIf(!chrome)('routed page chrome and content geometry', () => {+ let fixture;+ beforeAll(async () => {+ fixture = await startBrowserFixture({ name: 'page-layout', createServer, chromium,+ launchOptions: { executablePath: chrome, args: ['--mute-audio', '--no-sandbox'] },+ // Cold compilation belongs to the fixture's bounded warmup phase, not+ // a geometry assertion's interaction timeout.+ warmup: async (page, origin) => {+ await page.route('**/api/**', route => {+ const key = new URL(route.request().url()).pathname.slice(4);+ return route.fulfill({ json: Object.hasOwn(responses, key) ? responses[key] : {} });+ });+ await page.goto(`${origin}layout-test?route=/code-animation/gallery`, { waitUntil: 'domcontentloaded' });+ await page.locator('h1').waitFor();+ },+ viteConfig: temp => ({+ configFile: false, root, cacheDir: join(temp, 'vite-cache'),+ optimizeDeps: {+ entries: ['src/pages/ChiefOfStaff.jsx', 'src/pages/CodeAnimation.jsx', 'src/pages/UsagePage.jsx', 'src/pages/SystemHealthPage.jsx'],+ include: ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime', 'react-router', 'lucide-react'],+ },+ plugins: [react(), {+ name: 'page-layout-fixture', enforce: 'pre',+ resolveId(id) {+ if (id === '/layout-fixture.jsx') return '\0layout-fixture.jsx';+ if (/\/services\/socket(?:\.js)?$/.test(id)) return '\0layout-socket';+ },+ load(id) {+ if (id === '\0layout-socket') return 'export default { connected: false, on() {}, off() {}, emit() {} };';+ if (id !== '\0layout-fixture.jsx') return;+ return `+ import React from 'react';+ import { createRoot } from 'react-dom/client';+ import { MemoryRouter, Routes, Route } from 'react-router';+ import ChiefOfStaff from '/src/pages/ChiefOfStaff.jsx';+ import CodeAnimation from '/src/pages/CodeAnimation.jsx';+ import UsagePage from '/src/pages/UsagePage.jsx';+ import SystemHealthPage from '/src/pages/SystemHealthPage.jsx';+ import { isFullWidthRoute } from '/src/lib/layoutRoutes.js';+ import '/src/index.css';+ const path = new URLSearchParams(location.search).get('route') || '/cos/agents';+ const rail = innerWidth >= 768 ? 256 : 0;+ const h = React.createElement;+ createRoot(document.getElementById('root')).render(+ h(MemoryRouter, { initialEntries: [path] },+ h('main', { id: 'fixture-main', style: {height: '100dvh', marginLeft: rail, width: 'calc(100% - ' + rail + 'px)'},+ className: isFullWidthRoute(path) ? 'relative overflow-hidden' : 'overflow-auto p-4 md:p-6' },+ h(Routes, null,+ h(Route, { path: '/cos/:tab', element: h(ChiefOfStaff) }),+ h(Route, { path: '/code-animation/gallery', element: h(CodeAnimation) }),+ h(Route, { path: '/devtools/usage', element: h(UsagePage) }),+ h(Route, { path: '/system-resources/:tab', element: h(SystemHealthPage) })))));++ `;+ },+ configureServer(vite) {+ vite.middlewares.use('/layout-test', async (_req, res) => {+ res.setHeader('Content-Type', 'text/html');+ res.end(await vite.transformIndexHtml('/layout-test', '<meta name="viewport" content="width=device-width, initial-scale=1"><div id="root"></div><script type="module" src="/layout-fixture.jsx"></script>'));+ });+ },+ }], server: { host: '127.0.0.1', port: 0 },+ }),+ });+ }, BROWSER_FIXTURE_STARTUP_MS);+ afterAll(() => fixture?.close());++ it.each([1440, 1024, 390, 320])('keeps chrome flush and card edges inside the scroll body at %i px', async width => {+ const page = await fixture.browser.newPage({ viewport: { width, height: 900 }, reducedMotion: 'reduce' });+ page.setDefaultTimeout(10000);+ const errors = [];+ page.on('pageerror', error => errors.push(error.message));+ await page.route('**/*', route => {+ const url = new URL(route.request().url());+ if (url.origin !== new URL(fixture.origin).origin) return route.abort();+ if (!url.pathname.startsWith('/api/')) return route.continue();+ const key = url.pathname.slice(4);+ return route.fulfill({ json: Object.hasOwn(responses, key) ? responses[key] : {} });+ });+ try {+ for (const path of ['/code-animation/gallery', '/cos/agents', '/cos/health', '/system-resources/storage', '/devtools/usage']) {+ await page.goto(`${fixture.origin}layout-test?route=${encodeURIComponent(path)}`, { waitUntil: 'domcontentloaded' });+ await page.locator('h1').waitFor();+ if (path.startsWith('/cos/')) await page.getByRole('tabpanel').waitFor();+ if (path === '/code-animation/gallery') await page.getByText('Animations you generate in Fast HTML appear here.').waitFor();+ if (path === '/cos/health') await page.getByText('No issues detected', { exact: true }).waitFor();+ if (path === '/cos/agents') await page.getByRole('heading', { name: 'Active Agents', exact: true }).waitFor();+ if (path === '/devtools/usage') await page.getByText('Example claude', { exact: true }).first().waitFor();+ expect(await page.getByRole('alert').count(), path).toBe(0);+ const geometry = await page.locator('main').evaluate(main => {+ const shell = main.firstElementChild;+ const [header, nav, body] = shell.children;+ const rect = el => { const r = el.getBoundingClientRect(); return { x: r.x, y: r.y, right: r.right, bottom: r.bottom }; };+ return {+ main: rect(main), header: rect(header), nav: rect(nav), body: rect(body),+ mainWidth: main.clientWidth, mainScrollWidth: main.scrollWidth,+ bodyWidth: body.clientWidth, bodyScrollWidth: body.scrollWidth,+ h1s: main.querySelectorAll('h1').length,+ };+ });+ expect(geometry.h1s, path).toBe(1);+ expect(geometry.header.x, path).toBe(geometry.main.x);+ expect(geometry.header.y, path).toBe(geometry.main.y);+ expect(geometry.header.right, path).toBe(geometry.main.right);+ expect(geometry.nav.x, path).toBe(geometry.main.x);+ expect(geometry.nav.y, path).toBe(geometry.header.bottom);+ expect(geometry.nav.right, path).toBe(geometry.main.right);+ expect(geometry.body.bottom, path).toBeLessThanOrEqual(geometry.main.bottom + 1);+ expect(geometry.mainScrollWidth, path).toBeLessThanOrEqual(geometry.mainWidth + 1);+ expect(geometry.bodyScrollWidth, path).toBeLessThanOrEqual(geometry.bodyWidth + 1);+ if (path === '/devtools/usage') {+ const edges = await page.evaluate(() => {+ const body = document.querySelector('main').firstElementChild.lastElementChild;+ const style = getComputedStyle(body);+ const r = body.getBoundingClientRect();+ const cards = [...body.querySelectorAll('.bg-port-card')].filter(el => el.getBoundingClientRect().width > 0);+ return { padding: [style.paddingLeft, style.paddingRight], count: cards.length,+ outside: cards.filter(el => { const c = el.getBoundingClientRect(); return c.x < r.x + parseFloat(style.paddingLeft) - 1 || c.right > r.x + body.clientWidth - parseFloat(style.paddingRight) + 1; }).map(el => el.textContent.slice(0, 80)),+ unbalanced: cards.filter(el => { const s = getComputedStyle(el); return s.paddingLeft !== s.paddingRight; }).length,+ overflowing: cards.filter(el => el.scrollWidth > el.clientWidth + 1).map(el => el.textContent.slice(0, 80)),+ };+ });+ expect(edges.padding).toEqual(width < 768 ? ['16px', '16px'] : ['24px', '24px']);+ expect(edges.count).toBeGreaterThan(5);+ expect(edges.outside).toEqual([]);+ expect(edges.unbalanced).toBe(0);+ expect(edges.overflowing).toEqual([]);+ const body = page.locator('main > div > div').last();+ const before = await page.locator('h1').boundingBox();+ await body.evaluate(el => { el.scrollTop = el.scrollHeight; });+ expect((await page.locator('h1').boundingBox()).y).toBe(before.y);+ expect(await body.evaluate(el => el.scrollTop)).toBeGreaterThan(0);+ await body.evaluate(el => { el.scrollTop = 0; });+ }+ if (process.env.PORTOS_LAYOUT_SCREENSHOTS) {+ await mkdir(process.env.PORTOS_LAYOUT_SCREENSHOTS, { recursive: true });+ await page.screenshot({ path: join(process.env.PORTOS_LAYOUT_SCREENSHOTS, `${path.replaceAll('/', '_')}-${width}.png`) });+ }+ }+ expect(errors).toEqual([]);+ } finally { await page.close(); }+ }, 60000);+});diff --git a/client/src/pages/QuotaBurn.jsx b/client/src/pages/QuotaBurn.jsxindex bcff24609e..3290e9cfe9 100644--- a/client/src/pages/QuotaBurn.jsx+++ b/client/src/pages/QuotaBurn.jsx@@ -1,3 +1,6 @@+import ModelsTabsHeader from '../components/models/ModelsTabsHeader';+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';/*** Quota Burn — configure the ONE install-level loop that spends subscription* quota which would otherwise expire unused.@@ -75,7 +78,7 @@ const normalizeCatalog = (data) => ({])),});-export default function QuotaBurn() {+function QuotaBurnContent() {// Which family is expanded lives in the URL, not local state, so a specific// family's plan is linkable and survives a reload.const { familyId: expanded } = useParams();@@ -470,7 +473,6 @@ export default function QuotaBurn() {</Banner>)}<header className="flex flex-wrap items-center gap-3">- <h1 className="text-xl font-semibold text-white flex items-center gap-2"><Flame size={20} className="text-orange-400" /> Quota Burn</h1>{/* There is no Save button on this page, and nothing else said so — thesilence is what makes people reach for the nearest button-shapedthing (the per-job ▶, which spends quota) to "commit" an edit. */}@@ -583,3 +585,11 @@ export default function QuotaBurn() {</div>);}++export default function QuotaBurn() {+ return (+ <PageLayout header={<PageHeader icon={Flame} title="Quota Burn" />} navigation={<ModelsTabsHeader activeTab="quota-burn" />}>+ <QuotaBurnContent />+ </PageLayout>+ );+}diff --git a/client/src/pages/RunnerPage.jsx b/client/src/pages/RunnerPage.jsxindex 7203ebf426..22e245c393 100644--- a/client/src/pages/RunnerPage.jsx+++ b/client/src/pages/RunnerPage.jsx@@ -1,3 +1,4 @@+import PageLayout from '../components/PageLayout';import { useState, useEffect, useRef, useCallback } from 'react';import { useLocation, useNavigate } from 'react-router';import { Clock, Image, X, Info, Code2 } from 'lucide-react';@@ -273,12 +274,12 @@ ${prompt.trim()}`;const currentProvider = providers.find(p => p.id === selectedProvider);return (- <div className="space-y-6">- <PageHeader+ <PageLayout header={<PageHeadericon={Code2}title="Code Runner"subtitle="Execute AI assistant tasks and shell commands across workspaces"- />+ />}>+ <div className="space-y-6">{/* Continuation Context Banner */}{continueContext && (@@ -543,7 +544,8 @@ ${prompt.trim()}`;)}</div></div>- </div>+ </div>+ </PageLayout>);}diff --git a/client/src/pages/SystemHealthPage.jsx b/client/src/pages/SystemHealthPage.jsxindex ecab833b9a..afa1050bb1 100644--- a/client/src/pages/SystemHealthPage.jsx+++ b/client/src/pages/SystemHealthPage.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useEffect, useState, useRef } from 'react';import { Link, Navigate, useParams } from 'react-router';import { Activity, AlertTriangle, HardDrive, Cpu, Database, ListOrdered, RefreshCw, ServerCog, X, Zap } from 'lucide-react';@@ -76,23 +78,11 @@ export default function SystemResourcesPage() {const activeTabLabel = RESOURCE_TABS.find((item) => item.id === tab)?.label;return (- <div className="mx-auto max-w-7xl space-y-4">- <header className="overflow-hidden rounded-2xl border border-port-border bg-gradient-to-r from-port-card via-port-card to-port-accent/10 p-4 sm:p-5">- <div className="flex items-start gap-3">- <div className="rounded-xl bg-port-accent/15 p-2.5 text-port-accent"><ServerCog size={22} /></div>- <div>- <h1 className="text-xl font-bold text-white">System Resources</h1>- <p className="mt-1 max-w-3xl text-sm text-gray-400">- Health, disk intelligence, and active work queues in one control center.- </p>- </div>- </div>- <div className="mt-5">- <RouteTabsHeader tabs={RESOURCE_TABS} activeTab={tab} ariaLabel="System resources sections" />- </div>- </header>-- <div role="tabpanel" aria-labelledby="system-resources-panel-heading">+ <PageLayout+ header={<PageHeader icon={ServerCog} title="System Resources" subtitle="Health, disk intelligence, and active work queues in one control center." />}+ navigation={<RouteTabsHeader tabs={RESOURCE_TABS} activeTab={tab} ariaLabel="System resources sections" />}+ >+ <div className="mx-auto max-w-7xl" role="tabpanel" aria-labelledby="system-resources-panel-heading"><h2 id="system-resources-panel-heading" className="sr-only">{activeTabLabel}</h2>{tab === 'overview' && <SystemHealthOverview />}{tab === 'storage' && (@@ -106,7 +96,7 @@ export default function SystemResourcesPage() {)}{tab === 'queues' && <QueuesPanel />}</div>- </div>+ </PageLayout>);}diff --git a/client/src/pages/Templates.jsx b/client/src/pages/Templates.jsxindex 6ae6d33232..cb61c898c4 100644--- a/client/src/pages/Templates.jsx+++ b/client/src/pages/Templates.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useState, useCallback } from 'react';import { useNavigate } from 'react-router';import { Layers, Code, Server, Globe, Smartphone, MonitorSmartphone, Plus } from 'lucide-react';@@ -17,7 +19,7 @@ const ICONS = {'monitor-smartphone': MonitorSmartphone};-export default function Templates() {+function TemplatesContent() {const navigate = useNavigate();const [selectedTemplate, setSelectedTemplate] = useState(null);const [createMode, setCreateMode] = useState(false);@@ -81,10 +83,7 @@ export default function Templates() {return (<div><div className="flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-6">- <div>- <h1 className="text-2xl font-bold text-white">App Templates</h1>- <p className="text-gray-500 text-sm sm:text-base">Create new apps from pre-configured templates</p>- </div>+ <p className="text-gray-500 text-sm sm:text-base">Create new apps from pre-configured templates</p><buttononClick={() => navigate('/apps/create')}className="px-4 py-2 text-gray-400 hover:text-white text-sm sm:text-base self-start sm:self-auto"@@ -238,3 +237,11 @@ export default function Templates() {</div>);}++export default function Templates() {+ return (+ <PageLayout header={<PageHeader icon={Layers} title="App Templates" />}>+ <TemplatesContent />+ </PageLayout>+ );+}diff --git a/client/src/pages/UsagePage.jsx b/client/src/pages/UsagePage.jsxindex b271681b93..c789144d43 100644--- a/client/src/pages/UsagePage.jsx+++ b/client/src/pages/UsagePage.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useCallback, useState, useEffect, useRef } from 'react';import { useSearchParams } from 'react-router';import { RefreshCw, AlertTriangle, DatabaseZap, Network } from 'lucide-react';@@ -15,7 +17,7 @@ import FleetUsageCard from '../components/usage/FleetUsageCard';import RollingCostCard from '../components/usage/RollingCostCard';import FreeTierUsageCard from '../components/usage/FreeTierUsageCard';import ProviderQuotaBody from '../components/usage/ProviderQuotaBody';-import ModelsTabsHeader, { ModelsSectionLayout } from '../components/models/ModelsTabsHeader';+import ModelsTabsHeader from '../components/models/ModelsTabsHeader';import { USAGE_PERIOD_OPTIONS, DEFAULT_USAGE_PERIOD } from '../lib/usagePeriods';@@ -161,7 +163,7 @@ function ProviderQuotaSection() {return (<div className="space-y-3"><div className="flex items-center justify-between">- <h1 className="text-xl sm:text-2xl font-bold text-white">Subscription Usage</h1>+ <h2 className="text-xl sm:text-2xl font-bold text-white">Subscription quotas</h2><buttontype="button"onClick={() => load(true)}@@ -445,11 +447,15 @@ function CostReportFilters({ period, from, to, isCustom, onPeriod, onRange }) {{opt.label}</button>))}- <div className={`flex items-center gap-1.5 rounded-full border px-2 py-0.5 ${isCustom ? 'border-port-accent bg-port-accent/10' : 'border-port-border'}`}>- <label htmlFor="usage-from" className="text-xs text-gray-400">From</label>- <RangeDateInput id="usage-from" label="From date" value={from} onCommit={(v) => onRange(v, to)} />- <label htmlFor="usage-to" className="text-xs text-gray-400">To</label>- <RangeDateInput id="usage-to" label="To date" value={to} onCommit={(v) => onRange(from, v)} />+ <div className={`flex flex-wrap items-center gap-1.5 rounded-xl border px-2 py-0.5 ${isCustom ? 'border-port-accent bg-port-accent/10' : 'border-port-border'}`}>+ <div className="flex items-center gap-1.5">+ <label htmlFor="usage-from" className="text-xs text-gray-400">From</label>+ <RangeDateInput id="usage-from" label="From date" value={from} onCommit={(v) => onRange(v, to)} />+ </div>+ <div className="flex items-center gap-1.5">+ <label htmlFor="usage-to" className="text-xs text-gray-400">To</label>+ <RangeDateInput id="usage-to" label="To date" value={to} onCommit={(v) => onRange(from, v)} />+ </div></div></div>);@@ -924,13 +930,12 @@ function InternalUsageMetrics() {export function UsagePage() {return (- <ModelsSectionLayout activeTab="usage">- <ModelsTabsHeader activeTab="usage" />- <div className="min-h-0 min-w-0 flex-1 space-y-6 overflow-auto">+ <PageLayout header={<PageHeader title="Subscription Usage" />} navigation={<ModelsTabsHeader activeTab="usage" />}>+ <div className="space-y-6"><ProviderQuotaSection /><InternalUsageMetrics /></div>- </ModelsSectionLayout>+ </PageLayout>);}diff --git a/client/src/pages/WorkspaceContexts.jsx b/client/src/pages/WorkspaceContexts.jsxindex 8cb56b9916..fcc8c81fe1 100644--- a/client/src/pages/WorkspaceContexts.jsx+++ b/client/src/pages/WorkspaceContexts.jsx@@ -1,3 +1,5 @@+import PageHeader from '../components/PageHeader';+import PageLayout from '../components/PageLayout';import { useState, useEffect, useCallback } from 'react';import { useParams, useNavigate } from 'react-router';import {@@ -255,16 +257,14 @@ export default function WorkspaceContexts() {const { appId } = useParams();return (- <div className="max-w-5xl mx-auto space-y-4">- <div className="flex items-center gap-2">- <Layers size={20} className="text-port-accent" />- <h1 className="text-xl font-semibold text-white">Workspace Contexts</h1>- </div>+ <PageLayout header={<PageHeader icon={Layers} title="Workspace Contexts" />}>+ <div className="max-w-5xl mx-auto space-y-4"><p className="text-sm text-gray-500">Save and restore each project's working context — the active git branch, theshell sessions rooted in its repo, and the tasks scoped to it.</p>{appId ? <ContextDetail key={appId} appId={appId} /> : <ContextList />}- </div>+ </div>+ </PageLayout>);}diff --git a/docs/PAGE_LAYOUT_AUDIT.md b/docs/PAGE_LAYOUT_AUDIT.mdnew file mode 100644index 0000000000..3be0895752--- /dev/null+++ b/docs/PAGE_LAYOUT_AUDIT.md@@ -0,0 +1,179 @@+# Routed page layout audit — 2026-10-23++Base: `040c183c31b5b7398e4b700e67c14363a1577566` (fetched `origin/main`).+Scope: page-level outer margins/padding and section navigation, using Code Animation as the reference. “Zero margin/padding” means no **outer gutter around the title and nav bars**; their intrinsic text/button padding is necessary for readable labels and touch targets. Content gutters, bounded reading columns, cards, editor panes and viewport surfaces remain intentional.++`PageLayout` shares the flush chrome / bounded scroll-body contract without a global CSS reset. `layoutRoutes.js` only adds full-width classification where the route now owns its scroll. Existing responsive tab icons, keyboard handling, deep links, feature gates and panel ARIA references are preserved. CoS's avatar titles become h2 beneath the single page h1.++## Chief of Staff matrix++All tabs are rendered by the same `ChiefOfStaff` shell. Tab bodies were inspected; no per-tab padding reset is applied. Agent deep links (`/cos/:tab/:agentId`) use that same shell.++| Route | Result / preserved behavior |+| --- | --- |+| `/cos/briefing` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/tasks` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/agents` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/jobs` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/runs` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/run-events` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/schedule` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/workflow` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/digest` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/gsd` | Flush shared title/nav; existing tab content spacing and lazy loading retained. Feature visibility gate retained. |+| `/cos/learning` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/memory` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/mind` | Mind chat retains its `min-h-0` / desktop flex sizing and internal pane scroll. |+| `/cos/health` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos/config` | Flush shared title/nav; existing tab content spacing and lazy loading retained. |+| `/cos`, `/cos/tools`, `/cos/mind/tools` | Existing redirects retained, including the Mind tools query parameter. |++## Routed page inventory++Grouped by rendered component, including param/deep-link routes. “Retained” is a source audit disposition, not a claim that every page was browser-tested. Child routes hosted by MediaGen inherit its full-width chrome. Redirect-only routes are listed separately.++| Route(s) | Disposition | Reason |+| --- | --- | --- |+| `/ai/presets`, `/ai/presets/new`, `/ai/presets/:presetId`, `/ai/edit/:providerId`, `/ai/fleet`, `/ai/harnesses`, `/ai/harnesses/:harnessId`, `/ai/services`, `/ai/services/new`, `/ai/services/:serviceSlug` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/agents`, `/agents/:agentId`, `/agents/:agentId/:tab` | Fixed | Detail navigation now uses flush TabPills with compact mobile icons; list and record identity bars stay full width. |+| `/devtools/agents` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/ambient` | Intentional layout | Standalone ambient display; intentionally outside the application chrome. |+| `/api-reference/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/apps/:appId`, `/apps/:appId/:tab` | Intentional layout | App record editor; existing full-width title/nav and internal scroll. |+| `/apps` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/ask`, `/ask/:conversationId` | Intentional layout | Conversation workspace; dedicated chat toolbar and message scrolling. |+| `/authors`, `/authors/:authorId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/brain/:tab/:recordType/:recordId`, `/brain/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/brain/links/:id/scan-report` | Intentional layout | Bounded scan-report document and verdict controls, with its own scroll. |+| `/browser` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/calendar/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/capabilities` | Fixed | Added shared h1/scroll shell; readiness cards and disclosures retained. |+| `/catalog` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/catalog/ingest` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/catalog/:type/:id`, `/casting/:id/:tab?`, `/environments/:id/:tab?`, `/objects/:id/:tab?` | Intentional layout | Catalog record editor with its own toolbar, tabs and pane scrolling. |+| `/character` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/cos/:tab/:agentId`, `/cos/:tab` | Fixed | PageLayout: title and compact route tabs precede the avatar/content split; existing rail, pane padding and Mind sizing retained. |+| `/code-animation`, `/code-animation/gallery`, `/code-animation/:jobId`, `/code-animation/production`, `/code-animation/production/:projectId` | Reference preserved | Canonical reference adopted PageLayout with the same title, tabs, gutters and max-w-7xl body. |+| `/apps/create` | Intentional layout | Bounded app-import form with sticky supporting aside; default main scroll is intentional. |+| `/casting/import` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/creative-commission/:id` | Intentional layout | Commission record/status workspace; bounded record content. |+| `/creative-commission`, `/creative-commission/new` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/video`, `/creative-director` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/creative-director/:id/:tab/:sceneId`, `/creative-director/:id/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/casting`, `/environments`, `/objects` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/` | Intentional layout | Widget canvas with its own arrangement and dashboard spacing; no section tab strip. |+| `/devtools/datadog` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/data` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/decks/:id` | Intentional layout | Deck editing/preview workspace; dedicated record toolbar. |+| `/decks` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/digital-twin/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/eidoverse/solo`, `/eidoverse` | Intentional layout | Immersive world and solo surface; dedicated viewport/HUD layout. |+| `/eidoverse/guest` | Intentional layout | Guest admission/world surface, outside the operator shell. |+| `/fableloom` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/fableloom/join` | Intentional layout | Hosted join flow, outside the operator shell. |+| `/fableloom/:loomId`, `/fableloom/:loomId/:episodeId/outline`, `/fableloom/:loomId/:episodeId`, `/fableloom/:loomId/:episodeId/:nodeId` | Intentional layout | Story/episode editor; data-driven episode picker intentionally retained. |+| `/feature-agents/create`, `/feature-agents/:id/:tab` | Fixed | Moved record tabs out of the padded header into TabPills; kept record identity/back navigation. |+| `/feature-agents` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/flows` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/game`, `/game/:id` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/github`, `/devtools/github/:tab`, `/devtools/github/:tab/:accountId/:threadId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/goals/:tab`, `/goals/list/:goalId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/history` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/imessage/:chatKey` | Intentional layout | Legacy chat deep link; dedicated conversation panes. |+| `/devtools/image-clean` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/media/image` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/importer` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/insights/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/instances` | Fixed | Added shared title/scroll shell around the existing federation provider and drawers. |+| `/devtools/jira` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/jira/reports` | Intentional layout | Bounded report reader/master-detail view with report filters; not a section header/nav shell. |+| `/local-llm/playground` | Intentional layout | Full-width model playground; independent conversation panes. |+| `/login` | Intentional layout | Authentication surface, outside the operator shell. |+| `/loops` | Fixed | Added shared title/scroll shell; retained creation controls, counters, and responsive cards. |+| `/meatspace/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/3d` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/3d/:id` | Intentional layout | 3D record/preview surface; dedicated record controls. |+| `/media/annotate`, `/media/annotate/:mediaKey` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/media/collections/:id` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/media/collections/:id/sync` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/media/collections` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/media`, `/video/generate` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/media/history` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/messages/:tab/:chatKey`, `/messages/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/models/llms-runtimes/:recordId?`, `/models/performance/results/:assessmentKey`, `/models/performance/:view`, `/models/:tab`, `/models/:tab/:recordId`, `/models/decision-classifiers/jev/:taskView`, `/models/llms/jev/:taskView` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/mood-boards/:id` | Intentional layout | Board editor toolbar and canvas; record controls remain local to the editor. |+| `/mood-boards` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/music`, `/music/:tab`, `/music/:tab/:id` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/music-video`, `/music-video/:projectId`, `/music-video/:projectId/:stage`, `/music-video/:projectId/:stage/scene/:sceneId`, `/music-video/:projectId/scene/:sceneId`, `/music-video/:projectId/dev/:artifactId`, `/music-video/:projectId/:stage/dev/:artifactId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/*` | Intentional layout | Small missing-route message in the default document scroller. |+| `/openclaw` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/pipeline` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/pipeline/series/:seriesId/continuity-bible` | Intentional layout | Series reference document/workbench; own record toolbar and scroll. |+| `/pipeline/editorial-checks` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/pipeline/series/:seriesId/export` | Intentional layout | Series export workbench; record-specific actions. |+| `/pipeline/issues/:issueId/:stage` | Intentional layout | Stage editor with record/stage navigation and independent scroll. |+| `/pipeline/series/:seriesId/manuscript/*` | Intentional layout | Manuscript editor with independent text/outline scrolling. |+| `/pipeline/series/:seriesId/reverse-outline` | Intentional layout | Series outline document/workbench; own record toolbar and scroll. |+| `/pipeline/series/:seriesId` | Intentional layout | Series workspace with record header and nested panels. |+| `/pipeline/series/:seriesId/roadmap` | Intentional layout | Series planning canvas with record-specific navigation. |+| `/pipeline/series/:seriesId/voice-fingerprint` | Intentional layout | Series diagnostic document/workbench; own record toolbar and scroll. |+| `/post/:tab`, `/post/:tab/:subtab`, `/post/:tab/:subtab/:mode` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/privacy/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/processes` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/media/prompt`, `/media/prompt/:examinationId` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/prompts` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/quota-burn`, `/devtools/quota-burn/:familyId` | Fixed | Added flush PageHeader and existing Models navigation; retained autosave/actions and card spacing. |+| `/rapid-reader`, `/rapid-reader/:id` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/review`, `/review/:actionId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/rounds/:id` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/rounds` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/rounds/guide` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/runner` | Fixed | Moved PageHeader out of the padded document flow; PageLayout owns the padded scroll body. |+| `/security` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/settings/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/sharing`, `/sharing/:section`, `/sharing/:section/:bucketId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/shell`, `/shell/iterm`, `/shell/iterm/:itermSessionId`, `/shell/:sessionId` | Intentional layout | Terminal workspace with session controls and terminal scroll owner. |+| `/songbook` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/songbook/import` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/songbook/:id` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/sprites`, `/sprites/:id` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/stacker-news`, `/stacker-news/:accountId/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/start-story` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/story-builder`, `/story-builder/:storyId/:step` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/storyboards/:id`, `/storyboards/:id/panel/:panelId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/storyboards` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/universes/:universeId/sync`, `/pipeline/series/:seriesId/sync` | Intentional layout | Record-specific sync review/compare surface. |+| `/system-resources/:tab` | Fixed | Replaced inset rounded hero/nav with flush title/nav; retained max-w-7xl report body. |+| `/templates` | Fixed | Added shared title/scroll shell; template cards and create form retain their spacing. |+| `/media/threejs/:id` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/media/threejs` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/timeline`, `/timeline/:date` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/tribe` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/universes/new`, `/universes/:universeId` | Intentional layout | Universe editor with record header and independent panes. |+| `/universes` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/uploads` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/devtools/usage` | Fixed | Added flush title/nav, one padded content scroller, and wrapping date-range controls; card padding remains local. |+| `/devtools/video-download` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/media/timeline` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/media/timeline/:projectId` | Retained, nested | Hosted by MediaGen; local gallery/form/editor controls are content, not duplicate page chrome. |+| `/voice/call-host` | Intentional layout | Dedicated call-host status/permission surface; no section navigation. |+| `/voices`, `/voices/:profileId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/wiki/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/workspace-contexts`, `/workspace-contexts/:appId` | Fixed | Moved title outside the max-w-5xl content column; retained bounded prose/forms. |+| `/writers-room`, `/writers-room/works/:workId` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/writers-room/guide` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |+| `/x`, `/x/:accountId/:tab` | Retained, flush | Existing full-width title/navigation shell and internal content scrolling; no outer-gutter mismatch found. |++## Redirect-only routes++Existing bookmark/legacy redirects are unchanged; destination layouts are covered above.++`/devtools`, `/devtools/runs`, `/devtools/submodules`, `/ai`, `/ai/new`, `/ai/connections`, `/ai/connections/:connectionId`, `/ai/harnesses/:harnessId/connections`, `/ai/harnesses/:harnessId/connections/:connectionId`, `/cos`, `/cos/mind/tools`, `/cos/tools`, `/calendar`, `/brain`, `/digital-twin`, `/privacy`, `/goals`, `/feature-agents/:id`, `/settings`, `/settings/catalog`, `/settings/contacts`, `/settings/local-llm`, `/settings/embeddings`, `/settings/code-reviewers`, `/settings/spotify`, `/settings/youtube`, `/api-reference`, `/models`, `/models/llms/jev`, `/models/llms/runtimes`, `/models/harnesses`, `/insights`, `/system-health`, `/system-resources`, `/system-resources/models`, `/meatspace`, `/post`, `/messages`, `/imessage`, `/annotate`, `/annotate/:mediaKey`, `/datadog`, `/jira`, `/openworld`, `/openworld/*`, `/city`, `/city/*`, `/media/video`, `/media/creative-director`, `/media/creative-director/:id`, `/media/creative-director/:id/:tab/:sceneId`, `/media/creative-director/:id/:tab`, `/media/music-video`, `/media/music-video/:projectId`, `/media/sprites`, `/media/sprites/:id`, `/media/models`, `/media/3d`, `/media/3d/:id`, `/media/loras`, `/media/training`, `/media/training/:datasetId`, `/media/universe-builder`, `/media/universe-builder/:universeId`, `/media/universe-builder/:universeId/canon`, `/video/:id`, `/video/:id/:tab/:sceneId`, `/video/:id/:tab`, `/creative-director/:id`, `/image-gen`, `/video-gen`, `/media-history`, `/media-models`, `/wiki`, `/universes/:universeId/canon`, `/universe-builder`, `/universe-builder/:universeId/canon`, `/universe-builder/:universeId`, `/universe-builder/new`, `/story-builder/:storyId`, `/pipeline/findings/:commentId`, `/pipeline/issues/:issueId`.++## Usage card diagnosis++`/devtools/usage` previously combined Layout's padded scrolling main with a full-height Models wrapper and another unpadded scroller. The page now owns one scroll body with symmetric 16px narrow / 24px desktop gutters. Provider cards already had symmetric local `p-2 sm:p-4`; those values are preserved. Real Chromium also reproduced a separate **320px overflow inside the date-filter card**: its From/To inputs were one non-wrapping flex item. Each label/input pair now stays together while the group can wrap. No overflow-hiding or global card padding rule is used.++## Validation++See final task handoff for command outcomes. `PageLayout.browser.test.js` renders real route components and Tailwind against synthetic API fixtures, with the available content width reduced by a 256px desktop global rail. It checks Code Animation, CoS Agents/Health, System Resources Storage, and Usage at 1440, 1024, 390 and 320px. Assertions cover flush title/nav rectangles, a single h1, scroll containment, both card gutters, balanced card padding, and card overflow. Usage includes provider quota cards and a cost report with a long model name. Screenshots are optional via `PORTOS_LAYOUT_SCREENSHOTS`; no private instance data is used. This fixture does not boot the production backend or assert every audited route visually.diff --git a/docs/README.md b/docs/README.mdindex 7c3571d645..6469e173e2 100644--- a/docs/README.md+++ b/docs/README.md@@ -52,6 +52,7 @@ Index of everything under `docs/`. Start with the [root README](../README.md) fo| [SECURITY_SCANNER_RUNTIME.md](./SECURITY_SCANNER_RUNTIME.md) | Runner-owned Codex security scans, pinned execution, process cleanup and observed evidence || [UX_DESIGN_GUIDE.md](./UX_DESIGN_GUIDE.md) | Admin workspace design specification: icon navigation, responsive layouts, disclosure, visual hierarchy, and redesign acceptance || [UX_DESIGN_AUDIT.md](./UX_DESIGN_AUDIT.md) | Representative UX audit and Jev/Performance pilot content maps |+| [PAGE_LAYOUT_AUDIT.md](./PAGE_LAYOUT_AUDIT.md) | Routed header/navigation layout inventory, fixes, intentional exceptions, and browser regression coverage || [GITHUB_ACTIONS.md](./GITHUB_ACTIONS.md) | CI and release workflows || [VERSIONING.md](./VERSIONING.md) | SemVer + release process (`/do:release`) || [SELF_UPDATE.md](./SELF_UPDATE.md) | Fork-aware self-update flow — release polling, `FORK_SYNC_REQUIRED`, fork sync, running a customized fork, and the unattended idle-gated automatic update |