Add mood-specific selectable chip answers to guided reflection flow

Reduces friction in the guided reflection by offering predefined tappable
chip answers tailored to each mood category's therapeutic framework:
- Positive (Behavioral Activation): savoring emotions + reinforcing actions
- Neutral (ACT Cognitive Defusion): ambivalent feelings + defusion reframes + values
- Negative (CBT Thought Record): automatic negative thoughts + compassionate reframes + grounding actions

Chips appear between the question and text editor. Tapping toggles selection
and auto-fills the text field. "More" expander reveals additional options.
Free text always remains available alongside chips.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trey T
2026-03-21 13:37:55 -05:00
parent 4a4ea9efaa
commit 8ae8d23f95
5 changed files with 623 additions and 0 deletions

View File

@@ -185,6 +185,15 @@ struct GuidedReflectionView: View {
.accessibilityIdentifier(AccessibilityID.GuidedReflection.questionLabel(step: currentStep))
.id("question_\(currentStep)")
if let chips = QuestionChips.chips(for: reflection.moodCategory, questionIndex: currentStep) {
ChipSelectionView(
chips: chips,
accentColor: moodTint.color(forMood: entry.mood),
selectedChips: $reflection.responses[currentStep].selectedChips,
textAnswer: $reflection.responses[currentStep].answer
)
}
TextEditor(text: $reflection.responses[currentStep].answer)
.focused($isTextFieldFocused)
.frame(minHeight: 120, maxHeight: 200)