Skip to content

feat(explore): add mobile responsiveness to map view#41

Open
nicholasalanbrown wants to merge 1 commit intomainfrom
feat/mobile-responsive
Open

feat(explore): add mobile responsiveness to map view#41
nicholasalanbrown wants to merge 1 commit intomainfrom
feat/mobile-responsive

Conversation

@nicholasalanbrown
Copy link
Copy Markdown
Contributor

Summary

Adds mobile responsiveness to the CommonGrid map view (/explore).

Closes MAI-47

What changed

ExplorerShell.tsx

Mobile-first default layout

  • On mount, detects if the viewport is mobile (< 768px) via matchMedia and switches to map layout by default (was showing the list/hybrid split which collapsed badly on small screens)

Keep-alive map on mobile

  • Map is always mounted when on mobile, just hidden when list view is active (was unmounting, losing viewport position and causing a flash)
  • Uses CSS hidden class instead of conditional rendering so Mapbox doesn't need to re-initialize on toggle

New MobileViewToggle component

  • Replaces the previous floating toggle button with a cleaner pill that uses bg-foreground text-background for proper contrast in both light/dark mode
  • active:scale-95 for tactile feedback, select-none to prevent text selection on mobile tap

Touch support for HybridLayout resize handle

  • Added onTouchStart handler alongside existing onMouseDown
  • Touch listeners use { passive: false } on touchmove so preventDefault can prevent scroll interference
  • Resize handle gets touch-none Tailwind class to opt that element out of browser touch handling

Testing

  • ✅ TypeScript clean (tsc --noEmit exits 0)
  • ✅ Next.js build passes (npm run build exits 0)
  • Manual testing recommended on actual mobile device for:
    • Map-first default view on load
    • Toggle pill behavior (map ↔ list)
    • Pinch-to-zoom on map
    • Tab bar scrolling on narrow screens

- Default to map-first layout on mobile (< 768px) via matchMedia on mount
- Keep map mounted when switching to list view on mobile to preserve viewport
- Add floating map/list toggle pill with accessible labels and touch-friendly sizing
- Add touch event support to HybridLayout resize handle (onTouchStart/touchmove)
- Resize handle gets touch-none Tailwind class to prevent scroll interference

Closes MAI-47
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opengrid Ready Ready Preview, Comment Mar 19, 2026 8:33pm

Request Review

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