Fix scope dialog button alignment and night briefing showing wrong day

- Replace DialogFooter with plain div for vertical button layout in scope dialog
- Add today's remaining items to night briefing (before 5 AM) before tomorrow preview

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kyle 2026-02-22 02:13:16 +08:00
parent e22cad1d86
commit 56876841c7
2 changed files with 16 additions and 7 deletions

View File

@ -17,7 +17,6 @@ import {
DialogContent,
DialogHeader,
DialogTitle,
DialogFooter,
} from '@/components/ui/dialog';
import CalendarSidebar from './CalendarSidebar';
import EventForm from './EventForm';
@ -369,24 +368,24 @@ export default function CalendarPage() {
<p className="text-sm text-muted-foreground">
This is a recurring event. How would you like to proceed?
</p>
<DialogFooter className="flex-col gap-2 sm:flex-col">
<div className="flex flex-col gap-2 mt-2">
<Button
variant="outline"
className="w-full"
className="w-full justify-center"
onClick={() => handleScopeChoice('this')}
>
This event only
</Button>
<Button
variant="outline"
className="w-full"
className="w-full justify-center"
onClick={() => handleScopeChoice('this_and_future')}
>
This and all future events
</Button>
<Button
variant="ghost"
className="w-full"
className="w-full justify-center"
onClick={() => {
setScopeDialogOpen(false);
setScopeEvent(null);
@ -394,7 +393,7 @@ export default function CalendarPage() {
>
Cancel
</Button>
</DialogFooter>
</div>
</DialogContent>
</Dialog>
</div>

View File

@ -41,8 +41,18 @@ export default function DayBriefing({ upcomingItems, dashboardData, weatherData
const parts: string[] = [];
// Night (9PM5AM): Focus on tomorrow
// Night (9PM5AM): Show today if items remain, then preview tomorrow
if (hour >= 21 || hour < 5) {
// Before 5 AM, "today" still matters — mention remaining items
if (todayItems.length > 0 && hour < 5) {
const remainingToday = todayEvents.filter((e) => isAfter(new Date(e.end_datetime), now));
if (remainingToday.length > 0) {
parts.push(`${remainingToday.length} event${remainingToday.length > 1 ? 's' : ''} still on today.`);
} else if (todayTodos.length > 0) {
parts.push(`${todayTodos.length} task${todayTodos.length > 1 ? 's' : ''} due today.`);
}
}
if (tomorrowItems.length === 0) {
parts.push('Tomorrow is clear — nothing scheduled.');
} else {