-
Notifications
You must be signed in to change notification settings - Fork 12
feat(calendar-apps): fix overlapping event layout in calendar views #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(calendar-apps): fix overlapping event layout in calendar views #630
Conversation
…t layout - Add column-based layout algorithm using BFS for connected event clusters - Implement visual overlap with 70% overlap ratio for earlier column events - Add z-index stacking where higher columns appear on top - Only render events in their starting time slot to avoid duplicates - Remove hardcoded right positioning from SCSS to support dynamic widths
PR Reviewer Guide 🔍(Review updated until commit caf62cf)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to caf62cf
Previous suggestionsSuggestions up to commit 5e059bd
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Implements a Google Calendar-style overlapping event layout for the daily calendar by computing overlap clusters, assigning events to columns, and applying width/left/z-index positioning to event blocks.
Changes:
- Added a BFS-based clustering + column assignment algorithm to compute overlapping event layouts.
- Updated event rendering to avoid duplicate rendering across multiple time slots by rendering only at the start hour.
- Updated event styling to apply column-based width/left positioning and z-index stacking; removed conflicting
rightstyling in SCSS.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue | Adds overlap clustering + column layout calculations and applies width/left/z-index styling; changes per-slot event selection to “start-only”. |
| edge-apps/blueprint/ts/assets/calendar/daily-calendar-view.scss | Removes right positioning to allow inline left/width layout to control event placement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
Outdated
Show resolved
Hide resolved
- Add optional chaining to safely access column element before calling isSameOrBefore - Prevents 'Object is possibly undefined' TypeScript error
Replace queue.shift() with index-based queue traversal to reduce time complexity of BFS from O(n²) to O(n)
…idth and left offset Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Use layout.span instead of layout.columnSpan to match the return type of getEventLayout function
- Add layout index and total columns to cache key to prevent collisions - Events with identical start/end/backgroundColor now cache separately based on layout position
- Add colored left border to calendar event items matching weekly view style - Use theme color for visual consistency with Google Calendar appearance - Fix border syntax and add base style for proper CSS specificity
- Reduce event height by 4% to create visual separation between adjacent events - Ensure minimum height of 90% of original to maintain readability - Matches Google Calendar appearance with minimal spacing between events
…n weekly calendar - Add event clustering with BFS for transitive overlap detection - Implement column-based layout algorithm for consistent event positioning - Add visual overlapping effect with 70% overlap ratio - Include z-index stacking for proper event layering - Add 4% gap between adjacent events for visual separation - Update cache key to include layout properties preventing collisions - Maintain event style caching for performance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
Outdated
Show resolved
Hide resolved
edge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
Outdated
Show resolved
Hide resolved
- Change isAfter to isBefore comparison for accurate week range check - Ensures events at the start of the week are properly included
…View - Change layoutMap key from 'startTime-endTime' string to CalendarEvent object - Prevents cache collisions when multiple distinct events share identical start/end times - Aligns with DailyCalendarView implementation
- Add getEventKey helper function generating stable key from startTime, endTime, and title - Replace object reference keying with composite string key in layoutMap - Ensures consistent layout lookup regardless of event object identity - Prevents layout misapplication for duplicate start/end time events
- Pre-sort events by start time for efficient overlap detection with early termination - Build adjacency list once per cluster to eliminate O(n²) repeated comparisons in BFS - Pre-compute events per column to reduce span calculation from O(n³) to O(n²) - Add isSameOrAfter dayjs plugin for proper time comparisons - Reduces complexity in dense overlap scenarios from O(n³) to O(n² log n)
- Create event-layout-utils.ts with shared functions for overlapping event layout - Move EventLayout interface, findEventClusters, calculateClusterLayouts, getEventKey - Update DailyCalendarView and WeeklyCalendarView to use shared utilities - Reduce code duplication (~280 lines removed)
…lity - Wrap calendar events with a new wrapper container for border styling - Add thin white border (0.07rem) around events in both daily and weekly views - Split getEventStyle into getWrapperStyle (positioning) and getItemStyle (background-color) - Preserve existing red left border and event color-coding
- Add back default grey (#e6e7e7) background to calendar-event-item - Fixes transparent events in calendar apps that don't provide backgroundColor
b2f1e7e
into
dependabot/bun/edge-apps/asset-metadata/bun-4fb95960b5
|
Persistent review updated to latest commit caf62cf |
User description
Implements Google Calendar-style overlapping event layout using a column-based algorithm with BFS for event clustering.
Changes:
Applies to:
Screenshots
PR Type
Enhancement
Description
Add event clustering and layout utilities
Integrate column-based overlap layout in views
Replace event style functions with wrapper/item styles
Update SCSS for wrapper-based event styling
Diagram Walkthrough
File Walkthrough
event-layout-utils.ts
Implement column-based event layout utilitiesedge-apps/blueprint/ts/utils/event-layout-utils.ts
eventsOverlapfor time overlap detectionfindEventClusterswith BFS adjacencycalculateClusterLayoutsfor column spansgetEventKeyfor stable event mappingDailyCalendarView.vue
Integrate overlap layout in daily viewedge-apps/blueprint/ts/components/calendar/DailyCalendarView.vue
eventLayoutswith clusters and layoutsgetEventStylewithgetWrapperStyleandgetItemStylegetEventLayoutandgetAllEventsForTodayhelpersWeeklyCalendarView.vue
Integrate overlap layout in weekly viewedge-apps/blueprint/ts/components/calendar/WeeklyCalendarView.vue
eventLayoutsdaily-calendar-view.scss
Adjust daily view event wrapper stylesedge-apps/blueprint/ts/assets/calendar/daily-calendar-view.scss
.calendar-event-wrapperborder and radius.calendar-event-itemto wrapper.calendar-event-itemfor left border styleweekly-calendar-view.scss
Adjust weekly view event wrapper stylesedge-apps/blueprint/ts/assets/calendar/weekly-calendar-view.scss
event-wrapper-stylesmixin for wrappersevent-base-stylesmixin parameters.calendar-event-wrapper