Refactors the event layout and stacking logic based on review feedback.
This includes:
- Merging conflicting event groups to prevent inconsistencies.
- Implementing minimal stack level assignment using a min-heap.
- Consolidating styling and using DateService for drag operations.
- Adding reflow after drag and drop.
- Improving the column event filtering to include events overlapping midnight.
- Ensuring explicit sorting of events for grid layout.
Refines the event grid layout algorithm to more accurately
identify conflicting events for stacking within the grid.
Now uses an expanding search to find chains of conflicting events,
ensuring that all events that should be grouped together are
correctly identified.
Introduces a coordinator to manage event layout calculations,
separating this logic from rendering.
It calculates stack levels and allocates event columns for
improved visual organization of calendar events.
Moves complex layout determination logic (grid grouping, stack levels, positioning) from `EventRenderer` to a new `EventLayoutCoordinator` class.
Delegates layout responsibilities to the coordinator, significantly simplifying the `EventRenderer`'s `renderColumnEvents` method. Refines `EventStackManager` by removing deprecated layout methods, consolidating its role to event grouping and core stack level management.
Improves modularity and separation of concerns within the rendering pipeline.
Introduces a 3-phase algorithm in `EventStackManager` for dynamic event positioning. Groups events by start time proximity to determine optimal layout.
Optimizes horizontal space by using side-by-side grid columns for simultaneous events and allowing non-overlapping events to share stack levels. Supports nested stacking for late-arriving events within grid columns.
Includes comprehensive documentation (`STACKING_CONCEPT.md`) and a visual demonstration (`stacking-visualization.html`) to explain the new layout logic. Updates event rendering to utilize the new manager and adds extensive test coverage.
Relocates event CSS positioning logic from the `SwpEventElement` to the `DateEventRenderer`. This improves separation of concerns, making the renderer responsible for event layout.
Introduces a polymorphic `createClone` method on base event elements to customize clone generation.
Adds a `replaceClone` delegate to drag event payloads, enabling subscribers to dynamically swap the active dragged clone.
This supports scenarios like converting a standard event clone to an all-day event clone when dragging to the all-day header.
Improves efficiency and reliability of drag-and-drop operations involving calendar headers.
Transitions from continuous polling within `handleMouseMove` to using native `mouseenter` and `mouseleave` events with delegation on `swp-calendar-header` elements. This change ensures more precise and performant detection of header interactions during a drag.
Also enhances the initial event detection logic to correctly identify `SWP-ALLDAY-EVENT` elements when starting a drag.
Introduces web components for event elements, separating timed and all-day events into distinct components for better organization and reusability.
This change also simplifies event rendering and drag-and-drop operations by leveraging the properties and lifecycle methods of web components.
Refactors event rendering to handle transitive overlaps, ensuring that entire chains of overlapping events are correctly processed.
Fixes an issue where only direct overlaps were re-rendered after a drag and drop, leading to inconsistent stacking.
Now collects and re-renders all events in the stack.
Enhances date validation and timezone handling using DateService, ensuring data integrity and consistency.
Refactors event rendering and dragging to correctly handle date transformations.
Adds a test plan for event stacking and z-index management.
Fixes edge cases in navigation and date calculations for week/year boundaries and DST transitions.
Standardizes date manipulation across the application by leveraging the DateService.
This change improves consistency and reduces code duplication by removing redundant date calculations.
Replaces DateCalculator with DateService for improved date and time operations, including timezone handling.
This change enhances the calendar's accuracy and flexibility in managing dates, especially concerning timezone configurations.
It also corrects a typo in the `allDay` dataset attribute.
Improves date validation and adds flexible date/time formatting capabilities.
The date validation is updated to return a boolean and is incorporated directly into calling functions to throw errors, improving code readability and maintainability. DateService is extended with functions for formatting time in 12-hour format, getting day names, and formatting date ranges with customizable options.
Addresses issues with all-day event duration calculation and positioning during drag and drop.
- Uses `differenceInCalendarDays` to correctly calculate event duration across timezone and DST boundaries.
- Preserves the original event time when moving events to a different day.
- Snaps dragged event to the top of the target time slot.
Adds DateService using date-fns-tz for robust time zone
conversions and date manipulations.
Refactors DateCalculator and TimeFormatter to utilize the
DateService, centralizing date logic and ensuring consistent
time zone handling throughout the application.
Improves event dragging by updating time displays and data
attributes, handling cross-midnight events correctly.
Comments out the timestamp update logic within the dragged clone functionality.
This change is a preliminary step towards refactoring the scroll logic, which will be managed by a dedicated scroll manager, decoupling it from the event renderer.
Adds options for technical date and time formatting and includes the option to show seconds.
Updates time formatting to use UTC-to-local conversion and ensures consistent colon separators for time values.
Adjusts all-day event handling to preserve original start/end times.
Ensures all-day events maintain their original duration
when dragged and dropped to a new date.
Calculates and applies the correct end date based on the
original event's span.
Addresses issues with dragging all-day events, ensuring correct event placement and layout calculations after a drag and drop operation.
Specifically, ensures the correct event ID is used and updates the event layout when dragging all day events.
Refines drag and drop behavior for all-day events.
Removes unnecessary logging and conditional logic in the
AllDayManager.
Simplifies column change handling in the EventRendererManager.
Ensures that the all-day event overflow indicator updates
correctly when the number of events changes, instead of
creating duplicate indicators.
Removes unused event click handling logic.
Ensures correct display of all-day events when collapsed or expanded.
Improves the transition between collapsed and expanded states by
adjusting the overflow event visibility.
Simplifies the all-day event overflow toggle logic by using distinct class names and avoiding direct class switching, improving code readability and maintainability.
Centralizes the maximum number of displayed all-day event rows into a single constant.
This change ensures consistency and simplifies management of the all-day event row limit across the application.
Corrects off-by-one error in overflow count.
Improves the visual appearance of all-day events
by adjusting padding and margins.
Reduces padding in the all-day container and adds
margins to individual events for better spacing.
Ensures consistent all-day event row height calculation across CSS and TypeScript.
The all-day event row height calculation is adjusted by removing redundant container padding from the TypeScript constant and synchronizing the CSS variable with the event height.
Additionally, the layout engine is directly tested in the test file for better coverage.
Refactors all-day event layout calculation to use the header elements directly.
This change improves the accuracy of event positioning
and fixes potential issues with date handling.
Refactors all-day event rendering to use header column data.
This ensures events are rendered based on the actual visible
dates in the header, improving accuracy and responsiveness to view changes.
Removes direct dependency on week dates in `AllDayManager` and
`EventRenderingService`, instead, the all-day manager is instantiated
with event manager.
Updates `HeaderManager` to emit header bounds.
Refactors all-day event layout calculation and rendering for improved accuracy and performance.
Improves drag-and-drop behavior for all-day events, ensuring correct event placement and column detection.
Addresses issues with event overflow display and provides a more responsive user experience.
Adds a method to retrieve column bounds based on a given date, enhancing date-specific event placement.
Removes unnecessary data storage for overflow event titles, simplifying overflow event handling.
Refactors all-day event height calculation to use the `currentLayouts` array, ensuring more accurate and reliable height adjustments.
This avoids querying the DOM directly and relies on the existing layout data for improved performance and correctness.
Improves all-day event drag and drop by recalculating layouts and applying differential updates to minimize DOM manipulations.
This change optimizes the update process by comparing current and new layouts, only updating elements with changed grid areas, leading to smoother transitions.
Removes obsolete code.
Enhances the all-day event display when collapsed by showing four rows (three events plus an overflow indicator).
Updates the overflow indicator logic to dynamically display the number of hidden events and allow the user to expand the view.
Adds functionality to collapse the all-day event rows when the number of rows exceeds a limit.
This improves the layout by preventing the all-day section from taking up too much space. A chevron button is added to allow users to expand/collapse the section.
Refactors drag and drop logic to use the dragged clone consistently, fixing issues with event handling and element manipulation during drag operations.
Also includes a fix where the original element is removed after a drag is completed.
Adds column bounds cache update after drag operations for improved column detection.
Refactors all-day event conversion during drag and drop to
use the event payload, improving code clarity and reducing
redundancy.
Removes unnecessary style settings and fixes column detection
logic. Addresses an issue where event removal occurred before
successful placement.
Moves event extraction logic to a shared utility function for reusability.
Removes redundant code and improves consistency in event handling.
The original duration is now mandatory.