Files
minstrel/android/app
bvandeusen 5697bfeedf feat(android): Phase 11 Commit B — ServerUrl entry + auth-gated startDestination
Cold launch now lands on the right screen based on persisted auth
state instead of always starting at Home.

New:
  - auth/ui/AuthGateViewModel.kt — one-shot StateFlow that resolves
    the initial NavHost destination from AuthSessionDao directly
    (not AuthStore.sessionCookie, which is null until Room's first
    async emission). Three outcomes:
      no row at all                                → ServerUrl
      row with default URL and no cookie           → ServerUrl
      row with cookie absent / empty               → Login
      row with cookie present                      → Home
  - auth/ui/ServerUrlScreen.kt — VM + Screen in one file (still under
    the function-count cap). Validates `http(s)://` prefix +
    non-empty, trims trailing slash before persisting. On success
    navigates to Login and pops ServerUrl off the back stack.

Modified:
  - MainActivity.kt — wraps the NavGraph in an App() composable that
    reads the AuthGateViewModel. Renders a centered spinner
    (BootSplash) while the gate resolves; once resolved, hands the
    decision to MinstrelNavGraph as `startDestination`.
  - nav/MinstrelNavGraph.kt — startDestination is now a parameter
    (was hardcoded to Home). ServerUrl route renders the real screen
    instead of ComingSoon.

Settings (with sign-out) is Commit C; cross-restart user identity
persistence + auth-error 401 redirect handling are later refinements.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 12:31:22 -04:00
..