appstore: checking status survives on the scaffold loading surface
- Commit
988c731b58bb21d37ae0e73accdaa5610da013b0- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-23 00:47 UTC (13 days ago)
- Parents
1161cfa
The scaffold migration hid the 'Checking for updates...' status while checking (empty list). The state already carried the message at the call site, so it now passes through AppScaffold's loadingMessage: spinner and message show together. The test keeps its exact assertion (now satisfied via the loading surface) and gains a does-not-exist check that no empty state leaks through while checking. Verified: UpdatesScreenTest 5/5, compile green. Note: appstore lintVitalRelease still flags LibraryScreen's in-content LoadingState - a separate product call (its filter-chip row shouldn't hide), left for its own fix.
Diff
appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesScreen.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesScreen.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesScreen.ktindex e459e63d0e..030be05236 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesScreen.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesScreen.kt@@ -44,8 +44,20 @@ fun UpdatesScreen( ) { val anyInstalling = state.stages.values.any { it !is InstallStage.Failed } val total = state.updates.size + state.foreignUpdates.size+ // While checking with nothing to show, the scaffold replaces the content+ // (and with it the in-content status line), so the checking status must+ // ride on the loading surface or it would vanish behind the spinner.+ val checkingMessage = if (state.isChecking) {+ state.statusMessage.ifBlank { stringResource(R.string.updates_checking) }+ } else {+ null+ } - AppScaffold(topBar = {}, isLoading = total == 0 && state.isChecking) { padding ->+ AppScaffold(+ topBar = {},+ isLoading = total == 0 && state.isChecking,+ loadingMessage = checkingMessage,+ ) { padding -> AppPullToRefreshBox( isRefreshing = state.isChecking, onRefresh = { actions.checkForUpdates() },
appstore/src/test/java/com/vayunmathur/appstore/ui/UpdatesScreenTest.kt
diff --git a/appstore/src/test/java/com/vayunmathur/appstore/ui/UpdatesScreenTest.kt b/appstore/src/test/java/com/vayunmathur/appstore/ui/UpdatesScreenTest.ktindex ca41ea67b3..af1638001b 100644--- a/appstore/src/test/java/com/vayunmathur/appstore/ui/UpdatesScreenTest.kt+++ b/appstore/src/test/java/com/vayunmathur/appstore/ui/UpdatesScreenTest.kt@@ -105,6 +105,10 @@ class UpdatesScreenTest { val state = UpdatesUiState(isChecking = true, statusMessage = "Checking Play") rule.setContent { UpdatesScreen(state = state, actions = UpdatesActions.Noop) } + // Checking with an empty list is scaffold loading: the content (and+ // its in-content status line) is not composed, so the checking text+ // must survive on the loading surface as the scaffold loadingMessage. rule.onNodeWithText("Checking Play").assertIsDisplayed()+ rule.onNodeWithText("Everything is up to date").assertDoesNotExist() } }