Skip to content

ios pwa: rubber-band pull-to-refresh instead of Material circle#597

Open
sshane wants to merge 1 commit into
masterfrom
ios-rubberband-pull-refresh
Open

ios pwa: rubber-band pull-to-refresh instead of Material circle#597
sshane wants to merge 1 commit into
masterfrom
ios-rubberband-pull-refresh

Conversation

@sshane
Copy link
Copy Markdown
Contributor

@sshane sshane commented Apr 30, 2026

Summary

iOS PWAs in standalone mode don't get the system pull-to-refresh because there's no browser chrome to host it. The previous `PullDownReload` showed a Material Design circle indicator that didn't match the iOS look.

Replace it with iOS Safari rubber-band style: when the user pulls down at `scrollTop=0`, translate `document.body` downward with damping (exponent 0.55, capped at 200px). On release, animate back to 0 via cubic-bezier easing. If pulled past 80px, reload after the animation completes so the rubber-band-back isn't cut short.

Also leaves a 30px edge zone uncaptured so iOS' system edge-swipe-back gesture is preserved.

No visible UI element — the page itself is the indicator.

Test plan

  • iOS PWA: pull down at top of dashboard → page rubber-bands with damping
  • Release without enough pull → page springs back, no reload
  • Release past ~80px → page springs back, then reload fires
  • Pull down mid-scroll (not at top) → normal scrolling, no rubber-band
  • Edge-swipe from left edge → OS back gesture works
  • Non-iOS / non-standalone: behavior unchanged (component is no-op)
  • `pnpm lint` clean
  • `pnpm test` passes (30/30)

🤖 Generated with Claude Code

iOS PWAs in standalone mode don't get the system pull-to-refresh
because there's no browser chrome to host it. The previous
PullDownReload showed a Material Design circle indicator that didn't
match the OS look.

Replace it with the iOS Safari rubber-band style: when the user pulls
down at scrollTop=0, translate document.body downward with damping
(damping exponent 0.55, max translate 200px). On release, animate
back to 0 with a cubic-bezier easing. If pulled past 80px, reload
after the animation completes so the rubber-band-back isn't cut
short.

Also leaves a 30px edge zone uncaptured so iOS' system edge-swipe-back
gesture is preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

deployed preview: https://597.connect-d5y.pages.dev

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