Skip to content

feat(digest): v2 — commit sparklines, merged-PR count, avg time-to-merge - #39

Merged
dPeluChe merged 1 commit into
mainfrom
feat/digest-v2
Jun 10, 2026
Merged

dPeluChe merged 1 commit into
mainfrom
feat/digest-v2

Conversation

@dPeluChe

Copy link
Copy Markdown
Owner

Digest v2 from the backlog — with strict request economics: two GraphQL calls per window, both IDB-cached (30 m).

What's new

  • 📈 Sparklines on Most active — default-branch commit activity per repo as a 12-bar mini chart (tooltip = commits in window). All top repos come from ONE aliased GraphQL query, not per-repo fan-out.
  • 🔀 "PRs merged" tile — PRs involving you merged in the window (single is:pr is:merged merged:>=… search).
  • ⏱️ "Avg time to merge" tile — open→merged mean, compact formatting (16h, 1.8d).
  • Window flips (24h/7d/30d) and reloads serve from the digestMerged:/digestActivity: prefs cache (registered in CACHE_TTLS, visible in the Cache tab).
  • 🎭 Demo mode: canned merged PRs + deterministic activity curves, so the demo Digest shows the full v2.
  • 🧪 Tests for the pure helpers (bucketize boundaries, formatDuration units) → suite is now 38 tests / 9 files.

npm run check green.

Verify

Home → Digest: two new tiles + sparklines on Most active rows; flip windows (second flip within 30 m = instant, no new calls — visible in Config → Cache).

🤖 Generated with Claude Code

Digest v2 from the backlog, with strict request economics — two GraphQL calls
per window, both IDB-cached (30m):

- Sparklines on Most active: default-branch commit timestamps for ALL top repos
  come from ONE aliased GraphQL query (fetchReposCommitActivity), bucketed into
  a 12-bar mini chart per row with a commits-in-window tooltip.
- New stat tiles: "PRs merged" (involving you, in window) and "Avg time to
  merge" (open→merged mean, compact 16h/1.8d formatting) via a single
  is:pr is:merged merged:>=window search (searchMergedPRs).
- useDigestExtras hook: window-keyed react-query + digestMerged:/digestActivity:
  prefs (registered in CACHE_TTLS) so flipping 24h/7d/30d or reloading serves
  from cache.
- Demo mode: canned merged PRs + deterministic activity curves.
- Tests for the pure helpers (bucketize boundaries, formatDuration units) —
  suite now 38 tests / 9 files.

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