Modern Apps git

← Modern-Apps.git

wordmaker: only go side-by-side in landscape, not any short window

Commit
5141fc06fc77123d7a49996e54fc12ba68280f40
Author
Vayun Mathur <[email protected]>
When
2026-11-19 22:16 UTC (16 days ago)
Parents
d8071e0
CI reported 19 wordmaker failures after 2dc4dc226. The new
compact-height branch gated on isCompactHeight() alone, so it
also engaged in short PORTRAIT windows - including the 320x470dp
Compose-test window and portrait split-screen - where the wheel
column is capped at half an already-narrow width and the wheel
shrinks to ~48dp inside its side columns. Every game-flow test
waits on taps landing on that geometry. The exact CI failures do
not reproduce on this 192-core box (taps still landed), but the
portrait layout was wrong and had no margin.

The gate is now isCompactHeight() && maxWidth > maxHeight, the
chess pattern: landscape phones keep side-by-side, portrait at
any height returns to the stacked layout those tests (and users)
had before. No test changed.

Verified: :games:wordmaker:testDevUnitTest 158/158 and compile.

Diff

games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/WordGameScreen.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/WordGameScreen.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/WordGameScreen.ktindex 971df38472..651eb1eba4 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/WordGameScreen.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/WordGameScreen.kt@@ -171,13 +171,17 @@ fun WordGameScreen(         // instead of stretching the crossword across the window; the board         // itself never splits. Bars stay full-bleed — only the body is capped.         DesktopMaxWidthContainer(modifier = Modifier.padding(innerPadding)) {-        // Short windows (landscape phones, under 480.dp tall) cannot stack the-        // board over the wheel: wheelHeight alone is 320-410.dp, so reserving it-        // as bottom padding left the board ~0.dp and it collapsed. There the-        // board and wheel sit side by side instead — the same split sudoku and-        // minesweeper make on isCompactHeight() — each with the full height,-        // and the wheel's measured-fit geometry shrinks it to its column.-        // Taller windows keep the stacked layout below, unchanged.+        // Short landscape windows (under 480.dp tall, wider than tall) cannot+        // stack the board over the wheel: wheelHeight alone is 320-410.dp, so+        // reserving it as bottom padding left the board ~0.dp and it collapsed.+        // There the board and wheel sit side by side instead, each with the+        // full height, and the wheel's measured-fit geometry shrinks it to its+        // column. Portrait windows keep the stacked layout no matter how short+        // they are: a side-by-side split there halves an already narrow width,+        // squeezing the wheel into a sliver of its column (Robolectric's+        // 320x470.dp test window and portrait split-screen both hit this), so+        // compact height alone must not trigger the split — landscape aspect+        // is required too. Taller windows keep the stacked layout, unchanged.         BoxWithConstraints(             modifier = Modifier                 .padding(bottom = 32.dp)@@ -245,7 +249,8 @@ fun WordGameScreen(                 )             } -            if (isCompactHeight()) {+            val sideBySide = isCompactHeight() && maxWidth > maxHeight+            if (sideBySide) {                 Row(modifier = Modifier.fillMaxSize()) {                     Box(                         modifier = Modifier.weight(1f).fillMaxHeight(),