Skip to content

Commit ee99c2e

Browse files
committed
fix: iOS layout — blank header, hidden FAB, and sheet snap position
- Index.tsx: pass title/icon to PageLayout so IosPageHeader shows "Dashboard" in the center nav bar; remove the page's own inline h1 which was doubling the heading and leaving the iOS header blank - NewTaskForm: add fab-nav-offset CSS class so the floating + button clears the MobileNav (64px) plus safe-area-inset-bottom on iOS; was hidden behind the nav at the previous bottom-20 (80px) offset - adaptive-dialog: control vaul activeSnapPoint so drawers open at the first snap point immediately rather than requiring the user to swipe up from a near-zero peek height; resets to snapPoints[0] each time the dialog opens - pwa.css: add .fab-nav-offset rule under @supports iOS selector https://claude.ai/code/session_014br3fcYa3SDmGjBHnDYZec
1 parent 07b4466 commit ee99c2e

4 files changed

Lines changed: 26 additions & 11 deletions

File tree

public/pwa.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ body {
220220
overscroll-behavior: contain;
221221
}
222222

223+
/* Lift the floating action button above the mobile nav + home indicator on iOS */
224+
@supports (-webkit-touch-callout: none) {
225+
.fab-nav-offset {
226+
bottom: calc(5rem + env(safe-area-inset-bottom, 0px)) !important;
227+
}
228+
}
229+
223230
/* iOS page transition: subtle slide-in from the right on route change */
224231
@supports (-webkit-touch-callout: none) {
225232
.page-transition-enter {

src/components/NewTaskForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const NewTaskForm: React.FC<NewTaskFormProps> = ({ onSubmit, defaultOpen
6868
<Button
6969
variant="default"
7070
onClick={() => setIsOpen(true)}
71-
className="fixed bottom-20 md:bottom-6 right-6 w-16 h-16 rounded-full text-white text-md shadow-2xl hover:shadow-3xl transition-all duration-200 flex items-center justify-center z-50 hover:scale-110"
71+
className="fixed bottom-20 fab-nav-offset md:bottom-6 right-6 w-16 h-16 rounded-full text-white text-md shadow-2xl hover:shadow-3xl transition-all duration-200 flex items-center justify-center z-50 hover:scale-110"
7272
aria-label="New Task"
7373
>
7474
<Plus style={{ fontSize: "1.5rem", width: "1.5rem", height: "1.5rem" }} />

src/components/ui/adaptive-dialog.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,25 @@ export const AdaptiveDialog = ({
3232
children,
3333
snapPoints,
3434
}: AdaptiveDialogProps) => {
35+
const [activeSnapPoint, setActiveSnapPoint] = React.useState<number | string | null>(
36+
snapPoints?.[0] ?? null
37+
)
38+
39+
React.useEffect(() => {
40+
if (open) {
41+
setActiveSnapPoint(snapPoints?.[0] ?? null)
42+
}
43+
}, [open]) // snapPoints are static per dialog instance
44+
3545
if (isIosBuild) {
3646
return (
37-
<Drawer open={open} onOpenChange={onOpenChange} snapPoints={snapPoints}>
47+
<Drawer
48+
open={open}
49+
onOpenChange={onOpenChange}
50+
snapPoints={snapPoints}
51+
activeSnapPoint={activeSnapPoint}
52+
setActiveSnapPoint={setActiveSnapPoint}
53+
>
3854
{children}
3955
</Drawer>
4056
)

src/pages/Index.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,14 @@ const TimeTrackerContent = () => {
7373
}
7474

7575
return (
76-
<PageLayout>
76+
<PageLayout title="Dashboard" icon={<DashboardIcon className="w-6 h-6" />}>
7777
<div className="max-w-6xl mx-auto pt-4 pb-6 px-4 md:p-6 print:p-4 space-y-6">
7878
<StartDayDialog
7979
isOpen={showStartDayDialog}
8080
onClose={() => setShowStartDayDialog(false)}
8181
onStartDay={handleStartDayWithDateTime}
8282
/>
8383

84-
{/* Dashboard header */}
85-
<div className="flex items-center justify-between">
86-
<h1 className="md:text-2xl font-bold text-foreground flex items-center space-x-1">
87-
<DashboardIcon className="w-6 h-6 mr-1" />
88-
<span>Dashboard</span>
89-
</h1>
90-
</div>
91-
9284
{/* Stats (always visible) */}
9385
{!isDayStarted && (
9486
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 print:hidden">

0 commit comments

Comments
 (0)