The UI was desktop-first: no viewport meta (phones rendered at ~980px CSS width, killing every breakpoint), an always-inline 240px sidebar squeezing phone content, fixed p-6/100vh chrome, a 6-column bookmarks table, fixed w-60/w-72 rails on collections/tags/contacts, a 12-tab settings strip that overflowed, and w-72 kanban columns. This pass makes every screen usable on a phone while leaving the desktop layout intact. - layout.tsx: viewport meta (width=device-width, initial-scale=1). - app-shell/sidebar: below lg the sidebar is an overlay drawer (closed by default, hamburger opens, backdrop/navigation/resize-to-desktop closes); at lg+ it is the static expand/collapse rail exactly as before. Separate mobileOpen state so closing the drawer never collapses the desktop rail. h-screen -> h-dvh; main p-6 -> p-3 sm:p-6. - lib/use-media-query.ts: hydration-safe useSyncExternalStore media hook (server snapshot false) so surfaces swap whole layouts without duplicating hidden DOM that would break the suites' strict text locators. - bookmarks: table swaps to tappable cards below sm (title/host/status/tags/ updated + open/trash); shared trash handler; detail sheet unchanged. - collections/tags/contacts: rails become master-detail on phones — full-width list first, tap into detail, Back returns; collections no longer auto-jump into the first item on mobile; phone padding. - settings: tab strip scrolls horizontally (triggers shrink-0) instead of overflowing the page. - kanban/collection boards: columns w-[85vw] max-w-72/64 with a peek of the next column; dvh heights. - calendar: compact cells + single-letter weekday headers on phones. - ui/dialog: max-h-[calc(100dvh-2rem)] + internal scroll + phone width guard so tall forms never clip; ui/tabs triggers shrink-0. - top-bar: alerts panel fits 320px; theme/avatar collapse on the smallest widths; hamburger gains an accessible name. - connector settings (MCP/WebDAV/CalDAV/CardDAV): connection rows wrap and the name gets a width floor — the action cluster previously squeezed the name to zero width on phones (a real bug the new mobile test caught). Verification: new mobile regression suite (390x844 context) proves drawer open/close-on-nav, bookmark cards + sheet, tags master-detail + Back, scrollable settings tabs reaching WebDAV, kanban column fits, and zero horizontal overflow on all eight screens; all 19 existing desktop tests still pass (20/20). Real-stack e2e fully passing. yarn lint / SSR eslint / build: 0 errors.
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { DM_Sans, Plus_Jakarta_Sans, JetBrains_Mono } from 'next/font/google'
|
|
import './globals.css'
|
|
import { Providers } from '@/components/providers'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
const dmSans = DM_Sans({ subsets: ['latin'], variable: '--font-sans' })
|
|
const jakartaSans = Plus_Jakarta_Sans({ subsets: ['latin'], variable: '--font-display' })
|
|
const jetbrainsMono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-mono' })
|
|
|
|
export const metadata = {
|
|
metadataBase: new URL(process.env.NEXTAUTH_URL ?? 'http://localhost:3000'),
|
|
title: 'Superbrain',
|
|
description: 'Your personal binder of life on the web',
|
|
icons: {
|
|
icon: '/favicon.svg',
|
|
shortcut: '/favicon.svg',
|
|
},
|
|
openGraph: {
|
|
title: 'Superbrain',
|
|
description: 'Your personal binder of life on the web',
|
|
images: ['/og-image.png'],
|
|
},
|
|
}
|
|
|
|
// Mobile layout depends on the viewport meta: without it phones render at
|
|
// ~980px CSS width and every responsive breakpoint is dead.
|
|
export const viewport = {
|
|
width: 'device-width',
|
|
initialScale: 1,
|
|
}
|
|
|
|
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<html lang="en" suppressHydrationWarning>
|
|
<body className={`${dmSans.variable} ${jakartaSans.variable} ${jetbrainsMono.variable} font-sans`}>
|
|
<Providers>
|
|
{children}
|
|
</Providers>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|