Modern Apps git

← Modern-Apps.git

library: keep onDismiss last in AchievementNotification (#ux-audit)

Commit
ffa12191dcc1e299a3da88c2c36e01414dcb026c
Author
Vayun Mathur <[email protected]>
When
2026-11-13 03:19 UTC (23 days ago)
Parents
3f7f92c
Follow-up to "keep the achievement toast clear of the status bar"
(6bf275308), which added the windowInsets parameter after onDismiss.

Symptom: every game calls AchievementNotification(achievement) { ... }
with onDismiss as a trailing lambda. With windowInsets last, Kotlin
bound that lambda to windowInsets, and sudoku, minesweeper, pipes,
unblockjam, nonogram, arrows, wordmaker, logicgate, chess and
solitaire failed to compile ("No value passed for parameter
'onDismiss'").

Fix: windowInsets (still defaulted to safeDrawing top + horizontal)
now sits between achievement and onDismiss, so the trailing lambda is
onDismiss again and no call site changes. Behaviour is identical to
6bf275308.

Verification: :games:{sudoku,minesweeper,pipes,unblockjam,nonogram,
arrows,wordmaker,logicgate,chess,solitaire,hub}:compileDevKotlin; the
toast tests pass arguments by name and are unaffected.

Diff

library/ui/src/main/java/com/vayunmathur/library/ui/AchievementNotification.kt
diff --git a/library/ui/src/main/java/com/vayunmathur/library/ui/AchievementNotification.kt b/library/ui/src/main/java/com/vayunmathur/library/ui/AchievementNotification.ktindex 0b9f39de5d..836f6db46d 100644--- a/library/ui/src/main/java/com/vayunmathur/library/ui/AchievementNotification.kt+++ b/library/ui/src/main/java/com/vayunmathur/library/ui/AchievementNotification.kt@@ -67,8 +67,9 @@ import kotlinx.coroutines.flow.first @Composable fun AchievementNotification(     achievement: Achievement,-    onDismiss: () -> Unit,+    // Before onDismiss, which every caller passes as a trailing lambda.     windowInsets: WindowInsets = WindowInsets.safeDrawing.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal),+    onDismiss: () -> Unit, ) {     key(achievement) { AchievementToast(achievement, onDismiss, windowInsets) } }