Repository navigation
Description
Background
PR #61 (tech-debt umbrella) added DI abstractions (INavigationService, IPreferences, IDispatcher, TimeProvider) to the three PageModels so they can be exercised from unit tests. However, the Phase-1 PageModel tests from #52 did not ship in that PR.
Blocker
tests/AniSprinkles.UnitTests targets net10.0 (plain — no Android workload required) and link-compiles source files from src/ rather than project-referencing the MAUI app. This works for pure-algorithm code (e.g. MediaListSectionsMerger) but fails for PageModels.
Re-measured 2026-08-22 against the versions currently pinned; two of the three package claims below were wrong. Method and evidence in the verification comment on this issue.
It does have one —Microsoft.Maui.Controlshas nonet10.0target (platform-specific TFMs only), soShell,Keyboard,VisualElementetc. don't resolve.Microsoft.Maui.Controls.Core/.Xaml10.0.60 shipnet10.0, andShell,Keyboard,VisualElementandDisplayPromptAsyncall resolve.It does not — 14.2.0 shipsCommunityToolkit.Maui(Popup types) has the same restriction.lib/net10.0, andPopup,PopupOptionsandShowPopupAsyncall resolve.IconFont.Maui.FluentIcons1.1.0 is platform-specific (net10.0-android36.0/-ios26.0/-maccatalyst26.0only). This one still blocks.
What actually blocks the move:
- IconFont glyph constants — 15 files across
PageModels/,Converters/andServices/; 57 distinct members. - XAML-backed popups in
AniSprinkles.Views—EntryActionCoordinator,ListEntryStatusFlow,SettingsPageModel,MediaDetailsPageModel. - Android platform types —
AuthService(Android.Webkit) andAiringNotificationService(AndroidX.Work), both already behind interfaces and both staying in the app project.
Everything else in Models/, Utilities/, Services/ and PageModels/ compiles clean on net10.0 as it stands.
Proposal
Extract a new src/AniSprinkles.Core/ class library targeting net10.0 containing code that has no MAUI-UI dependency:
Models/(AniList DTOs and domain types)Services/(non-platform services:AniListClient,AuthServicebody,ErrorReportService,FileLoggerProvider)Services/Abstractions/(INavigationService)PageModels/— all of it. The Popup /Shell/Browsercall sites move behind newIDialogServiceandIExternalBrowserabstractions (see Risks below) rather than intopartialfiles.
The MAUI app project references the Core library; the test project also references it. Both project-reference instead of link-compile, eliminating the source-file glob in the unit-tests csproj.
Benefits
- Unblocks Add unit test suite for PageModels, Services, and Converters #52 Phase 1 (PageModels) and Add unit test suite for PageModels, Services, and Converters #52 Phase 2 (Services).
- Removes the fragile
<Compile Include=\"..\..\src\...\" />glob from the unit-test csproj. - Keeps compile-time stub service swaps (
-p:CiBuild=true) working — the#if CIstubs areinternaland stay in the MAUI app project, so noDefineConstantsplumbing is needed in Core. - Smaller MAUI app project → faster incremental builds.
Risks / open questions
IDialogServiceandIExternalBrowserare in scope, not deferred. The five XAML popups (ActionMenuPopup,MoveToListPopup,EditProgressPopup,ConfirmPopup,RatingPopup),Shell.Current.DisplayPromptAsync, and the fourBrowser.Default.OpenAsyncsites go behind Core interfaces implemented insrc/Services/Maui/, alongside the existingMauiShellNavigationService/MauiUserFeedback.- The IconFont glyph table is mirrored into Core as generated constants; the MAUI project and XAML keep the package. Add a test that validates x:Static icon glyph references in XAML #117's test is extended to assert the mirrored names and values against the package assembly, so the copy cannot drift.
It does not. It takesFileLoggerProviderusesFileSystem.Current.AppDataDirectory— may need to inject a path resolver.logDirectoryas a constructor parameter; the path is resolved by the caller inMauiProgram.cs. No path resolver needed.OutageStateService.DispatchOrInvokecallsMainThread.IsMainThread, which throwsNotImplementedInReferenceAssemblyExceptionon plainnet10.0— the existingcatch (InvalidOperationException)does not cover it, despite the comment claiming it falls back safely in unit tests. Fixed as part of the move by routing through the injectedIDispatcher.
Acceptance
AniSprinkles.Coreclass library exists, builds clean onnet10.0.- MAUI app project-references it; CI builds green.
- Unit test project project-references it (link-compile globs removed).
- Add unit test suite for PageModels, Services, and Converters #52 Phase 1 PR can land afterwards without csproj churn.
- All PageModels live in Core;
src/PageModels/is empty. IDialogService/IExternalBrowserexist in Core with MAUI adapters insrc/Services/Maui/.- Core's mirrored glyph constants are validated against
IconFont.Maui.FluentIconsby the Add a test that validates x:Static icon glyph references in XAML #117 test.
Activity
zhollis21 commentedon Aug 22, 2026
Evidence from #116 — six bugs this would have caught
#116 (bottom tab bar) went through six review rounds. Every round found real defects, and all of them live in exactly the code this issue is about: PageModel state machines and async ordering. None were reachable by the current 391-test suite, which covers pure algorithms and XAML well-formedness only.
Recording them here because the argument for this extraction is much stronger with specifics than in the abstract.
054c3f6IsSearchinginfinally(that is what stops the spinner), re-arming Load More while the section still held the previous query's items andHasNextPage. Scrolling then appended page 2 of the new query onto the old query's results — one list silently mixing two searches.121c8af_searchedAuthenticatedwritten before the cancellation check, so a superseded search resuming late could clobber a newer search's recorded context.48e5ca0OperationCanceledExceptionrethrow inAuthServiceturned a survivable cleanup failure into a crash. Ten call sites across six page models callGetAccessTokenAsyncwith no token fromasync voidlifecycle paths;SignOutAsynccan surface a cancellation of its own viaMainThread.InvokeOnMainThreadAsyncduring teardown.8ea0cbbf575d36IsBusywent up, butLoadAsyncawaits the auth read before setting it — leaving that suspension open for a page fetched under a context the refresh was about to replace.f575d36Why this is the right evidence for this issue
Three of the six were regressions introduced by the previous round's fix. #2 was a half-fix of #1's neighbouring problem, #4 was introduced by the fix in #3's round, and #6 was a hole in a guard added earlier in the same PR. That is the signature of code whose correctness rests on a reasoning argument with nothing executable to check it: each fix was defensible in isolation and each broke or missed something adjacent.
Device verification cannot reach any of them. Every one needs a specific interleaving — a request failing at a precise moment, a superseded continuation resuming after a newer one, a debounced settings write landing between two reads. The
/run-anisprinklespass confirms the happy path and nothing more. Several were also explicitly not device-verifiable because the CI stubs replaceAuthServiceentirely underCiBuild=true.None of them need MAUI to test. They are all decisions about ordering and flags:
CanLoadMoreis false afterwards.Each is a handful of lines against a fake
IAniListClientonceSearchPageModel/DiscoverPageModelare in anet10.0library. That is precisely what the link-compile setup blocks today.Suggested scope note
SearchPageModelandDiscoverPageModelare the highest-value first movers for #52 Phase 1 once this lands — they hold the debounce, the generation guarding, the context invalidation and the paging interlocks, which is where all six of the above concentrated.zhollis21 commentedon Aug 22, 2026
Verification notes (2026-08-22)
Re-measured the blocker before planning. Two of the three package restrictions in the Blocker section above no longer hold on the versions this repo is currently pinned to.
What the packages actually ship
src/AniSprinkles.csprojnet10.0lib?Microsoft.Maui.Controls(via.Controls.Core/.Controls.Xaml)CommunityToolkit.MauiMicrosoft.Maui.Essentials/Microsoft.Maui.CoreIconFont.Maui.FluentIconsnet10.0-android36.0,-ios26.0,-maccatalyst26.0onlyConfirmed by building a throwaway
net10.0project that referencesMicrosoft.Maui.Controls10.0.60 +CommunityToolkit.Maui14.2.0 and compilesShell.Current,Shell.DisplayPromptAsync(..., keyboard: Keyboard.Numeric),PopupOptionswith aShapes.RoundRectangle, andpage.ShowPopupAsync<object>(...). Build succeeded, 0 warnings, 0 errors.Measured blocker inventory
Link-compiled all of
src/Models/,src/Utilities/,src/Services/,src/Services/Abstractions/,src/PageModels/andsrc/Converters/into anet10.0probe project. Everything that fails does so for one of three reasons:IconFont.Maui.FluentIcons— 15 files, 57 distinct members (FluentIconsRegular.*,FluentIconsFilled.*):Converters/FavouriteHeartConverters.cs,Converters/MediaFormatIcons.cs,Services/AniListApiException.Icon.cs,Services/ListEntryStatusFlow.cs, and 11 files underPageModels/.AniSprinkles.Views—PageModels/EntryActionCoordinator.cs:6,Services/ListEntryStatusFlow.cs:2,PageModels/SettingsPageModel.cs:665,754,PageModels/MediaDetailsPageModel.cs:1229(ConfirmPopup,ActionMenuPopup,MoveToListPopup,EditProgressPopup,RatingPopup).Services/AuthService.cs:1(Android.Webkit,Java.Lang) andServices/AiringNotificationService.cs:1-2(AndroidX.Work,AniSprinkles.Platforms). Both already sit behindIAuthService/IAiringNotificationService.Nothing else fails. All of
Models/, all ofUtilities/(includingAppSettings.Storage.cs),AniListClient,CachingAniListClient,AniListRateLimitHandler,AniListErrorClassifier,ErrorReportService,FileLoggerProvider,LoggingHandler,OutageStateServiceandListEntryStatusMutationscompile clean onnet10.0as they stand.Two open questions in the body are already answered
FileLoggerProviderdoes not useFileSystem.Current.AppDataDirectory. It takeslogDirectoryas a constructor parameter (src/Services/FileLoggerProvider.cs:12); the path is resolved by the caller insrc/MauiProgram.cs:42. No path-resolver injection needed.AppSettings.Storage.cscompiles onnet10.0unchanged —Microsoft.Maui.Essentials10.0.60 has anet10.0target, soPreferencesresolves.First-mover confirmation
PageModels/SearchPageModel.cshas zero references to IconFont, popups orShell.PageModels/DiscoverPageModel.cshas exactly one — theFluentIconsRegular.ErrorCircle24fallback at line 265. The only thing stopping either from compiling onnet10.0today is the concreteEntryActionCoordinatorfield type (SearchPageModel.cs:32,DiscoverPageModel.cs:28).Measurement trap
An unresolved
usingdirective (CS0246) suppresses method-body binding errors elsewhere in the same compilation. A first pass that leftAniListApiException.Icon.csin the probe reported 19 errors and showedSettingsPageModelas clean; removing that one file surfaced itsViews.ConfirmPopupandFluentIconsRegularfailures. Anyone re-running this needs to drop the files with failing platformusings before trusting the error count.zhollis21 commentedon Aug 22, 2026
Updated during planning:
Microsoft.Maui.ControlsandCommunityToolkit.Mauiclaims are struck; both shipnet10.0libs on the versions pinned here. Replaced the "~37 errors" figure with the measured blocker inventory (IconFont, XAML popups, Android types). Evidence in the verification comment above.PageModels/moves wholesale rather than partially, so the "small cleanup pass /partialfiles" wording is gone.#if CIstubs stay in the app project, not Core; they areinternal, so moving them would mean widening their visibility for no gain.IDialogService/IExternalBrowserare in scope now rather than deferred; theFileLoggerProviderpath-resolver concern is struck (it already takeslogDirectoryas a parameter); added theOutageStateService/MainThreaddefect found while verifying.Scope decided alongside this: move everything movable (not just Search/Discover), mirror the IconFont glyphs into Core as generated constants, and land #117 and a first slice of #52 on the same branch — #117 is what keeps the mirrored glyph table honest. #119 is not unblocked by this work:
AuthServiceusesAndroid.Webkitand stays in the app project either way.zhollis21 commentedon Aug 22, 2026
Implementation notes, for whoever reviews the branch.
Three things surfaced during the work that are tracked separately rather than folded in:
AppSettingswrites through the staticPreferences.Default, soSettingsPageModel's authenticated path stays untestable even after this extraction. The narrow fix (injectable storage, static surface kept) is written up there.Also fixed in passing, because the move exposed them:
OutageStateServicecalledMainThread.IsMainThread, whoseNotImplementedInReferenceAssemblyExceptionitscatch (InvalidOperationException)never covered — so the comment promising an inline fallback in unit tests was never true; andSettingsPageModelreadAppInfo.Currentin a field initializer, so the type could not be constructed off-device at all.Extract AniSprinkles.Core so PageModels can be tested (#62, #117) (#123)
Adult-content commit timing, token redaction, AppSettings seam, and C…
Add ani-issue skill for filing and auditing GitHub issues
Add ani-issue skill for filing and auditing GitHub issues (#140)
Stop reporting cancelled requests as failures, and fix two CI gates t…
Extract AniSprinkles.Core so PageModels can be tested (#62, #117) (#123)
Adult-content commit timing, token redaction, AppSettings seam, and C…
Add ani-issue skill for filing and auditing GitHub issues (#140)
Stop reporting cancelled requests as failures, and fix two CI gates t…