You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(auth): W1.b — LoginScreen now uses MutationScreenContent (replaces raw Scaffold + MifosProgressIndicatorOverlay)
Per user direction: the W1 alignment was incomplete — LoginScreen still wrapped
the form in a raw `Scaffold` and used the project-local `MifosProgressIndicatorOverlay`
for the submit-in-flight state. That bypasses the canonical mutation-screen pattern
established in core-base/ui (`template.core.base.ui.submit.MutationScreenContent`)
which auto-composes ScreenContent + SubmitProgressOverlay + SubmitResultHandler
for any mutation lifecycle.
The Scaffold here genuinely matters (the persistent "Update Server Configuration"
bottom-bar button + snackbar host) — that stays as the outer container. The form
body + submit lifecycle now flow through MutationScreenContent inside the Scaffold's
content area.
What changed in LoginScreen.kt:
Old structure:
Scaffold(bottomBar = serverConfigButton) { padding ->
Column { LoginForm }
}
if (isSubmitting) { MifosProgressIndicatorOverlay() } ← project-local overlay
New structure:
Scaffold(bottomBar = serverConfigButton) { padding ->
MutationScreenContent<Unit, PostAuthenticationResponse>(
screenState = ScreenState.Content(Unit, DataFreshness.FRESH), ← degenerate; login has no fetched data
submitState = submitState,
onRetry = {},
onSubmitted = { _ -> }, ← navigation handled by LoginViewModel via NavigateToPasscode Event
modifier = Modifier.padding(padding),
) { _, _ ->
LoginForm(state, onSubmit, isSubmitting = submitState is SubmitState.Submitting)
}
}
The previous monolithic `LoginContent` was split into `LoginContent` (Scaffold
shell + MutationScreenContent wiring) + `LoginForm` (pure form composable that
takes `state`, `onSubmit`, `isSubmitting`). This separates the framework-binding
concerns from the actual form layout — easier to preview, easier to reuse.
Previews updated to pass `submitState: SubmitState<PostAuthenticationResponse>`
instead of the previous `isSubmitting: Boolean` flag — the 3 @DevicePreview
variants are Idle / Submitting / ValidationError, each constructing the right
SubmitState directly.
Net behavior: same UX (form layout unchanged; submit progress overlay still
appears during the network call). Difference: the overlay is now the framework-
provided SubmitProgressOverlay (consistent across all mutation screens) instead
of the project-local MifosProgressIndicatorOverlay. Also unlocks: future
SubmitResultHandler integration for consistent error categorization across all
mutation screens.
The MIGRATION_PLAYBOOK.md (framework repo, separate batch commit) now carries
W1's full E2E architecture mapping table — first wave to author this canonical
artifact. Every future wave will document its 7-layer mapping (Compose →
ViewModel → Repository → Store builder → DAO → Api → Domain DTOs) before
authoring code.
0 commit comments