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: clamp skeleton block counts against Infinity and file PageSkeleton follow-ups (#2843)

[._.]/ Adam Eivy8f288e54da9c
diff --git a/PLAN.md b/PLAN.md
index da4a66f8f5..9b15610a2d 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -256,3 +256,9 @@ The `kimi-cli`/`kimi-tui` providers shipped without a live `kimi` binary in the
- [ ] **Structured-output contamination.** If plain `kimi --print` interleaves intermediate tool/assistant activity with the final message, a pipeline stage parsing stdout as JSON could choke on the chatter. If the live `kimi` exposes a "final message only" flag, add it to `ensureKimiHeadlessArgs` in `server/lib/kimi.js`. NOT added blind: an unrecognized flag would make every headless run fail at startup.
- [ ] **Confirm the TUI auto-approve + print flags.** Verify `--yolo` (TUI auto-approve), `--print`/`--afk` (headless), and `--prompt`/`-p` (prompt value) are the real flag names, and that `--print` implies `--afk`. Adjust `ensureKimiTuiArgs`/`ensureKimiHeadlessArgs` if the CLI differs.
- [ ] **Kimi usage/quota family (out of scope of issue-2815).** Once the `kimi` usage command is confirmed, add a `FAMILIES` entry in `server/services/providerUsage.js` so the provider surfaces a quota card (currently maps to no family, like ollama-backed wrappers).
+
+### Loading-skeleton rollout follow-ups (#2843)
+
+- [ ] **Chief of Staff has no dimension-reserving skeleton** (`client/src/pages/ChiefOfStaff.jsx` ~line 587). It still shows a centered `BrailleSpinner` because it is a bespoke two-pane shell (`lg:grid-cols-[320px_1fr]` avatar panel + chat pane), not the list/detail shape `PageSkeleton` models — a card skeleton there would misrepresent the layout worse than the spinner does. Wants either a two-pane `layout` mode on `PageSkeleton` or a local `CoSSkeleton`.
+- [ ] **`/data` (Data Manager) is a self-scrolling `h-full` shell nested in Layout's padded scrolling main** (`client/src/pages/DataManager.jsx` ~line 374; `/data` is absent from the `isFullWidth` list in `client/src/components/Layout.jsx` ~line 1148). The loaded page renders its own bar + `flex-1 overflow-auto` body inside `overflow-auto p-4 md:p-6`, so it double-pads and nests two scroll containers. The skeleton mirrors the page faithfully, so this is pre-existing, not introduced by #2843. Fix by either adding `/data` to `isFullWidth` or dropping the page's `h-full` shell — then drop `padded`/`fullHeight`/`barClassName` from its `PageSkeleton` call accordingly. Raised in the #2843 review, deferred to keep that PR scoped to skeletons.
+- [ ] **Sub-region spinners are untouched by #2843.** Tab bodies that refetch (`Brain`/`Goals`/`DigitalTwin` Suspense fallbacks, `Apps` per-app expansion, `DataManager` category detail, `UsagePage` provider-quota section, `CharacterSheet` sync panels) still render bare `BrailleSpinner`s. Lower value than first-paint (the surrounding layout is already reserved), but the taller ones could take a scoped skeleton.
diff --git a/client/src/components/ui/PageSkeleton.jsx b/client/src/components/ui/PageSkeleton.jsx
index 468b7da7f4..8c0839168c 100644
--- a/client/src/components/ui/PageSkeleton.jsx
+++ b/client/src/components/ui/PageSkeleton.jsx
@@ -55,8 +55,9 @@ export default function PageSkeleton({
bodyClassName = 'p-3 sm:p-4',
}) {
// Callers derive counts from live data (`TABS.length`, a config value), so
- // clamp rather than trusting them: `Array.from({ length: -1 })` throws.
- const repeat = (n) => Array.from({ length: Math.max(0, Math.floor(n) || 0) });
+ // 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.
+ const repeat = (n) => Array.from({ length: Math.min(64, Math.max(0, Math.floor(n) || 0)) });
const cardBlocks = repeat(cards).map((_, i) => (
<div
diff --git a/client/src/components/ui/PageSkeleton.test.jsx b/client/src/components/ui/PageSkeleton.test.jsx
index 488b9a3143..5e017d4d85 100644
--- a/client/src/components/ui/PageSkeleton.test.jsx
+++ b/client/src/components/ui/PageSkeleton.test.jsx
@@ -138,5 +138,10 @@ describe('PageSkeleton', () => {
const fractional = render(<PageSkeleton header="bar" tabs={3.7} />);
expect(fractional.container.querySelectorAll('.h-\\[44px\\]')).toHaveLength(3);
+ fractional.unmount();
+
+ // Infinity would also throw RangeError without the upper clamp.
+ const infinite = render(<PageSkeleton cards={Infinity} sidebar={false} />);
+ expect(cardCount(infinite.container)).toBe(64);
});
});