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
lay out Subscription Usage cards in four quadrants with Codex and Grok sharing a cell
[._.]/ Adam Eivy88646faf721f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex c3c17b4914..bf26182380 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -3,3 +3,4 @@## Changed- **Continuing a video carries its prompt forward.** Continuing or extending a clip we generated now prefills the Video Gen prompt (and negative prompt) with the one that produced the source, instead of dropping you into an empty box. This covers both entry points: the **Continue** action on a video card/lightbox, and picking a prior render in Extend mode. Text you typed yourself is never overwritten — only a blank box or a value an earlier pick filled — and a clip we didn't generate (an import, or a legacy render with no stored prompt) leaves the field alone rather than clearing it. The style preset is dropped along with the prefill, since history stores the already-composed prompt and re-applying a preset would prefix it twice.+- **Subscription Usage cards now lay out in four quadrants.** The provider quota grid orders Claude, Antigravity, Codex, Grok — and because Codex and Grok typically report only a single weekly meter, they now share one grid cell stacked vertically instead of each stretching to a full-height card. Cards render at their natural height, so the Image Gen card floats into the fourth quadrant and the whole section fits above the fold on desktop.diff --git a/client/src/pages/UsagePage.jsx b/client/src/pages/UsagePage.jsxindex 1ac9b6e740..f835b3c31c 100644--- a/client/src/pages/UsagePage.jsx+++ b/client/src/pages/UsagePage.jsx@@ -194,6 +194,36 @@ function ProviderQuotaCard({ quota, onRefresh, refreshing, disabled }) {);}+// Desktop layout: one entry per grid cell, in display order, listing the+// families that cell holds. Claude and Antigravity each meter several windows+// and earn a cell to themselves; Codex and Grok report far less (typically a+// lone weekly window), so they share one cell stacked vertically instead of+// each padding out a half-empty full-height card.+//+// This is a fixed visual preference, deliberately NOT derived from how many+// meters a card happens to be carrying: a card's height changes between its+// pending, error, and loaded states, so a height-derived pairing would+// re-shuffle the whole grid every time a scrape landed.+const CELL_GROUPS = [['claude'], ['agy'], ['codex', 'grok']];+const GROUPED_FAMILIES = new Set(CELL_GROUPS.flat());++// Arrange the server's provider cards into grid cells: `{ key, cards[] }`, where+// a cell holding more than one card stacks them. A family absent from+// CELL_GROUPS (Image Gen, or one added later) still gets its own cell in server+// order — this is a display preference, never a filter.+export function arrangeQuotaCells(quotas) {+ const byFamily = new Map(quotas.map((q) => [q.family, q]));+ const toCell = (cards) => ({ key: cards.map((q) => q.family).join('+'), cards });++ const grouped = CELL_GROUPS+ .map((families) => families.map((f) => byFamily.get(f)).filter(Boolean))+ .filter((cards) => cards.length > 0)+ .map(toCell);+ const rest = quotas.filter((q) => !GROUPED_FAMILIES.has(q.family)).map((q) => toCell([q]));++ return [...grouped, ...rest];+}+// Subscription usage for every enabled provider family (claude, codex, agy,// grok). Self-contained fetch/loading/error state so it always renders above// the PortOS-internal metrics.@@ -276,15 +306,22 @@ function ProviderQuotaSection() {)}{quotas && (- <div className="grid grid-cols-1 lg:grid-cols-2 gap-3 sm:gap-4">- {quotas.map((quota) => (- <ProviderQuotaCard- key={quota.family}- quota={quota}- onRefresh={refreshFamily}- refreshing={refreshingFamilies.has(quota.family)}- disabled={loading}- />+ // `items-start` keeps every card at its natural height: a one-meter+ // Codex/Grok card must not be stretched to the height of the tallest+ // card in its row, which is what left the old grid mostly whitespace.+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-3 sm:gap-4 items-start">+ {arrangeQuotaCells(quotas).map((cell) => (+ <div key={cell.key} className="space-y-3 sm:space-y-4">+ {cell.cards.map((quota) => (+ <ProviderQuotaCard+ key={quota.family}+ quota={quota}+ onRefresh={refreshFamily}+ refreshing={refreshingFamilies.has(quota.family)}+ disabled={loading}+ />+ ))}+ </div>))}{quotas.length === 0 && (<div className="text-gray-500 text-sm">No enabled providers report subscription usage.</div>diff --git a/client/src/pages/UsagePage.test.jsx b/client/src/pages/UsagePage.test.jsxindex 67c6bd8db5..8383f67ee1 100644--- a/client/src/pages/UsagePage.test.jsx+++ b/client/src/pages/UsagePage.test.jsx@@ -11,7 +11,9 @@ const api = vi.hoisted(() => ({vi.mock('../services/api', () => api);-const UsagePage = (await import('./UsagePage')).default;+const UsagePageModule = await import('./UsagePage');+const UsagePage = UsagePageModule.default;+const { arrangeQuotaCells } = UsagePageModule;const usage = {totalSessions: 1,@@ -146,6 +148,28 @@ describe('UsagePage per-provider refresh', () => {});});+describe('arrangeQuotaCells', () => {+ const q = (family) => ({ family, label: family });++ it('orders Claude, Antigravity, then a shared Codex+Grok cell, then the rest', () => {+ // Server order deliberately differs from display order.+ const cells = arrangeQuotaCells(['claude', 'codex', 'agy', 'grok', 'imagegen'].map(q));+ expect(cells.map((c) => c.cards.map((card) => card.family))).toEqual([+ ['claude'], ['agy'], ['codex', 'grok'], ['imagegen']+ ]);+ });++ it('collapses a shared cell to the one family of the pair that is enabled', () => {+ const cells = arrangeQuotaCells([q('grok'), q('claude')]);+ expect(cells.map((c) => c.key)).toEqual(['claude', 'grok']);+ });++ it('renders a family it has no display preference for exactly once, in server order', () => {+ const cells = arrangeQuotaCells([q('imagegen'), q('newthing')]);+ expect(cells.map((c) => c.cards.map((card) => card.family))).toEqual([['imagegen'], ['newthing']]);+ });+});+describe('UsagePage provider reset times', () => {it('localizes an ISO reset and adds the relative countdown', async () => {// A minute past the 3h mark, so the floor in `timeUntil` can't round to 2h.