Skip to content

Mobile: swipe navigation + scroll-instead-of-clip slides#3

Open
socalindc wants to merge 1 commit into
stackblitz:mainfrom
socalindc:mobile-swipe-and-scroll
Open

Mobile: swipe navigation + scroll-instead-of-clip slides#3
socalindc wants to merge 1 commit into
stackblitz:mainfrom
socalindc:mobile-swipe-and-scroll

Conversation

@socalindc

Copy link
Copy Markdown

On phones the deck was hard to use two ways: a slide whose content runs taller than the viewport was clipped at both ends (the stage centers and hides overflow, so e.g. a 6-cell StatGrid rendered as a blank slide at 375×812), and the only way to advance was the small dock arrows.

Changes

  • Swipe navigation (Deck.tsx): a quick horizontal swipe pages the deck, including <Build> reveals. Vertical drags are left free for slide scrolling; slow or diagonal drags don't page; touches on the dock, rail, grid view, presenter panel, annotator, and form controls are ignored. Listeners are passive.
  • Scroll instead of clip (base.css ≤640px): slides become scroll containers with justify-content: safe center — short slides stay visually centered, tall ones scroll from the top, with bottom padding so the last content clears the dock. The atmosphere layer is pinned static there (its -15% bleed plus the drift animation's scale created ~140px of phantom scroll on every slide once slides could scroll).
  • Split stacking (≤640px): the media pane keeps its natural height (minmax(min-content, 1fr)) instead of being crushed into the leftover row, and the slide scrolls when the stack runs long.
  • StatGrid (≤640px): compacts to 2-up cards so six stats fit one phone screen (full-width stacking ran ~1.5 screens tall).
  • Data tables (≤640px): fit the phone width — compact type, headers and label cells wrap (number strings carry no break points, so they stay whole) — instead of forcing a 540px min-width and panning sideways, which buried the right-hand columns. overflow-x: auto remains as the escape hatch for genuinely too-wide tables.
  • Safe areas: dock and annotator bar respect env(safe-area-inset-bottom); viewport-fit=cover added to the viewport meta.
  • SKILL.md: documents the phone behavior, per CONTRIBUTING.

Testing

  • npx tsc --noEmit and npm run build both pass.
  • Exercised at 375×812 and 375×660: every demo-style slide type either fits or scrolls correctly; swipe forward/back verified, vertical drags and slow drags correctly don't page.
  • Desktop (>640px) rendering is unchanged — all changes live inside the existing ≤640px media queries plus the touch handler (inert without touch input).

🤖 Generated with Claude Code

On phones, a slide whose content runs taller than the viewport was
clipped at both ends (flex centering + overflow hidden), and the only
way to advance was the small dock arrows.

- Deck.tsx: quick horizontal swipes page the deck (build reveals
  included). Vertical drags are left free for slide scrolling; slow or
  diagonal drags don't page; touches on the dock, rail, grid, presenter,
  annotator, and form controls are ignored.
- base.css (≤640px): slides become scroll containers with
  `justify-content: safe center` — short slides stay centered, tall ones
  scroll, with bottom padding so the last content clears the dock. The
  atmosphere layer is pinned static (its -15% bleed + drift scale created
  ~140px of phantom scroll on every slide once slides could scroll).
  Split stacks by content height instead of crushing media into the
  leftover row. StatGrid compacts to 2-up cards so six stats fit one
  phone screen. Dock and annotator bar respect safe-area insets.
- index.html: viewport-fit=cover for notched phones.
- SKILL.md: document the phone behavior per CONTRIBUTING.

npx tsc --noEmit and npm run build both pass; desktop (>640px) rendering
is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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