Repository navigation
Draw a commit graph scale the app doesn't know as a year - #199
Merged
simonhamp merged 1 commit intoNov 21, 2026
Merged
Conversation
A profile's commit activity comes from devnull with a scale of day, week, month or year. If the scale was anything else, the app dropped the whole response, so the profile said "0 commits in the last year" over an empty strip. A scale that wasn't a string, such as an array, threw an error and broke the profile screen. A scale the app doesn't know, or one that's missing or not a string, is now drawn as a year and keeps its buckets. dev-null-sh/dev-null.sh#1658 proposes a half scale, which then shows as 26 weekly cells, but nothing here depends on it merging.
2 of 3 tasks
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 profile's commit activity comes from devnull with a
scaleofday,week,monthoryear. If the scale was anything else, the app dropped the whole response. The profile then said "0 commits in the last year" over an empty strip. Ascalethat wasn't a string, such as an array, threw an error and broke the profile screen.dev-null-sh/dev-null.sh#1658 proposes a
halfscale: 26 weeks of daily buckets for profiles 30 days to 6 months old. Without this change, someone two months in would see "0 commits in the last year" in the app as soon as that ships. That PR may not merge, but devnull could add a scale at any time, so this makes the app ready for one either way.Fix
Activity::fromArray()now draws a scale it doesn't know, or one that's missing or not a string, as a year, keeping its buckets.half, that's 26 cells, and the count is right, because devnull only sendshalfwhen nothing visible is older than 26 weeks (if the dependent PR is merged, otherwise it never sendshalf).The app still only knows
day,week,monthandyear, so nothing here depends on #1658. If that is merged, we could add support forhalf(or any future scale) at our own pace without the app displaying an error.Tests
A new test in
tests/Unit/Devnull/ActivityTest.phpreads 91 days under an unknownquarterscale.ActivityTest.phpandProfileTest.phppass (38 passed).I didn't run this on a device. It depends on the API sending an unknown value to reproduce it.
Screenshots