From 2cfcac353816c95ca012543ae3eec83d6cd09cce Mon Sep 17 00:00:00 2001 From: wchwawa Date: Wed, 5 Aug 2026 10:34:16 +1000 Subject: [PATCH] fix: mobile horizontal overflow; redesign daily check-in modal - Header: theme selector becomes desktop-only; right controls no longer push past the viewport on phones - Bottom bar: min-w-0 flex children, tighter gaps/padding at small widths so Record/Journals/Assistant always fit 375px - Daily check-in: serif title + date, weather-style day-quality cards, emotion chips with pressed states, pill actions (visual only, same data flow) Co-Authored-By: Claude Fable 5 --- src/components/layout/bottom-bar.tsx | 12 +- src/components/layout/header.tsx | 7 +- .../components/daily-mood-modal.tsx | 133 +++++++++++------- 3 files changed, 96 insertions(+), 56 deletions(-) diff --git a/src/components/layout/bottom-bar.tsx b/src/components/layout/bottom-bar.tsx index aaf0f7d..330bd8b 100644 --- a/src/components/layout/bottom-bar.tsx +++ b/src/components/layout/bottom-bar.tsx @@ -22,7 +22,7 @@ const NAV_ITEMS = [ ]; const buttonBaseClass = - 'bg-card/95 backdrop-blur flex flex-1 items-center justify-center gap-2 rounded-2xl px-4 py-3 text-sm font-semibold shadow-lg shadow-black/10 ring-1 ring-border/40 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 hover:translate-y-[-1px]'; + 'bg-card/95 backdrop-blur flex min-w-0 flex-1 items-center justify-center gap-1.5 rounded-2xl px-2 py-3 text-sm font-semibold shadow-lg shadow-black/10 ring-1 ring-border/40 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 hover:translate-y-[-1px] sm:gap-2 sm:px-4'; export default function BottomBar() { const pathname = usePathname(); @@ -34,7 +34,7 @@ export default function BottomBar() { paddingBottom: 'calc(env(safe-area-inset-bottom, 0px) + 0.75rem)' }} > -
+
{NAV_ITEMS.map((item) => { const Icon = item.icon; const isActive = pathname.startsWith(item.href); @@ -50,8 +50,8 @@ export default function BottomBar() { 'border-primary/40 bg-primary text-primary-foreground shadow-lg' )} > - - {item.label} + + {item.label} ); })} @@ -72,8 +72,8 @@ function AgentButton() { onClick={() => setOpen(true)} className={cn(buttonBaseClass, 'text-primary hover:text-primary')} > - - Assistant + + Assistant diff --git a/src/components/layout/header.tsx b/src/components/layout/header.tsx index 871c0b1..d8ad053 100644 --- a/src/components/layout/header.tsx +++ b/src/components/layout/header.tsx @@ -32,13 +32,16 @@ export default function Header() {
-
+
- + {/* Too wide for phone headers; theme switching stays a desktop affordance. */} +
+ +
); diff --git a/src/features/daily-record/components/daily-mood-modal.tsx b/src/features/daily-record/components/daily-mood-modal.tsx index 0cd82e7..cc992cb 100644 --- a/src/features/daily-record/components/daily-mood-modal.tsx +++ b/src/features/daily-record/components/daily-mood-modal.tsx @@ -16,17 +16,16 @@ import { DialogDescription } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; -import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; -import { Label } from '@/components/ui/label'; -import { Checkbox } from '@/components/ui/checkbox'; +import { CloudRain, CloudSun, Sun } from 'lucide-react'; +import { cn } from '@/lib/utils'; import { createClient } from '@/lib/supabase/client'; import { getLocalDayRange } from '@/lib/timezone'; import { TablesInsert, Tables } from '@/types/supabase'; const DAY_QUALITY_OPTIONS = [ - { value: 'good', label: 'Good day' }, - { value: 'bad', label: 'Bad day' }, - { value: 'so-so', label: 'Just so so' } + { value: 'good', label: 'Good day', icon: Sun }, + { value: 'so-so', label: 'Just so so', icon: CloudSun }, + { value: 'bad', label: 'Bad day', icon: CloudRain } ]; const EMOTION_OPTIONS = ['Happy', 'Anxious', 'Anger', 'Sadness', 'Despair']; @@ -166,67 +165,105 @@ const DailyMoodModal = forwardRef( const isValid = dayQuality.length > 0; + const today = new Date().toLocaleDateString('en-US', { + weekday: 'long', + month: 'long', + day: 'numeric' + }); + return ( - - - Daily Check-in - - How was your day today? Please share your thoughts with us. - + + + + Daily Check-in + + {today}. Take five seconds.
{/* Question 1: Day Quality */} -
- - - {DAY_QUALITY_OPTIONS.map((option) => ( -
- - -
- ))} -
+
+

How was your day?

+
+ {DAY_QUALITY_OPTIONS.map((option) => { + const Icon = option.icon; + const selected = dayQuality === option.value; + return ( + + ); + })} +
{/* Question 2: Emotions */} -
- -
- {EMOTION_OPTIONS.map((emotion) => ( -
- - handleEmotionChange(emotion, checked as boolean) - } - /> -
-
+
-