fix(calendar): page the week grid with prev/next, not only the header - #56
Open
lucletoffe wants to merge 2 commits into
Open
lucletoffe wants to merge 2 commits into
lucletoffe wants to merge 2 commits into
Conversation
Week view kept two dates: currentDate drove the header range and event fetch, selectedDate drove the grid. Prev/next only moved currentDate, so the title jumped while the displayed week stayed put.
Prev/next already moved the grid; a horizontal swipe did nothing, so paging weeks still felt broken. A right swipe goes to the previous week, a left swipe to the next, without stealing the hour-grid scroll.
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.
Summary
Week view stored the visible period (
currentDate) separately from the highlighted day (selectedDate). The header title and event fetch followedcurrentDate; the grid followedselectedDate. Prev/next only movedcurrentDate, so the title jumped to the next week while the grid (and the selected-day highlight) stayed put.WeekViewtakes aweekDate(the period to show) and keepsselectedDatefor the highlight only.Changes
src/lib/calendar-navigation.ts:applyCalendarNavigation/shiftViewDatesrc/screens/CalendarScreen.tsx: wire prev/next and the week toggle through that helpersrc/components/calendar/WeekView.tsx: render the week ofweekDateType of change
Checklist
npm test(977 passed, 14 skipped) andtsc --noEmitare clean