Phase 3: complex component mobile adaptations
3a. CalendarSidebar mobile collapse: - Desktop sidebar + resize handle hidden below lg breakpoint - Mobile Sheet overlay with PanelLeft toggle in toolbar - Template selection closes mobile sidebar automatically 3b. KanbanBoard touch support: - TouchSensor added alongside PointerSensor (200ms delay) - Column min-width reduced on mobile (160px vs 200px) - iOS smooth scroll enabled on horizontal container 3c. EntityTable mobile card view: - mobileCardRender optional prop renders cards instead of table on mobile - PeoplePage: card with name, category, email, phone - LocationsPage: card with name, category, address - TodosPage/RemindersPage use custom list components, not EntityTable 3d. DatePicker mobile bottom sheet: - Renders as full-width bottom sheet on mobile (< 768px) - Safe area inset padding for iOS home indicator - Desktop positioned dropdown unchanged Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d8f7f7ac92
commit
b05adf7f12
@ -8,7 +8,7 @@ import dayGridPlugin from '@fullcalendar/daygrid';
|
||||
import timeGridPlugin from '@fullcalendar/timegrid';
|
||||
import interactionPlugin from '@fullcalendar/interaction';
|
||||
import type { EventClickArg, DateSelectArg, EventDropArg, DatesSetArg } from '@fullcalendar/core';
|
||||
import { ChevronLeft, ChevronRight, Plus, Search } from 'lucide-react';
|
||||
import { ChevronLeft, ChevronRight, PanelLeft, Plus, Search } from 'lucide-react';
|
||||
import api, { getErrorMessage } from '@/lib/api';
|
||||
import axios from 'axios';
|
||||
import type { CalendarEvent, EventTemplate, Location as LocationType, CalendarPermission } from '@/types';
|
||||
@ -17,6 +17,7 @@ import { useSettings } from '@/hooks/useSettings';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Select } from '@/components/ui/select';
|
||||
import { Sheet, SheetContent } from '@/components/ui/sheet';
|
||||
import CalendarSidebar from './CalendarSidebar';
|
||||
import EventDetailPanel from './EventDetailPanel';
|
||||
import type { CreateDefaults } from './EventDetailPanel';
|
||||
@ -164,6 +165,8 @@ export default function CalendarPage() {
|
||||
|
||||
// Track desktop breakpoint to prevent dual EventDetailPanel mount
|
||||
const isDesktop = useMediaQuery('(min-width: 1024px)');
|
||||
const isMobile = useMediaQuery('(max-width: 1023px)');
|
||||
const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
|
||||
|
||||
// Continuously resize calendar during panel open/close CSS transition
|
||||
useEffect(() => {
|
||||
@ -471,15 +474,28 @@ export default function CalendarPage() {
|
||||
|
||||
return (
|
||||
<div className="flex h-full overflow-hidden animate-fade-in">
|
||||
<div className="hidden lg:flex lg:flex-row shrink-0">
|
||||
<CalendarSidebar ref={sidebarRef} onUseTemplate={handleUseTemplate} onSharedVisibilityChange={setVisibleSharedIds} width={sidebarWidth} />
|
||||
<div
|
||||
onMouseDown={handleSidebarMouseDown}
|
||||
className="w-1 shrink-0 cursor-col-resize hover:bg-accent/30 active:bg-accent/50 transition-colors duration-150"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{isMobile && (
|
||||
<Sheet open={mobileSidebarOpen} onOpenChange={setMobileSidebarOpen}>
|
||||
<SheetContent className="w-72 p-0">
|
||||
<CalendarSidebar onUseTemplate={(tmpl) => { setMobileSidebarOpen(false); handleUseTemplate(tmpl); }} onSharedVisibilityChange={setVisibleSharedIds} width={288} />
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
)}
|
||||
|
||||
<div ref={calendarContainerRef} className="flex-1 flex flex-col overflow-hidden">
|
||||
{/* Custom toolbar */}
|
||||
<div className="border-b bg-card px-4 md:px-6 min-h-[4rem] flex items-center gap-2 md:gap-4 flex-wrap py-2 md:py-0 md:h-16 md:flex-nowrap shrink-0">
|
||||
<Button variant="ghost" size="icon" className="h-8 w-8 lg:hidden" onClick={() => setMobileSidebarOpen(true)}>
|
||||
<PanelLeft className="h-4 w-4" />
|
||||
</Button>
|
||||
<div className="flex items-center gap-1">
|
||||
<Button variant="ghost" size="icon" className="h-8 w-8" onClick={navigatePrev}>
|
||||
<ChevronLeft className="h-4 w-4" />
|
||||
|
||||
@ -53,7 +53,7 @@ function KanbanColumn({
|
||||
return (
|
||||
<div
|
||||
ref={setNodeRef}
|
||||
className={`flex-1 min-w-[200px] rounded-lg border transition-colors duration-150 ${
|
||||
className={`flex-1 min-w-[160px] md:min-w-[200px] rounded-lg border transition-colors duration-150 ${
|
||||
isOver ? 'border-accent/40 bg-accent/5' : 'border-border bg-card/50'
|
||||
}`}
|
||||
>
|
||||
@ -200,7 +200,7 @@ export default function KanbanBoard({
|
||||
collisionDetection={closestCorners}
|
||||
onDragEnd={handleDragEnd}
|
||||
>
|
||||
<div className="flex gap-3 overflow-x-auto pb-2">
|
||||
<div className="flex gap-3 overflow-x-auto pb-2" style={{ WebkitOverflowScrolling: "touch" }}>
|
||||
{tasksByStatus.map(({ column, tasks: colTasks }) => (
|
||||
<KanbanColumn
|
||||
key={column.id}
|
||||
|
||||
@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { Calendar, ChevronLeft, ChevronRight, Clock } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useMediaQuery } from '@/hooks/useMediaQuery';
|
||||
|
||||
// ── Browser detection (stable — checked once at module load) ──
|
||||
|
||||
@ -127,6 +128,7 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
||||
const blurTimeoutRef = React.useRef<ReturnType<typeof setTimeout>>();
|
||||
|
||||
const [pos, setPos] = React.useState<{ top: number; left: number }>({ top: 0, left: 0 });
|
||||
const isMobile = useMediaQuery('(max-width: 767px)');
|
||||
|
||||
React.useImperativeHandle(ref, () => triggerRef.current!);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user