Repository navigation
feat: let overlapping calendar events lie over each other where no text is covered #149 - #152
Merged
rathlinus merged 1 commit intoNov 15, 2026
Conversation
…xt is covered bulwarkmail#149 Timed events that overlap used to share the day evenly: three in a cluster got a third each for their whole length, which in the week grid of a phone leaves room for no title at all. The columns are now only where an event starts from. It spreads over the columns beside it that are free while it runs, and over events that start far enough from it: 30 minutes, or 45 when the earlier one shows its start time. The later event is drawn on top and begins below the earlier one's title and time, set in a little so the edge of the one underneath still shows. Events that start closer together stay side by side as before, and no event gets narrower than it was. A block is never drawn under 20px tall, so a short event counts for the 25 minutes it takes up on screen, not only for its length.
Member
|
Thanks, merged. On top: a long event's title now wraps only down to where the event over it starts (with #135 it could run under it), and the room left above an overlapping event grows with the system text size, so with large text, events that start closer together stay side by side. |
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
Timed events that overlap now lie over each other where that covers no text, instead of sharing the day evenly (#149). An event keeps the room it had and takes more: the columns beside it that are free while it runs, and the room of events that start far enough from it. The later event is drawn on top and starts below the earlier one's title and time.
Changes
layoutOverlappingEventsinsrc/lib/calendar-utils.ts): the cluster and column packing is unchanged and is now only where an event starts from. A new step,spreadCluster, then sets each event'sleftandwidth:WeekView.tsx,TimeGridScrollView.tsx): both draw fromleftandwidth. The result is in start order, so later events are drawn last.TIME_LINE_MIN_MINUTESmoved fromEventBlock.tsxtocalendar-utils.ts, where the layout needs it too.Two things to know:
Related issues
Closes #149
Type of change
Checklist
npm run typecheckand there are no errors (native has nolintscript)npm run buildin native; an x86_64 release APK,assembleGithubRelease -PallowDebugSignedRelease=true, builds and runs)locales/) if my changes affect user-facing text (no new text)Tests:
npx vitest run src/lib/__tests__/calendar-utils.test.ts: 46 passed, 11 of them new. They cover a lone event, equal starts, a start that would cover the time line, one and two events over a long one, a free column, short and zero-length events, the example from the issue, and a mixed day checked for the rules above (never narrower, never outside the day, never over text).npx tsc --noEmitandnpm run i18n:checkare clean. The whole suite passed (7112) before the last change to the layout, which only the file above covers; CI runs it again here.On a device (Android 16 phone emulator, x86_64 release build, a test account on a self-hosted Stalwart): five events on one day, as in the screenshots: 10:00 to 14:00, 11:00 to 12:00, 11:45 to 12:45, and two at 13:00 for 30 minutes. Each block's place was read from the view hierarchy in the day and the week grid.
Not tested:
WeekView.tsx, used with free scrolling off or in a right-to-left language) on a device: it draws from the same layout through the same block component, and the run above used the scrolling grids.🤖 Generated with Claude Code