Skip to content

fix(schedule): correct tall view height for reservations ending befor…#1146

Draft
JohnVillalovos wants to merge 1 commit intodevelopfrom
jlvillal/start_date
Draft

fix(schedule): correct tall view height for reservations ending befor…#1146
JohnVillalovos wants to merge 1 commit intodevelopfrom
jlvillal/start_date

Conversation

@JohnVillalovos
Copy link
Collaborator

…e hidden blocked period

In the ScheduleTall (flipped) view, reservation height is calculated as endTd.top - startTd.top, where endTd is the row whose data-min matches the reservation's end timestamp. This row is normally the blocked period that immediately follows the reservation.

When hide.blocked.periods = true, blocked period rows are absent from the DOM. The fallback findClosestEnd() returns the last reservable slot whose start time ≤ reservation end — one row too early. For a multi-slot reservation this produces a height that stops at the top of the last reservable slot rather than its bottom, leaving that slot visually empty.

The single-slot case was already handled by the existing height === 0 guard. Extend the fix to multi-slot reservations by adding endTd.outerHeight() to height whenever findClosestEnd was used (calculatedAdjustment > 0) and height is already non-zero.

Closes: #920

…e hidden blocked period

In the ScheduleTall (flipped) view, reservation height is calculated as
`endTd.top - startTd.top`, where `endTd` is the row whose `data-min`
matches the reservation's end timestamp. This row is normally the
blocked period that immediately follows the reservation.

When `hide.blocked.periods = true`, blocked period rows are absent from
the DOM. The fallback `findClosestEnd()` returns the last reservable
slot whose start time ≤ reservation end — one row too early. For a
multi-slot reservation this produces a height that stops at the *top* of
the last reservable slot rather than its bottom, leaving that slot
visually empty.

The single-slot case was already handled by the existing `height === 0`
guard. Extend the fix to multi-slot reservations by adding
`endTd.outerHeight()` to height whenever `findClosestEnd` was used
(`calculatedAdjustment > 0`) and height is already non-zero.

Closes: #920
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes ScheduleTall (flipped) reservation rendering when blocked period rows are hidden by ensuring multi-slot reservations visually extend through the final reservable slot.

Changes:

  • Adjust ScheduleTall reservation height calculation when the end cell is inferred via findClosestEnd().
  • Extend the existing single-slot height === 0 handling to also cover multi-slot height truncation when blocked periods are absent.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +197 to +201
if (calculatedAdjustment > 0 && height > 0) {
// findClosestEnd was used: endTd is the last slot STARTING before resEnd,
// but height must extend through to the bottom of that slot row
height += endTd.outerHeight();
}
Comment on lines +197 to +201
if (calculatedAdjustment > 0 && height > 0) {
// findClosestEnd was used: endTd is the last slot STARTING before resEnd,
// but height must extend through to the bottom of that slot row
height += endTd.outerHeight();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UPDATED: Bookings with consecutive timeslots are not displayed in full if they are followed by a blocked timeslot

2 participants