Skip to content

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

fix: align page headers and detail routes with the full-width shell (#9948)

[._.]/ Adam Eivy7dd1d5d38f81
diff --git a/client/src/components/Layout.test.jsx b/client/src/components/Layout.test.jsx
index 179b787f8d..7030b6eb0e 100644
--- a/client/src/components/Layout.test.jsx
+++ b/client/src/components/Layout.test.jsx
@@ -608,7 +608,12 @@ describe('Layout — isFullWidthRoute classification', () => {
['/shell', true], ['/shell/abc', true], ['/shellx', false],
['/ask', true], ['/ask/1', true], ['/asking', false],
['/timeline', true], ['/timeline/2026-08-12', true],
- ['/tribe', true], ['/rapid-reader', true], ['/openclaw', true],
+ ['/tribe', true], ['/rapid-reader', true], ['/rapid-reader/r1', true], ['/openclaw', true],
+ ['/review', true], ['/review/a1', true], ['/reviewing', false],
+ ['/stacker-news', true], ['/stacker-news/a1/review', true], ['/x', true], ['/x/a1/posts', true], ['/xyz', false],
+ ['/privacy', true], ['/privacy/vault', true], ['/privacy-policy', false],
+ ['/code-animation', true], ['/code-animation/j1', true], ['/code-animation/production/p1', true],
+ ['/code-animations', false], ['/apps', true],
['/eidoverse', true], ['/eidoverse/world', false],
// Index page stays padded+scrolling; only the DETAIL route is full-width.
['/catalog', false], ['/catalog/book/1', true],
diff --git a/client/src/lib/layoutRoutes.js b/client/src/lib/layoutRoutes.js
index 49afbb5bb8..4e64ec8ce0 100644
--- a/client/src/lib/layoutRoutes.js
+++ b/client/src/lib/layoutRoutes.js
@@ -3,6 +3,11 @@
// padded+scrolling one. Checked in order: exact path, then prefix, then
// regex — see `isFullWidthRoute` below.
const EXACT_FULL_WIDTH_PATHS = [
+ '/apps',
+ '/stacker-news',
+ '/x',
+ '/privacy',
+ '/code-animation',
'/character',
'/eidoverse',
'/ai',
@@ -36,6 +41,12 @@ const EXACT_FULL_WIDTH_PATHS = [
];
const FULL_WIDTH_PATH_PREFIXES = [
+ '/review/',
+ '/rapid-reader/',
+ '/stacker-news/',
+ '/x/',
+ '/privacy/',
+ '/code-animation/',
'/ask/',
'/calendar',
// Only the Catalog DETAIL editor (/catalog/{type}/{id}) and the
diff --git a/client/src/pageShellConventions.test.js b/client/src/pageShellConventions.test.js
new file mode 100644
index 0000000000..092f70b53d
--- /dev/null
+++ b/client/src/pageShellConventions.test.js
@@ -0,0 +1,65 @@
+import { describe, it, expect } from 'vitest';
+import { readFileSync, existsSync } from 'node:fs';
+import { dirname, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { isFullWidthRoute } from './lib/layoutRoutes.js';
+import { trackedSourceFiles } from './test/trackedFiles.js';
+import { maskComments, stringLiterals } from './test/classNameScan.js';
+
+const root = dirname(fileURLToPath(import.meta.url));
+
+// App's lazy imports and Route declarations are the real page inventory. Resolve
+// aliases (XPage, RapidReaderPage) rather than guessing a filename from the tag.
+function pageRoutes(app) {
+ const modules = new Map([...app.matchAll(/const\s+(\w+)\s*=\s*lazyWithReload\(\(\)\s*=>\s*import\(['"]([^'"]+)['"]\)/g)]
+ .map((match) => [match[1], match[2]]));
+ for (const match of app.matchAll(/import\s+(\w+)\s+from\s+['"]([^'"]+)['"]/g)) modules.set(match[1], match[2]);
+ const shell = app.slice(app.indexOf('<Route path="/" element={<Layout />}'));
+ return [...shell.matchAll(/<Route\s+path="([^"]+)"\s+element=\{<(\w+)\b/g)]
+ .filter((match) => modules.has(match[2]))
+ .map((match) => ({ path: `/${match[1]}`, component: match[2], module: modules.get(match[2]) }));
+}
+
+function ownsShell(raw) {
+ const source = maskComments(raw);
+ return /<PageHeader\b/.test(source) && stringLiterals(source).some(({ value }) =>
+ /(?:^|\s)h-full(?:\s|$)/.test(value) ||
+ (/(?:^|\s)flex-1(?:\s|$)/.test(value) && /(?:^|\s)overflow-(?:auto|y-auto)(?:\s|$)/.test(value)));
+}
+
+function violations(routes, sourceFor, classify = isFullWidthRoute) {
+ const failures = [];
+ for (const route of routes) {
+ if (!classify(route.path) && ownsShell(sourceFor(route))) failures.push(`${route.path}: ${route.component} owns its PageHeader shell`);
+ // A param sibling mounting the same page must retain its index shell even
+ // if the page's implementation delegates its header/body to a child.
+ const index = routes.find((entry) => entry.component === route.component &&
+ !entry.path.includes(':') && route.path.startsWith(`${entry.path}/:`));
+ if (index && classify(index.path) && !classify(route.path)) failures.push(`${route.path}: differs from ${index.path}`);
+ }
+ return failures;
+}
+
+const tracked = new Set(trackedSourceFiles(resolve(root, '..')).map((file) => resolve(root, '..', file)));
+const routes = pageRoutes(readFileSync(resolve(root, 'App.jsx'), 'utf8'));
+const sourceFor = ({ module }) => {
+ const path = resolve(root, module);
+ const file = [path, `${path}.jsx`, `${path}.js`].find(existsSync);
+ if (!file || !tracked.has(file)) throw new Error(`Missing tracked route module: ${module}`);
+ return readFileSync(file, 'utf8');
+};
+
+describe('page shell conventions', () => {
+ it('pairs routed PageHeader workspaces and their detail routes with the full-width shell', () => {
+ expect(routes.length).toBeGreaterThan(100);
+ expect(violations(routes, sourceFor)).toEqual([]);
+ });
+
+ it('rejects a probe workspace in the padded shell and a missed param sibling', () => {
+ const probe = [{ path: '/probe', component: 'Probe' }, { path: '/probe/:id', component: 'Probe' }];
+ expect(violations(probe, () => '<div className="flex h-full"><PageHeader /></div>', () => false)).toHaveLength(2);
+ expect(violations(probe, () => '<Child />', (path) => path === '/probe')).toEqual(['/probe/:id: differs from /probe']);
+ expect(violations(probe, () => '<div className="flex-1 overflow-auto"><PageHeader /></div>', () => true)).toEqual([]);
+ expect(violations(probe, () => '<div><PageHeader /></div>', () => false)).toEqual([]);
+ });
+});
diff --git a/client/src/pages/Apps.jsx b/client/src/pages/Apps.jsx
index dc3c6e92ee..1133a2b10b 100644
--- a/client/src/pages/Apps.jsx
+++ b/client/src/pages/Apps.jsx
@@ -196,11 +196,10 @@ export default function Apps() {
}
return (
- <div>
+ <div className="flex h-full min-h-0 flex-col">
<PageHeader
title="Apps"
subtitle="Manage registered applications"
- className="mb-6"
actions={(
<>
{/* Archive Toggle — stays mounted while the archived view is open even
@@ -228,284 +227,286 @@ export default function Apps() {
)}
/>
- {loadError && (
- <div role="alert" className="mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-port-warning/40 bg-port-warning/10 p-3 text-sm">
- <AlertTriangle size={16} aria-hidden="true" className="shrink-0 text-port-warning" />
- <span className="min-w-0 flex-1 text-gray-300">
- Apps are unavailable — showing the last loaded collection. {loadError.message || 'Retry when the connection recovers.'}
- </span>
- <button
- onClick={() => fetchApps({ retry: true })}
- disabled={retrying}
- aria-busy={retrying}
- className="inline-flex min-h-[40px] items-center gap-2 rounded-lg bg-port-border px-3 py-1.5 text-xs text-white hover:bg-port-border/80 disabled:opacity-50"
- >
- <RefreshCw size={14} aria-hidden="true" className={retrying ? 'animate-spin' : ''} />
- {retrying ? 'Retrying…' : 'Retry'}
- </button>
- </div>
- )}
-
- {/* In-flight update/standardize — page-level so it survives collapsing
- the row and remounting the page. */}
- {operationBanners}
-
- {/* App List */}
- {displayedApps.length === 0 ? (
- <div className="bg-port-card border border-port-border rounded-xl p-12 text-center">
- <div className="text-4xl mb-4">{showArchived ? '📦' : '🗂️'}</div>
- <h2 className="text-xl font-semibold text-white mb-2">
- {showArchived ? 'No archived apps' : 'No apps registered'}
- </h2>
- <p className="text-gray-500 mb-6">
- {showArchived ? 'Archived apps will appear here' : 'Register your first app to monitor its health, restart it, and surface it on your dashboard.'}
- </p>
- {showArchived ? (
+ <div className="flex-1 min-h-0 overflow-auto p-4 md:p-6">
+ {loadError && (
+ <div role="alert" className="mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-port-warning/40 bg-port-warning/10 p-3 text-sm">
+ <AlertTriangle size={16} aria-hidden="true" className="shrink-0 text-port-warning" />
+ <span className="min-w-0 flex-1 text-gray-300">
+ Apps are unavailable — showing the last loaded collection. {loadError.message || 'Retry when the connection recovers.'}
+ </span>
<button
- onClick={() => setShowArchived(false)}
- className="inline-block px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded-lg transition-colors"
+ onClick={() => fetchApps({ retry: true })}
+ disabled={retrying}
+ aria-busy={retrying}
+ className="inline-flex min-h-[40px] items-center gap-2 rounded-lg bg-port-border px-3 py-1.5 text-xs text-white hover:bg-port-border/80 disabled:opacity-50"
>
- Back to active apps
+ <RefreshCw size={14} aria-hidden="true" className={retrying ? 'animate-spin' : ''} />
+ {retrying ? 'Retrying…' : 'Retry'}
</button>
- ) : (
- <Link
- to="/apps/create"
- className="inline-block px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded-lg transition-colors"
- >
- Add App
- </Link>
- )}
- </div>
- ) : (
- <div className="space-y-4">
- {displayedApps.map(app => {
- const isNonPm2 = NON_PM2_TYPES.has(app.type);
- const launchUrls = getLaunchUrls(app);
- const primaryLaunchUrl = launchUrls.https || launchUrls.http;
- return (
- <div
- key={app.id}
- className="bg-port-card border border-port-border rounded-xl overflow-hidden"
- >
- {/* Main App Row */}
- <div className="p-4">
- <div className="flex flex-col sm:flex-row sm:items-center gap-4">
- {/* Identity + Status */}
- <div className="flex items-center gap-3 flex-1 min-w-0">
- <div className={`w-8 h-8 rounded-[22%] shrink-0 overflow-hidden ${
- app.appIconPath ? '' : `flex items-center justify-center ${app.archived ? 'bg-port-border/50 text-gray-500' : 'bg-port-border text-port-accent'}`
- }`}>
- <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={18} ariaLabel={app.name} fillContainer />
- </div>
- <div className="min-w-0 flex-1">
- <div className="flex flex-wrap items-center gap-2">
- <Link
- to={`/apps/${app.id}`}
- className={`font-medium underline decoration-dotted underline-offset-4 hover:decoration-solid transition-colors ${
- app.archived
- ? 'text-gray-400 decoration-gray-600 hover:text-gray-200'
- : 'text-port-accent decoration-port-accent/50 hover:text-white'
- }`}
- >
- {app.name}
- </Link>
- {app.archived && (
- <span className="px-1.5 py-0.5 bg-port-warning/20 text-port-warning text-xs rounded">
- Archived
- </span>
- )}
- {isNonPm2 ? (
- <span className="px-1.5 py-0.5 bg-port-accent/20 text-port-accent text-xs rounded">
- {getAppTypeLabel(app.type)}
- </span>
- ) : (
- <StatusBadge status={app.overallStatus} size="sm" />
- )}
+ </div>
+ )}
+
+ {/* In-flight update/standardize — page-level so it survives collapsing
+ the row and remounting the page. */}
+ {operationBanners}
+
+ {/* App List */}
+ {displayedApps.length === 0 ? (
+ <div className="bg-port-card border border-port-border rounded-xl p-12 text-center">
+ <div className="text-4xl mb-4">{showArchived ? '📦' : '🗂️'}</div>
+ <h2 className="text-xl font-semibold text-white mb-2">
+ {showArchived ? 'No archived apps' : 'No apps registered'}
+ </h2>
+ <p className="text-gray-500 mb-6">
+ {showArchived ? 'Archived apps will appear here' : 'Register your first app to monitor its health, restart it, and surface it on your dashboard.'}
+ </p>
+ {showArchived ? (
+ <button
+ onClick={() => setShowArchived(false)}
+ className="inline-block px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded-lg transition-colors"
+ >
+ Back to active apps
+ </button>
+ ) : (
+ <Link
+ to="/apps/create"
+ className="inline-block px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded-lg transition-colors"
+ >
+ Add App
+ </Link>
+ )}
+ </div>
+ ) : (
+ <div className="space-y-4">
+ {displayedApps.map(app => {
+ const isNonPm2 = NON_PM2_TYPES.has(app.type);
+ const launchUrls = getLaunchUrls(app);
+ const primaryLaunchUrl = launchUrls.https || launchUrls.http;
+ return (
+ <div
+ key={app.id}
+ className="bg-port-card border border-port-border rounded-xl overflow-hidden"
+ >
+ {/* Main App Row */}
+ <div className="p-4">
+ <div className="flex flex-col sm:flex-row sm:items-center gap-4">
+ {/* Identity + Status */}
+ <div className="flex items-center gap-3 flex-1 min-w-0">
+ <div className={`w-8 h-8 rounded-[22%] shrink-0 overflow-hidden ${
+ app.appIconPath ? '' : `flex items-center justify-center ${app.archived ? 'bg-port-border/50 text-gray-500' : 'bg-port-border text-port-accent'}`
+ }`}>
+ <AppIcon icon={app.icon || 'package'} appId={app.id} hasAppIcon={!!app.appIconPath} size={18} ariaLabel={app.name} fillContainer />
</div>
- <AppQuality app={app} />
- <div className="text-xs text-gray-500 flex flex-wrap gap-x-2 mt-1">
- {isNonPm2 ? (
- <span className="break-all">{app.repoPath}</span>
- ) : (
- (app.pm2ProcessNames || []).map((procName, i) => {
- const procInfo = app.processes?.find(p => p.name === procName);
- const ports = procInfo?.ports || {};
- const portEntries = Object.entries(ports);
- const portDisplay = portEntries.length > 1
- ? ` (${portEntries.map(([label, port]) => `${label}:${port}`).join(', ')})`
- : portEntries.length === 1
- ? `:${portEntries[0][1]}`
- : '';
- return (
- <span key={i}>
- {procName}<span className="text-port-accent">{portDisplay}</span>
- {i < (app.pm2ProcessNames?.length || 0) - 1 ? ',' : ''}
- </span>
- );
- })
- )}
+ <div className="min-w-0 flex-1">
+ <div className="flex flex-wrap items-center gap-2">
+ <Link
+ to={`/apps/${app.id}`}
+ className={`font-medium underline decoration-dotted underline-offset-4 hover:decoration-solid transition-colors ${
+ app.archived
+ ? 'text-gray-400 decoration-gray-600 hover:text-gray-200'
+ : 'text-port-accent decoration-port-accent/50 hover:text-white'
+ }`}
+ >
+ {app.name}
+ </Link>
+ {app.archived && (
+ <span className="px-1.5 py-0.5 bg-port-warning/20 text-port-warning text-xs rounded">
+ Archived
+ </span>
+ )}
+ {isNonPm2 ? (
+ <span className="px-1.5 py-0.5 bg-port-accent/20 text-port-accent text-xs rounded">
+ {getAppTypeLabel(app.type)}
+ </span>
+ ) : (
+ <StatusBadge status={app.overallStatus} size="sm" />
+ )}
+ </div>
+ <AppQuality app={app} />
+ <div className="text-xs text-gray-500 flex flex-wrap gap-x-2 mt-1">
+ {isNonPm2 ? (
+ <span className="break-all">{app.repoPath}</span>
+ ) : (
+ (app.pm2ProcessNames || []).map((procName, i) => {
+ const procInfo = app.processes?.find(p => p.name === procName);
+ const ports = procInfo?.ports || {};
+ const portEntries = Object.entries(ports);
+ const portDisplay = portEntries.length > 1
+ ? ` (${portEntries.map(([label, port]) => `${label}:${port}`).join(', ')})`
+ : portEntries.length === 1
+ ? `:${portEntries[0][1]}`
+ : '';
+ return (
+ <span key={i}>
+ {procName}<span className="text-port-accent">{portDisplay}</span>
+ {i < (app.pm2ProcessNames?.length || 0) - 1 ? ',' : ''}
+ </span>
+ );
+ })
+ )}
+ </div>
</div>
</div>
- </div>
- {/* Controls */}
- <div className="flex flex-wrap items-center gap-2">
- {/* Start/Stop/Restart Button Group - only for PM2 apps */}
- {!isNonPm2 && (
- <div className="inline-flex rounded-lg overflow-hidden border border-port-border">
- {app.overallStatus === 'online' ? (
- <>
+ {/* Controls */}
+ <div className="flex flex-wrap items-center gap-2">
+ {/* Start/Stop/Restart Button Group - only for PM2 apps */}
+ {!isNonPm2 && (
+ <div className="inline-flex rounded-lg overflow-hidden border border-port-border">
+ {app.overallStatus === 'online' ? (
+ <>
+ <button
+ onClick={() => handleStop(app)}
+ disabled={actionLoading[app.id]}
+ className="px-3 py-1.5 min-h-[44px] bg-port-error/20 text-port-error enabled:hover:bg-port-error/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-error"
+ aria-label={`Stop ${app.name}`}
+ aria-busy={actionLoading[app.id] === 'stop'}
+ >
+ <Square size={14} aria-hidden="true" />
+ <span className="text-xs">{actionLoading[app.id] === 'stop' ? 'Stopping...' : 'Stop'}</span>
+ </button>
+ <button
+ onClick={() => handleRestart(app)}
+ disabled={actionLoading[app.id]}
+ className="px-3 py-1.5 min-h-[44px] bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors disabled:opacity-50 border-l border-port-border flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-warning"
+ aria-label={`Restart ${app.name}`}
+ aria-busy={actionLoading[app.id] === 'restart'}
+ >
+ <RotateCcw size={14} aria-hidden="true" className={actionLoading[app.id] === 'restart' ? 'animate-spin' : ''} />
+ <span className="text-xs">{actionLoading[app.id] === 'restart' ? 'Restarting...' : 'Restart'}</span>
+ </button>
+ </>
+ ) : (app.degraded || app.overallStatus === 'unknown') ? (
+ // PM2 read failed — status is genuinely unknown, so don't
+ // offer a misleading Start. Surface "Status unavailable"
+ // and let the user re-check rather than act on bad info.
<button
- onClick={() => handleStop(app)}
+ onClick={() => fetchApps()}
disabled={actionLoading[app.id]}
- className="px-3 py-1.5 min-h-[44px] bg-port-error/20 text-port-error enabled:hover:bg-port-error/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-error"
- aria-label={`Stop ${app.name}`}
- aria-busy={actionLoading[app.id] === 'stop'}
+ className="px-3 py-1.5 min-h-[44px] bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-warning"
+ aria-label={`${app.name} status unavailable — refresh`}
+ title="PM2 status could not be read — refresh to retry"
>
- <Square size={14} aria-hidden="true" />
- <span className="text-xs">{actionLoading[app.id] === 'stop' ? 'Stopping...' : 'Stop'}</span>
+ <RefreshCw size={14} aria-hidden="true" />
+ <span className="text-xs">Status unavailable</span>
</button>
+ ) : (
<button
- onClick={() => handleRestart(app)}
+ onClick={() => handleStart(app)}
disabled={actionLoading[app.id]}
- className="px-3 py-1.5 min-h-[44px] bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors disabled:opacity-50 border-l border-port-border flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-warning"
- aria-label={`Restart ${app.name}`}
- aria-busy={actionLoading[app.id] === 'restart'}
- >
- <RotateCcw size={14} aria-hidden="true" className={actionLoading[app.id] === 'restart' ? 'animate-spin' : ''} />
- <span className="text-xs">{actionLoading[app.id] === 'restart' ? 'Restarting...' : 'Restart'}</span>
- </button>
- </>
- ) : (app.degraded || app.overallStatus === 'unknown') ? (
- // PM2 read failed — status is genuinely unknown, so don't
- // offer a misleading Start. Surface "Status unavailable"
- // and let the user re-check rather than act on bad info.
- <button
- onClick={() => fetchApps()}
- disabled={actionLoading[app.id]}
- className="px-3 py-1.5 min-h-[44px] bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-warning"
- aria-label={`${app.name} status unavailable — refresh`}
- title="PM2 status could not be read — refresh to retry"
- >
- <RefreshCw size={14} aria-hidden="true" />
- <span className="text-xs">Status unavailable</span>
- </button>
- ) : (
- <button
- onClick={() => handleStart(app)}
- disabled={actionLoading[app.id]}
- className="px-3 py-1.5 min-h-[44px] bg-port-success/20 text-port-success enabled:hover:bg-port-success/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-success"
- aria-label={`Start ${app.name}`}
- aria-busy={actionLoading[app.id] === 'start'}
- >
- <Play size={14} aria-hidden="true" />
- <span className="text-xs">{actionLoading[app.id] === 'start' ? 'Starting...' : 'Start'}</span>
- </button>
- )}
- </div>
- )}
-
- {/* Launch buttons grouped together */}
- {(app.nativeLaunch || (app.overallStatus === 'online' && (primaryLaunchUrl || launchUrls.dev))) && (
- <div className="inline-flex rounded-lg overflow-hidden border border-port-border divide-x divide-port-border">
- {app.overallStatus === 'online' && primaryLaunchUrl && (
- <button
- onClick={() => handleWebLaunch(primaryLaunchUrl)}
- className="px-3 py-1.5 min-h-[44px] bg-port-accent/20 text-port-accent enabled:hover:bg-port-accent/30 transition-colors flex items-center gap-1"
- aria-label={`Launch ${app.name} UI`}
- >
- <ExternalLink size={14} aria-hidden="true" />
- <span className="text-xs">Launch</span>
- </button>
- )}
- {app.overallStatus === 'online' && launchUrls.dev && (
- <button
- onClick={() => handleWebLaunch(launchUrls.dev)}
- className="px-3 py-1.5 min-h-[44px] bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors flex items-center gap-1"
- aria-label={`Launch ${app.name} Dev UI`}
- >
- <ExternalLink size={14} aria-hidden="true" />
- <span className="text-xs">Dev UI</span>
- </button>
- )}
- {app.nativeLaunch && (
- <button
- onClick={() => handleNativeLaunch(app)}
- disabled={nativeLaunchLoading[app.id]}
- className="px-3 py-1.5 min-h-[44px] bg-port-success/20 text-port-success enabled:hover:bg-port-success/30 transition-colors flex items-center gap-1 disabled:opacity-50"
- aria-label={`Launch ${app.nativeLaunch.label} for ${app.name}`}
- aria-busy={nativeLaunchLoading[app.id]}
+ className="px-3 py-1.5 min-h-[44px] bg-port-success/20 text-port-success enabled:hover:bg-port-success/30 transition-colors disabled:opacity-50 flex items-center gap-1 focus:outline-hidden focus:ring-2 focus:ring-port-success"
+ aria-label={`Start ${app.name}`}
+ aria-busy={actionLoading[app.id] === 'start'}
>
- <Gamepad2 size={14} aria-hidden="true" />
- <span className="text-xs">
- {nativeLaunchLoading[app.id] ? 'Launching…' : app.nativeLaunch.label}
- </span>
+ <Play size={14} aria-hidden="true" />
+ <span className="text-xs">{actionLoading[app.id] === 'start' ? 'Starting...' : 'Start'}</span>
</button>
)}
</div>
- )}
+ )}
- {/* Manage is the row's single primary action; the rare and
- destructive ones (Archive/Remove) live behind the "…"
- menu so removal isn't the loudest control on the card. */}
- <div className="flex items-center gap-2">
- <Link
- to={`/apps/${app.id}/overview`}
- className="px-4 py-1.5 min-h-[44px] inline-flex items-center rounded-lg bg-port-accent text-white hover:bg-port-accent/80 transition-colors text-xs font-medium focus:outline-hidden focus:ring-2 focus:ring-port-accent"
- aria-label={`Manage ${app.name}`}
- >
- Manage
- </Link>
- {/* Archive + Remove are withheld for the PortOS baseline app */}
- {app.id !== api.PORTOS_APP_ID && (
- <OverflowMenu
- label={`More actions for ${app.name}`}
- triggerRef={menuTriggerRef(app.id)}
- items={[
- {
- id: 'archive',
- label: archiving[app.id] ? 'Working…' : app.archived ? 'Unarchive' : 'Archive',
- icon: app.archived ? ArchiveRestore : Archive,
- disabled: !!archiving[app.id],
- onSelect: () => (app.archived ? handleUnarchive(app) : handleArchive(app)),
- },
- {
- id: 'remove',
- label: 'Remove from PortOS',
- icon: Trash2,
- tone: 'danger',
- onSelect: () => setConfirmingDelete(app.id),
- },
- ]}
- />
+ {/* Launch buttons grouped together */}
+ {(app.nativeLaunch || (app.overallStatus === 'online' && (primaryLaunchUrl || launchUrls.dev))) && (
+ <div className="inline-flex rounded-lg overflow-hidden border border-port-border divide-x divide-port-border">
+ {app.overallStatus === 'online' && primaryLaunchUrl && (
+ <button
+ onClick={() => handleWebLaunch(primaryLaunchUrl)}
+ className="px-3 py-1.5 min-h-[44px] bg-port-accent/20 text-port-accent enabled:hover:bg-port-accent/30 transition-colors flex items-center gap-1"
+ aria-label={`Launch ${app.name} UI`}
+ >
+ <ExternalLink size={14} aria-hidden="true" />
+ <span className="text-xs">Launch</span>
+ </button>
+ )}
+ {app.overallStatus === 'online' && launchUrls.dev && (
+ <button
+ onClick={() => handleWebLaunch(launchUrls.dev)}
+ className="px-3 py-1.5 min-h-[44px] bg-port-warning/20 text-port-warning enabled:hover:bg-port-warning/30 transition-colors flex items-center gap-1"
+ aria-label={`Launch ${app.name} Dev UI`}
+ >
+ <ExternalLink size={14} aria-hidden="true" />
+ <span className="text-xs">Dev UI</span>
+ </button>
+ )}
+ {app.nativeLaunch && (
+ <button
+ onClick={() => handleNativeLaunch(app)}
+ disabled={nativeLaunchLoading[app.id]}
+ className="px-3 py-1.5 min-h-[44px] bg-port-success/20 text-port-success enabled:hover:bg-port-success/30 transition-colors flex items-center gap-1 disabled:opacity-50"
+ aria-label={`Launch ${app.nativeLaunch.label} for ${app.name}`}
+ aria-busy={nativeLaunchLoading[app.id]}
+ >
+ <Gamepad2 size={14} aria-hidden="true" />
+ <span className="text-xs">
+ {nativeLaunchLoading[app.id] ? 'Launching…' : app.nativeLaunch.label}
+ </span>
+ </button>
+ )}
+ </div>
)}
+
+ {/* Manage is the row's single primary action; the rare and
+ destructive ones (Archive/Remove) live behind the "…"
+ menu so removal isn't the loudest control on the card. */}
+ <div className="flex items-center gap-2">
+ <Link
+ to={`/apps/${app.id}/overview`}
+ className="px-4 py-1.5 min-h-[44px] inline-flex items-center rounded-lg bg-port-accent text-white hover:bg-port-accent/80 transition-colors text-xs font-medium focus:outline-hidden focus:ring-2 focus:ring-port-accent"
+ aria-label={`Manage ${app.name}`}
+ >
+ Manage
+ </Link>
+ {/* Archive + Remove are withheld for the PortOS baseline app */}
+ {app.id !== api.PORTOS_APP_ID && (
+ <OverflowMenu
+ label={`More actions for ${app.name}`}
+ triggerRef={menuTriggerRef(app.id)}
+ items={[
+ {
+ id: 'archive',
+ label: archiving[app.id] ? 'Working…' : app.archived ? 'Unarchive' : 'Archive',
+ icon: app.archived ? ArchiveRestore : Archive,
+ disabled: !!archiving[app.id],
+ onSelect: () => (app.archived ? handleUnarchive(app) : handleArchive(app)),
+ },
+ {
+ id: 'remove',
+ label: 'Remove from PortOS',
+ icon: Trash2,
+ tone: 'danger',
+ onSelect: () => setConfirmingDelete(app.id),
+ },
+ ]}
+ />
+ )}
+ </div>
</div>
</div>
+
+ {confirmingDelete === app.id && (
+ <InlineConfirmRow
+ className="mt-3"
+ autoFocus
+ question={`Remove ${app.name} from PortOS? Its repository will stay on disk.`}
+ confirmText="Remove"
+ cancelText="Keep"
+ aria-label={`Confirm removal of ${app.name} from PortOS`}
+ onConfirm={() => handleDelete(app)}
+ onCancel={() => {
+ setConfirmingDelete(null);
+ menuTriggerRef(app.id).current?.focus();
+ }}
+ />
+ )}
</div>
- {confirmingDelete === app.id && (
- <InlineConfirmRow
- className="mt-3"
- autoFocus
- question={`Remove ${app.name} from PortOS? Its repository will stay on disk.`}
- confirmText="Remove"
- cancelText="Keep"
- aria-label={`Confirm removal of ${app.name} from PortOS`}
- onConfirm={() => handleDelete(app)}
- onCancel={() => {
- setConfirmingDelete(null);
- menuTriggerRef(app.id).current?.focus();
- }}
- />
- )}
</div>
+ );
+ })}
+ </div>
+ )}
- </div>
- );
- })}
- </div>
- )}
-
+ </div>
</div>
);
}
diff --git a/client/src/pages/CodeAnimation.jsx b/client/src/pages/CodeAnimation.jsx
index e74d70c3fc..32bdf56a18 100644
--- a/client/src/pages/CodeAnimation.jsx
+++ b/client/src/pages/CodeAnimation.jsx
@@ -533,13 +533,6 @@ function FastCodeAnimation() {
return (
<div className="mx-auto max-w-7xl space-y-4">
- <PageHeader
- icon={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."
- className="rounded-xl border border-port-border bg-port-card"
- />
-
<section className="space-y-3 rounded-xl border border-port-border bg-port-card p-4" aria-labelledby="ca-gallery-heading">
<div className="flex flex-wrap items-center justify-between gap-3">
<div>
@@ -766,7 +759,7 @@ function FastCodeAnimation() {
<section className="space-y-3 rounded-xl border border-port-border bg-port-card p-4" aria-labelledby="ca-prompt-heading">
<div className="flex flex-wrap items-center justify-between gap-2">
<h2 id="ca-prompt-heading" className="text-sm font-semibold text-white">Prompt</h2>
- <div className="flex flex-wrap gap-2">
+ <div className="flex shrink-0 flex-wrap gap-2 border-b border-port-border px-4 py-2">
<button type="button" onClick={handleBuild} disabled={!canBuild} className={buttonPrimary}>
{building ? <LoaderCircle className="h-4 w-4 animate-spin" /> : <Wand2 className="h-4 w-4" />}
{built ? 'Rebuild prompt' : 'Build prompt'}
@@ -787,7 +780,7 @@ function FastCodeAnimation() {
{built.attachments?.length > 0 && (
<div>
<p className="mb-1 text-xs text-gray-400">Attach these images, in order, when you paste the prompt into another LLM:</p>
- <div className="flex flex-wrap gap-2">
+ <div className="flex shrink-0 flex-wrap gap-2 border-b border-port-border px-4 py-2">
{built.attachments.map((attachment, index) => (
<a key={attachment.url} href={attachment.url} target="_blank" rel="noreferrer" title={`${index + 1}. ${attachment.label} (${attachment.origin})`} className="relative block h-14 w-14 overflow-hidden rounded border border-port-border">
<img src={attachment.url} alt={attachment.label} className="h-full w-full object-cover" />
@@ -871,11 +864,21 @@ function FastCodeAnimation() {
export default function CodeAnimation() {
const { pathname } = useLocation();
const production = pathname.startsWith('/code-animation/production');
- return <div className="space-y-4">
- <nav aria-label="Animation mode" className="flex flex-wrap gap-2">
+ return <div className="flex h-full min-h-0 flex-col">
+ <PageHeader
+ icon={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."
+ />
+
+ <nav aria-label="Animation mode" className="flex shrink-0 flex-wrap gap-2 border-b border-port-border px-4 py-2">
<Link to="/code-animation" className={buttonSecondary} aria-current={!production ? 'page' : undefined}>Fast HTML</Link>
<Link to="/code-animation/production" className={buttonSecondary} aria-current={production ? 'page' : undefined}>Production</Link>
</nav>
- {production ? <ProductionProjects /> : <FastCodeAnimation />}
+ <div className="flex-1 min-h-0 overflow-auto p-4 md:p-6">
+ <div className="mx-auto max-w-7xl">
+ {production ? <ProductionProjects /> : <FastCodeAnimation />}
+ </div>
+ </div>
</div>;
}
diff --git a/client/src/pages/Privacy.jsx b/client/src/pages/Privacy.jsx
index 9076622778..201a6931f6 100644
--- a/client/src/pages/Privacy.jsx
+++ b/client/src/pages/Privacy.jsx
@@ -110,7 +110,7 @@ export default function Privacy() {
};
return (
- <div className="flex flex-col">
+ <div className="flex h-full min-h-0 flex-col">
<PageHeader
icon={Shield}
title="Privacy Center"
@@ -123,23 +123,25 @@ export default function Privacy() {
mobileCompact
ariaLabel="Privacy Center sections"
/>
- <div className="pt-4">
- <SubjectSwitcher
- subjects={subjects}
- subjectId={subjectId}
- onChange={selectSubject}
- onManage={() => setDrawerOpen(true)}
- />
- </div>
- {/* Keying on the subject remounts the tab when the scope changes, so ALL
- of its local state resets at once — revealed plaintext, open drawers,
- expanded rows, filters. Clearing those by hand inside each tab's
- `load()` both missed some and fired on ordinary post-mutation
- refetches, collapsing rows the user had just opened. */}
- <div className="pt-4" key={subjectId}>
- {renderTab()}
- </div>
+ <div className="flex-1 min-h-0 overflow-auto p-4 md:p-6">
+ <div>
+ <SubjectSwitcher
+ subjects={subjects}
+ subjectId={subjectId}
+ onChange={selectSubject}
+ onManage={() => setDrawerOpen(true)}
+ />
+ </div>
+ {/* Keying on the subject remounts the tab when the scope changes, so ALL
+ of its local state resets at once — revealed plaintext, open drawers,
+ expanded rows, filters. Clearing those by hand inside each tab's
+ `load()` both missed some and fired on ordinary post-mutation
+ refetches, collapsing rows the user had just opened. */}
+ <div className="pt-4" key={subjectId}>
+ {renderTab()}
+ </div>
+ </div>
<SubjectsDrawer
open={drawerOpen}
subjects={subjects}
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index 0d70f823e5..c2f2e3f7ce 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -487,6 +487,7 @@ const structuralTestsFor = (changedFiles, trackedSet) => {
add('client/src/hooks/mountedRefConventions.test.js');
add('client/src/moduleContractConventions.test.js');
add('client/src/numberFormattingConventions.test.js');
+ add('client/src/pageShellConventions.test.js');
add('client/src/pollingConventions.test.js');
add('client/src/popoverClampConventions.test.js');
add('client/src/preWrapClasses.test.js');
diff --git a/scripts/repo-scan-guards.test.js b/scripts/repo-scan-guards.test.js
index a257f06595..e216d403f8 100644
--- a/scripts/repo-scan-guards.test.js
+++ b/scripts/repo-scan-guards.test.js
@@ -61,6 +61,7 @@ const STRUCTURALLY_SELECTED = new Map([
['client/src/hooks/mountedRefConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/moduleContractConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/numberFormattingConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
+ ['client/src/pageShellConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/pollingConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/popoverClampConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/providerSelectConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],