From ca01f6e72945764a6eece8f4b099136054a7067a Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Fri, 17 Jul 2026 16:01:08 +0200 Subject: [PATCH] fix(detail): keep the zone card's hierarchy matching the When card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The When card reads date-large, time-small-beneath. The zone card led with the original time at titleMedium and dropped the zone label to bodyMedium, inverting that — which made the foreign time the loudest thing on the screen and pulled attention off the local time the reader actually acts on. Put the label back on top and the original time small beneath it, so both cards read the same way and the original stays available without competing. The label already names the zone, so the range drops its "in New York" tail (and the string with it). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../calendula/ui/detail/EventDetailScreen.kt | 32 +++++++++---------- app/src/main/res/values/strings.xml | 3 -- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt index da5ccb8..61fad9f 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/detail/EventDetailScreen.kt @@ -453,16 +453,20 @@ private fun EventDetailContent(state: EventDetailUiState.Success, modifier: Modi } // Time zone — only when the event is timed and pinned to a zone other - // than the device's, so cross-zone events read unambiguously. The card - // above already answers "when is this for me"; this one answers "when - // was it set", which the zone's name alone never did — an 8 AM New York - // call showing as 2 PM here should still say 8 AM somewhere. + // than the device's, so cross-zone events read unambiguously. It answers + // "when was it set", which the zone's name alone never did: an 8 AM New + // York call showing as 2 PM here should still say 8 AM somewhere. + // + // Same hierarchy as the When card above — the label carries the card, + // the time sits small beneath it. The local time is the one the reader + // acts on, so the original must stay quieter than it, not compete. foreignTimeZoneLabel(detail.eventTimezone, instance.isAllDay, locale)?.let { tzLabel -> Spacer(Modifier.height(gap)) DetailCard( icon = Icons.Default.Public, iconContentDescription = stringResource(R.string.event_detail_timezone), ) { + Text(text = tzLabel, style = MaterialTheme.typography.titleMedium) val originalZone = detail.eventTimezone?.let { tz -> runCatching { TimeZone.of(tz) }.getOrNull() } @@ -473,21 +477,15 @@ private fun EventDetailContent(state: EventDetailUiState.Success, modifier: Modi // the primary instead, so fall back to it rather than // dropping the original time entirely. val (primary, secondary) = formatWhen(instance, originalZone, locale) - Text( - text = stringResource( - R.string.event_detail_timezone_original, - secondary ?: primary, - originalZone.id.substringAfterLast('/').replace('_', ' '), - ), - style = MaterialTheme.typography.titleMedium, - ) Spacer(Modifier.height(2.dp)) + Text( + // The label above already names the zone, so the range + // needs no "in New York" tail to be unambiguous here. + text = secondary ?: primary, + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) } - Text( - text = tzLabel, - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 16cfe3d..eb03dd9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -111,9 +111,6 @@ the same event expressed where the user actually is. %1$s is a time range, e.g. "2:00 PM – 3:00 PM". --> %1$s your time - - %1$s in %2$s Color