Mobile-friendly UI: responsive shell, phone layouts, drawer navigation
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.
This commit is contained in:
@@ -205,9 +205,9 @@ export function CardDavSettings() {
|
||||
const failure = r?.sync && !r.sync.ok ? r.sync.error : r?.test && !r.test.ok ? r.test.error : null
|
||||
return (
|
||||
<li key={c.id} className="space-y-2 p-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Switch checked={c.enabled} onCheckedChange={() => toggle(c)} aria-label={`Enable ${c.name}`} />
|
||||
<span className="text-sm font-medium truncate">{c.name}</span>
|
||||
<span className="min-w-[6rem] flex-1 truncate text-sm font-medium">{c.name}</span>
|
||||
{Array.isArray(c.addressbooks) && c.addressbooks.length > 0 && <Badge variant="outline" className="shrink-0 text-[10px]">{c.addressbooks.length} books</Badge>}
|
||||
<span className="ml-auto flex items-center gap-1">
|
||||
<Button size="sm" variant="outline" onClick={() => sync(c)} loading={syncing === c.id} aria-label={`Sync ${c.name}`}>
|
||||
|
||||
Reference in New Issue
Block a user