fix(scroll): snap day/week grid to one page per swipe#35
Draft
anton-patrushev wants to merge 1 commit into
Draft
fix(scroll): snap day/week grid to one page per swipe#35anton-patrushev wants to merge 1 commit into
anton-patrushev wants to merge 1 commit into
Conversation
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>
fc10c26 to
856219d
Compare
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In plain day and week paging, the body grid's horizontal
ScrollViewhas no snap offsets —snapToIntervalis only set for thescrollByDay/resource path. It therefore relies solely onpagingEnabled, which does not constrain momentum on the New-ArchitectureScrollViewwrapping 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-columnsnapToInterval(plain day/week), enumerate page-level snap offsets (one per page; page width = one day in day view, one week in week view). This makesdisableIntervalMomentumengage downstream inCalendarList, capping a flick at exactly one page. Also setdecelerationRate="fast"to matchResourceListViewand avoid overshoot.The
scrollByDay/resource per-column path is unchanged;ResourceListView(resource-scroll) is untouched.Notes
fix/drag-autoscroll-zoom-scale.🤖 Generated with Claude Code