Skip to content

feat(usage): one unified MagicGrid board for all quota cards - #12

Merged
patrickrho-patty merged 1 commit into
pattyfrom
feat/unified-quota-magic-grid
Sep 25, 2026
Merged

patrickrho-patty merged 1 commit into
pattyfrom
feat/unified-quota-magic-grid

Conversation

@patrickrho-patty

Copy link
Copy Markdown
Collaborator

What

Replaces the per-provider sections with one unified MagicGrid board: every connection — any provider, any account count — is the same fixed-width card flowing shortest-column-first, filling every row. Provider identity (icon + label + plan badge) lives on the card, so nothing is lost by dropping the section headers. The page header's PROVIDER filter narrows the board.

Single-account providers (Codex, Claude Code, Z.AI) now sit in the same grid next to 7-account Antigravity — no more lone cards owning a row.

How

  • magic-grid (MIT, zero-dep, ~4KB) computes positions; cards keep CSS widths: w-full on phones (→ 1 column), sm:w-[280px] desktop / sm:w-[260px] compact, capped at 8 columns.
  • Listener hygiene: MagicGrid's listen() registers an unremovable window resize listener and has no destroy — we never call it. Instead: static: true config + our own ResizeObserver (container), MutationObserver (card height changes: "Show 5 more", loading→data swaps), and window resize — all disconnected on unmount.
  • Card order stays the stable priority sort from fix(usage): opencode-go expiry/swap + kimi-coding stuck-at-100% quota display #10/feat(usage): consistent quota card grid + scannable reset tracking #11 (status → soonest reset (minute granularity) → remaining → name).
  • ESLint clean; dashboard typecheck unchanged (1 pre-existing merge-inherited error in an untouched file).

Tests

Visual verification

Screenshot of omni.patty.io after deploy will be attached.

Operator direction after the sectioned layout: single-account providers
should not own a row — every card belongs on ONE grid regardless of
provider or account count, with provider identity on the card itself.

- QuotaCardGrid rebuilt as a flat MagicGrid board: uniform fixed-width
  cards (280px desktop / 260px compact, full-width on phones so MagicGrid
  computes a single column), shortest-column-first placement, provider
  icon + label + plan badge on every card. Per-provider <details> sections
  and grouping helpers are gone; the page header's PROVIDER filter remains
  the way to narrow the board.
- MagicGrid wiring: static:true + our own ResizeObserver / MutationObserver
  / window-resize triggers, all disconnected on unmount. listen() is never
  called (it registers an unremovable window resize listener — leak).
- Guard tests: new quota-unified-magic-grid.test.ts pins the architecture
  (no section markup, mobile w-full -> 1 column, density at 1200px,
  listener hygiene, compact track < full track). diegosouzapw#7072/diegosouzapw#6815/horizontal-
  layout guards superseded and removed (their guarantees re-pinned here);
  diegosouzapw#8916 compact guard updated for the new mechanism.
- Found en route: ts.forEachChild STOPS on a truthy visitor return — the
  AST collectors must use void-returning callbacks (the concise-arrow
  version silently collected only the first child).
@patrickrho-patty
patrickrho-patty merged commit 2b3b224 into patty Sep 25, 2026
@patrickrho-patty
patrickrho-patty deleted the feat/unified-quota-magic-grid branch September 25, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant