Repository navigation
Serve manga from the details page and add a manga filter to Search (#12) - #150
Merged
Merged
Conversation
Phase 1 of #12. Media ids are unique across anime and manga, so `type: ANIME` on `Media(id:)` was only ever a filter we added -- and the sole reason a manga id 404'd. Dropping it from MediaQuery and the three per-section paging queries is most of the work; the rest is making the UI stop saying "episode" when the thing has chapters. Progress follows AniHyou's model rather than tracking two counters at once. AniList keeps `progress` (chapters) and `progressVolumes` as fully independent fields, relates neither to the other nor to status, and has no auto-complete setting, so which one drives the UI is entirely a client decision: MediaListEntry.UsesVolumeProgress picks chapters unless the entry has volume progress and no chapter progress. Everything now reads ActiveProgress / ActiveProgressTotal / ActiveProgressUnit instead of assuming episodes. The unit is derived, so any caller that writes progress and may need to undo it captures the unit first and reverts through SetProgressFor. Wording lives in one MediaListVocabulary table so "Watching"/"Reading" and "Episodes"/"Chapters"/"Volumes" cannot drift between the details page, the status picker, the bottom sheet and the long-press toasts. Chips keep the short form -- an anime chip still reads "Planning", not "Plan to Watch". Two fixes the issue does not mention: - ToggleFavourite hardcoded FavouriteKind.Anime, so the heart on a manga page would have sent animeId and silently favourited nothing. It now sends mangaId. - Three manga ids were already referenced by CI fixtures and resolved to nothing (53390 and 85199 in Attack on Titan's relations, 30013 on Luffy's character page), so every manga tap under CI stubs landed on the error page the moment those taps started navigating. They resolve now, and manga search honours isAdult the way anime search always did. An ongoing manga has no cap at all: AniList returns null chapters AND null volumes for every RELEASING series, and there is no nextAiringEpisode to fall back on. No completion prompt, no progress bar, unbounded +1. That is the common manga case, not an edge one. Library, Discover and View All stay anime-only on purpose.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
It makes broad cross-cutting changes (GraphQL queries, core models, UI flows, CI stubs, and many call sites) that warrant final human validation despite strong test coverage.
Pull request overview
Phase 1 of manga support (#12): makes Media(id:) details navigation type-agnostic so manga IDs can open in the existing details page flow, and adds an Anime/Manga filter toggle to Search while generalizing progress/status wording to be media-type aware.
Changes:
- Removed the
type: ANIMEpin from the Media details GraphQL query (and per-section paging queries), enabling manga/novel IDs to resolve and navigate from carousels and bio links. - Added a persisted Anime/Manga toggle to Search and generalized
IAniListClientsearch fromSearchAnimePageAsync→SearchMediaPageAsync(kind, ...). - Introduced type-aware progress/unit + vocabulary helpers (episodes/chapters/volumes) and updated UI/dialog flows, mutations, CI stubs, and tests accordingly.
File summaries
| File | Description |
|---|---|
| tests/AniSprinkles.UnitTests/TestDataBuilder.cs | Extends test entry builder with manga fields (type/chapters/volumes/progressVolumes). |
| tests/AniSprinkles.UnitTests/SearchPageModelTests.cs | Adds coverage for Search kind toggle, persistence, and paging pinning. |
| tests/AniSprinkles.UnitTests/RelatedMediaTests.cs | Updates tests to assert Kind parsing and type-aware status chip wording. |
| tests/AniSprinkles.UnitTests/MediaListVocabularyTests.cs | Pins the new per-type vocabulary/unit wording table behavior. |
| tests/AniSprinkles.UnitTests/MediaListEntryProgressTests.cs | Updates wording/expectations for generalized progress-total semantics. |
| tests/AniSprinkles.UnitTests/MediaListEntryMangaProgressTests.cs | Adds tests for inferred manga progress unit and counters behavior. |
| tests/AniSprinkles.UnitTests/MediaDetailsPageModelTests.cs | Adds details-page assertions for manga wording/chips/progress behavior. |
| tests/AniSprinkles.UnitTests/MediaBrowsePageModelTests.cs | Updates browse navigation test to expect manga cards to navigate. |
| tests/AniSprinkles.UnitTests/ListEntryStatusMutationsTests.cs | Adds manga-aware status mutation cases (completion/repeating/current). |
| tests/AniSprinkles.UnitTests/ListEntryStatusFlowTests.cs | Adds tests for completion prompt wording and unit-correct write-back. |
| tests/AniSprinkles.UnitTests/Fakes/ScriptedDialogService.cs | Extends fake dialogs to capture kind/unit/max for assertions. |
| tests/AniSprinkles.UnitTests/EntryActionCoordinatorTests.cs | Adds coverage for manga long-press flows (edit progress/move-to-list). |
| tests/AniSprinkles.UnitTests/DetailsSpineTests.cs | Updates details spine navigation to allow manga IDs. |
| tests/AniSprinkles.UnitTests/BioLinkFollowerTests.cs | Updates manga bio links to navigate to details instead of toasting. |
| tests/AniSprinkles.UnitTests/AniListLinkTargetTests.cs | Updates link resolution tests to route manga to media-details. |
| tests/AniSprinkles.UnitTests/AniListClientOperationsTests.cs | Asserts progressVolumes and manga favourite IDs are sent correctly. |
| src/AniSprinkles/Views/MoveToListPopup.xaml.cs | Makes status sheet labels type-aware via MediaListVocabulary. |
| src/AniSprinkles/Views/MediaDetailsLoadedContentView.xaml | Adds Chapters/Volumes chips and binds status labels from the model. |
| src/AniSprinkles/Views/EditProgressPopup.xaml.cs | Generalizes progress popup wording to unit-aware header/captions. |
| src/AniSprinkles/Views/EditProgressPopup.xaml | Updates popup header binding (unit-aware). |
| src/AniSprinkles/Services/Maui/MauiDialogService.cs | Threads MediaKind/MediaProgressUnit into the MAUI popup implementations. |
| src/AniSprinkles/Services/CI/CIAniListClient.cs | Adds manga fixtures and makes stubs type-aware for details/search. |
| src/AniSprinkles/Platforms/Android/BioLinkSpans.cs | Updates Android bio span click path for new BioLinkFollower signature. |
| src/AniSprinkles/Pages/SearchPage.xaml | Adds Anime/Manga toggle pills and binds copy strings to the model. |
| src/AniSprinkles.Core/Utilities/MediaListVocabulary.cs | Introduces centralized per-type status/unit wording helpers. |
| src/AniSprinkles.Core/Utilities/BioLinkFollower.cs | Removes “unsupported manga” toast branch; relies on routing now. |
| src/AniSprinkles.Core/Utilities/AniListLinkTarget.cs | Routes /manga/<id> to media-details. |
| src/AniSprinkles.Core/Services/ListEntryStatusMutations.cs | Generalizes mutations to active progress unit and dual counters. |
| src/AniSprinkles.Core/Services/ListEntryStatusFlow.cs | Makes completion flow unit-aware (chapters/volumes/episodes). |
| src/AniSprinkles.Core/Services/IAniListClient.cs | Adds FavouriteKind.Manga and generalizes search API surface. |
| src/AniSprinkles.Core/Services/FaultInjection/FaultProfile.cs | Updates fault-injection docs to new search method name. |
| src/AniSprinkles.Core/Services/FaultInjection/FaultInjectingHttpHandler.cs | Updates fault-injection docs to new search method name. |
| src/AniSprinkles.Core/Services/FaultInjection/FaultInjectingAniListClient.cs | Wraps SearchMediaPageAsync for client-layer fault injection. |
| src/AniSprinkles.Core/Services/CachingAniListClient.cs | Pass-through for new SearchMediaPageAsync signature. |
| src/AniSprinkles.Core/Services/AniListClient.cs | Updates GraphQL: type-agnostic Media query, typed Search, and manga fields/counters. |
| src/AniSprinkles.Core/Services/Abstractions/IDialogService.cs | Updates dialog abstractions to include MediaKind and MediaProgressUnit. |
| src/AniSprinkles.Core/PageModels/SearchPageModel.cs | Implements persisted search kind toggle + pins kind per result set. |
| src/AniSprinkles.Core/PageModels/MyAnimePageModel.cs | Adjusts progress logic for generalized progress-total semantics. |
| src/AniSprinkles.Core/PageModels/MediaDetailsPageModel.cs | Adds manga chips, type-aware vocabulary, and unit-aware progress handling. |
| src/AniSprinkles.Core/PageModels/MediaBrowsePageModel.cs | Removes manga navigation guard now that details supports it. |
| src/AniSprinkles.Core/PageModels/EntryActionCoordinator.cs | Makes long-press flows unit/kind-aware and rollback-safe. |
| src/AniSprinkles.Core/PageModels/DiscoverPageModel.cs | Removes manga navigation guard now that details supports it. |
| src/AniSprinkles.Core/PageModels/DetailsPageModelBase.cs | Removes manga navigation guard now that details supports it. |
| src/AniSprinkles.Core/Models/RelatedMedia.cs | Adds chapters/volumes and replaces IsAnime with Kind + type-aware chip label. |
| src/AniSprinkles.Core/Models/MediaProgressUnit.cs | Introduces progress unit enum (episode/chapter/volume). |
| src/AniSprinkles.Core/Models/MediaListEntry.cs | Adds volume progress counter and active-unit helpers (value/total/unit). |
| src/AniSprinkles.Core/Models/MediaKind.cs | Introduces MediaKind + AniList type conversion/parsing helpers. |
| src/AniSprinkles.Core/Models/Media.cs | Adds Type, Chapters, Volumes, and IsManga helper. |
| src/AniSprinkles.Core/Models/BrowseMediaItem.cs | Carries Type/chapters/volumes into synthesized list entries for long-press flows. |
| README.md | Updates feature list to reflect manga-enabled details and Search toggle. |
| AGENTS.md | Documents the new type-agnostic Media query and manga progress model. |
| .claude/skills/run-anisprinkles/SKILL.md | Updates runbook to include manga fixture IDs and new search method name. |
| .claude/skills/run-anisprinkles/driver.ps1 | Updates help text to new search method name. |
| .claude/skills/project-architecture/SKILL.md | Updates architecture notes for Search kind toggle and new search API. |
Review details
- Files reviewed: 54/54 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.
Two review findings from driving the build. The progress row read a flat "Progress" for everything. That is fine for anime, but the unit is decided per entry for manga, so "20" on a volume-tracked series looked exactly like a chapter count with nothing on the page to say otherwise. The row now reads "Episodes watched" / "Chapters read" / "Volumes read", sharing MediaListVocabulary.UnitProgressHeader with the edit-progress popup it opens so the two cannot disagree about what is being counted. Search gains an All pill, and defaults to it. Most searches are "find this title", not "find this title but only if it's manga", and the result rows print the format either way -- so a mixed list is the more useful default now that both types open. The mechanism has a trap worth knowing. AniList's `media(type:)` is optional and omitting it searches both, but passing `type: null` explicitly returns an EMPTY list -- it does not read a null argument as "no filter". Verified against the live API. We get the absent form because JsonWriteOptions drops null variables, the same mechanism the isAdult filter already relies on; it is now commented at the call site rather than left to luck. "All" is deliberately not a fourth MediaKind: a piece of media is anime or manga and never "all", and MediaKind is also what RelatedMedia.Kind and MediaListVocabulary answer with. It gets its own SearchTypeFilter, converted to a MediaKind? at the client boundary. That also keeps the per-result-set pin honest -- All's own value is null, which on a MediaKind? would have been indistinguishable from "nothing seeded yet", exactly the collision the adult filter documents two fields above it. Also pluralises the count chips, so a one-shot reads "1 Chapter" rather than "1 Chapters" -- which cures the same bug a single-episode anime always had.
This was referenced Aug 30, 2026
Open
zhollis21
added a commit
that referenced
this pull request
Nov 19, 2026
…) (#150) * Serve manga from the details page and add a manga filter to Search Phase 1 of #12. Media ids are unique across anime and manga, so `type: ANIME` on `Media(id:)` was only ever a filter we added -- and the sole reason a manga id 404'd. Dropping it from MediaQuery and the three per-section paging queries is most of the work; the rest is making the UI stop saying "episode" when the thing has chapters. Progress follows AniHyou's model rather than tracking two counters at once. AniList keeps `progress` (chapters) and `progressVolumes` as fully independent fields, relates neither to the other nor to status, and has no auto-complete setting, so which one drives the UI is entirely a client decision: MediaListEntry.UsesVolumeProgress picks chapters unless the entry has volume progress and no chapter progress. Everything now reads ActiveProgress / ActiveProgressTotal / ActiveProgressUnit instead of assuming episodes. The unit is derived, so any caller that writes progress and may need to undo it captures the unit first and reverts through SetProgressFor. Wording lives in one MediaListVocabulary table so "Watching"/"Reading" and "Episodes"/"Chapters"/"Volumes" cannot drift between the details page, the status picker, the bottom sheet and the long-press toasts. Chips keep the short form -- an anime chip still reads "Planning", not "Plan to Watch". Two fixes the issue does not mention: - ToggleFavourite hardcoded FavouriteKind.Anime, so the heart on a manga page would have sent animeId and silently favourited nothing. It now sends mangaId. - Three manga ids were already referenced by CI fixtures and resolved to nothing (53390 and 85199 in Attack on Titan's relations, 30013 on Luffy's character page), so every manga tap under CI stubs landed on the error page the moment those taps started navigating. They resolve now, and manga search honours isAdult the way anime search always did. An ongoing manga has no cap at all: AniList returns null chapters AND null volumes for every RELEASING series, and there is no nextAiringEpisode to fall back on. No completion prompt, no progress bar, unbounded +1. That is the common manga case, not an edge one. Library, Discover and View All stay anime-only on purpose. * CI: Update UI screenshots [skip ci] * Show which counter the progress row means, and default Search to All Two review findings from driving the build. The progress row read a flat "Progress" for everything. That is fine for anime, but the unit is decided per entry for manga, so "20" on a volume-tracked series looked exactly like a chapter count with nothing on the page to say otherwise. The row now reads "Episodes watched" / "Chapters read" / "Volumes read", sharing MediaListVocabulary.UnitProgressHeader with the edit-progress popup it opens so the two cannot disagree about what is being counted. Search gains an All pill, and defaults to it. Most searches are "find this title", not "find this title but only if it's manga", and the result rows print the format either way -- so a mixed list is the more useful default now that both types open. The mechanism has a trap worth knowing. AniList's `media(type:)` is optional and omitting it searches both, but passing `type: null` explicitly returns an EMPTY list -- it does not read a null argument as "no filter". Verified against the live API. We get the absent form because JsonWriteOptions drops null variables, the same mechanism the isAdult filter already relies on; it is now commented at the call site rather than left to luck. "All" is deliberately not a fourth MediaKind: a piece of media is anime or manga and never "all", and MediaKind is also what RelatedMedia.Kind and MediaListVocabulary answer with. It gets its own SearchTypeFilter, converted to a MediaKind? at the client boundary. That also keeps the per-result-set pin honest -- All's own value is null, which on a MediaKind? would have been indistinguishable from "nothing seeded yet", exactly the collision the adult filter documents two fields above it. Also pluralises the count chips, so a one-shot reads "1 Chapter" rather than "1 Chapters" -- which cures the same bug a single-episode anime always had. * 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 (does not close it — this is Phase 1 of five areas).
Every manga id in the app is now openable, and manga is findable in Search. The Library manga tab, Discover manga rows and the manga settings stay for later phases.
The load-bearing finding
Media(id:)is type-agnostic. Media ids are unique across anime and manga, sotype: ANIMEwas only ever a filter we added — and the sole reason a manga id 404'd. Verified against the live API:Dropping that pin from
MediaQueryand the three per-section paging queries is most of the data-layer work. The rest is making the UI stop saying "episode" when the thing has chapters.Chapters and volumes
AniList keeps
progress(chapters) andprogressVolumesas fully independent counters, relates neither to the other nor to status, and has no auto-complete setting anywhere inMediaListOptions. Which one drives the UI is entirely a client decision.This follows AniHyou's model rather than tracking both at once:
MediaListEntry.UsesVolumeProgresspicks chapters unless the entry has volume progress and no chapter progress. One counter, one total, one completion rule per entry — it reads however you already track that title.Every progress surface now reads
ActiveProgress/ActiveProgressTotal/ActiveProgressUnitinstead of assuming episodes. The unit is derived, so any caller that writes progress and may need to undo it captures the unit first and reverts throughSetProgressFor—SetActiveProgresscould otherwise land on the other field.Wording lives in one
MediaListVocabularytable so "Watching"/"Reading" and "Episodes"/"Chapters"/"Volumes" can't drift between the details page, the status picker, the bottom sheet and the long-press toasts. Chips keep the short form deliberately: an anime chip still reads "Planning", not "Plan to Watch".Ongoing manga have no cap at all
AniList returns
nullchapters andnullvolumes for every RELEASING series — verified across One Piece, Berserk, Dandadan and Sakamoto Days — and there is nonextAiringEpisodeto fall back on the way an airing anime has. So no completion prompt, no progress bar, and+1runs unbounded. That is the common manga case, not an edge one, and it matches AniList's own client.Two fixes the issue doesn't mention
ToggleFavouritehardcodedFavouriteKind.Anime, so the heart on a manga page would have sentanimeIdand silently favourited nothing. It sendsmangaIdnow.isAdultthe way anime search always did.The progress row says which counter it means — "Episodes watched" / "Chapters read" / "Volumes read" rather than a flat "Progress". That was fine while everything was episodes, but the unit is per-entry for manga, so
20on a volume-tracked series looked exactly like a chapter count with nothing on the page to say otherwise. It sharesUnitProgressHeaderwith the edit-progress popup it opens, so the two can't disagree.Search: All / Anime / Manga, defaulting to All
Most searches are "find this title", not "find this title but only if it's manga", and the rows print the format either way — so a mixed list is the better default now that both types open.
The mechanism has a trap.
media(type:)is optional and omitting it searches both, but passingtype: nullexplicitly returns an empty list — AniList doesn't read a null argument as "no filter". Verified live:"type": nullin the payloadWe get the absent form because
JsonWriteOptionsdrops null variables, the same mechanismisAdultalready relies on. That's now commented at the call site rather than left to luck."All" is deliberately not a fourth
MediaKind. A piece of media is anime or manga and never "all", andMediaKindis also whatRelatedMedia.KindandMediaListVocabularyanswer with. It gets its ownSearchTypeFilter, converted to aMediaKind?at the client boundary. That also keeps the per-result-set pin honest: All's own value isnull, which on aMediaKind?would be indistinguishable from "nothing seeded yet" — precisely the collision_seededDisplayAdult's comment documents two fields above it.Removed
AniListLinkTarget.IsUnsupportedEntity,BioLinkFollower.UnsupportedMediaMessage, the bio-link toast branch, and the fourIsAnimenavigation guards. 7 of the 235 bio links sampled across the most-favourited characters and staff point atanilist.co/manga, so that was a real dead end rather than a theoretical one.CI fixtures
Six manga fixtures, each covering a shape the progress layer has to tell apart:
5339030013105778851998547685470Reachable via
driver.ps1 deeplink <id>, the relations carousels, or the Manga search pill. Documented in therun-anisprinklesskill.Verification
dotnet test— 1451 passed. All four AGENTS.md builds clean, zero warnings.On the emulator:
141 Chapters/34 Volumeschips, no Episodes/Duration/Season, Studios and Next-Airing absent, status Reading, progress 100 / 141. Rankings, stats, staff ("Story & Art") and external links all render — sections no CI screenshot had exercised before.20with no total and no slider; its prompt says "Enter volume" — no range, because there is no cap.25 Episodes/Spring 2013, Watching,20 / 25, and Library still shows+1 EPand359 eps behind.The device caught two things the tests hadn't: the flat "Progress" label above, and the one-shot rendering "1 Chapters". The latter is fixed by pluralising the count chips, which also cures the pre-existing "1 Episodes" a single-episode anime would have shown.
Net new AniList requests: zero. Search is the same request with a different variable, details is the same request, and the browse fragment gained two scalar fields.
Breaking changes to shared types
All call sites updated; flagged because they're wide.
IAniListClient.SearchAnimePageAsync→SearchMediaPageAsync, with a requiredMediaKindIDialogService.ShowEditProgressAsynctakes aMediaProgressUnit;ShowMoveToListAsynctakes aMediaKindSearchMediaPageAsync’sMediaKindis nullable — null means both typesMediaListEntry.MaxEpisodes/HasKnownEpisodeCount→ActiveProgressTotal/HasKnownProgressTotalRelatedMedia.IsAnime→KindBioLinkFollower.FollowAsyncno longer takesIUserFeedbackStill open on #12
Library manga tab (with the parameterized
MediaListPageModel), Discover manga rows,mangaList.sectionOrder,statistics.manga. The last two are deliberately not fetched yet — they'd be dead model surface until the pages that use them exist.Airing notifications stay anime-only; manga doesn't air.