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

ux: let each page declare its header row shape so the skeleton reserves the right number of rows (#2843)

[._.]/ Adam Eivyb7afd52f880a
diff --git a/client/src/components/ui/PageSkeleton.jsx b/client/src/components/ui/PageSkeleton.jsx
index 8c0839168c..8b2a93a0db 100644
--- a/client/src/components/ui/PageSkeleton.jsx
+++ b/client/src/components/ui/PageSkeleton.jsx
@@ -53,7 +53,16 @@ export default function PageSkeleton({
fullHeight = false,
barClassName = 'px-3 py-2 sm:px-4 sm:py-3',
bodyClassName = 'p-3 sm:p-4',
+ // Flex shape of the title/action row. The defaults are the common cases
+ // (PageHeader's wrapping row for `bar`, stack-then-row for `inline`); pages
+ // that break at a different width — or never stack at all — pass their own,
+ // otherwise the skeleton reserves one row where the page renders two.
+ headerRowClass,
}) {
+ const headerRow = headerRowClass || (header === 'bar'
+ ? 'flex flex-wrap items-center justify-between gap-x-3 gap-y-2'
+ : 'flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4');
+
// Callers derive counts from live data (`TABS.length`, a config value), so
// clamp rather than trusting them: `Array.from` throws on a negative or
// infinite length, and no page shell ever needs more than a few dozen blocks.
@@ -110,13 +119,18 @@ export default function PageSkeleton({
aria-label={label}
>
<div className={`shrink-0 border-b border-port-border ${barClassName}`}>
- <div className="flex items-center gap-2 sm:gap-3">
- <div className="w-6 h-6 sm:w-7 sm:h-7 shrink-0 rounded bg-port-card animate-pulse" />
- <div className="min-w-0 flex-1">
- <div className={`h-6 sm:h-7 rounded bg-port-card animate-pulse ${titleWidthClass}`} />
- {showSubtitle && (
- <div className={`${subtitleOnMobile ? '' : 'hidden sm:block'} h-4 w-64 max-w-full rounded bg-port-card animate-pulse mt-1`} />
- )}
+ <div className={headerRow}>
+ {/* Icon + title stay one unit, so a `flex-col` headerRowClass
+ stacks the ACTION under the title (what the page does) rather
+ than breaking the icon off onto its own line. */}
+ <div className="flex items-center gap-2 sm:gap-3 min-w-0">
+ <div className="w-6 h-6 sm:w-7 sm:h-7 shrink-0 rounded bg-port-card animate-pulse" />
+ <div className="min-w-0">
+ <div className={`h-6 sm:h-7 rounded bg-port-card animate-pulse ${titleWidthClass}`} />
+ {showSubtitle && (
+ <div className={`${subtitleOnMobile ? '' : 'hidden sm:block'} h-4 w-64 max-w-full rounded bg-port-card animate-pulse mt-1`} />
+ )}
+ </div>
</div>
{showAction && <div className="h-6 w-24 rounded bg-port-card animate-pulse" />}
</div>
@@ -140,7 +154,7 @@ export default function PageSkeleton({
aria-label={label}
>
{header !== 'none' && (
- <div className="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4 mb-6">
+ <div className={`${headerRow} mb-6`}>
<div className="min-w-0">
<div className={`h-8 rounded bg-port-card animate-pulse ${titleWidthClass}`} />
{showSubtitle && (
diff --git a/client/src/components/ui/PageSkeleton.test.jsx b/client/src/components/ui/PageSkeleton.test.jsx
index 5e017d4d85..1e3a958e90 100644
--- a/client/src/components/ui/PageSkeleton.test.jsx
+++ b/client/src/components/ui/PageSkeleton.test.jsx
@@ -115,6 +115,21 @@ describe('PageSkeleton', () => {
expect(shown.container.innerHTML).not.toContain('hidden sm:block');
});
+ it('defaults the header row per mode and lets a page override the break width', () => {
+ const inline = render(<PageSkeleton />);
+ expect(inline.container.innerHTML).toContain('flex flex-col sm:flex-row');
+ inline.unmount();
+
+ const bar = render(<PageSkeleton header="bar" />);
+ expect(bar.container.innerHTML).toContain('flex flex-wrap items-center justify-between');
+ bar.unmount();
+
+ // A page whose header only stacks at `lg` must not reserve an `sm` stack.
+ const override = render(<PageSkeleton headerRowClass="flex flex-col lg:flex-row gap-3" />);
+ expect(override.container.innerHTML).toContain('flex flex-col lg:flex-row gap-3');
+ expect(override.container.innerHTML).not.toContain('sm:flex-row');
+ });
+
it('renders no tab strip when tabs is 0', () => {
const { container } = render(<PageSkeleton tabs={0} />);
expect(container.querySelectorAll('.h-\\[44px\\]')).toHaveLength(0);
diff --git a/client/src/pages/CapabilityMap.jsx b/client/src/pages/CapabilityMap.jsx
index a2bf6dee1b..9db7ba4307 100644
--- a/client/src/pages/CapabilityMap.jsx
+++ b/client/src/pages/CapabilityMap.jsx
@@ -51,7 +51,15 @@ export default function CapabilityMap() {
);
if (loading) {
- return <PageSkeleton label="Loading capabilities" titleWidthClass="w-40" showSubtitle layout="grid" gridColsClass="lg:grid-cols-2" cards={6} />;
+ return <PageSkeleton
+ label="Loading capabilities"
+ headerRowClass="flex flex-wrap items-center justify-between gap-3"
+ titleWidthClass="w-40"
+ showSubtitle
+ layout="grid"
+ gridColsClass="lg:grid-cols-2"
+ cards={6}
+ />;
}
if (!data) {
diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx
index d3c8b02b51..0b5c82932f 100644
--- a/client/src/pages/Dashboard.jsx
+++ b/client/src/pages/Dashboard.jsx
@@ -328,7 +328,13 @@ export default function Dashboard() {
return (
// No BOOTING SchematicLabel here: it exists only while loading, so its
// height is exactly the shift this skeleton is meant to eliminate.
- <PageSkeleton label="Loading dashboard" titleWidthClass="w-40" layout="grid" cards={6} />
+ <PageSkeleton
+ label="Loading dashboard"
+ headerRowClass="flex flex-row items-center justify-between gap-2 sm:gap-4"
+ titleWidthClass="w-40"
+ layout="grid"
+ cards={6}
+ />
);
}
diff --git a/client/src/pages/DigitalTwin.jsx b/client/src/pages/DigitalTwin.jsx
index 428c62d8f1..4f6851d74d 100644
--- a/client/src/pages/DigitalTwin.jsx
+++ b/client/src/pages/DigitalTwin.jsx
@@ -111,6 +111,7 @@ export default function DigitalTwin() {
label="Loading digital twin"
fullHeight
padded
+ headerRowClass="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"
barClassName="p-4"
bodyClassName="p-4"
titleWidthClass="w-40"
diff --git a/client/src/pages/Review.jsx b/client/src/pages/Review.jsx
index 8a674ef4fd..cf4fbf6e78 100644
--- a/client/src/pages/Review.jsx
+++ b/client/src/pages/Review.jsx
@@ -263,7 +263,15 @@ export default function Review() {
}), [pendingItems]);
if (loading) {
- return <PageSkeleton label="Loading review hub" padded fullHeight titleWidthClass="w-40" cards={4} sidebar={false} />;
+ return <PageSkeleton
+ label="Loading review hub"
+ headerRowClass="flex flex-col lg:flex-row lg:items-center justify-between gap-3"
+ padded
+ fullHeight
+ titleWidthClass="w-40"
+ cards={4}
+ sidebar={false}
+ />;
}
// Cheap derivations off the memoized `pendingItems`/`actionableItems` — plain
diff --git a/client/src/pages/SystemHealthPage.jsx b/client/src/pages/SystemHealthPage.jsx
index dd7fdc11d2..bbca95ce70 100644
--- a/client/src/pages/SystemHealthPage.jsx
+++ b/client/src/pages/SystemHealthPage.jsx
@@ -67,7 +67,14 @@ export default function SystemHealthPage() {
if (loading) {
return (
<div className="max-w-5xl mx-auto">
- <PageSkeleton label="Loading system health" titleWidthClass="w-48" layout="grid" gridColsClass="md:grid-cols-3" cards={3} />
+ <PageSkeleton
+ label="Loading system health"
+ headerRowClass="flex items-center justify-between gap-3"
+ titleWidthClass="w-48"
+ layout="grid"
+ gridColsClass="md:grid-cols-3"
+ cards={3}
+ />
</div>
);
}