Modern Apps git

← Modern-Apps.git

games-sudoku: expand the Continue button when a game is live

Commit
dc28f9754f5d799804a6ef3d0906515661532765
Author
Vayun Mathur <[email protected]>
When
2026-12-05 16:25 UTC (18 hours ago)
Parents
b63ceca
The Continue button mounted in a cut above the board-size
picker once an unfinished game existed. It now opens through
ExpandVisibility in the home column; the content guards the
active game so the exit animation cannot read a cleared game.

Wrap abrupt conditional content in the shared library.ui motion
helpers so it expands/fades/pops in instead of popping in cut, and
closes up cleanly when it goes away. No raw androidx.compose.
animation is used at the call site, per the fatal DirectCompose
Animation lint; durations and easing come from the helpers'
MaterialTheme motion-scheme defaults.

Verified in this worktree with lint, lintVitalRelease and
testDevUnitTest for the module (details in the session report;
any pre-existing failure was reproduced on the pristine base).

Diff

games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/HomeScreen.kt
diff --git a/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/HomeScreen.kt b/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/HomeScreen.ktindex dbb8509e8f..ef93deb3f7 100644--- a/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/HomeScreen.kt+++ b/games/sudoku/src/main/java/com/vayunmathur/games/sudoku/ui/HomeScreen.kt@@ -29,6 +29,7 @@ import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.DesktopMaxWidthContainer+import com.vayunmathur.library.ui.ExpandVisibility import com.vayunmathur.library.ui.ExperimentalMaterial3Api import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.R as UiR@@ -72,15 +73,17 @@ fun HomeScreen(             verticalArrangement = Arrangement.spacedBy(Spacing.md),         ) {             val active = uiState.game?.takeIf { !it.isWon }-            if (active != null) {-                Button(-                    onClick = {-                        backStack.add(-                            Route.Game(GameConfig(active.size, active.difficulty, active.answerMode))-                        )-                    },-                    modifier = Modifier.fillMaxWidth(),-                ) { Text(stringResource(UiR.string.continue_label)) }+            ExpandVisibility(visible = active != null) {+                if (active != null) {+                    Button(+                        onClick = {+                            backStack.add(+                                Route.Game(GameConfig(active.size, active.difficulty, active.answerMode))+                            )+                        },+                        modifier = Modifier.fillMaxWidth(),+                    ) { Text(stringResource(UiR.string.continue_label)) }+                }             }             Text(                 stringResource(R.string.board_size),