Repository navigation
Show manga totals in Settings, and give the card its own colours (#12) - #153
Merged
Merged
Conversation
added 3 commits
August 30, 2026 23:15
The viewer query asked for statistics { anime } only, so a manga reader
got a profile card of four anime numbers and nothing about the list they
actually keep — the last screen where manga was still second-class after
#151 gave it a Library tab.
Fetch statistics { manga { count meanScore chaptersRead volumesRead } }
in both viewer queries and render a Manga Stats card mirroring the anime
2x2: Total Manga, Chapters, Volumes, Mean Score.
UserMangaStatistics is its own model rather than a shared one. AniList
returns a single UserStatistics type carrying every counter for either
kind, so sharing it would put a meaningless EpisodesWatched on manga and
a meaningless ChaptersRead on anime; modelling only the fields that mean
something keeps the card from being able to show a number that cannot be
true. The DTO stays shared, because the wire shape genuinely is.
The card shows for an account with no manga rather than hiding, matching
the anime card, which has always rendered zeros for a fresh account.
Both stat sets now sit under one STATISTICS banner, which avoids
renumbering the five sections below them.
Caught on device, not by the build or the tests: the Manga Stats card rendered all four figures in the same blue, next to a four-colour anime card. Manga, Chapters and Volumes each hashed to RainbowBlue, which is also where Score lands. Map the three through the converter's existing _keyMappings, which is there for exactly this — "ensuring related concepts get the same color". Each manga tile now points at the anime tile in the same grid position, so the two cards read as one shape shown twice rather than two unrelated panels. Tested via ResourceKeyFor, asserting both the pairing and that the four manga keys are distinct from each other — the property that broke, and the one a future palette or hash change could quietly break again.
Two problems with the previous commit, both found on device. It reached for the shared keys. Mapping "Manga" to "Anime" did not just recolour a stat tile: those keys also drive Search's type pills, the two Library nav titles and the details-page chips, so the Manga pill and the Manga Library title started rendering identically to the Anime ones. A decision about a stat tile silently changed four other screens. And matching the anime card was the wrong goal anyway. The two cards sit one above the other and should read as two things. The tiles now use keys that exist only in Settings — StatsTotalManga, StatsChapters and so on — pinned in the lookup table rather than hashed. Nothing outside Settings can be recoloured by a stat-tile decision again, and the shared keys go back to the hash values they always had. The palette has eight stops and the two cards have ten slots, so exactly two colours recur, both chosen rather than incidental: blue on each Mean Score, which is the same metric on both cards, and cyan on the anime header and the manga Volumes tile, which never sit in the same role. The anime entries pin the colours that card already rendered, so it does not move. Renamed _statusColors to _fixedColors, since it no longer holds only status sections. Tests cover the whole contract: five distinct colours within each card, exactly eight across both, headers that differ, and — guarding the regression above — that Anime/Manga and Episodes/Chapters still resolve apart from each other.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The mapping/UI changes are consistent end-to-end (API → model → page model → XAML), and the added unit tests cover both the new manga stats contract and the prior color-key regression risk.
Pull request overview
This PR completes the “manga stats in Settings” gap in the #12 manga-support epic by fetching AniList manga statistics alongside anime statistics and rendering a dedicated “Manga Stats” card with its own fixed accent-color keys to avoid cross-screen recolor regressions.
Changes:
- Extend
ViewerFullandUpdateUserGraphQL selections to includestatistics { manga { count meanScore chaptersRead volumesRead } }, and map into a newUserMangaStatisticsmodel. - Add manga totals to
SettingsPageModeland render a second statistics card in Settings (mirroring the existing anime 2×2 grid). - Pin Settings-only stat-tile color keys in
RainbowAccentConverterand add tests covering the “two cards stay visually distinct” and “shared keys unchanged” contracts.
File summaries
| File | Description |
|---|---|
| tests/AniSprinkles.UnitTests/SettingsPageModelTests.cs | Asserts Settings loads and displays manga totals distinctly from anime totals. |
| tests/AniSprinkles.UnitTests/ConverterTests.cs | Verifies fixed color keying keeps the two stat cards distinct and avoids shared-key regressions. |
| tests/AniSprinkles.UnitTests/AniListClientOperationsTests.cs | Validates viewer deserialization/mapping for manga stats and the “missing manga branch” case. |
| src/AniSprinkles/Views/SettingsLoadedContentView.xaml | Adds the “Manga Stats” card and switches anime stat colors to Settings-only stat keys. |
| src/AniSprinkles/Services/CI/CIAniListClient.cs | Seeds CI stub viewer with non-anime-derived manga stats for screenshot verification. |
| src/AniSprinkles.Core/Services/AniListClient.cs | Adds manga statistics DTO fields, maps them into the user model, and updates ViewerFull/UpdateUser selections. |
| src/AniSprinkles.Core/PageModels/SettingsPageModel.cs | Introduces manga stat observable properties and populates/clears them with the rest of profile data. |
| src/AniSprinkles.Core/Models/UserMangaStatistics.cs | New model representing manga-only statistics fields. |
| src/AniSprinkles.Core/Models/AniListUser.cs | Adds MangaStatistics to the core user model. |
| src/AniSprinkles.Core/Converters/RainbowAccentConverter.cs | Renames status-color table to _fixedColors and pins Settings stat-card keys to fixed palette entries. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
zhollis21
added a commit
that referenced
this pull request
Nov 19, 2026
#153) * Show manga totals in Settings alongside the anime ones The viewer query asked for statistics { anime } only, so a manga reader got a profile card of four anime numbers and nothing about the list they actually keep — the last screen where manga was still second-class after #151 gave it a Library tab. Fetch statistics { manga { count meanScore chaptersRead volumesRead } } in both viewer queries and render a Manga Stats card mirroring the anime 2x2: Total Manga, Chapters, Volumes, Mean Score. UserMangaStatistics is its own model rather than a shared one. AniList returns a single UserStatistics type carrying every counter for either kind, so sharing it would put a meaningless EpisodesWatched on manga and a meaningless ChaptersRead on anime; modelling only the fields that mean something keeps the card from being able to show a number that cannot be true. The DTO stays shared, because the wire shape genuinely is. The card shows for an account with no manga rather than hiding, matching the anime card, which has always rendered zeros for a fresh account. Both stat sets now sit under one STATISTICS banner, which avoids renumbering the five sections below them. * Give each manga stat tile the colour of its anime counterpart Caught on device, not by the build or the tests: the Manga Stats card rendered all four figures in the same blue, next to a four-colour anime card. Manga, Chapters and Volumes each hashed to RainbowBlue, which is also where Score lands. Map the three through the converter's existing _keyMappings, which is there for exactly this — "ensuring related concepts get the same color". Each manga tile now points at the anime tile in the same grid position, so the two cards read as one shape shown twice rather than two unrelated panels. Tested via ResourceKeyFor, asserting both the pairing and that the four manga keys are distinct from each other — the property that broke, and the one a future palette or hash change could quietly break again. * Give the Manga Stats card its own colours, on Settings-only keys Two problems with the previous commit, both found on device. It reached for the shared keys. Mapping "Manga" to "Anime" did not just recolour a stat tile: those keys also drive Search's type pills, the two Library nav titles and the details-page chips, so the Manga pill and the Manga Library title started rendering identically to the Anime ones. A decision about a stat tile silently changed four other screens. And matching the anime card was the wrong goal anyway. The two cards sit one above the other and should read as two things. The tiles now use keys that exist only in Settings — StatsTotalManga, StatsChapters and so on — pinned in the lookup table rather than hashed. Nothing outside Settings can be recoloured by a stat-tile decision again, and the shared keys go back to the hash values they always had. The palette has eight stops and the two cards have ten slots, so exactly two colours recur, both chosen rather than incidental: blue on each Mean Score, which is the same metric on both cards, and cyan on the anime header and the manga Volumes tile, which never sit in the same role. The anime entries pin the colours that card already rendered, so it does not move. Renamed _statusColors to _fixedColors, since it no longer holds only status sections. Tests cover the whole contract: five distinct colours within each card, exactly eight across both, headers that differ, and — guarding the regression above — that Anime/Manga and Episodes/Chapters still resolve apart from each other. * CI: Update UI screenshots [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.










Advances #12. Settings was the last screen where manga was still second-class after #151 gave it a Library tab: the viewer query asked for
statistics { anime }only, so a manga reader opened their profile to four anime numbers and nothing about the list they actually keep.The change
statistics { manga { count meanScore chaptersRead volumesRead } }in both viewer queries, and a Manga Stats card mirroring the anime 2×2: Total Manga, Chapters, Volumes, Mean Score.Both queries, because both map through the same
MapUser.GetViewerandUpdateUsershare it, so asking in only one place would have blanked the card every time a setting saved.UserMangaStatisticsis its own model. AniList returns a singleUserStatisticstype carrying every counter for either kind, so a shared model would put a meaninglessEpisodesWatchedon manga and a meaninglessChaptersReadon anime. Modelling only the fields that mean something keeps the card from being able to show a number that cannot be true. The DTO stays shared, because the wire shape genuinely is one type.The card shows for an account with no manga rather than hiding, matching the anime card, which has always rendered zeros for a fresh account. Plenty of AniList accounts track anime only — the same fact that justified the Library's empty state — so this is the common case, not the edge one.
Both cards now sit under one
STATISTICSbanner, which avoids renumbering the five sections below them.Colours: two rounds, and a regression caught on device
The card rendered correctly first time and looked wrong: all four manga figures came out the same blue, against a four-colour anime card.
Manga,ChaptersandVolumeseach hashed toRainbowBlue, which is also whereScorelands. Invisible to the build and to the tests — only looking at it caught it.The first fix was worse than the bug. Pointing those keys at their anime counterparts did make the card colourful, but those keys are not Settings-only:
'Manga'and'Anime'also drive Search's type pills and the two Library nav titles, and'Chapters'/'Volumes'drive the details-page chips. So a decision about a stat tile silently made the Manga pill and the Manga Library title render identically to the Anime ones. Found by checking the call sites before the second change, not by anything failing.The tiles now use keys that exist only in Settings —
StatsTotalManga,StatsChapters,StatsMangaHeaderand so on — pinned in the lookup table rather than hashed. Nothing outside Settings can be recoloured by a stat-tile decision again, and the shared keys go back to the hash values they always had.The palette has eight stops and the two cards have ten slots, so exactly two colours recur — that is arithmetic, not an oversight, and which two is a decision: blue on each Mean Score, the same metric on both cards, and cyan on the anime header versus the manga Volumes tile, which never sit in the same role. The anime entries pin the colours that card already rendered, so it does not move.
_statusColorsbecame_fixedColors, since it no longer holds only status sections.Verification
dotnet test— 1477 passed. All builds clean, zero warnings.The converter tests cover the whole contract rather than one example: five distinct colours within each card, exactly eight across both, headers that differ, and — guarding the regression above — that
Anime/MangaandEpisodes/Chaptersstill resolve apart from each other.Two client tests: the full mapping, and an account with no manga branch at all, since AniList omits it rather than sending zeros and the card renders those numbers directly.
On the emulator:
Settings is already in the CI screenshot set, so the new card gets visual coverage from the next run onward.
Commits
Three, and the middle one is the version that regressed the shared keys — kept rather than rewritten so the reasoning is legible. The repo squash-merges, so
maingets one commit either way.Still open on #12
Discover manga rows, which needs design rather than wiring: Currently Airing and Upcoming Next Season have no manga analogue, so it cannot be a parameterized copy of
DiscoverSectionDefinitionsthe way the Library was.The two Settings items that were on the checklist are resolved: manga display preferences turned out to have nothing that differs from anime, and the section-ordering control is not manga-specific at all — anime has none either — so it moved to #152.