Modern Apps git

← Modern-Apps.git

measure: name route captures and add diagnostics capture

Commit
f844989ed90113301246f14176c5a42cb6cd0690
Author
Vayun Mathur <[email protected]>
When
2026-12-02 01:02 UTC (4 days ago)
Parents
c4676c8
Every measure route already rendered from a stateless Content
composable in the phone previews, but the previews carried no
Preview name, so RouteScreenshotCoverage could not attribute them
to their routes (Compass, Level, Ruler, ArMeasure, Settings), and
Diagnostics had no capture at all.

PhonePreviews Preview1..Preview6 gain the route-naming
1-compass, 2-level, 3-ruler, 4-ar-measure, 5-saved and 6-settings
names (keeping their phone group and fixed literal fixtures), and
Preview8Diagnostics renders DiagnosticsContent from a fixed
DiagnosticsUiState (184 features, 152 tracked, 29.8 Hz frame rate,
loaded native engine, 0.87 scale confidence) with
DiagnosticsActions.Noop, as 8-diagnostics on the phone bucket. The
existing 7-saved-expanded tablet capture already covered Saved and
is unchanged. No route is exempted, and no fixture reads a clock,
sensor or random source.

measure/AGENTS.md needs no change: no documented file is added,
removed or renamed; only screenshot preview attributes and one
additional preview in the existing MetadataPreviews.kt changed.

Verified: ./gradlew :measure:lint :measure:lintVitalRelease
:measure:testDevUnitTest (96 tests, 0 failures)
:measure:compileReleaseKotlin all green, plus
:measure:compileDevScreenshotTestKotlin green.

Diff

measure/src/screenshotTest/kotlin/com/vayunmathur/measure/MetadataPreviews.kt
diff --git a/measure/src/screenshotTest/kotlin/com/vayunmathur/measure/MetadataPreviews.kt b/measure/src/screenshotTest/kotlin/com/vayunmathur/measure/MetadataPreviews.ktindex d7b807985d..bfdcab7ddd 100644--- a/measure/src/screenshotTest/kotlin/com/vayunmathur/measure/MetadataPreviews.kt+++ b/measure/src/screenshotTest/kotlin/com/vayunmathur/measure/MetadataPreviews.kt@@ -19,12 +19,15 @@ import com.vayunmathur.measure.platform.SavedActions import com.vayunmathur.measure.platform.SavedUiState import com.vayunmathur.measure.platform.SettingsActions import com.vayunmathur.measure.platform.SettingsUiState+import com.vayunmathur.measure.platform.DiagnosticsActions+import com.vayunmathur.measure.platform.DiagnosticsUiState import com.vayunmathur.measure.ui.ArMeasureContent import com.vayunmathur.measure.ui.CompassContent import com.vayunmathur.measure.ui.LevelContent import com.vayunmathur.measure.ui.RulerContent import com.vayunmathur.measure.ui.SavedMeasurementsContent import com.vayunmathur.measure.ui.SettingsContent+import com.vayunmathur.measure.ui.DiagnosticsContent  /**  * Store listing screenshots, rendered from Compose previews rather than an instrumented@@ -36,7 +39,7 @@ private const val EXPANDED = "spec:width=1280dp,height=800dp,dpi=240"  class PhonePreviews {     @PreviewTest-    @Preview(showBackground = true, widthDp = 412, heightDp = 915, group = "phone")+    @Preview(name = "1-compass", showBackground = true, widthDp = 412, heightDp = 915, group = "phone")     @Composable     fun Preview1Compass() {         DynamicTheme {@@ -53,7 +56,7 @@ class PhonePreviews {     }      @PreviewTest-    @Preview(showBackground = true, widthDp = 412, heightDp = 915, group = "phone")+    @Preview(name = "2-level", showBackground = true, widthDp = 412, heightDp = 915, group = "phone")     @Composable     fun Preview2Level() {         DynamicTheme {@@ -65,7 +68,7 @@ class PhonePreviews {     }      @PreviewTest-    @Preview(showBackground = true, widthDp = 412, heightDp = 915, group = "phone")+    @Preview(name = "3-ruler", showBackground = true, widthDp = 412, heightDp = 915, group = "phone")     @Composable     fun Preview3Ruler() {         DynamicTheme {@@ -74,7 +77,7 @@ class PhonePreviews {     }      @PreviewTest-    @Preview(showBackground = true, widthDp = 412, heightDp = 915, group = "phone")+    @Preview(name = "4-ar-measure", showBackground = true, widthDp = 412, heightDp = 915, group = "phone")     @Composable     fun Preview4ArMeasure() {         DynamicTheme {@@ -95,7 +98,7 @@ class PhonePreviews {     }      @PreviewTest-    @Preview(showBackground = true, widthDp = 412, heightDp = 915, group = "phone")+    @Preview(name = "5-saved", showBackground = true, widthDp = 412, heightDp = 915, group = "phone")     @Composable     fun Preview5Saved() {         DynamicTheme {@@ -113,7 +116,7 @@ class PhonePreviews {     }      @PreviewTest-    @Preview(showBackground = true, widthDp = 412, heightDp = 915, group = "phone")+    @Preview(name = "6-settings", showBackground = true, widthDp = 412, heightDp = 915, group = "phone")     @Composable     fun Preview6Settings() {         DynamicTheme {@@ -123,6 +126,29 @@ class PhonePreviews {             )         }     }++    @PreviewTest+    @Preview(name = "8-diagnostics", showBackground = true, widthDp = 412, heightDp = 915, group = "phone")+    @Composable+    fun Preview8Diagnostics() {+        DynamicTheme {+            DiagnosticsContent(+                state = DiagnosticsUiState(+                    featureCount = 184,+                    trackedCount = 152,+                    imuRateHz = 208.0,+                    frameRateHz = 29.8,+                    timestampSkewMs = 1.2,+                    nativeEngineAvailable = true,+                    focalPx = 1480.0,+                    principalPointPx = 540.0 to 1170.0,+                    landmarkCount = 12,+                    scaleConfidence = 0.87,+                ),+                actions = DiagnosticsActions.Noop,+            )+        }+    } }  class ExpandedPreviews {