Repository navigation
fix(calendar): handle multi-day events and isolate lanes per day (#1755) - #1902
VishalDhariwal wants to merge 2 commits into
Conversation
[Medium impact] The PR appears safe to merge with these non-blocking display issues noted. FindingsFix with agent prompt### Issue 1
frontend/src/views/DashboardView/components/WeekCalendar.vue:158-166
**Repeated-hour events collapse.** In London on October 25, 2026, a booking from `01:30+01:00` to `01:15+00:00` lasts 45 minutes. Subtracting clock minutes gives −15 here, which is clamped to zero and draws only the minimum-height block. The previous elapsed-time calculation preserved its duration. Keep the wall-clock calculation for ordinary slices, but handle positive-duration bookings that cross the repeated hour separately and add a fall-back test.
### Issue 2
frontend/src/utils.ts:434-435
This check drops events whose start and end are equal. Google events pass through without a positive-duration requirement, so a timed reminder with equal endpoints reaches this helper and now vanishes from the calendar. Previously it reached `calculateEventGridPosition` and drew a block. Keep equal-endpoint events as a single visible block while rejecting reversed dates.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThis PR splits timed events across calendar days, keeps overlapping event widths separate per day, and preserves full event times on hover.
Reviews (2) · Last reviewed commit: "fix(calendar): address review findings a..." · Reviewed by Greptile |
| if (!eventStart.isValid() || !eventEnd.isValid() || !eventStart.isBefore(eventEnd)) { | ||
| return []; |
There was a problem hiding this comment.
Zero-length events disappear. This check drops events whose start and end are equal. Google events pass through without a positive-duration requirement, so a timed reminder with equal endpoints reaches this helper and now vanishes from the calendar. Previously it reached
calculateEventGridPosition and drew a block. Keep equal-endpoint events as a single visible block while rejecting reversed dates.
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/utils.ts
Line: 434-435
Comment:
**Zero-length events disappear.** This check drops events whose start and end are equal. Google events pass through without a positive-duration requirement, so a timed reminder with equal endpoints reaches this helper and now vanishes from the calendar. Previously it reached `calculateEventGridPosition` and drew a block. Keep equal-endpoint events as a single visible block while rejecting reversed dates.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
|
| const endMinutesTotal = eventStart.isSame(eventEnd, 'day') | ||
| ? eventEnd.hour() * 60 + eventEnd.minute() | ||
| : 24 * 60; | ||
|
|
||
| let durationMinutes = endMinutesTotal - startMinutesTotal; | ||
| const maxRemainingMinutesInDay = 24 * 60 - startMinutesTotal; | ||
|
|
||
| if (durationMinutes < 0) { | ||
| durationMinutes = 0; |
There was a problem hiding this comment.
Repeated-hour events collapse. In London on October 25, 2026, a booking from
01:30+01:00 to 01:15+00:00 lasts 45 minutes. Subtracting clock minutes gives −15 here, which is clamped to zero and draws only the minimum-height block. The previous elapsed-time calculation preserved its duration. Keep the wall-clock calculation for ordinary slices, but handle positive-duration bookings that cross the repeated hour separately and add a fall-back test.
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/views/DashboardView/components/WeekCalendar.vue
Line: 158-166
Comment:
**Repeated-hour events collapse.** In London on October 25, 2026, a booking from `01:30+01:00` to `01:15+00:00` lasts 45 minutes. Subtracting clock minutes gives −15 here, which is clamped to zero and draws only the minimum-height block. The previous elapsed-time calculation preserved its duration. Keep the wall-clock calculation for ordinary slices, but handle positive-duration bookings that cross the repeated hour separately and add a fall-back test.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.


What changed?
splitEventIntoDaySegmentsinfrontend/src/utils.tsto break multi-day and overnight events into day-bounded slices ([start, 24:00],[00:00, 24:00], and[00:00, end]).filteredRemoteEventsForGridandfilteredPendingAppointmentsForGridinWeekCalendar.vueto include events overlapping the active week (not just those starting in it) and map each daily slice into its respective weekday column.calculateEventGridPosition, boundeddurationMinutesto the remaining minutes of that day, ensuring event blocks terminate cleanly at midnight (24:00) without breaking past the 24-hour grid.gridColumnbefore callingassignEventLanes, isolating lane assignments to each day column. Events crossing midnight or spanning multiple days no longer shrink unrelated events on adjacent days.originalStartandoriginalEndon event segments soEventPopupdisplays the full multi-day event timeframe when hovered on any day slice.frontend/test/utils.test.jscovering single-day, multi-day, overnight, midnight-boundary, and out-of-week event slicing.frontend/test/components/WeekCalendar.test.jsverifying multi-day grid position slicing, height clamping, and day lane isolation.AI Disclosure: Implemented with the assistance of Antigravity AI agent, reviewed, tested, and verified by me.
Why?
Follows up on the limitation noted in #1882 and resolves #1755:
eventEnd - eventStartin raw minutes across multiple days, resulting in thousands of pixels in height on the start day that broke past the bottom of the 24-hour calendar grid, while completely disappearing on subsequent days.Limitations and Notes
None. All-day events remain in the header row, and timed grid events now correctly slice across day columns and terminate cleanly at the midnight grid line.
Applicable Issues
Closes #1755
QA Log
pnpm run test test/components/WeekCalendar.test.js test/utils.test.js(21/21 passing).pnpm run lintpasses with 0 errors and 0 warnings.http://localhost:8090/calendar) using multi-day events (e.g. Tuesday 09:00 to Thursday 15:00) alongside single-day events (Thursday 10:00 to 11:30):Screenshots
Before (Overflows 24h grid on start day, missing on Wed & Thu, narrows Thu event)
| Overview / Morning | Scrolled to 11 PM (Bottom Overflow) |

After (Properly sliced across Tue, Wed, & Thu; lane isolation on Thu; clean midnight boundary)
| Overview / Sliced Days | Scrolled to 11 PM (Clean Midnight Boundary) |
