Skip to content

fix(scroll): snap day/week grid to one page per swipe#35

Draft
anton-patrushev wants to merge 1 commit into
fix/drag-autoscroll-zoom-scalefrom
fix/day-week-page-snap
Draft

fix(scroll): snap day/week grid to one page per swipe#35
anton-patrushev wants to merge 1 commit into
fix/drag-autoscroll-zoom-scalefrom
fix/day-week-page-snap

Conversation

@anton-patrushev

Copy link
Copy Markdown
Owner

Problem

In plain day and week paging, the body grid's horizontal ScrollView has no snap offsets — snapToInterval is only set for the scrollByDay/resource path. It therefore relies solely on pagingEnabled, which does not constrain momentum on the New-Architecture ScrollView wrapping the virtualized list (HorizontalVirtualizedList, content ≈ 1.25M px).

Result: a fast flick free-flings across the entire min..max date range and the visible date is read (dayIndex = round(offset / columnWidth)) wherever momentum happens to stop — landing on arbitrary far-past/far-future dates.

Fix

In CalendarListView, when there is no per-column snapToInterval (plain day/week), enumerate page-level snap offsets (one per page; page width = one day in day view, one week in week view). This makes disableIntervalMomentum engage downstream in CalendarList, capping a flick at exactly one page. Also set decelerationRate="fast" to match ResourceListView and avoid overshoot.

The scrollByDay/resource per-column path is unchanged; ResourceListView (resource-scroll) is untouched.

Notes

  • Stacked on fix/drag-autoscroll-zoom-scale.
  • Single-file change.

🤖 Generated with Claude Code

In plain day/week paging the body grid relied solely on pagingEnabled,
which does not constrain momentum on the New-Architecture ScrollView
wrapping the virtualized list: a fast flick free-flings across the whole
date range and the visible date is read wherever momentum stops.

Enumerate page-level snap offsets so disableIntervalMomentum caps a flick
at one page, and set decelerationRate=fast. iOS only — on Android the
large offsets array froze the grid and bled the now-line onto non-current
pages (and Android did not show the far-jump), so Android keeps its
original behavior (native pagingEnabled, no offsets array, default
deceleration).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@anton-patrushev anton-patrushev force-pushed the fix/day-week-page-snap branch from fc10c26 to 856219d Compare June 10, 2026 12:45
@anton-patrushev

Copy link
Copy Markdown
Owner Author

Amended: gated the page-snap to iOS only. Android regressed with the large snapToOffsets array (freezing + now-line on non-current pages) and didn't have the far-jump, so it now falls back to the original native pagingEnabled path. Single-file change (Platform check in CalendarListView).

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