Standalone stats banner — all-time commits and streaks, no character#15
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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, soit matches the character banner beside it. The engine knows nothing about it.
.gifdrifts soft clouds behind the numbers and loops — twoparallax clouds, each crossing a whole number of spans per loop, so
frame(0) == frame(N). A.pngis the still. Same command, extension picks.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.profile/README.md,docs/PROFILE.md, the sample setup, and theroot README.
Verified
stat_boxesinjection — is tested locally, and config→banner renders end to end.
Before merge, know
dateonly run in real Actions, so theall-time numbers want a look on the first run.
AWAN_VERSIONis bumped to v0.0.6: the workflow calls thestatssubcommand, so this needs the v0.0.6 release to be cut together with the merge.