Streamlines the conversion of all-day events to timed events during drag and drop operations. This change improves the event rendering process by ensuring proper handling of element replacement and position updates.
Removes redundant code and simplifies the logic for updating the dragged clone.
Implements drag-and-drop conversion from all-day events to timed events in day columns. This change introduces a new event type (`drag:mouseenter-column`) and delegates rendering logic to the `DateEventRenderer` to maintain architectural consistency.
Allows users to convert all-day events to timed events by dragging them over a day column.
This implementation adds logic to the DragDropManager to detect when an all-day event is dragged over a column.
It then emits a new event, 'drag:mouseenter-column', carrying the event data and target column information.
The event rendering service handles this event.
Adds locale support to the date header renderer and date service.
This change ensures that the day names are displayed correctly based on the user's configured locale.
The date header now uses the configured locale to display the day name in the correct language.
The day name is now displayed in uppercase.
Additionally, styles the date header to highlight today's date.
Enhances the visual feedback during and after event drag and drop operations in the calendar.
- Preserves the full opacity of the dragged event clone during the drag operation for better visibility.
- Applies a highlight class to the event after it's dropped to visually indicate the new location.
- Adds specific styling for the highlighted state based on event type.
Improves event dragging by tracking the source column and using the updated event data for re-rendering affected columns.
Also, enhances event resizing by updating the event data and re-rendering the column to recalculate stacking/grouping.
Uses snap interval as minimum duration when resizing.
Enhances the event drag and drop functionality by setting the initial position of the dragged event to prevent it from jumping to the top of the column.
Also adjust event transition for a smoother user experience.
Removes unused resize logic.
Replaces the previous rough event resizing implementation with a smooth, animated approach.
Uses pointer events for accurate tracking and adds a visual resize handle
for better user interaction.
Also refactors drag and drop to exclude resize handle.
Refines drag and drop functionality by calculating position relative to the column during drag and snapping to the grid on mouse up, resulting in more precise placement.
Addresses an issue where the dragged element's position was not correctly calculated relative to the target column.
Implements a smooth drag animation for a more fluid user experience.
Instead of directly snapping to the mouse position, it interpolates
the position over time using `requestAnimationFrame`. This provides
a visually smoother movement during drag operations.
Uses CSS classes for event hover highlighting,
instead of directly manipulating the background color.
This allows for more flexible and maintainable styling.
Re-enables resize handle manager.
Removes console logs.
Removes `pointer-events: none` from various calendar elements.
This ensures that the elements are correctly interactive,
allowing the user to click on them as intended.
Enhances the visual design of the resize handle for calendar events, making it more prominent and user-friendly.
- Updates the handle's styling with a darker background, increased size, and refined shadow.
- Replaces grip dots with grip lines for a cleaner look.
Enhances the resize handle indicator for calendar events by using cached event elements for efficiency.
This eliminates the need to constantly query the DOM, and only refreshes the cache on relevant event changes.
Additionally updates the resize indicator style for improved visual clarity and user experience.
Adds a resize handle manager to handle mouse hover
effects on calendar events and display a resize indicator.
This allows users to visually identify and initiate
event resizing by hovering near the bottom edge of an event.
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.