Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f02e4e8
Add Discover page with sections, search, and View All
Jun 13, 2026
31222da
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
dc0147c
Address review: search load-more safety, adult-toggle clear, CTS disp…
Jun 13, 2026
474bc94
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
33f6e96
CI: open Discover search by mirroring the hamburger position
Jun 13, 2026
032bade
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
41e4365
Trending row shows its own metric with a flame badge
Jun 13, 2026
d0be29a
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
87c326f
Doc: clarify MetricFormat M-tier promotes at 999,950 not exactly 1M
Jun 13, 2026
522cf23
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
27f340b
Fix View All metric badge sort; tidy mixed named/positional args
Jun 13, 2026
acb9ea2
Address review nits: a11y labels + reduce per-bind allocations
Jun 13, 2026
cad9900
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
b07d25d
CI fixtures: varied list statuses + fuller search; review fixes
Jun 13, 2026
d361c77
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
9ed93a1
CI stub: off-list browse items have null score, not 0
Jun 13, 2026
d1151f0
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 13, 2026
9e1abaa
Unsubscribe flyout pages from singleton page models on teardown
Jun 14, 2026
61aa313
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 14, 2026
0ffea1a
Search query: add ID tiebreaker for stable pagination
Jun 14, 2026
04e1174
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 14, 2026
c61ba84
Harden browse: enum-validate route, cache brushes, invalidate stale c…
Jun 14, 2026
9c6fceb
CI: Update UI screenshots [skip ci]
github-actions[bot] Jun 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .claude/skills/project-architecture/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,30 @@ description: "AniSprinkles project architecture reference: DI lifetimes, page/Pa
| Registration | Lifetime |
| ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| `ErrorReportService`, `HttpClient`, `IAuthService`, `IAniListClient`, `IAiringNotificationService`, `IOutageStateService`, `INavigationService`, `IUserFeedback` | Singleton |
| `MyAnimePageModel`, `SettingsPageModel` | **Singleton** (survive page recreation across flyout switches) |
| `MyAnimePageModel`, `DiscoverPageModel`, `SettingsPageModel` | **Singleton** (survive page recreation across flyout switches) |
| `LoggingHandler`, `AniListRateLimitHandler` | Transient |

`IAniListClient` resolves to `CachingAniListClient` wrapping the concrete `AniListClient` (session-lifetime in-memory cache of character/staff reads, with request coalescing). The shared `HttpClient` pipeline is `AniListRateLimitHandler` → `LoggingHandler` → `HttpClientHandler`, so every AniList call is serialized and 429/`Retry-After`-aware app-wide.
| `MyAnimePage`, `SettingsPage`, `MediaDetailsPageModel`, `MediaDetailsPage`, `StaffDetailsPageModel`, `StaffDetailsPage`, `CharacterDetailsPageModel`, `CharacterDetailsPage`, `StudioDetailsPageModel`, `StudioDetailsPage` | Transient |
| `MyAnimePage`, `DiscoverPage`, `SettingsPage`, `MediaDetailsPageModel`, `MediaDetailsPage`, `StaffDetailsPageModel`, `StaffDetailsPage`, `CharacterDetailsPageModel`, `CharacterDetailsPage`, `StudioDetailsPageModel`, `StudioDetailsPage`, `MediaBrowsePageModel`, `MediaBrowsePage` | Transient |

## Page ↔ PageModel Binding

Two-constructor pattern: parameterless (for XAML tooling) + DI constructor. `ServiceProviderHelper` provides `IServiceProvider` fallback via `IPlatformApplication.Current.Services` when `Application.Current.Handler` is not ready during Shell startup.

## OnAppearing Three-Branch Pattern (both flyout pages)
## OnAppearing Three-Branch Pattern (all flyout pages)

1. Content alive → background refresh
2. Content gone + `HasLoadedData` → immediate rebuild + background refresh
3. First load → spinner + deferred fetch

See `MyAnimePage.xaml.cs` and `SettingsPage.xaml.cs` for reference implementations.
See `MyAnimePage.xaml.cs` and `SettingsPage.xaml.cs` for reference implementations. `DiscoverPage.xaml.cs` is the auth-free variant (no Unauthenticated/AuthenticationPending states); its singleton page model doubles as a ~20-minute TTL cache for the Discover sections (bypassed by pull-to-refresh, invalidated by adult-toggle or auth changes).

## Discover / Browse / Search

- `DiscoverPageModel` (singleton): one aliased `DiscoverSections` request seeds every row (a `DiscoverRow` wrapping a `PaginatedSection<BrowseMediaItem>`); rows then page themselves horizontally through `BrowseAnimePageAsync` (one request per row-page) via the shared `DiscoverSectionFetch` helper. Card badges follow the row's sort via `MediaMetricBadges.ForMediaSort`. Search is revealed by a toolbar icon (same toggle pattern as My Anime); debounced (600 ms, 2+ chars) queries swap the rows for a `PaginatedSection` results list via visibility (rows stay alive underneath).
- `MediaBrowsePage` ("View All", transient): `DeferredContentLoader` + one `PaginatedSection<BrowseMediaItem>` over the same `DiscoverSectionFetch`; `DiscoverSectionDefinitions` is the single source of truth for section title/sort/filters/format/rank. Has the My Anime view-mode switcher; the mode persists to the shared `ListViewModePreference` key, so My Anime and View All always match (My Anime re-syncs in `OnAppearing`).
- `BrowseTemplates.xaml` (merged in App.xaml) holds the shared templates: `BrowseMediaRowTemplate` (Standard, also used by search results), `BrowseMediaLargeTemplate` (2-col grid), `BrowseMediaCompactTemplate`, plus `ListStatusPillStyle` — the ONE on-list status pill used by rows, grid cards, and the Discover carousel cards. Tap commands resolve from the hosting CollectionView's BindingContext (`NavigateToMediaCommand`).
- `EntryActionCoordinator` (`PageModels/`) owns the long-press action flows (menu, add/move/rate/edit-progress/complete/remove, persistence, toasts/snackbars) for My Anime AND the browse surfaces; page models supply `EntryActionHost` callbacks (optimistic removal, reload vs in-place chip update, error details). `CollectionViewLongPress` (`Views/`) is the reusable Android RecyclerView long-press hook for flat CollectionViews; navigate commands call `ShouldSuppressTap()` to swallow the synthetic tap that follows a long press.

## Details Page UX

Expand All @@ -41,7 +48,7 @@ Spinner-first flow: lightweight shell page appears immediately, full content vie

## Navigation

Shell flyout (`my-anime`, `settings`). Details routes registered in `AppShell.xaml.cs`: `media-details` → `MediaDetailsPage`, `staff-details` → `StaffDetailsPage`, `character-details` → `CharacterDetailsPage`, `studio-details` → `StudioDetailsPage`. Navigate via `Shell.Current.GoToAsync` (or the injected `INavigationService`) with lightweight query params (`mediaId` / `staffId` / `characterId` / `studioId` + trace IDs) — never pass full model objects. Rapid-tap prevention on My Anime → details. Default Shell back behavior — no custom Android back overrides.
Shell flyout (`my-anime`, `discover`, `settings`). Details routes registered in `AppShell.xaml.cs`: `media-details` → `MediaDetailsPage`, `staff-details` → `StaffDetailsPage`, `character-details` → `CharacterDetailsPage`, `studio-details` → `StudioDetailsPage`, `media-browse` → `MediaBrowsePage` (Discover "View All"; takes a `section` enum-name param decoded against `DiscoverSectionDefinitions`). Navigate via `Shell.Current.GoToAsync` (or the injected `INavigationService`) with lightweight query params (`mediaId` / `staffId` / `characterId` / `studioId` / `section` + trace IDs) — never pass full model objects. Rapid-tap prevention on My Anime → details. Default Shell back behavior — no custom Android back overrides.

## Performance Defaults

Expand Down
165 changes: 165 additions & 0 deletions .github/workflows/ci-build-and-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,70 @@ jobs:
return 1
}

# Open the Discover search bar by tapping the lone right-side toolbar icon. MAUI Shell's
# action icons aren't exposed to uiautomator as findable nodes (only the hamburger has a
# content-desc), so we mirror the hamburger's position to the right edge: toolbars are
# horizontally symmetric, so the rightmost icon center sits at (screen_width - drawer_cx,
# drawer_cy). Resolution-independent and needs no node for the icon itself.
# Usage: tap_search_toggle
tap_search_toggle() {
adb shell rm -f /sdcard/ui_toolbar.xml >/dev/null 2>&1 || true
if ! adb shell uiautomator dump /sdcard/ui_toolbar.xml >/dev/null 2>&1 \
|| ! adb shell test -s /sdcard/ui_toolbar.xml >/dev/null 2>&1; then
echo "::warning::Failed to dump UI for the search toggle"
return 1
fi
local drawer_bounds
drawer_bounds=$(adb shell cat /sdcard/ui_toolbar.xml 2>/dev/null | tr '>' '>\n' \
| grep -o 'content-desc="Open navigation drawer"[^/]*bounds="\[[0-9]*,[0-9]*\]\[[0-9]*,[0-9]*\]"' \
| grep -o 'bounds="\[[0-9]*,[0-9]*\]\[[0-9]*,[0-9]*\]"' | head -1 | sed 's/bounds="//;s/"//') || true
if [ -z "$drawer_bounds" ]; then
echo "::warning::Could not locate the toolbar hamburger to mirror the search icon"
return 1
fi
local dl dt dr dbot dcx dcy width tap_x
dl=$(echo "$drawer_bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $1}')
dt=$(echo "$drawer_bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $2}')
dr=$(echo "$drawer_bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $3}')
dbot=$(echo "$drawer_bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $4}')
dcx=$(( (dl + dr) / 2 )); dcy=$(( (dt + dbot) / 2 ))
width=$(adb shell wm size | grep -o '[0-9]*x[0-9]*' | head -1 | cut -dx -f1)
[ -z "$width" ] && { echo "::warning::Could not read screen width"; return 1; }
tap_x=$(( width - dcx ))
echo "Tapping search toggle at (${tap_x}, ${dcy}) [mirror of hamburger ${dcx},${dcy} on width ${width}]"
adb shell input tap "$tap_x" "$dcy"
}

# Tap the first "View All ›" row link. Its text node carries the chevron (a multibyte
# char), so match on the "View All" prefix up to the next quote rather than exact text.
# Usage: tap_first_view_all
tap_first_view_all() {
adb shell rm -f /sdcard/ui_viewall.xml >/dev/null 2>&1 || true
if ! adb shell uiautomator dump /sdcard/ui_viewall.xml >/dev/null 2>&1 \
|| ! adb shell test -s /sdcard/ui_viewall.xml >/dev/null 2>&1; then
echo "::warning::Failed to dump UI for View All"
return 1
fi
local bounds
bounds=$(adb shell cat /sdcard/ui_viewall.xml 2>/dev/null \
| tr '>' '>\n' \
| grep -o 'text="View All[^"]*"[^/]*bounds="\[[0-9]*,[0-9]*\]\[[0-9]*,[0-9]*\]"' \
| grep -o 'bounds="\[[0-9]*,[0-9]*\]\[[0-9]*,[0-9]*\]"' \
| head -1 | sed 's/bounds="//;s/"//') || true
if [ -z "$bounds" ]; then
echo "::warning::Could not find a 'View All' link"
return 1
fi
local l t r bot cx cy
l=$(echo "$bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $1}')
t=$(echo "$bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $2}')
r=$(echo "$bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $3}')
bot=$(echo "$bounds" | sed 's/\[//g;s/\]/ /g' | awk -F'[, ]' '{print $4}')
cx=$(( (l + r) / 2 )); cy=$(( (t + bot) / 2 ))
echo "Tapping 'View All' at (${cx}, ${cy})"
adb shell input tap "$cx" "$cy"
}

# Press BACK until the My Anime page (its toolbar title) is showing again, so the flyout
# step runs from the root regardless of how deep navigation went.
# Usage: back_to_my_anime [max_presses]
Expand Down Expand Up @@ -544,6 +608,101 @@ jobs:
adb pull /sdcard/settings.png screenshots/settings.png || echo "::warning::Failed to pull Settings screenshot"
echo "Captured: settings.png (Settings — $AUTH_MODE)"

# ---- Discover / View All / Search (issues #15/#16) ----
# All rendered from CI stub fixtures (popular SFW titles); the adult toggle defaults off,
# so the 18+ rows are never requested.

# Open the flyout from Settings and tap Discover.
DISCOVER_OPENED=0
for FLYOUT_ATTEMPT in 1 2 3; do
echo "Flyout open attempt ${FLYOUT_ATTEMPT} (Discover)..."
tap_element_by_content_desc "Open navigation drawer" || true
sleep 1
adb shell rm -f /sdcard/ui_flyout_disc.xml >/dev/null 2>&1 || true
if adb shell uiautomator dump /sdcard/ui_flyout_disc.xml >/dev/null 2>&1 && \
adb shell test -s /sdcard/ui_flyout_disc.xml >/dev/null 2>&1 && \
adb shell cat /sdcard/ui_flyout_disc.xml 2>/dev/null | grep -qi '"Discover"'; then
DISCOVER_OPENED=1
break
fi
done

if [ "$DISCOVER_OPENED" -eq 1 ]; then
tap_element_by_text "Discover"
# Wait for the rows to populate (a known section header appears once loaded).
DISC_WAIT=0
while [ $DISC_WAIT -lt 20 ]; do
adb shell uiautomator dump /sdcard/ui_disc.xml 2>/dev/null || true
if adb shell cat /sdcard/ui_disc.xml 2>/dev/null | grep -qi "Trending Now\|Currently Airing"; then
echo " Discover ready after ${DISC_WAIT}s"
sleep 1
break
fi
sleep 1
DISC_WAIT=$((DISC_WAIT + 1))
done

# Screenshot 7: Discover landing (section rows)
adb shell screencap -p /sdcard/discover.png || echo "::warning::Failed to capture Discover screenshot"
adb pull /sdcard/discover.png screenshots/discover.png || echo "::warning::Failed to pull Discover screenshot"
echo "Captured: discover.png (Discover — $AUTH_MODE)"

# Screenshot 8: View All (default Large grid). Tap the first "View All ›".
if tap_first_view_all; then
BROWSE_WAIT=0
while [ $BROWSE_WAIT -lt 15 ]; do
adb shell uiautomator dump /sdcard/ui_browse.xml 2>/dev/null || true
# On the browse page the row "View All" links are gone but cards remain.
if adb shell cat /sdcard/ui_browse.xml 2>/dev/null | grep -qi "ONE PIECE\|Attack on Titan" \
&& ! adb shell cat /sdcard/ui_browse.xml 2>/dev/null | grep -q "View All"; then
echo " View All ready after ${BROWSE_WAIT}s"
break
fi
sleep 1
BROWSE_WAIT=$((BROWSE_WAIT + 1))
done
sleep 1
adb shell screencap -p /sdcard/browse.png || echo "::warning::Failed to capture View All screenshot"
adb pull /sdcard/browse.png screenshots/browse.png || echo "::warning::Failed to pull View All screenshot"
echo "Captured: browse.png (View All — $AUTH_MODE)"
# Back to Discover (View All is a stacked route, so BACK is safe here).
adb shell input keyevent KEYCODE_BACK
sleep 1.5
else
echo "::warning::Could not open a View All list — skipping browse screenshot"
fi

# Screenshot 9: Search results. Open the search bar, focus the field, type a popular
# SFW query that matches a stub title, capture results.
if tap_search_toggle; then
sleep 1
# Tap the revealed field by its hint to guarantee focus before typing (the field
# auto-focuses on reveal, but a tap is a cheap belt-and-suspenders for CI).
tap_element_by_text "Search all anime..." || true
sleep 1
# "One" matches "ONE PIECE" in the stub fixtures.
adb shell input text "One"
SEARCH_WAIT=0
while [ $SEARCH_WAIT -lt 12 ]; do
adb shell uiautomator dump /sdcard/ui_search.xml 2>/dev/null || true
if adb shell cat /sdcard/ui_search.xml 2>/dev/null | grep -qi "ONE PIECE"; then
echo " Search results ready after ${SEARCH_WAIT}s"
break
fi
sleep 1
SEARCH_WAIT=$((SEARCH_WAIT + 1))
done
sleep 1
adb shell screencap -p /sdcard/search.png || echo "::warning::Failed to capture Search screenshot"
adb pull /sdcard/search.png screenshots/search.png || echo "::warning::Failed to pull Search screenshot"
echo "Captured: search.png (Discover Search — $AUTH_MODE)"
else
echo "::warning::Could not open the search bar — skipping search screenshot"
fi
else
echo "::warning::Flyout did not open for Discover — skipping Discover/View All/Search screenshots"
fi

echo ""
echo "Auth mode: $AUTH_MODE"
echo "Screenshots captured:"
Expand Down Expand Up @@ -657,6 +816,9 @@ jobs:

const screenshots = [
{ file: 'screenshots/my_anime.png', label: 'My Anime' },
{ file: 'screenshots/discover.png', label: 'Discover' },
{ file: 'screenshots/browse.png', label: 'View All (Browse)' },
{ file: 'screenshots/search.png', label: 'Discover Search' },
{ file: 'screenshots/one_piece_details.png', label: 'One Piece Details' },
{ file: 'screenshots/studio_details.png', label: 'Toei Animation (Studio)' },
{ file: 'screenshots/character_details.png', label: 'Luffy (Character)' },
Expand Down Expand Up @@ -751,6 +913,9 @@ jobs:
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
for shot in \
"my_anime.png|My Anime" \
"discover.png|Discover" \
"browse.png|View All (Browse)" \
"search.png|Discover Search" \
"one_piece_details.png|One Piece Details" \
"studio_details.png|Toei Animation (Studio)" \
"character_details.png|Luffy (Character)" \
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Thumbs.db
*.pfx

# PR Tool Results
/tools/pr-comments.md
tools/

# Tmp and Testing Files
/tmp
Expand Down
Loading