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:
parent
e22cad1d86
commit
56876841c7
@ -17,7 +17,6 @@ import {
|
|||||||
DialogContent,
|
DialogContent,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogFooter,
|
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import CalendarSidebar from './CalendarSidebar';
|
import CalendarSidebar from './CalendarSidebar';
|
||||||
import EventForm from './EventForm';
|
import EventForm from './EventForm';
|
||||||
@ -369,24 +368,24 @@ export default function CalendarPage() {
|
|||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
This is a recurring event. How would you like to proceed?
|
This is a recurring event. How would you like to proceed?
|
||||||
</p>
|
</p>
|
||||||
<DialogFooter className="flex-col gap-2 sm:flex-col">
|
<div className="flex flex-col gap-2 mt-2">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="w-full"
|
className="w-full justify-center"
|
||||||
onClick={() => handleScopeChoice('this')}
|
onClick={() => handleScopeChoice('this')}
|
||||||
>
|
>
|
||||||
This event only
|
This event only
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="w-full"
|
className="w-full justify-center"
|
||||||
onClick={() => handleScopeChoice('this_and_future')}
|
onClick={() => handleScopeChoice('this_and_future')}
|
||||||
>
|
>
|
||||||
This and all future events
|
This and all future events
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
className="w-full"
|
className="w-full justify-center"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setScopeDialogOpen(false);
|
setScopeDialogOpen(false);
|
||||||
setScopeEvent(null);
|
setScopeEvent(null);
|
||||||
@ -394,7 +393,7 @@ export default function CalendarPage() {
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
</DialogFooter>
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -41,8 +41,18 @@ export default function DayBriefing({ upcomingItems, dashboardData, weatherData
|
|||||||
|
|
||||||
const parts: string[] = [];
|
const parts: string[] = [];
|
||||||
|
|
||||||
// Night (9PM–5AM): Focus on tomorrow
|
// Night (9PM–5AM): Show today if items remain, then preview tomorrow
|
||||||
if (hour >= 21 || hour < 5) {
|
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) {
|
if (tomorrowItems.length === 0) {
|
||||||
parts.push('Tomorrow is clear — nothing scheduled.');
|
parts.push('Tomorrow is clear — nothing scheduled.');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user