diff --git a/src/apps/calendar/CalendarFilters.tsx b/src/apps/calendar/CalendarFilters.tsx index 66eb513..edf9db7 100644 --- a/src/apps/calendar/CalendarFilters.tsx +++ b/src/apps/calendar/CalendarFilters.tsx @@ -80,13 +80,13 @@ export function CalendarFilters({ filters, onChange, authorError, resolvedAuthor set('authorInput', event.target.value)} aria-invalid={authorError || undefined} className="h-8 text-xs" /> - {authorError &&

Not a valid npub or hex pubkey.

} + {authorError &&

Not a valid npub, nprofile, or hex pubkey.

}
diff --git a/src/apps/calendar/MonthGrid.tsx b/src/apps/calendar/MonthGrid.tsx index ef61f9d..7009242 100644 --- a/src/apps/calendar/MonthGrid.tsx +++ b/src/apps/calendar/MonthGrid.tsx @@ -48,6 +48,13 @@ export function MonthGrid({ const todayKey = localDateKey(today); const cellRefs = useRef(new Map()); + // Exactly one cell must be tab-focusable, or a keyboard user who tabs away + // and back can never re-enter the grid. Prefer the selected day, then + // today if it's in the displayed month, and only otherwise fall back to + // the 1st — e.g. after PageUp/PageDown lands on a month with neither. + const isTodayInMonth = today.getFullYear() === monthAnchor.getFullYear() && today.getMonth() === monthIndex; + const focusKey = selectedDate ?? (isTodayInMonth ? todayKey : localDateKey(new Date(monthAnchor.getFullYear(), monthIndex, 1))); + const focusDate = (date: Date) => { const key = localDateKey(date); onSelectDate(key, { focus: true }); @@ -121,7 +128,7 @@ export function MonthGrid({ const isCurrentMonth = date.getMonth() === monthIndex; const isToday = key === todayKey; const isSelected = key === selectedDate; - const isFocusable = selectedDate ? isSelected : isToday && isCurrentMonth; + const isFocusable = key === focusKey; return (