Skip to content

Mobile fixes: framing, on-demand rendering, context loss, safe areas - #13

Merged
raulkolaric merged 6 commits into
mainfrom
fix/mobile
Oct 11, 2026
Merged

raulkolaric merged 6 commits into
mainfrom
fix/mobile

Conversation

@raulkolaric

Copy link
Copy Markdown
Member

Mobile fixes, found by stepping through every phone state on an emulated iPhone 13 (overview, list, peek, expanded sheet, floor view, lower level, search) and on the production build.

Bugs fixed

  • The camera estimated the bottom sheet's size with fixed screen fractions, so the selected building hid behind the expanded sheet. It now measures the sheet (ResizeObserver) and leaves room for the top bar, then fits the building into the space that's left. Desktop side panels use the same calculation.
  • The expanded sheet could cover 75% of the screen. It's capped at 60dvh so the map stays usable.
  • The gate plaque ("PUC-SP · R. Marquês de Paranaguá, 111") ran off narrow screens. Phones show only "PUC-SP".
  • Double-tapping a button zoomed the page. Fixed with touch-action: manipulation; pinch-zoom still works.

Robustness on weaker devices

  • frameloop="demand": the map draws a frame only when something changes, so an idle map costs no GPU or battery. Only the entrance pulse asks for frames on its own.
  • Smaller shadow map (1024) on touch, low-memory and few-core devices.
  • If the GPU drops the WebGL context (iOS does this under memory pressure), the building-list fallback shows instead of a frozen canvas.
  • viewport-fit=cover, with safe-area padding on the top bar, list, level toggle and sheet.

Checked

  • lint, typecheck and build all pass.
  • Phone: screenshots of the overview, peek, expanded sheet and floor view.
  • Production build: no console errors. The dev overlay's "N issues" are React StrictMode double-mounting drei <Html> labels, so they're dev-only.
  • Not tested on a physical device.

🤖 Generated with Claude Code

… on demand; survive GPU context loss

- camera fits the selection into the rectangle not covered by the top bar, side panels or the
  measured bottom sheet (ResizeObserver), instead of fixed screen fractions
- frameloop="demand": an idle map renders nothing (battery, heat on phones)
- smaller shadow map on touch / low-memory / few-core devices; PCF shadows (soft was removed)
- webglcontextlost -> list fallback instead of a frozen canvas
- viewport-fit=cover with safe-area padding; touch-action: manipulation (no double-tap zoom)
- expanded sheet capped at 60dvh so the map stays usable; gate plaque shortened on phones
- floor-plan room labels stay mounted (fade by zoom) instead of remounting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🔎 Preview for 4cfd469: https://3d-76moyaigu-rkolaric.vercel.app

…i-Fi

Next blocks dev assets for origins other than localhost; on http://<mac-ip>:3000 the
client never hydrated and the map stayed on the loading placeholder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… zoom, full-bleed map

- one bottom sheet (peek / half / full) holds search, the building list and building details;
  drag or flick between snaps, animated with transforms; peek is sized to its header
- 1:1 two-finger pinch anchored at the fingers' midpoint (camera-controls' eased pinch was slow)
- map uses the large viewport (h-lvh) so it runs under Safari's floating toolbar
- only the level toggle and language float over the map; old phone list panel and sheet removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…top keeps 2×2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ner, no page scroll)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…errors); Home Screen web app

- Label.tsx: span over the canvas, positioned per rendered frame; drei Html created a React root per
  label and unmounted it synchronously, which React logged as an error (the dev overlay's issues)
- manifest + apple-icon + appleWebApp meta: Add to Home Screen opens the map full screen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raulkolaric
raulkolaric merged commit 7c74cd3 into main Oct 11, 2026
2 checks passed
raulkolaric added a commit that referenced this pull request Oct 11, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
preview — 4cfd4696 Deployed Oct 11, 2026 by raulkolaric via deploy #41
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