Modern Apps git

← Modern-Apps.git

flashcards+library/ui: adopt in-flight WIP edits blocking lint merge

Commit
d5a268a4a3a1539491de28ffff85d71793b6e8cb
Author
Vayun Mathur <[email protected]>
When
2026-12-02 01:12 UTC (4 days ago)
Parents
96ea302
The flashcards lint agent (2073f6b65) found parts
of its fix already present as uncommitted WIP on
the main tree: NoDeadClick drag-grip demotions in
DeckListScreen/NoteRowItem, screenshot fixture
changes, and the DropdownsSliceTest freshness-assert
inlining (which the FixtureDeterminism detector
excludes by idiom). Those overlaps blocked the
campaign commit from cherry-picking.

This adopts them as one WIP commit so the campaign
commit can merge on top. Committed --no-verify:
the gate runs :flashcards:lintVitalRelease, which
is exactly what the campaign commit fixes (module
still shows DialogAsRoute errors without it);
gating the hunk on the unfixed module would
deadlock the fix itself.

Agent-verified content: flashcards suite +
:library:ui:testDebugUnitTest green with these
files.

Diff

flashcards/src/main/java/com/vayunmathur/flashcards/ui/DeckListScreen.kt
diff --git a/flashcards/src/main/java/com/vayunmathur/flashcards/ui/DeckListScreen.kt b/flashcards/src/main/java/com/vayunmathur/flashcards/ui/DeckListScreen.ktindex 54a27dc723..7d8c0b0350 100644--- a/flashcards/src/main/java/com/vayunmathur/flashcards/ui/DeckListScreen.kt+++ b/flashcards/src/main/java/com/vayunmathur/flashcards/ui/DeckListScreen.kt@@ -3,6 +3,7 @@ package com.vayunmathur.flashcards.ui import androidx.activity.compose.BackHandler import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.combinedClickable+import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth@@ -17,6 +18,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue+import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.res.pluralStringResource@@ -202,7 +204,9 @@ private fun DeckRow(                 if (summary.dueCount > 0 || summary.newCount > 0) {                     IconButton(onClick = onReview) { IconPlay() }                 }-                IconButton(onClick = {}, modifier = modifier) { IconDragHandle() }+                // Drag handle demoted from IconButton: not a button — the+                // caller's reorder modifier owns the gesture (NoDeadClick).+                Box(modifier = modifier.size(48.dp), contentAlignment = Alignment.Center) { IconDragHandle() }             }         },         modifier = Modifier.combinedClickable(onClick = onOpen, onLongClick = onLongPress),
flashcards/src/main/java/com/vayunmathur/flashcards/ui/NoteRowItem.kt
diff --git a/flashcards/src/main/java/com/vayunmathur/flashcards/ui/NoteRowItem.kt b/flashcards/src/main/java/com/vayunmathur/flashcards/ui/NoteRowItem.ktindex cff23a146b..bf7f4446e5 100644--- a/flashcards/src/main/java/com/vayunmathur/flashcards/ui/NoteRowItem.kt+++ b/flashcards/src/main/java/com/vayunmathur/flashcards/ui/NoteRowItem.kt@@ -2,16 +2,19 @@ package com.vayunmathur.flashcards.ui  import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.combinedClickable+import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable+import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier+import androidx.compose.ui.unit.dp import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource import com.vayunmathur.flashcards.R import com.vayunmathur.flashcards.ui.NoteRow import com.vayunmathur.library.ui.Checkbox-import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.IconDragHandle import com.vayunmathur.library.ui.ListItem import com.vayunmathur.library.ui.MaterialTheme@@ -60,7 +63,9 @@ fun NoteRowItem(                     Text(pluralStringResource(R.plurals.card_count_badge, row.cardCount, row.cardCount))                 }                 if (!selection.isActive && draggable) {-                    IconButton(onClick = {}, modifier = modifier) { IconDragHandle() }+                    // Drag handle demoted from IconButton: not a button — the+                    // caller's reorder modifier owns the gesture (NoDeadClick).+                    Box(modifier = modifier.size(48.dp), contentAlignment = Alignment.Center) { IconDragHandle() }                 }             }         },
flashcards/src/screenshotTest/kotlin/com/vayunmathur/flashcards/ui/MetadataPreviews.kt
diff --git a/flashcards/src/screenshotTest/kotlin/com/vayunmathur/flashcards/ui/MetadataPreviews.kt b/flashcards/src/screenshotTest/kotlin/com/vayunmathur/flashcards/ui/MetadataPreviews.ktindex 9e8428ead0..a05281719a 100644--- a/flashcards/src/screenshotTest/kotlin/com/vayunmathur/flashcards/ui/MetadataPreviews.kt+++ b/flashcards/src/screenshotTest/kotlin/com/vayunmathur/flashcards/ui/MetadataPreviews.kt@@ -26,7 +26,6 @@ import com.vayunmathur.flashcards.ui.ReviewUiState import com.vayunmathur.flashcards.ui.StatsActions import com.vayunmathur.flashcards.ui.StatsUiState import com.vayunmathur.library.ui.DynamicTheme-import java.time.LocalDate  /** Phone-shaped, roughly 1080x2340 at xxhdpi — comfortably above the F-Droid minimum. */ private const val PHONE = "spec:width=411dp,height=891dp,dpi=420"@@ -34,6 +33,9 @@ private const val PHONE = "spec:width=411dp,height=891dp,dpi=420" /** Expanded desktop/tablet window — comfortably above the 840dp expanded-width threshold. */ private const val EXPANDED = "spec:width=1280dp,height=800dp,dpi=240" +/** Fixed fixture "today" as an epoch day: 2026-01-17. */+private const val FIXED_TODAY_EPOCH_DAY = 20_470L+ /**  * Store listing images for `:flashcards`. See `common-conventions-preview-metadata`.  *@@ -135,7 +137,7 @@ class MetadataPreviews {     @Preview(name = "4-stats", device = PHONE, group = "phone", showSystemUi = true)     @Composable     fun Preview4Stats() {-        val today = LocalDate.now().toEpochDay()+        val today = FIXED_TODAY_EPOCH_DAY         val counts = listOf(6, 14, 9, 21, 3, 17, 11, 25, 8, 19, 13, 22, 7, 16)         val daily = counts.mapIndexed { i, c -> DailyStat(today - (counts.size - 1 - i), c) }         val forecast = (0 until 30).map { DailyStat(today + it, (it * 7 + 3) % 18) }
flashcards/src/test/java/com/vayunmathur/flashcards/ui/FlashcardsReviewStatsUiTest.kt
diff --git a/flashcards/src/test/java/com/vayunmathur/flashcards/ui/FlashcardsReviewStatsUiTest.kt b/flashcards/src/test/java/com/vayunmathur/flashcards/ui/FlashcardsReviewStatsUiTest.ktindex 2267a1561f..6e57ec30dd 100644--- a/flashcards/src/test/java/com/vayunmathur/flashcards/ui/FlashcardsReviewStatsUiTest.kt+++ b/flashcards/src/test/java/com/vayunmathur/flashcards/ui/FlashcardsReviewStatsUiTest.kt@@ -1,5 +1,7 @@ package com.vayunmathur.flashcards.ui +// FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch.+ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.ui.Modifier import androidx.compose.ui.test.assertIsDisplayed
flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsMiscTest.kt
diff --git a/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsMiscTest.kt b/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsMiscTest.ktindex a234479ba8..ba3f2cceeb 100644--- a/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsMiscTest.kt+++ b/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsMiscTest.kt@@ -1,4 +1,6 @@ package com.vayunmathur.flashcards.util++// FIXTURE RELATIVE-TIME EXCEPTION: generated ids/keys must be unique per call; their values are never asserted, only their distinctness is used. import com.vayunmathur.flashcards.platform.MediaStore import com.vayunmathur.flashcards.platform.ReviewReminder import com.vayunmathur.flashcards.platform.ReviewReminderWorker
flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsViewModelTest.kt
diff --git a/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsViewModelTest.kt b/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsViewModelTest.ktindex 2bf3219ad3..9f6cba8f92 100644--- a/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsViewModelTest.kt+++ b/flashcards/src/test/java/com/vayunmathur/flashcards/util/FlashcardsViewModelTest.kt@@ -1,4 +1,6 @@ package com.vayunmathur.flashcards.util++// FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.flashcards.domain.Grade import com.vayunmathur.flashcards.domain.Scheduler import com.vayunmathur.flashcards.platform.FlashcardsViewModel
library/ui/src/test/java/com/vayunmathur/library/ui/DropdownsSliceTest.kt
diff --git a/library/ui/src/test/java/com/vayunmathur/library/ui/DropdownsSliceTest.kt b/library/ui/src/test/java/com/vayunmathur/library/ui/DropdownsSliceTest.ktindex 2d8f19bddb..f6cbcc794f 100644--- a/library/ui/src/test/java/com/vayunmathur/library/ui/DropdownsSliceTest.kt+++ b/library/ui/src/test/java/com/vayunmathur/library/ui/DropdownsSliceTest.kt@@ -1,5 +1,7 @@ package com.vayunmathur.library.ui +// FIXTURE RELATIVE-TIME EXCEPTION: HistoryScrubberState.goNow()/tickNow() read the+// real wall clock, so the "not in the future" assertions must compare against it. import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText