Repository navigation
fix: start a new event from the "+" button on a day the calendar shows #139 - #140
Merged
rathlinus merged 1 commit intoNov 15, 2026
Merged
Conversation
wmcparla
marked this pull request as ready for review
November 14, 2026 12:43
Member
|
Thanks, merged. |
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
In the calendar, "+" opened the new-event editor on the selected day, and swiping a view does not move the selection. So after swiping the day view to 22 November, "+" still offered today (#139). The week and multi-day grids and the month did the same once scrolled away from the selected day.
"+" now starts the event on the selected day while that day is on screen, and otherwise on the first day the view shows: the day in the day view, the first column of the week and multi-day grids, and in the month the 1st of the month in the title (or that month's first day still on screen when the 1st has scrolled off the top). The schedule is unchanged.
Two related things in the same line of code:
Changes
src/lib/calendar-new-event.ts(new):shownDays()gives the days a view has on screen and the day an event starts on there;newEventStart()picks the selected day or that one, at the clock's time.src/screens/CalendarScreen.tsx: the "+" button uses them. A day reported by a scrolling view is ignored once free scrolling is off.src/components/calendar/MonthScrollView.tsx: reports the rows in view (onVisibleRowsChange), since the month in the title turns before the previous month's rows have left the screen. The screen keeps them in a ref, so scrolling causes no extra render.src/lib/__tests__/calendar-new-event.test.ts: 13 cases, among them the [Bug]: Incorrect default date when adding event in day view via "+" #139 case, the late-evening hold, a selected day of the previous month still on screen, stale month rows after a jump, and the Jalali month.Related issues
Closes #139
Type of change
Checklist
npx tsc --noEmit,npx vitest runandnpm run i18n:checkare clean (this repo has no lint or build script)How it was tested
On an Android 16 phone emulator, with a test account on a self-hosted Stalwart 1.1.0, the same scripted run against
mainat b3b4230 and against this branch. It scrolls a view, presses "+", reads the start date in the editor and closes it without saving.mainNot run on a device: iOS (the reporter's platform; the code is shared and has no platform branch), the multi-day view, a tablet, free scrolling turned off, a right-to-left layout and the late-evening hold. The unit tests cover the multi-day range and the hold.
Screenshots
The day view swiped to 22 November, and the editor "+" opens there on this branch:
🤖 Generated with Claude Code