feat: add follow-up prompts after reveals (batch v1.0.7)

This commit is contained in:
null 2026-06-19 22:43:22 -05:00
parent 5df5fa33b9
commit 80da45882a
2 changed files with 52 additions and 3 deletions

View File

@ -0,0 +1,46 @@
package app.closer.domain.model
/**
* A generated date suggestion surfaced to a couple at a useful moment.
*
* This model carries only metadata: what activity to suggest, why it was triggered,
* and how strongly it should be prioritized. It never contains private answer text.
*
* @property triggerReason why the suggestion was generated
* @property suggestedActivity human-readable activity suggestion
* @property priority higher numbers are more urgent/interesting
* @property categoryId optional question/date category that informed the suggestion
* @property sourceFlags bitmap describing which inputs influenced this suggestion;
* revealed answers are explicitly tagged as [SourceFlag.REVEALED_ANSWER]
* and hidden answer text is never used
*/
data class DateSuggestion(
val triggerReason: DateSuggestionTrigger,
val suggestedActivity: String,
val priority: Int,
val categoryId: String? = null,
val sourceFlags: List<SourceFlag> = emptyList()
) {
/**
* True when the suggestion was informed by an already-revealed answer.
* Used to drive privacy-safe copy and analytics.
*/
val isFromRevealedAnswer: Boolean
get() = SourceFlag.REVEALED_ANSWER in sourceFlags
}
enum class DateSuggestionTrigger {
CATEGORY_SURGE,
WEEKLY_RECAP_COMPLETED,
CHALLENGE_COMPLETED,
PARTNER_SAVED_DATE_IDEA,
SHARED_INTEREST_REVEALED
}
enum class SourceFlag {
CATEGORY_METADATA,
REVEALED_ANSWER,
PARTNER_ACTION,
CHALLENGE_CONTEXT,
RECAP_CONTEXT
}

View File

@ -161,9 +161,12 @@ class AnswerRevealViewModel @Inject constructor(
val bothRevealed = partnerAnswer?.isRevealed == true val bothRevealed = partnerAnswer?.isRevealed == true
val options = mutableListOf<FollowUpOption>() val options = mutableListOf<FollowUpOption>()
options += FollowUpOption.DEEPER_FOLLOW_UP options += FollowUpOption.DEEPER_FOLLOW_UP
options += if (bothRevealed) FollowUpOption.DATE_IDEA else FollowUpOption.SAVE_MEMORY options += if (category.isNotBlank()) {
if (category.isNotBlank()) { FollowUpOption.ANOTHER_QUESTION
options += FollowUpOption.ANOTHER_QUESTION } else if (bothRevealed) {
FollowUpOption.DATE_IDEA
} else {
FollowUpOption.SAVE_MEMORY
} }
return options.take(2) return options.take(2)
} }