Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
}

:global(.rbc-month-view .rbc-date-cell) {
padding: 0;
min-height: 50px; /* Adjust height based on your design */
padding-bottom: 10px; /* Ensures space below existing events is clickable */
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

Removing padding: 0 and replacing it with padding-bottom: 10px will also add default padding to other sides of the element. If the intent was to only have bottom padding, consider using padding: 0 0 10px 0 to be more explicit and avoid unintended padding on other sides.

Suggested change
padding-bottom: 10px; /* Ensures space below existing events is clickable */
padding: 0 0 10px 0; /* Ensures space below existing events is clickable */

Copilot uses AI. Check for mistakes.
}

:global(.rbc-month-view .rbc-date-cell .rbc-button-link) {
Expand All @@ -36,4 +37,6 @@
height: 100%;
padding: 0.25rem 0.5rem;
text-align: left;
padding-bottom: 150px;
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The magic number 150px for padding-bottom is unusually large and lacks explanation. This seems excessive for ensuring clickable space and could cause significant layout issues. Please either add a comment explaining why 150px is needed, or verify this value is correct. If the goal is to make space clickable, a more reasonable value like 10-20px would typically suffice.

Suggested change
padding-bottom: 150px;
padding-bottom: 10px; /* Provide extra clickable space without distorting layout */

Copilot uses AI. Check for mistakes.
}

13 changes: 11 additions & 2 deletions frontend/src/components/booking-calendar/booking-calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,20 @@ type Props = Omit<CalendarProps<CalendarBooking>, "localizer"> &
}>;

function BookingCalendar(props: Props) {
const { onRepeatSlot } = props;
const { onRepeatSlot, onSelectSlot, longPressThreshold, ...calendarProps } =
props;

const handleSelectSlot = (slotInfo: any) => {
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The parameter type should be explicitly typed instead of using any. Based on the react-big-calendar library, this should be typed as SlotInfo which includes properties like start, end, slots, and action.

Copilot uses AI. Check for mistakes.
if (onSelectSlot) {
onSelectSlot(slotInfo);
}
};
return (
<div className={styles.calendarWrapper}>
<Calendar
localizer={dateLocalizer}
selectable={true}
longPressThreshold={longPressThreshold ?? 50}
toolbar
titleAccessor="title"
startAccessor="start"
Expand All @@ -82,7 +90,8 @@ function BookingCalendar(props: Props) {
dayPropGetter={dayPropGetter}
slotPropGetter={slotPropGetter}
eventPropGetter={eventPropGetter}
{...props}
onSelectSlot={handleSelectSlot}
{...calendarProps}
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The handleSelectSlot wrapper function doesn't add any meaningful logic - it only conditionally calls onSelectSlot if it exists. However, spreading calendarProps after explicitly setting onSelectSlot on line 93 means that if onSelectSlot exists in calendarProps, it will override this wrapper. This could bypass the wrapper entirely and may cause unexpected behavior. Consider either removing the wrapper if it's unnecessary, or ensure onSelectSlot is excluded from calendarProps when spreading.

Copilot uses AI. Check for mistakes.
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ function BookingCreationTimeSlotSelector() {
onDrillDown={onDrillDown}
onRepeatSlot={onRepeatSlot}
selectable
longPressThreshold={50}
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

The magic number 50 for longPressThreshold is duplicated between this file (line 226) and the default value in booking-calendar.tsx (line 67). Consider extracting this to a named constant to ensure consistency and make it easier to adjust this value across the codebase if needed.

Copilot uses AI. Check for mistakes.
/>
</Segment>

Expand Down
Loading