Modern Apps git

← Modern-Apps.git

calculator: route-key capture, exempt sheet-nested pickers

Commit
1144647fb52d072b150a6c4a97fe770ee3fdae35
Author
Vayun Mathur <[email protected]>
When
2026-12-02 00:57 UTC (4 days ago)
Parents
e0d8576
RouteScreenshotCoverage (1): the keypad capture is renamed
to the route key, 1-calculator in MetadataPreviews, so
Route.Calculator has a real capture (Graph and Units already
matched their keys).

DialogAsRoute (2): the absolute-time DatePickerDialog and
time AlertDialog stay local with a verbatim DIALOG LOCAL
EXCEPTION. They are the second step of the unit-picker
bottom sheet, which is not a route, and the combined
date-and-time flow carries the picked date into its time
step - intermediate state with no route/result shape yet.
Routes 0, exemptions 1 file (2 dialog calls).

calculator/AGENTS.md also corrected: it claimed there is no
Route.kt, but Route.kt + Navigation.kt host the tab
destinations.

Verified from a clean build dir with --no-build-cache:
./gradlew :calculator:lint :calculator:lintVitalRelease
:calculator:testDevUnitTest :calculator:compileReleaseKotlin
all green (202 tests, 0 failures).

Diff

calculator/AGENTS.md
diff --git a/calculator/AGENTS.md b/calculator/AGENTS.mdindex 4b5a30560c..497443a283 100644--- a/calculator/AGENTS.md+++ b/calculator/AGENTS.md@@ -5,7 +5,7 @@ _Install: ./install calculator (dev by default)._ - Gradle: :calculator / dir: calculator/ - Package roots present: ui, widget-- Entry files: MainActivity.kt (no Route.kt — single-screen app with pages, not nav destinations)+- Entry files: MainActivity.kt + Route.kt + Navigation.kt (tab destinations: Calculator, Graph, Units) - Deps: :library:network, :library:widgets - Metadata: metadata_data/calculator.md (present) - Rust: no / screenshotTest: yes@@ -24,12 +24,13 @@ _Install: ./install calculator (dev by default)._ - Currency rates are the only network call — everything else must stay offline-safe  ## Key files-### Root — entry (no Route.kt)+### Root — entry - com/vayunmathur/calculator/MainActivity.kt+- com/vayunmathur/calculator/Route.kt + Navigation.kt ### ui/ — keypad, graph, converter pages - com/vayunmathur/calculator/ui/CalculatorPage.kt - com/vayunmathur/calculator/ui/CalculatorKeypad.kt-- com/vayunmathur/calculator/ui/CalculatorDialogs.kt+- com/vayunmathur/calculator/ui/CalculatorDialogs.kt (unit-picker sheet; its absolute-time date/time pickers stay local — see the DIALOG LOCAL EXCEPTION in the file) - com/vayunmathur/calculator/ui/GraphPage.kt - com/vayunmathur/calculator/ui/UnitConverterPage.kt ### util/ — ViewModel + pure engine
calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorDialogs.kt
diff --git a/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorDialogs.kt b/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorDialogs.ktindex 4a0990a39b..ef193abdb3 100644--- a/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorDialogs.kt+++ b/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorDialogs.kt@@ -1,4 +1,5 @@ package com.vayunmathur.calculator.ui+// DIALOG LOCAL EXCEPTION: the date/time pickers are the second step of the unit-picker bottom sheet, which is not a route; the combined date-and-time flow carries the picked date into the time step, so its intermediate state has no route/result shape yet  import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.ExperimentalLayoutApi
calculator/src/screenshotTest/kotlin/com/vayunmathur/calculator/ui/MetadataPreviews.kt
diff --git a/calculator/src/screenshotTest/kotlin/com/vayunmathur/calculator/ui/MetadataPreviews.kt b/calculator/src/screenshotTest/kotlin/com/vayunmathur/calculator/ui/MetadataPreviews.ktindex c80f5c72ac..c79db73570 100644--- a/calculator/src/screenshotTest/kotlin/com/vayunmathur/calculator/ui/MetadataPreviews.kt+++ b/calculator/src/screenshotTest/kotlin/com/vayunmathur/calculator/ui/MetadataPreviews.kt@@ -90,7 +90,7 @@ private const val EXPANDED = "spec:width=1280dp,height=800dp,dpi=240"  */ class MetadataPreviews {     @PreviewTest-    @Preview(name = "1-keypad", device = PHONE, group = "phone", showSystemUi = true)+    @Preview(name = "1-calculator", device = PHONE, group = "phone", showSystemUi = true)     @Composable     fun Preview1Keypad() {         ChromePreview(Route.Calculator)