Skip to content

fix(layout): scale desktop layouts to laptop sizes; add safe-area insets - #5

Merged
timothygithinji merged 1 commit into
mainfrom
feat/responsive-layouts
May 28, 2026
Merged

fix(layout): scale desktop layouts to laptop sizes; add safe-area insets#5
timothygithinji merged 1 commit into
mainfrom
feat/responsive-layouts

Conversation

@timothygithinji

@timothygithinji timothygithinji commented May 28, 2026

Copy link
Copy Markdown
Owner

Problem

The three-column desktop layouts were keyed to the md (768 px) breakpoint with hard-coded pixel widths:

  • DesktopReview — queue w-[260px] + hero w-[540px]
  • DesktopListingDetail — media column w-[720px] shrink-0
  • DesktopSearches / DesktopShortlistpx-10 page gutters everywhere

On iPad portrait and narrow laptops (768–1023 px) those widths overflowed and the desktop chrome rendered broken. Some mobile-side overflow and notched-iPhone safe-area gaps also went unhandled.

What changed

1. Move the desktop/mobile boundary from md (768 px) to lg (1024 px)

Every route shell, the AdminSidebar desktop-only mode, the bottom nav, and useIsMobile() switch in lockstep. Tablets now get the centred max-w-md mobile layout (which actually fits) instead of a malformed desktop one.

File Change
src/hooks/use-mobile.ts MOBILE_BREAKPOINT 768 → 1024
src/components/layout/admin-sidebar.tsx hidden md:contentshidden lg:contents
src/components/layout/bottom-nav.tsx md:hiddenlg:hidden
src/routes/{index,shortlist,searches/index,searches/new,searches/\$id,settings/household,listings/\$clusterId}.tsx mobile shells md:hiddenlg:hidden

2. Make the desktop columns fluid above lg

  • DesktopReview — queue w-56 xl:w-[260px], hero drops the fixed width and runs on flex-1 min-w-0.
  • DesktopListingDetail — media column drops w-[720px] shrink-0 and runs on flex-[2] min-w-0 alongside the existing flex-1 info column.
  • Every desktop page chrome switches from px-10 to px-6 lg:px-10 (review, listing detail top bar, searches, shortlist, search-create header, search-form, cost-estimate sticky bar).

3. Guard small-phone overflow on the searches list

/searches cards used a justify-between flex with a non-truncating title; on a 360 px-wide phone the active/paused badge could collide. Now: flex-wrap, min-w-0 truncate on the title, shrink-0 whitespace-nowrap on the badge, and flex-wrap gap-y-1 on the stats row.

4. Safe-area insets on the sticky bottom UI

  • Bottom navpb-[env(safe-area-inset-bottom)] so the tab labels clear the home indicator on notched iPhones.
  • Listing-detail CTApb-[max(1.75rem,calc(env(safe-area-inset-bottom)+0.5rem))]. Devices without an inset (Android, older iPhones, desktop browsers) keep the original 28 px gap; notched iPhones get safe-area + 8 px.

5. Infra

.gitignore now ignores the per-feature worktrees/ directory used to run each improvement on its own branch (this is item 1 of a 6-item improvement series).

Verification

  • bun run typecheck
  • bun run lint:ci
  • bun run test — 154 tests, all pass ✅
  • Pre-push hooks run the same gates ✅

Browser-verification against prod isn't useful here because the gaff app sits behind Cloudflare Access OTP — the public URL just shows Cloudflare's own sign-in page. Please pull the branch and bun run dev on your devices (phone, iPad portrait, laptop, external monitor) to confirm the auth-gated screens (Review, Listings, Shortlist, Searches) look right at each size. Specifically worth eyeballing:

  • iPad portrait (768 px) should now show the mobile layout.
  • 13" laptop (1280 px) should show the desktop layout with the queue at w-56 (224 px).
  • External 1920+ monitor should show the desktop layout with the queue at w-[260px].
  • The detail CTA on a notched iPhone should clear the home indicator.

Next in the series

This is PR #1 of 6 (each on its own worktree):

  1. Responsive layouts ← this PR
  2. Area search → covering outcodes for "North London" et al
  3. "What stands out" relevance pass
  4. "Boring numbers" overhaul (London/England crime baseline; cull stubbed amenities)
  5. Map: walking + transit directions to the nearest station
  6. Listing detail: consolidated Costs section (rent, deposit, council tax, fees)

Summary by CodeRabbit

Release Notes

Style

  • Refined responsive padding and spacing across all pages for improved visual consistency on different screen sizes
  • Updated mobile-to-desktop layout transitions to provide better experience on tablets and larger devices
  • Enhanced safe-area support for notched mobile devices to prevent interface overlaps

Chores

  • Updated development configuration

Review Change Stack

The three-column desktop layouts were keyed to the `md` (768 px)
breakpoint with hard-coded pixel widths (260 / 540 / 720). On iPad
portrait and narrow laptops (768–1023 px) those widths overflowed,
so the desktop chrome rendered broken.

* Move the desktop/mobile boundary from `md` to `lg` (1024 px).
  Every route shell, the AdminSidebar `desktop-only` mode, the bottom
  nav, and `useIsMobile` switch in lockstep so tablets now use the
  centered max-w-md mobile layout (which works) instead of a malformed
  desktop one.

* Make the desktop columns fluid above `lg`:
  - DesktopReview: queue `w-56 xl:w-[260px]`, hero drops the fixed
    width and runs on `flex-1 min-w-0`.
  - DesktopListingDetail: media column drops `w-[720px] shrink-0` and
    runs on `flex-[2] min-w-0` alongside the existing `flex-1` info
    column.
  - Every desktop page chrome switches from `px-10` to `px-6 lg:px-10`.

* Guard small-phone overflow on the searches list (wrap, truncate,
  whitespace-nowrap on the active/paused badge and stats row).

* Add `env(safe-area-inset-bottom)` padding to the bottom nav and the
  listing-detail sticky CTA so they sit above the home indicator on
  notched iPhones; devices without an inset keep the original gap.

Also gitignore the per-feature `worktrees/` directory used to run each
improvement on its own branch.

Verification: typecheck, biome ci and the 154-test suite all pass.
Auth-gated screens need a visual check by running `bun run dev` on
the branch (browser verification against prod hits Cloudflare Access,
not the gaff UI itself).
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 148d2558-cc81-4cf2-9b64-29a43d90e385

📥 Commits

Reviewing files that changed from the base of the PR and between 7944c2e and d5fdf27.

📒 Files selected for processing (19)
  • .gitignore
  • src/components/layout/admin-sidebar.tsx
  • src/components/layout/bottom-nav.tsx
  • src/components/listing-detail/desktop-listing-detail.tsx
  • src/components/listing-detail/detail-cta.tsx
  • src/components/review/desktop-review.tsx
  • src/components/search-form/cost-estimate.tsx
  • src/components/search-form/desktop-search-create.tsx
  • src/components/search-form/search-form.tsx
  • src/components/searches/desktop-searches.tsx
  • src/components/shortlist/desktop-shortlist.tsx
  • src/hooks/use-mobile.ts
  • src/routes/index.tsx
  • src/routes/listings/$clusterId.tsx
  • src/routes/searches/$id.tsx
  • src/routes/searches/index.tsx
  • src/routes/searches/new.tsx
  • src/routes/settings/household.tsx
  • src/routes/shortlist.tsx

Walkthrough

This PR shifts the responsive design breakpoint from md (768px) to lg (1024px), repositioning where the application switches from mobile to desktop layouts. The mobile hook constant is updated, followed by systematic changes to visibility toggles across pages, responsive padding adjustments, and layout restructuring to support flexible component sizing at the new boundary.

Changes

Responsive Breakpoint Migration to 1024px (lg)

Layer / File(s) Summary
Mobile breakpoint constant definition
src/hooks/use-mobile.ts
MOBILE_BREAKPOINT constant increased from 768 to 1024, with documentation explaining alignment to Tailwind lg: shell rendering and iPad portrait width inclusion. The useIsMobile hook now reports mobile status based on 1024px breakpoint.
Shell components responsive boundary
src/components/layout/admin-sidebar.tsx, src/components/layout/bottom-nav.tsx
Admin sidebar and bottom navigation components updated to use lg:hidden instead of md:hidden; component documentation updated to reflect 1024px desktop-only boundary. Safe-area inset padding comments added for mobile devices.
Page-level mobile/desktop layout visibility
src/routes/index.tsx, src/routes/listings/$clusterId.tsx, src/routes/searches/$id.tsx, src/routes/searches/index.tsx, src/routes/searches/new.tsx, src/routes/settings/household.tsx, src/routes/shortlist.tsx
All route pages updated to toggle between mobile and desktop layouts at lg breakpoint instead of md, ensuring consistent visibility across the application.
Responsive horizontal padding and safe-area adjustments
src/components/review/desktop-review.tsx, src/components/search-form/cost-estimate.tsx, src/components/search-form/desktop-search-create.tsx, src/components/search-form/search-form.tsx, src/components/searches/desktop-searches.tsx, src/components/shortlist/desktop-shortlist.tsx, src/components/listing-detail/detail-cta.tsx
Container padding updated from fixed px-10 to responsive px-6 with lg:px-10; detail CTA safe-area bottom padding adjusted using max() calculation to support iOS notch devices.
Component layout restructuring for flexible sizing
src/components/listing-detail/desktop-listing-detail.tsx, src/components/review/desktop-review.tsx, src/routes/searches/index.tsx
Fixed-width layouts converted to flexible layouts: desktop-review hero column and sidebar width made responsive; desktop-listing-detail media column shifted to flex-based layout; search card header and stats rows updated with wrapping flex, truncation, and gap adjustments for improved text handling.

Git Configuration

Layer / File(s) Summary
Worktree directory ignore rule
.gitignore
Added comment and ignore pattern for worktrees/ directory, supporting per-feature Git worktree structure created via git worktree add ./worktrees/<slug>.

🎯 3 (Moderate) | ⏱️ ~25 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant