Skip to content

Serve manga from the details page and add a manga filter to Search (#12) - #150

Merged
zhollis21 merged 4 commits into
mainfrom
feature/12-manga-details-and-search
Aug 30, 2026
Merged

zhollis21 merged 4 commits into
mainfrom
feature/12-manga-details-and-search

Conversation

@zhollis21

@zhollis21 zhollis21 commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

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, so type: ANIME was only ever a filter we added — and the sole reason a manga id 404'd. Verified against the live API:

Media(id: 30002)              -> Berserk, type MANGA
Media(id: 30002, type: ANIME) -> 404 Not Found

Dropping that pin from MediaQuery and 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) and progressVolumes as fully independent counters, relates neither to the other nor to status, and has no auto-complete setting anywhere in MediaListOptions. Which one drives the UI is entirely a client decision.

This follows AniHyou's model rather than tracking both at once: MediaListEntry.UsesVolumeProgress picks 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 / 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 — SetActiveProgress could otherwise land on the other field.

Wording lives in one MediaListVocabulary table 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 null chapters and null volumes for every RELEASING series — verified across One Piece, Berserk, Dandadan and Sakamoto Days — and there is no nextAiringEpisode to fall back on the way an airing anime has. So no completion prompt, no progress bar, and +1 runs 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

  • ToggleFavourite hardcoded FavouriteKind.Anime, so the heart on a manga page would have sent animeId and silently favourited nothing. It sends mangaId now.
  • 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. The moment this change made those taps navigate instead of toast, every one landed on the error page. They resolve now, with real data and artwork, and manga search honours isAdult the 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 20 on a volume-tracked series looked exactly like a chapter count with nothing on the page to say otherwise. It shares UnitProgressHeader with 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 passing type: null explicitly returns an empty list — AniList doesn't read a null argument as "no filter". Verified live:

What we send Result
variable absent from the payload both types
"type": null in the payload zero results, silently

We get the absent form because JsonWriteOptions drops null variables, the same mechanism isAdult already 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", 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 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 four IsAnime navigation guards. 7 of the 235 bio links sampled across the most-favourited characters and staff point at anilist.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:

id Shape Covers
53390 AoT manga, 141ch / 34vol, chapter-tracked The rich one — tags, rankings, external links, score/status distributions, characters, staff, relation back to the anime
30013 ONE PIECE, RELEASING, volume-tracked Both counts null: no cap, no bar, unbounded +1
105778 Chainsaw Man, Completed, both counters set Chapters win — proves the unit is inferred, not just "has volumes"
85199 No Regrets, off-list The only route to the details page's Add to List
85476 Prologue, ONE_SHOT, 1ch / no vol Singular chip, and a Chapters chip with no Volumes chip beside it
85470 Mushoku Tensei, NOVEL Novels are type MANGA — proves the page keys off type, not format

Reachable via driver.ps1 deeplink <id>, the relations carousels, or the Manga search pill. Documented in the run-anisprinkles skill.

Verification

dotnet test — 1451 passed. All four AGENTS.md builds clean, zero warnings.

On the emulator:

  • Manga details from AoT's relations carousel: 141 Chapters / 34 Volumes chips, 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.
  • Progress prompt reads "Enter chapter (0–141)"; entering 141 fires "All chapters read! / You've read all 141 chapters of Shingeki no Kyojin." Declining reverts cleanly.
  • The volume-tracked ongoing manga shows a bare 20 with no total and no slider; its prompt says "Enter volume" — no range, because there is no cap.
  • Long-press on a manga search result: popup header "Chapters read", caption "of 141 chapters"; the move-to-list sheet reads Plan to Read / Rereading.
  • Search pills flip the placeholder, idle prompt and empty state. Under All, "in" returns FMA:B and the AoT anime (Watching) alongside the AoT manga (Reading), Chainsaw Man, No Regrets and the one-shot — same title, right vocabulary per type. Anime and Manga each narrow to zero rows of the other.
  • Anime unregressed: 25 Episodes / Spring 2013, Watching, 20 / 25, and Library still shows +1 EP and 359 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 required MediaKind
  • IDialogService.ShowEditProgressAsync takes a MediaProgressUnit; ShowMoveToListAsync takes a MediaKind
  • SearchMediaPageAsync’s MediaKind is nullable — null means both types
  • MediaListEntry.MaxEpisodes / HasKnownEpisodeCount → ActiveProgressTotal / HasKnownProgressTotal
  • RelatedMedia.IsAnime → Kind
  • BioLinkFollower.FollowAsync no longer takes IUserFeedback

Still 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.

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.
Copilot AI lite review requested due to automatic review settings August 30, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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: ANIME pin 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 IAniListClient search from SearchAnimePageAsync → 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.

@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

📱 UI Screenshots

✅ Authenticated UI — screenshots rendered via compile-time CI stub services with hardcoded data. No OAuth token required.

View Workflow Run →

Library Discover View All (Browse) Search One Piece Details Toei Animation (Studio) Luffy (Character) Mayumi Tanaka (Staff) Settings
Library Discover View All (Browse) Search One Piece Details Toei Animation (Studio) Luffy (Character) Mayumi Tanaka (Staff) Settings

Zach Hollis and others added 2 commits August 30, 2026 09:21
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.
@zhollis21
zhollis21 merged commit e1e2b91 into main Aug 30, 2026
3 checks passed
@zhollis21
zhollis21 deleted the feature/12-manga-details-and-search branch August 30, 2026 14:18
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants