Skip to content

Standalone stats banner — all-time commits and streaks, no character#15

Merged
codewithwan merged 4 commits into
mainfrom
feat/stats-banner
Jul 19, 2026
Merged

Standalone stats banner — all-time commits and streaks, no character#15
codewithwan merged 4 commits into
mainfrom
feat/stats-banner

Conversation

@codewithwan

Copy link
Copy Markdown
Owner

A separate profile output with no character: three metrics in a row, split by
vertical rules — all-time commits, current streak, longest streak — each with the
dates it covers. It answers a different question ("the numbers, at a glance") and
wants the whole width, so it isn't a scene in the reel.

What's here

  • Renderer (awan-profile stats --config awan.json --out banner.{gif,png}).
    Draws stat_boxes ({value, label, note} × 3) in awan's own 8×8 pixel font, so
    it matches the character banner beside it. The engine knows nothing about it.
  • Animation: a .gif drifts soft clouds behind the numbers and loops — two
    parallax clouds, each crossing a whole number of spans per loop, so
    frame(0) == frame(N). A .png is the still. Same command, extension picks.
  • Workflow: opt in with one input, stats_banner: assets/stats-banner.gif,
    and the reusable workflow fills the numbers (walking the contribution calendar
    year by year from the year you joined) and draws it. Nothing to add to
    awan.json. Gated on the input, so nobody else pays the extra API calls.
  • Docs: profile/README.md, docs/PROFILE.md, the sample setup, and the
    root README.

Verified

  • Whole workspace green, clippy clean, fmt clean, files under the 200-line cap.
  • The jq — longest-run scan across year boundaries, comma grouping, stat_boxes
    injection — is tested locally, and config→banner renders end to end.

Before merge, know

  • The multi-year GraphQL fetch and GNU date only run in real Actions, so the
    all-time numbers want a look on the first run.
  • AWAN_VERSION is bumped to v0.0.6: the workflow calls the stats
    subcommand, so this needs the v0.0.6 release to be cut together with the merge.

A separate output from the reel (`awan-profile stats --config awan.json --out
banner.png`), because it answers a different question — "the numbers, at a
glance" — and wants the whole width to itself, no character walking through it.

Three boxes split by vertical rules: a headline number in the accent gold, what
it counts, and the span it covers. All three are plain strings on the box, so CI
formats them — commas in the count, the dates in the note — and the renderer
knows nothing about GitHub; it only lays them out in awan's own 8×8 pixel font,
so it matches the character banner it sits beside.

It's a PNG, not a GIF: the numbers don't move, so there's nothing to animate and
a still is smaller and sharper. (A count-up animation is a later option if it's
ever wanted.) Added the `png` feature to the image dep for it.

The data the boxes want — all-time commit total with a first-commit date, the
current streak's start, the longest streak's span — is all derivable from the
contribution calendar, but the all-time figures need CI to fetch more than the
default one-year window. That fetch is the next step; this is the face it fills.
The numbers don't move, so a still was the honest default — but a dead banner
next to the character's animated one looks switched-off. The fix isn't to animate
the numbers (a count-up that loops has to snap back to zero); it's to give the
readout the character's *world*. awan means cloud, so soft clouds drift behind
the numbers and the thing breathes without anyone walking through it.

A `.gif` path animates now, a `.png` stays a still — same command, the extension
picks. Two clouds drift at different speeds (parallax), each crossing a whole
number of spans over the loop, so frame 0 and frame LOOP line up and there's no
seam. They're barely above the backdrop and sit *behind* the numbers, so they
read as depth, not data, and never fight the values for the eye.

Committed both an animated .gif and a still .png sample.
Opt in with one input — `stats_banner: assets/stats-banner.gif` — and the
workflow does the rest; you add nothing to awan.json. It computes the three
numbers the yearly calendar can't give, walking the contribution calendar year
by year from the year you joined: an all-time commit count with your first
commit's date, your current streak's start, and your longest streak ever with
its span. It writes them into the config as stat_boxes, draws the banner, shrinks
it, and commits it alongside the character GIF.

Gated on the input so nobody who doesn't want the banner pays for the extra API
calls. The jq — the longest-run scan across year boundaries, the comma grouping,
the stat_boxes injection — is tested locally; the multi-year GraphQL fetch and
GNU date runs only in CI, so the numbers want a look on the first real run.

AWAN_VERSION bumped to v0.0.6: this file needs the release that carries the
`stats` subcommand, so the two ship together.
The stats banner needed a home in the docs, and a few files that promise "here's
everything awan draws" were now incomplete.

- profile/README.md: a "The stats banner" section (the command, the .gif/.png
  split, the CI-filled stat_boxes), the stats_banner input in the workflow snippet
  and the input table, the README embed lines, and stat_boxes in the config
  reference.
- profile/sample/: the copy-ready workflow now sets stats_banner, the starter
  README shows the banner, and awan.json lists stat_boxes (empty, CI fills it) —
  so a fresh copy draws it out of the box.
- docs/PROFILE.md: a design note on why it's a separate output and why the
  all-time fetch is opt-in.
- root README.md: the stats banner in the shipping list and a pointer from the
  profile section.
@codewithwan
codewithwan merged commit a142164 into main Jul 19, 2026
8 checks passed
@codewithwan
codewithwan deleted the feat/stats-banner branch July 19, 2026 12:13
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