From 5375ba90a8e4318a6f5eff5fcb686126185fb720 Mon Sep 17 00:00:00 2001 From: null Date: Tue, 30 Jun 2026 18:14:23 -0500 Subject: [PATCH] feat(date-memories): add date reflection nudge card to HomeScreen --- .../java/app/closer/ui/home/HomeScreen.kt | 39 ++++++++++++++++--- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/app/closer/ui/home/HomeScreen.kt b/app/src/main/java/app/closer/ui/home/HomeScreen.kt index a81d1a90..eb18e986 100644 --- a/app/src/main/java/app/closer/ui/home/HomeScreen.kt +++ b/app/src/main/java/app/closer/ui/home/HomeScreen.kt @@ -251,6 +251,7 @@ private fun HomeCallbacks.toActionHandler(onNavigate: (String) -> Unit): (HomeAc HomeActionTarget.Challenge -> onNavigate(AppRoute.CONNECTION_CHALLENGES) HomeActionTarget.DatePlan -> onNavigate(AppRoute.DATE_MATCHES) HomeActionTarget.MemoryCapsule -> onNavigate(AppRoute.MEMORY_LANE) + HomeActionTarget.DateMemories -> onNavigate(AppRoute.DATE_MEMORIES) } } @@ -416,6 +417,7 @@ private fun homeActionGlyph(target: HomeActionTarget): Int = when (target) { HomeActionTarget.Challenge -> R.drawable.glyph_connection_challenge HomeActionTarget.DatePlan -> R.drawable.glyph_date_card_heart HomeActionTarget.MemoryCapsule -> R.drawable.glyph_memory_capsule + HomeActionTarget.DateMemories -> R.drawable.glyph_date_replay } @Composable @@ -715,6 +717,16 @@ private fun PartnerQuickActionsSheet( if (state.togetherSince > 0L) add("together since ${formatMonthYear(state.togetherSince)}") }.joinToString(" ยท ") } + // Living "today" status โ€” reflects where the couple is in the daily ritual. Hidden when there's no + // question assigned (no misleading "still open"). + val todayStatus = state.dailyQuestion?.let { + when (state.dailyQuestionState) { + DailyQuestionState.BOTH_ANSWERED, DailyQuestionState.REVEALED -> "You've both answered today ๐Ÿ’œ" + DailyQuestionState.PARTNER_ANSWERED_USER_PENDING -> "They answered โ€” your turn" + DailyQuestionState.USER_ANSWERED_PARTNER_PENDING -> "Waiting on their answer" + DailyQuestionState.UNANSWERED -> "Tonight's question is still open" + } + } val openPartnerPage = { onNavigate(AppRoute.PARTNER_HOME); onDismiss() } ModalBottomSheet(onDismissRequest = onDismiss, sheetState = sheetState) { @@ -757,26 +769,36 @@ private fun PartnerQuickActionsSheet( overflow = TextOverflow.Ellipsis ) } + todayStatus?.let { + Text( + text = it, + style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Medium), + color = MaterialTheme.colorScheme.primary, + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + } } } Divider(modifier = Modifier.padding(vertical = 4.dp), thickness = 0.5.dp) - PartnerSheetAction("๐Ÿ’œ", "Thinking of you", enabled = !state.isSendingNudge, onClick = onThinkingOfYou) - PartnerSheetAction("๐Ÿ’ฌ", "Message") { onNavigate(AppRoute.MESSAGES); onDismiss() } + PartnerSheetAction(R.drawable.glyph_heart, "Thinking of you", enabled = !state.isSendingNudge, onClick = onThinkingOfYou) + PartnerSheetAction(R.drawable.glyph_chat, "Message") { onNavigate(AppRoute.MESSAGES); onDismiss() } PartnerSheetAction( - "โœจ", + R.drawable.glyph_paired_cards, "Together", trailing = state.unreadActivityCount.takeIf { it > 0 }?.let { if (it > 9) "9+" else "$it" } ) { onNavigate(AppRoute.ACTIVITY); onDismiss() } - PartnerSheetAction("โš™๏ธ", "Your relationship") { onNavigate(AppRoute.RELATIONSHIP_SETTINGS); onDismiss() } + PartnerSheetAction(R.drawable.glyph_memory_capsule, "Our memories") { onNavigate(AppRoute.MEMORY_LANE); onDismiss() } + PartnerSheetAction(R.drawable.glyph_settings, "Your relationship") { onNavigate(AppRoute.RELATIONSHIP_SETTINGS); onDismiss() } } } } @Composable private fun PartnerSheetAction( - emoji: String, + @DrawableRes iconRes: Int, label: String, enabled: Boolean = true, trailing: String? = null, @@ -791,7 +813,12 @@ private fun PartnerSheetAction( horizontalArrangement = Arrangement.spacedBy(16.dp), verticalAlignment = Alignment.CenterVertically ) { - Text(text = emoji, style = MaterialTheme.typography.titleMedium) + HomeGlyphIcon( + resId = iconRes, + contentDescription = null, + tint = MaterialTheme.colorScheme.primary, + modifier = Modifier.size(22.dp) + ) Text( text = label, modifier = Modifier.weight(1f),