Skip to content

feat(qol): error boundaries + rate-limit aware fetching - #37

Merged
dPeluChe merged 1 commit into
mainfrom
feat/qol-boundaries-ratelimit
Jun 10, 2026
Merged

dPeluChe merged 1 commit into
mainfrom
feat/qol-boundaries-ratelimit

Conversation

@dPeluChe

Copy link
Copy Markdown
Owner

The two quality-of-life picks from the backlog.

🛟 Error boundaries

  • New ErrorBoundary (friendly fallback: error message + Try again / Reload app).
  • App-level on the root route, per-view around the Home main column — keyed by scope/repo so navigating away auto-resets a crashed view, and the sidebar lives outside the boundary: a broken scope no longer blanks the app, you just switch scopes.
  • The standalone /repos/:owner/:name route gets its own.

⏳ Rate-limit aware fetching (v1)

  • store/rateGate.ts — passive quota tracking: gql()/rest() report the x-ratelimit-* headers every response already carries (zero extra API calls), plus the dedicated rateLimit query feeds the graphql pool. The volatile per-minute search pool is deliberately ignored (it self-heals; gating on it would cause false alarms).
  • When a tracked pool drops under 5% (min 100): react-query's focus/reconnect refetching pauses — manual actions and initial loads unaffected — and the gate self-lifts at the reset timestamp.
  • Dashboard topbar: the quota readout turns red with ⚠ and a "background refresh paused until " tooltip.

Tests

6 new (thresholds, header parsing, search-pool ignore, reset behavior) → suite is now 35 tests / 8 files. npm run check green.

Verify

  • Throw inside any scope (devtools) → fallback card, sidebar still works, switching scopes recovers.
  • Topbar quota readout: normal now; goes ⚠ red under 5%.

Note: branched from main — independent of the still-open #36 (no file overlap).

🤖 Generated with Claude Code

Quality-of-life pair from the backlog:

Error boundaries
- New ErrorBoundary component (Try again / Reload, error message, console log).
- App-level wrap on the root route, per-view wrap around the Home main column —
  keyed by scope/repo/slot so navigating away auto-resets, and the sidebar
  lives outside the boundary so a crashed scope leaves navigation usable.
- The standalone /repos/:owner/:name route gets its own boundary.

Rate-limit awareness (v1)
- store/rateGate.ts: passive quota tracking — gql()/rest() report the
  x-ratelimit-* headers every response already carries (zero extra calls), and
  the dedicated rateLimit query feeds the graphql pool. The volatile per-minute
  'search' pool is deliberately ignored.
- When a tracked pool drops under 5% (min 100), react-query's focus/reconnect
  refetching pauses (queries.ts gate). Manual actions and initial loads are
  unaffected; the gate self-lifts once the window resets.
- Dashboard topbar turns the quota readout red with ⚠ and a "background
  refresh paused until <reset>" tooltip while low.
- 6 new tests (rateGate thresholds, header parsing, search-pool ignore,
  reset behavior) — suite now 35 tests / 8 files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dPeluChe
dPeluChe merged commit 613fc52 into main Jun 10, 2026
1 check passed
@dPeluChe
dPeluChe deleted the feat/qol-boundaries-ratelimit branch June 10, 2026 06:10
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