Repository navigation
feat(graph): overlay prior contribution windows as ghost lines (&ghosts=N) - #8
Merged
Merged
Conversation
Add an opt-in &ghosts=N URL param (0-6, clamped, default 0) that draws the N previous contribution windows as faded grey "ghost" lines behind the current one, so the current pace is comparable at a glance. - fetcher: each ghost window is the current range shifted back by its own length; all windows are fetched in ONE aliased GraphQL request (c0 = current, c1.. = ghosts), trimmed index-aligned to the current day count, front-padded with zero days for short windows, and skipped entirely when they start before GitHub's ~1-year data limit - chart: ghosts render first (SVG paints in document order, so they sit behind) as ct-series-ghost with no points or area; the current window is now always ct-series-current, and the area fill selector migrated accordingly - styling: fixed grey (#9e9e9e, 35% opacity, thinner stroke) regardless of theme; dash-draw animation inherited - /data stays single-window; ghosts=0 renders the same graph as before Refs chicks-net/chicks-projects#130
deploy is the branch that auto-deploys to the DO App Platform, so its PRs are exactly where the test suite should run; previously CI only watched main, and every PR that merged to deploy shipped untested. The live-API test in utils.test.ts is skipped when TOKEN is unset, so CI is green without repo secrets; adding the TOKEN secret enables it.
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.
Implements chicks-net/chicks-projects#130.
What
Opt-in
&ghosts=NURL param (integer 0–6, clamped, default0) that overlays theNprevious contribution windows as faded grey "ghost" lines behind the current line:ghosts=2⇒ current window + the two 31-day windows before it), index-aligned on the X-axis. Works with anydaysvalue and customfrom/to.c0: contributionsCollection(from:$FROM0,to:$TO0){…}, c1: …), so no rate-limit multiplication. Ghosts are trimmed to the current day count by keeping trailing days, front-padded with zero days for windows older than the account, and skipped when they start before GitHub's ~1-year data limit.ct-series-ghost, no points/area via Chartist's per-series options) so they paint behind the current window (ct-series-current); area-fill selector migrated accordingly. Fixed grey#9e9e9e@ 35% opacity, thinner stroke, theme-independent, dash-draw animation inherited.ghosts=0renders the same graph as before (same pixels; markup now uses semantic series classes)./datastays single-window and its response shape is unchanged.CI
Node.js CInow also runs on PRs todeploy(the branch that auto-deploys). It has never run on this fork before.TOKENsecret, so the one live-API test inutils.test.tsself-skips; adding aTOKENrepo secret would enable it.Verification
npm test: 16 passed (13 existing + 3 new), snapshots reviewed and updated — diffs are exactly the intended class migration + ghost CSS.tscclean; new/changed files prettier-clean.ghosts=2renders two grey ghost lines behind the current line;ghosts=9clamps to 6; customfrom/to+ ghosts works;ghosts=0and/dataunchanged.Refs chicks-net/chicks-projects#130