taxi: expand the driver card when a driver is assigned
- Commit
ba09f947e81bb657fc6a1c4f7e7977625f59defe- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-05 16:25 UTC (15 hours ago)
- Parents
ef61817
DriverCard returned early until a driver or vehicle existed, so the card mounted in a cut in the tracking sheet. It now opens through ExpandVisibility when the assignment arrives; its contents already read the driver/vehicle null-safely. Wrap abrupt conditional content in the shared library.ui motion helpers so it expands/fades/pops in instead of popping in cut, and closes up cleanly when it goes away. No raw androidx.compose. animation is used at the call site, per the fatal DirectCompose Animation lint; durations and easing come from the helpers' MaterialTheme motion-scheme defaults. Verified in this worktree with lint, lintVitalRelease and testDevUnitTest for the module (details in the session report; any pre-existing failure was reproduced on the pristine base).
Diff
taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingCards.kt
diff --git a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingCards.kt b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingCards.ktindex 3db15a11a0..d17d9a370f 100644--- a/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingCards.kt+++ b/taxi/src/main/java/com/vayunmathur/taxi/ui/RideTrackingCards.kt@@ -23,6 +23,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import com.vayunmathur.library.image.compose.AsyncImage import com.vayunmathur.library.ui.Card+import com.vayunmathur.library.ui.ExpandVisibility import com.vayunmathur.library.ui.IconPerson import com.vayunmathur.library.ui.IconStar import com.vayunmathur.library.ui.LinearProgressIndicator@@ -77,8 +78,7 @@ internal fun StatusHeader(ride: ActiveRide, ended: Boolean) { internal fun DriverCard(ride: ActiveRide, onCall: (String) -> Unit) { val driver = ride.driver val vehicle = ride.vehicle- if (driver == null && vehicle == null) return-+ ExpandVisibility(visible = driver != null || vehicle != null) { Card(Modifier.fillMaxWidth()) { Column(Modifier.padding(12.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { Row(verticalAlignment = Alignment.CenterVertically) {@@ -162,6 +162,7 @@ internal fun DriverCard(ride: ActiveRide, onCall: (String) -> Unit) { } } }+ } } internal fun statusLabel(status: RideStatus, ended: Boolean): Int = when {