Repository navigation
Conversation
…ions Define the compact (<768), intermediate (768-1023) and wide (>=1024) breakpoints, a 44px touch target token, and a useMediaQuery/useViewportLayout hook for behavior that changes with the viewport. Size the root shell with dvh and safe-area insets, opt the viewport into viewport-fit=cover and interactive-widget=resizes-content, and document the conventions in DESIGN.md. Closes TabularisDB#1581
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review: Files Reviewed (3 files)
Previous Review Summaries (2 snapshots, latest commit fd924ff)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit fd924ff)Status: No Issues Found | Recommendation: Merge Incremental review: the only change since the last review is generated guest CSS ( Files Reviewed (1 file)
Previous review (commit d4561ba)Status: No Issues Found | Recommendation: Merge Files Reviewed (9 files)
Reviewed by claude-sonnet-5.5 · Input: 254 · Output: 871 · Cached: 172.7K Review guidance: REVIEW.md from base branch |
debba
left a comment
There was a problem hiding this comment.
Thanks, Mittal. I appreciate the breakpoint boundary tests and the guidance on when to use pointer capabilities. One follow-up nit is to use the same units in the Tailwind breakpoint tokens and the JavaScript media queries. The CSS uses rem and the hook uses px, so they can disagree if the browser’s default font size differs from 16 px. I’ll keep this open for manual layout checks before merging.
|
Thanks @debba! Good catch on the units, I'll align the hook's media queries to rem so they match the Tailwind tokens and push a follow-up commit. |
…oints BREAKPOINTS now holds rem values (48, 64) matching the md and lg tokens in index.css, so the useViewportLayout media queries agree with Tailwind when the browser default font size is not 16px. Tests now resolve rem against a configurable font size and cover a 20px default.
debba
left a comment
There was a problem hiding this comment.
Thanks, Mittal. You switched BREAKPOINTS to rem and added the 20px default font cases, so the hook and the md/lg tokens now come from the same numbers.
I ran the hook and MainLayout tests on the branch (22 passing). I also checked it in a real Chromium with the default font set to 20px: at 900px, both the Tailwind md rule and (min-width: 48rem) say compact, while the old 768px query said intermediate. So the fix does what it should.
I'm approving this. One small follow-up, not a blocker: BREAKPOINTS now holds unitless rem numbers, and it would be easy to compare one against a px width by mistake. #1612 already plans to import it into a Playwright spec that compares against viewport.width. A px helper or a unit in the name (BREAKPOINTS_REM) would prevent that. It can be a separate small PR.
I'll do the manual layout check on desktop and on a phone before I merge.
Summary
Adds the shared responsive conventions from #1581 so the rest of #1580 builds on the same breakpoints, viewport sizing and touch rules. Only the root shell's sizing changes; the desktop layout looks exactly the same. Navigation, dialogs and per-screen changes are left to their own issues (#1582, #1583, ...).
Changes
mdandlgare pinned in the@themeblock ofindex.css, andBREAKPOINTS/MEDIA_QUERIESinsrc/utils/responsive.tshold the same values for code. I checked these against the shell: the icon rail plus the default explorer take 320 px, so below 768 px the main area would be under 448 px. With the row editor open, the main area is down to 320 px at 1024 px.touchspacing token (44 px), used aspointer-coarse:min-h-touch pointer-coarse:min-w-touch. Touch rules depend on the input device, not on width.viewport-fit=coverandinteractive-widget=resizes-content. Zoom is still allowed.MainLayoutusesh-dvhinstead ofh-screen, and a newsafe-area-paddingutility (env(safe-area-inset-*)).bodyusesmin-height: 100dvh. On desktop and in the Tauri window the insets are 0, so nothing moves there.useMediaQuery(query)anduseViewportLayout()(compact/intermediate/wide) insrc/hooks/useMediaQuery.ts, built onuseSyncExternalStoreand cleaning up on unmount. Nothing uses them yet. They are meant for the follow-up issues, only where behavior has to change.docs/DESIGN.mdcovers breakpoints, container queries, input capability and touch targets, viewport and safe areas, the keyboard, scroll ownership, and the rule that resizing must not write saved preferences..rules/design.mdgets a short rule pointing to it.No new UI strings, no theme color changes, no backend changes.
Notes for review
max-md:/max-lg:rules so desktop stays unchanged. Happy to switch to mobile-first wording if you prefer.visualViewport-based height.dvhplusinteractive-widgetcovers Chromium on Android, but iOS Safari doesn't resize the layout when the keyboard opens. The doc says so, and leaves keyboard handling to the dialog and form issues ([Feat]: Mobile: make dialogs and action menus fit small viewports #1583, [Feat]: Mobile: support SQL editing and execution on compact touch layouts #1586).ResultsWindowPage,JsonViewerPage,SchemaDiagramPage,VisualExplainPage,TaskManagerPage) still useh-screen. I left them to [Feat]: Mobile: adapt secondary inspection pages and utility views #1592 to keep this PR to the root shell.MainLayoutContent's root element and the globalbody/ viewport rules. I didn't run the GitNexus index locally.Testing
pnpm test: 624 files, 9911 tests passed, including the newtests/hooks/useMediaQuery.test.ts(live updates, unsubscribing on unmount, re-subscribing when the query changes, and the breakpoint edges 767/768/1023/1024) and aMainLayouttest for the shell classes.pnpm typecheck,pnpm lint(ESLint, Prettier, theme tokens) andpnpm buildpass.tabularis webserver (SQLite connection) in headless Chrome 156, before and after, at 320×640, 390×844, 844×390, 768×1024 and 1280×800. Safe-area insets were emulated through the DevTools protocol. At every sizedocument.documentElement.scrollWidthequals the viewport width (no page-level horizontal scroll), and the shell height equals the viewport height. With insets, the shell now pads by exactly the inset (for example47px 0 34pxin portrait), where before it had none.Closes #1581
Screenshots
tabularis-1581-responsive.mp4
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.