Skip to content

feat(stats): add accuracy and reuse-rate sparklines to the homepage hero (#4447, #4448) - #4685

Merged
JSONbored merged 1 commit into
mainfrom
feat/proof-of-power-sparklines-4447-4448
Jul 10, 2026
Merged

feat(stats): add accuracy and reuse-rate sparklines to the homepage hero (#4447, #4448)#4685
JSONbored merged 1 commit into
mainfrom
feat/proof-of-power-sparklines-4447-4448

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Closes #4448 (last unchecked deliverable — "Homepage//stats page shows the reuse-rate trend" — the other #4448 deliverables shipped in #4658/#4671; the "daily rollup, cron-refreshed" deliverable was deliberately built as a live-computed query over durable tables instead, mirroring the same live-vs-rollup call made for #4447, to avoid a cron-miss gap and a second copy of the number). Advances #4447 (already closed; this adds the "accuracy-over-time chart alongside the existing live number" piece its own checklist left undone at close time).

Validation

  • git diff --check
  • npm run actionlint — skipped, no .github/workflows/** changes in this diff.
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate. — skipped: no src/** lines in this diff (UI-only), so codecov/patch doesn't apply. UI-side behavior is covered by ui:test instead (see below).
  • npm run test:workers — skipped, no Worker/backend code touched.
  • npm run build:mcp — skipped, no MCP package changes.
  • npm run test:mcp-pack — skipped, no MCP package changes.
  • npm run ui:openapi:check — clean; this diff doesn't touch any route or schema.
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — proof-of-power-stats.test.tsx: five-tile assertion (was four), a dedicated sparkline-count/a11y-name test, and the fixture now carries a deliberate null-accuracy week to exercise the gap path.

Also ran, not in the template's list: npm --workspace @jsonbored/gittensory-ui run test (15 files / 113 tests, full workspace) both before and after rebasing onto latest main — no drift.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. — N/A, no auth/session/CORS code touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A, no API/OpenAPI/MCP changes; pure frontend consumer of already-shipped fields.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks — both tiles read straight off the live /v1/public/stats payload; the whole section still renders nothing until totals.handled > 0, same as before.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository. — left unchecked honestly: see UI Evidence below for what was actually verified and why no GitHub-hosted image URLs are attached.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs — no changelog edit (not a release-prep PR).

UI Evidence

No GitHub-hosted screenshot URLs are attached — this session has no browser access to github.com to produce user-attachments/user-images URLs, and the template asks not to commit review-evidence images to the repo. In lieu of that, here's exactly what was verified against the local dev server (apps/gittensory-ui, via Claude Code's Preview tooling, real recharts render in a real DOM, not a snapshot test):

State What was checked
Loaded, dark (default) All 5 tiles render; both sparklines draw with stroke: oklch(0.88 0.18 115) (--chart-1, accuracy) and oklch(0.75 0.16 140) (--chart-2, reuse rate) — the app's own existing, already-validated chart ramp, not a new palette.
Loaded, light Toggled the .dark class off directly (this app keys theming off a class, not prefers-color-scheme) — both sparklines correctly repaint to their light-mode OKLCH values (0.78 0.18 115 / light chart-2), no hardcoded dark-only color.
Null-week gap Inspected the accuracy sparkline's rendered SVG <path> directly: two M (moveto) subpaths, breaking exactly at the fixture's null-accuracy week — confirms connectNulls={false} produces a real visual gap for "below minimum sample," not an interpolated line through it.
Mobile (375×812) grid-cols-2 layout: the 5th tile ("AI work reused") wraps to its own row at half width as expected, sparkline stays proportioned inside the tile, no overflow/clipping.
Mark spec Both <Line>s: strokeWidth: 2px, strokeLinecap/strokeLinejoin: round, no axes/gridlines/tooltip (sparklines are the documented exception to the hover-layer default) — matches the dataviz skill's stat-tile figure contract.

Notes

  • .claude/launch.json (a local Preview-tooling dev-server config) is intentionally not included in this PR — it's outside wantedPaths and is personal/session tooling, not a repo need.

…ero (#4447, #4448)

Rides the two trend series already shipped in /v1/public/stats beside their
stat tiles instead of a separate /stats page, per the hero-band placement
call. Nulls (below-sample weeks) render as a genuine gap, not a fabricated
zero.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 10cf1f0 Commit Preview URL

Branch Preview URL
Jul 10 2026, 11:56 AM

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 10, 2026
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 10, 2026
@JSONbored
JSONbored merged commit a2e5d3e into main Jul 10, 2026
11 checks passed
@JSONbored
JSONbored deleted the feat/proof-of-power-sparklines-4447-4448 branch July 10, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(stats): AI-feature cache/reuse-efficiency rate, tracked over time, public

1 participant