Repository navigation
Add Discover page with sections, search, and View All - #102
Conversation
Discover (issues #15/#16): an anime browse page reachable from a new flyout item, working signed-out and showing on-list status when signed in. Sections (one aliased request seeds each row; rows page through BrowseAnime): Currently Airing, Trending Now, Top Anime, Top Movies, All Time Popular, Upcoming Next Season, plus Popular 18+ / Top Rated 18+ when the adult toggle is on. Per-row card badges follow the row's sort. - Search: toolbar-icon reveal (auto-focus), 600ms debounce, 2-char minimum. - View All (route media-browse): infinite list with the My Anime view-mode switcher (Standard/Large/Compact) sharing the same device preference. - Long-press entry actions everywhere via a shared EntryActionCoordinator extracted from My Anime; not-on-list shows Add to list, on-list the full menu. - One shared status pill (cards, browse rows, grid cards); shared row templates in BrowseTemplates.xaml. - 20-minute TTL cache in the singleton page model, invalidated by adult-toggle and auth changes; pull-to-refresh bypass. Also: - MetricFormat gains a millions tier (1.0M) so 7-figure popularity reads right. - Long-press tap-through fixed: suppression window re-stamped at finger-up. - Hold Microsoft.Maui.Controls at 10.0.60 to dodge the 10.0.70 + AndroidX.Core accessibility crash (dotnet/maui#35584). - CI screenshots now capture Discover, View All, and search (SFW stub data).
There was a problem hiding this comment.
Pull request overview
Adds a new “Discover” browsing surface to AniSprinkles (flyout route discover) with sectioned horizontal carousels, debounced global search, and per-section “View All” infinite lists (media-browse). The PR also centralizes long-press list-entry actions into a shared coordinator, adds a million-tier for compact metric formatting, and updates CI to capture new screenshots.
Changes:
- Introduces Discover + View All browse experiences (new pages, page models, views, templates, and AniList GraphQL operations for discover/search/browse paging).
- Extracts shared long-press entry actions into
EntryActionCoordinatorand adds reusable Android CollectionView long-press handling. - Improves metric formatting (
k→Mtier) and adds season math utility + unit tests; updates CI screenshots and docs.
Reviewed changes
Copilot reviewed 51 out of 52 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/AniSprinkles.UnitTests/RelatedMediaTests.cs | Adds tests for new browse metadata/status/list-chip display helpers on RelatedMedia. |
| tests/AniSprinkles.UnitTests/MetricFormatTests.cs | Adds coverage for new million-tier rounding/promotion behavior. |
| tests/AniSprinkles.UnitTests/DiscoverSectionDefinitionsTests.cs | Validates Discover section definitions invariants (ranked lists, adult-only rows, etc.). |
| tests/AniSprinkles.UnitTests/BrowseMediaItemTests.cs | Adds unit tests for browse item → list entry mapping and chip update notifications. |
| tests/AniSprinkles.UnitTests/AniSprinkles.UnitTests.csproj | Pins MAUI packages to app version and links new shared utilities/page-model code into unit tests. |
| tests/AniSprinkles.UnitTests/AniListSeasonTests.cs | Adds tests for season/next-season computation used by Discover queries. |
| src/Views/MoveToListPopup.xaml.cs | Extends popup to support add-to-list flow (subtitle, optional remove row) and nullable current status. |
| src/Views/MoveToListPopup.xaml | Adds named elements to support dynamic subtitle and conditional delete row visibility. |
| src/Views/MediaBrowseLoadedContentView.xaml.cs | Implements view-mode template/layout switching for View All browse list + long-press attach. |
| src/Views/MediaBrowseLoadedContentView.xaml | Adds the View All infinite list UI + empty state. |
| src/Views/DiscoverSectionView.xaml.cs | Adds a reusable Discover section view with bindable inputs + long-press attach. |
| src/Views/DiscoverSectionView.xaml | Implements Discover section header + horizontal carousel + “View All” affordance. |
| src/Views/DiscoverLoadedContentView.xaml.cs | Handles search-bar autofocus timing via VM property change subscription. |
| src/Views/DiscoverLoadedContentView.xaml | Hosts expandable search + results list and pull-to-refresh Discover rows. |
| src/Views/CollectionViewLongPress.cs | New reusable Android RecyclerView long-press bridge + tap-suppression helper. |
| src/Views/BrowseTemplates.xaml.cs | Code-behind to enable compiled bindings for shared browse templates. |
| src/Views/BrowseTemplates.xaml | Shared browse/search templates + single list-status pill style. |
| src/Utilities/MetricFormat.cs | Adds million-tier compact formatting and early promotion to avoid “1000k”. |
| src/Utilities/AniListSeason.cs | Adds season/next-season computation for Discover section filters. |
| src/Services/IAniListClient.cs | Extends API surface for paged search, discover seed request, and generic browse paging. |
| src/Services/ErrorSimulation/FailingAniListClient.cs | Updates error-sim client to implement new AniList client methods. |
| src/Services/CI/CIAniListClient.cs | Extends CI stub client to seed discover/search/browse items for screenshots. |
| src/Services/CachingAniListClient.cs | Pass-throughs new browse/discover/search APIs and documents caching boundaries. |
| src/Services/AniListClient.cs | Adds DiscoverSections/Search/Browse GraphQL queries + mapping to BrowseMediaItem/RelatedMedia list snapshot fields. |
| src/Pages/MyAnimePage.xaml.cs | Syncs shared list view-mode preference on appearing (shared with View All). |
| src/Pages/MediaBrowsePage.xaml.cs | New View All page with deferred content loading + section query-attribute handling. |
| src/Pages/MediaBrowsePage.xaml | New View All page UI with state container and toolbar view-mode switcher. |
| src/Pages/DiscoverPage.xaml.cs | New Discover flyout page with deferred load behavior and loaded-content host management. |
| src/Pages/DiscoverPage.xaml | New Discover page UI with search toolbar icon and state container. |
| src/PageModels/MyAnimePageModel.cs | Refactors long-press flows into EntryActionCoordinator; moves view-mode persistence to shared preference helper. |
| src/PageModels/MediaMetricBadges.cs | Adjusts badge behavior for trending rows (uses popularity as meaningful stand-in). |
| src/PageModels/MediaBrowsePageModel.cs | New View All page model with paging, ranks, view-mode switcher, and entry-action integration. |
| src/PageModels/ListViewMode.cs | Adds ListViewModePreference helper for shared persistence key. |
| src/PageModels/EntryActionCoordinator.cs | New shared orchestration for long-press entry actions across surfaces. |
| src/PageModels/DiscoverSectionFetch.cs | Centralizes translation from section definition → browse query args (season/adult/format). |
| src/PageModels/DiscoverSectionDefinitions.cs | Defines Discover sections and their authoritative sort/filter/rank metadata. |
| src/PageModels/DiscoverRow.cs | Wraps per-row paging state and exposes bindable row properties for Discover UI. |
| src/PageModels/DiscoverPageModel.cs | New Discover page model: TTL cache, row seeding, per-row paging, and debounced search. |
| src/Models/RelatedMedia.cs | Adds browse/search metadata formatting + viewer list snapshot fields and chip color/label helpers. |
| src/Models/DiscoverSections.cs | Adds discover seed response models (per-section page + pageInfo). |
| src/Models/BrowseMediaItem.cs | Adds browse item wrapper with rank/metric badge and chip notification plumbing. |
| src/MauiProgram.cs | Registers Discover and View All pages/page models in DI. |
| src/Converters/ColorToBrushConverter.cs | Adds converter for binding model colors into Brush-typed Border backgrounds. |
| src/AppShell.xaml.cs | Registers media-browse route. |
| src/AppShell.xaml | Adds Discover flyout item between My Anime and Settings. |
| src/App.xaml | Merges shared browse templates and registers ColorToBrushConverter. |
| src/AniSprinkles.csproj | Pins Microsoft.Maui.Controls to 10.0.60 due to accessibility crash regression. |
| README.md | Documents new Discover and quick long-press actions features. |
| AGENTS.md | Updates architecture docs for Discover/browse/search, new ops, and DI registrations. |
| .gitignore | Updates ignore rules for PR tool outputs. |
| .github/workflows/ci-build-and-preview.yml | Adds automated UI navigation + screenshots for Discover/View All/Search in CI. |
| .claude/skills/project-architecture/SKILL.md | Updates architecture skill doc to include Discover/browse/search patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…osal - LoadMoreSearchResults runs through ListOperationRunner so a failed search page-fetch is swallowed + snackbar'd instead of propagating out of the CollectionView threshold command. - Adult-toggle flip now clears active search (not just auth changes), so results fetched under the previous filter can't linger after the toggle is turned off. - Dispose the per-keystroke debounce CTS before reallocating. - CI: find the search toolbar icon by anchoring on the hamburger's toolbar band (class/resolution-independent) instead of a class+y guess.
|
Addressed the review feedback in the latest commit:
Also fixed the CI search screenshot (it had failed to find the toolbar icon): it now anchors on the hamburger''s toolbar band rather than guessing a class + y-threshold. |
MAUI Shell action icons aren't exposed to uiautomator as findable nodes (only the hamburger has a content-desc), so neither class-matching nor a toolbar-band scan could locate the search icon on the CI emulator. Toolbars are horizontally symmetric, so tap (screen_width - drawer_cx, drawer_cy) to hit the lone right-side icon. Tap the revealed field by its hint before typing to guarantee focus.
Previously the Trending row reused the popularity badge as a stand-in. With the new All Time Popular row that made the two rows' badges identical and broke the "show the sort metric" rule. Plumb AniList's `trending` field through the browseMedia fragment + RelatedMedia, and give TRENDING_DESC its own flame glyph + trending value so each row's badge is distinct.
- MediaBrowsePageModel.StampItems badged off PaginatedSection.Sort, which Seed() resets to the hard-coded placeholder initialSort — so the Compact View All (the browse template that shows the metric badge) stamped every section as popularity. Badge off the section definition's sort instead, so Top lists show score and Trending shows its flame metric. - Name the trailing perPage/cancellationToken args (the calls compiled fine as C# 7.2 non-trailing named arguments, but the mix read as a smell).
DiscoverPage/MyAnimePage/SettingsPage are transient but their page models are singletons. They subscribed to PageModel.PropertyChanged but never unsubscribed when the platform view was torn down (Handler -> null), so the singleton pinned orphaned page instances and could stack duplicate CurrentState handlers if Shell recreated the page. Drop the subscription on Handler-null and re-subscribe idempotently on reattach.
Discover search is infinite-scroll paged, but it sorted by SEARCH_MATCH only. Equal-relevance items could reorder across page boundaries and get dropped by PaginatedSection dedup. Append ID (matching WithTiebreaker elsewhere) so page boundaries are deterministic. Verified [SEARCH_MATCH, ID] against the live endpoint.
…ache - MediaBrowsePage.ApplyQueryAttributes: Enum.IsDefined-validate the parsed section so a numeric/undefined value falls through to the "Unknown browse section" error instead of throwing in DiscoverSectionDefinitions.Get(). - ColorToBrushConverter: cache one SolidColorBrush per Color (small fixed set of status colors) to cut per-bind allocations in scrolling lists. - MediaBrowsePageModel.LoadAsync: capture adult-content + auth at load and refetch on revisit when either changed, instead of short-circuiting to stale (possibly 18+) cached items — mirrors DiscoverPageModel.
* Add Discover page with sections, search, and View All Discover (issues #15/#16): an anime browse page reachable from a new flyout item, working signed-out and showing on-list status when signed in. Sections (one aliased request seeds each row; rows page through BrowseAnime): Currently Airing, Trending Now, Top Anime, Top Movies, All Time Popular, Upcoming Next Season, plus Popular 18+ / Top Rated 18+ when the adult toggle is on. Per-row card badges follow the row's sort. - Search: toolbar-icon reveal (auto-focus), 600ms debounce, 2-char minimum. - View All (route media-browse): infinite list with the My Anime view-mode switcher (Standard/Large/Compact) sharing the same device preference. - Long-press entry actions everywhere via a shared EntryActionCoordinator extracted from My Anime; not-on-list shows Add to list, on-list the full menu. - One shared status pill (cards, browse rows, grid cards); shared row templates in BrowseTemplates.xaml. - 20-minute TTL cache in the singleton page model, invalidated by adult-toggle and auth changes; pull-to-refresh bypass. Also: - MetricFormat gains a millions tier (1.0M) so 7-figure popularity reads right. - Long-press tap-through fixed: suppression window re-stamped at finger-up. - Hold Microsoft.Maui.Controls at 10.0.60 to dodge the 10.0.70 + AndroidX.Core accessibility crash (dotnet/maui#35584). - CI screenshots now capture Discover, View All, and search (SFW stub data). * CI: Update UI screenshots [skip ci] * Address review: search load-more safety, adult-toggle clear, CTS disposal - LoadMoreSearchResults runs through ListOperationRunner so a failed search page-fetch is swallowed + snackbar'd instead of propagating out of the CollectionView threshold command. - Adult-toggle flip now clears active search (not just auth changes), so results fetched under the previous filter can't linger after the toggle is turned off. - Dispose the per-keystroke debounce CTS before reallocating. - CI: find the search toolbar icon by anchoring on the hamburger's toolbar band (class/resolution-independent) instead of a class+y guess. * CI: Update UI screenshots [skip ci] * CI: open Discover search by mirroring the hamburger position MAUI Shell action icons aren't exposed to uiautomator as findable nodes (only the hamburger has a content-desc), so neither class-matching nor a toolbar-band scan could locate the search icon on the CI emulator. Toolbars are horizontally symmetric, so tap (screen_width - drawer_cx, drawer_cy) to hit the lone right-side icon. Tap the revealed field by its hint before typing to guarantee focus. * CI: Update UI screenshots [skip ci] * Trending row shows its own metric with a flame badge Previously the Trending row reused the popularity badge as a stand-in. With the new All Time Popular row that made the two rows' badges identical and broke the "show the sort metric" rule. Plumb AniList's `trending` field through the browseMedia fragment + RelatedMedia, and give TRENDING_DESC its own flame glyph + trending value so each row's badge is distinct. * CI: Update UI screenshots [skip ci] * Doc: clarify MetricFormat M-tier promotes at 999,950 not exactly 1M * CI: Update UI screenshots [skip ci] * Fix View All metric badge sort; tidy mixed named/positional args - MediaBrowsePageModel.StampItems badged off PaginatedSection.Sort, which Seed() resets to the hard-coded placeholder initialSort — so the Compact View All (the browse template that shows the metric badge) stamped every section as popularity. Badge off the section definition's sort instead, so Top lists show score and Trending shows its flame metric. - Name the trailing perPage/cancellationToken args (the calls compiled fine as C# 7.2 non-trailing named arguments, but the mix read as a smell). * Address review nits: a11y labels + reduce per-bind allocations - DiscoverSectionView: exclude the decorative header glyph from the a11y tree; give "View All" a SemanticProperties description/hint naming the section it opens. - BrowseMetaDisplay: hand-compose with StringBuilder (no LINQ/array) since it's evaluated per visible row while scrolling. - ColorToBrushConverter: return the shared Brush.Transparent for the no-color path instead of allocating one each call. * CI: Update UI screenshots [skip ci] * CI fixtures: varied list statuses + fuller search; review fixes - CIAniListClient.BrowseItems: interleave Watching/Planning/Completed and leave several items off-list, so Discover carousels and search results show a realistic mix of pills (and some with none) instead of a run of identical "Watching" chips. - CI search types "no" (matches several romaji stub titles) so the results list is full rather than a single hit. - EntryActionCoordinator.SaveAndAdoptIdAsync: treat a missing entry id when creating as a failure (routes through the error snackbar) instead of a false success with no real id for later delete/move. - MediaBrowseLoadedContentView: only swap the CollectionView template when the resource lookup succeeds, so a miss never blanks the list. * CI: Update UI screenshots [skip ci] * CI stub: off-list browse items have null score, not 0 Match the real API shape (mediaListEntry absent => list fields null) so no phantom score can leak into BrowseMediaItem.ToListEntry() under the stubs. * CI: Update UI screenshots [skip ci] * Unsubscribe flyout pages from singleton page models on teardown DiscoverPage/MyAnimePage/SettingsPage are transient but their page models are singletons. They subscribed to PageModel.PropertyChanged but never unsubscribed when the platform view was torn down (Handler -> null), so the singleton pinned orphaned page instances and could stack duplicate CurrentState handlers if Shell recreated the page. Drop the subscription on Handler-null and re-subscribe idempotently on reattach. * CI: Update UI screenshots [skip ci] * Search query: add ID tiebreaker for stable pagination Discover search is infinite-scroll paged, but it sorted by SEARCH_MATCH only. Equal-relevance items could reorder across page boundaries and get dropped by PaginatedSection dedup. Append ID (matching WithTiebreaker elsewhere) so page boundaries are deterministic. Verified [SEARCH_MATCH, ID] against the live endpoint. * CI: Update UI screenshots [skip ci] * Harden browse: enum-validate route, cache brushes, invalidate stale cache - MediaBrowsePage.ApplyQueryAttributes: Enum.IsDefined-validate the parsed section so a numeric/undefined value falls through to the "Unknown browse section" error instead of throwing in DiscoverSectionDefinitions.Get(). - ColorToBrushConverter: cache one SolidColorBrush per Color (small fixed set of status colors) to cut per-bind allocations in scrolling lists. - MediaBrowsePageModel.LoadAsync: capture adult-content + auth at load and refetch on revisit when either changed, instead of short-circuiting to stale (possibly 18+) cached items — mirrors DiscoverPageModel. * CI: Update UI screenshots [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>









Summary
Adds the Discover page (issues #15 / #16): an anime browse experience reachable from a new flyout item between My Anime and Settings. Works signed-out (public queries) and shows your list status on every card when signed in.
Sections
One aliased GraphQL request seeds every row; scrolling a row pages it through
BrowseAnime(one request per row-page).format: MOVIE, rankedPer-row card badges follow each row''s sort metric.
Search & View All
media-browseroute) — infinite vertical list with the My Anime view-mode switcher (Standard / Large / Compact), sharing the same device preference so the two pages always match.Shared machinery
EntryActionCoordinator, extracted from My Anime: not-on-list shows Add to list, on-list shows the full menu (edit progress / rate / move / remove). My Anime delegates to the same coordinator.ListStatusPillStyle) and shared row/grid templates inBrowseTemplates.xamlso cards, browse rows, and search results can''t drift.Also in this PR
MetricFormatgains a millions tier (1M,1.3M) so 7-figure popularity counts read correctly instead of1010.3k.Microsoft.Maui.Controlsat 10.0.60: 10.0.70 added anAccessibilityNodeInfoCompat.set_Checked(bool)call that crashes app-wide under any accessibility traversal (TalkBack / uiautomator) with the AndroidX.Core 1.17+ train ([Android] MissingMethodException AccessibilityNodeInfoCompat.set_Checked(bool) on 10.0.70 due to AndroidX.Core 1.17 breaking change dotnet/maui#35584). Revert once the .NET 10 SR8 fix ships.Testing
Follow-ups (filed)
Closes #15
Closes #16