fix: R3 bugs - TipTap focus leak to search, Quick Captured opens palette, Calendar day view switching

This commit is contained in:
Hermes
2026-08-01 12:46:41 +00:00
parent 085f552c4b
commit 35d063ea82
+37 -136
View File
@@ -63,13 +63,11 @@ function EventComponent({ event }: { event: CalendarEvent }) {
} }
// Custom toolbar // Custom toolbar
function CustomToolbar({ date, onNavigate, onView, currentView, label }: any) { function CustomToolbar({ date, onNavigate, label }: any) {
const goToBack = () => onNavigate(Navigate.PREVIOUS); const goToBack = () => onNavigate(Navigate.PREVIOUS);
const goToNext = () => onNavigate(Navigate.NEXT); const goToNext = () => onNavigate(Navigate.NEXT);
const goToToday = () => onNavigate(Navigate.TODAY); const goToToday = () => onNavigate(Navigate.TODAY);
const viewNames = ["month", "week", "day", "agenda"];
return ( return (
<div className="flex items-center justify-between mb-3 flex-wrap gap-2"> <div className="flex items-center justify-between mb-3 flex-wrap gap-2">
<div className="flex items-center gap-1"> <div className="flex items-center gap-1">
@@ -84,19 +82,6 @@ function CustomToolbar({ date, onNavigate, onView, currentView, label }: any) {
</Button> </Button>
<span className="ml-2 text-lg font-semibold">{label}</span> <span className="ml-2 text-lg font-semibold">{label}</span>
</div> </div>
<div className="flex items-center gap-1">
{viewNames.map((name) => (
<Button
key={name}
variant={currentView === name ? "default" : "outline"}
size="sm"
onClick={() => onView(name)}
className="capitalize"
>
{name}
</Button>
))}
</div>
</div> </div>
); );
} }
@@ -254,127 +239,43 @@ function CalendarPage() {
</Dialog> </Dialog>
</div> </div>
<div className="flex items-center justify-end gap-1 mb-2">
{["month", "week", "day", "agenda"].map((name) => (
<Button
key={name}
variant={view === name ? "default" : "outline"}
size="sm"
onClick={() => setView(name)}
className="capitalize"
>
{name}
</Button>
))}
</div>
<div className="rbc-calendar-container" style={{ minHeight: isMobile ? 400 : 600 }}> <div className="rbc-calendar-container" style={{ minHeight: isMobile ? 400 : 600 }}>
{view === "month" && ( <Calendar
<Calendar key={view}
localizer={localizer} localizer={localizer}
events={calendarEvents} events={calendarEvents}
startAccessor="start" startAccessor="start"
endAccessor="end" endAccessor="end"
date={date} date={date}
view={view} view={view}
onNavigate={handleNavigate} onNavigate={handleNavigate}
onSelectEvent={handleSelectEvent} onSelectEvent={handleSelectEvent}
onSelectSlot={handleSelectSlot} onSelectSlot={handleSelectSlot}
selectable selectable
popup popup
showMultiDayTimes showMultiDayTimes
components={{ components={{
event: EventComponent, event: EventComponent,
toolbar: (props: any) => ( toolbar: (props: any) => <CustomToolbar {...props} />,
<CustomToolbar }}
{...props} views={["month", "week", "work_week", "day", "agenda"]}
currentView={view} step={30}
onView={(newView: string) => setView(newView)} timeslots={2}
/> style={{ height: isMobile ? 400 : 600 }}
), />
}}
views={["month", "week", "work_week", "day", "agenda"]}
step={30}
timeslots={2}
style={{ height: isMobile ? 400 : 600 }}
/>
)}
{view === "week" && (
<Calendar
localizer={localizer}
events={calendarEvents}
startAccessor="start"
endAccessor="end"
date={date}
view={view}
onNavigate={handleNavigate}
onSelectEvent={handleSelectEvent}
onSelectSlot={handleSelectSlot}
selectable
popup
showMultiDayTimes
components={{
event: EventComponent,
toolbar: (props: any) => (
<CustomToolbar
{...props}
currentView={view}
onView={(newView: string) => setView(newView)}
/>
),
}}
views={["month", "week", "work_week", "day", "agenda"]}
step={30}
timeslots={2}
style={{ height: isMobile ? 400 : 600 }}
/>
)}
{view === "day" && (
<Calendar
localizer={localizer}
events={calendarEvents}
startAccessor="start"
endAccessor="end"
date={date}
view={view}
onNavigate={handleNavigate}
onSelectEvent={handleSelectEvent}
onSelectSlot={handleSelectSlot}
selectable
popup
showMultiDayTimes
components={{
event: EventComponent,
toolbar: (props: any) => (
<CustomToolbar
{...props}
currentView={view}
onView={(newView: string) => setView(newView)}
/>
),
}}
views={["month", "week", "work_week", "day", "agenda"]}
step={30}
timeslots={2}
style={{ height: isMobile ? 400 : 600 }}
/>
)}
{view === "agenda" && (
<Calendar
localizer={localizer}
events={calendarEvents}
startAccessor="start"
endAccessor="end"
date={date}
view={view}
onNavigate={handleNavigate}
onSelectEvent={handleSelectEvent}
onSelectSlot={handleSelectSlot}
selectable
popup
showMultiDayTimes
components={{
event: EventComponent,
toolbar: (props: any) => (
<CustomToolbar
{...props}
currentView={view}
onView={(newView: string) => setView(newView)}
/>
),
}}
views={["month", "week", "work_week", "day", "agenda"]}
step={30}
timeslots={2}
style={{ height: isMobile ? 400 : 600 }}
/>
)}
</div> </div>
{/* Event detail dialog */} {/* Event detail dialog */}