Event rendering strategies now exclusively handle timed events, while all-day events are managed by a dedicated renderer.
Centralizes calendar header creation within `GridRenderer`, ensuring the header element is always present from initial DOM construction. `HeaderManager` and `ScrollManager` now react to a `header:ready` event, which signifies the header is fully initialized.
Synchronizes all-day event rendering with header readiness, temporarily queuing events until the header is prepared. Emits an `allday:checkHeight` event to prompt all-day container height adjustments after rendering.
Deletes a large set of architectural plans, code reviews, and implementation documents. This content is no longer relevant as the described features and refactorings are complete.
Streamlines the event renderer by removing legacy drag event listener setup and outdated comments, reflecting improved separation of concerns and rendering strategies.
Refactors drag-to-all-day functionality to apply CSS styling and reposition the existing drag clone within the all-day container, rather than creating a new event element.
Centralizes all-day container creation in HeaderManager. Introduces `drag:mouseleave-header` to handle transitions from all-day back to timed events.
Ensures consistent styling and robust cleanup of drag clones for a smoother user experience.
Centralizes drag event listener setup in `EventRendererManager` for better separation of concerns.
Introduces factory and cloning methods in `SwpEventElement` to simplify event cloning and data extraction from DOM elements during drag operations.
Enhances `DragDropManager` to pass the actual dragged element for conversion and accurately detect the drop target (day column or header).
Updates `EventRenderer` to expose drag-handling methods publicly, allowing the `EventRendererManager` to delegate event-specific drag operations based on drop target.
Refactors drag and drop logic for better event handling and code clarity.
- Moves drag styling to CSS class for cleaner code.
- Emits a 'drag:convert-from-allday' event to handle the conversion of all-day events back to day events.
- Adds logging for debugging purposes.
This commit streamlines the codebase by removing the unnecessary `new_` prefixes from the event handling functions, resulting in cleaner and more consistent naming conventions. The functions were likely renamed at some point and the old names were kept around for a while.
Refactors drag and drop logic to dynamically find the dragged element, ensuring correct behavior even when the DOM changes during the drag operation.
Creates all-day container if it doesn't exist.
This resolves issues where drag and drop operations would fail if the original element was no longer present in the DOM or if the container didn't exist.
Centralizes event position calculations into `PositionUtils` for consistency and reusability across managers and renderers.
Improves drag-and-drop functionality by emitting events for all-day event conversion and streamlining position calculations during drag operations.
Introduces `AllDayManager` and `AllDayEventRenderer` to manage and render all-day events in the calendar header. This allows dragging events to the header to convert them to all-day events.
Addresses inconsistent time formatting and lack of timezone
handling throughout the application by introducing a
`TimeFormatter` utility.
This class centralizes time formatting logic, providing
timezone conversion (defaults to Europe/Copenhagen) and
support for both 12-hour and 24-hour formats, configurable
via `CalendarConfig`.
It also updates event rendering to utilize the new
`TimeFormatter` for consistent time displays.
Improves code organization and maintainability by separating concerns related to all-day event rendering, header management, and event resizing.
Moves all-day event rendering logic into a dedicated `AllDayEventRenderer` class, utilizing the factory pattern for event element creation.
Refactors `AllDayManager` to handle all-day row height animations, separated from `HeaderManager`.
Removes the `ResizeManager` and related functionality.
These changes aim to reduce code duplication, improve testability, and enhance the overall architecture of the calendar component.
Introduces the ability to convert all-day events to timed events by dragging them out of the header.
Leverages a factory method to create timed events from all-day elements, ensuring proper data conversion and styling.
Improves user experience by allowing more flexible event scheduling.
Creates `SwpEventElement` and `SwpAllDayEventElement` classes for handling event rendering.
Refactors event creation logic in `EventRenderer` to utilize these classes, improving code organization and reusability.
Adds factory methods for creating event elements from `CalendarEvent` objects, simplifying event instantiation and data management.
Improves drag and drop event handling, including conversion between all-day and timed events.
Introduces HeaderManager to handle header-related event logic and
centralizes header event handling for better code organization and
separation of concerns.
Optimizes event listeners and throttles events for improved performance.
Removes redundant code and improves the overall drag and drop
experience.
Updates event creation to correctly use the date from the calendar column, removing unnecessary time manipulation.
Simplifies duration handling by directly using the dataset value.
Removes unused all-day event drag and drop conversion functions.
Modifies event rendering to correctly handle dates that use a 1970 reference point during drag and drop operations.
This ensures that events maintain their correct date when moved between columns, resolving an issue where dragged events would revert to the 1970 reference date.
Introduces event resizing feature, allowing users to dynamically adjust event durations by dragging handles on the top or bottom of events.
Moves resize logic into a dedicated ResizeManager class for better code organization and separation of concerns.
Addresses an issue where dragging events that are part of a stack could lead to inconsistencies.
This change ensures that when an event is dragged and dropped, the other events in the stack are also repositioned correctly.
It traverses the stack, removes the related events from their original positions, and re-renders them in the correct column.
It also removes stack link data from the dragged element to prevent unexpected behavior.
Updates event start and end times in the dataset after a successful drag and drop operation. This ensures the event element reflects the new time position.
Also resets the z-index of the dropped element if no overlaps are detected, keeping the element's original appearance.
Ensures dragged event clones maintain correct positioning
by setting `marginLeft` to `0px`. This fixes a potential
visual issue where the clone might not fill the full
column width during dragging.
Replaces the old overlap handling system with a new approach.
The new system recalculates overlaps after a drag-and-drop action and re-renders the affected events, avoiding manual group management. This simplifies the overlap resolution logic and improves performance.
Restructures the project for better maintainability and clarity. Adds a ManagerFactory for dependency injection and reorganizes files.
Updates event rendering logic to correctly handle overlapping events using a stack link system. The EventRendererStrategy now correctly processes and renders event overlaps, ensuring proper display. Introduces processing tracking to avoid double rendering.
Updates documentation to reflect the new structure and build process. Also implements changes to build output and event system for improved clarity.
Fixes#123
Ensures existing events maintain their base positions when a new event is dragged and dropped into an overlapping time slot.
The fix prioritizes existing events in the stack, placing the newly dropped event on top. This ensures correct visual representation and expected behavior during event manipulation.
Refactors event overlap handling to use a DOM-centric approach with data attributes for stack tracking. This eliminates complex state management, reduces code complexity, and improves maintainability. Removes the previous Map-based linked list implementation.
The new approach offers better debugging, automatic memory management, and eliminates state synchronization bugs.
The solution maintains identical functionality with a significantly simpler implementation, focusing on DOM manipulation for visual stacking and column sharing.
Addresses potential performance concerns of DOM queries by scoping them to specific containers.
Refactors event overlap detection to use pixel-based comparison.
This improves accuracy and addresses issues with incorrect overlap
calculations when events have slight time differences but visually overlap.
It removes dependency on the event manager and the need to convert elements
to calendar events for overlap detection.
Refactors event dropping logic to first check for existing
event groups. If a group exists and the dropped event overlaps
with it, the dropped event is added to the group. Otherwise,
it proceeds with full overlap detection against individual events.
This change prevents unnecessary group creation and optimizes
event arrangement within columns. It also ensures the dragged
event is placed on the rightmost side by adding it to the
overlapping events array last.
Updates the event overlap detection to accurately determine when events overlap in time, fixing incorrect stacking behavior.
Implements column sharing for events starting within 30 minutes of each other.
Applies stacking only when events truly overlap in time but start times differ by more than 30 minutes.
Removes unnecessary data attributes and simplifies styling for stacked events, improving code cleanliness and performance.
Adds logic to handle event overlaps in the calendar view. It introduces two patterns: column sharing for events with the same start time (rendered using flexbox) and stacking for events with a >30 min difference (rendered with reduced width and z-index).
It also introduces deep linking to specific events via URL parameters.
Enhances drag and drop behavior by introducing free positioning during auto-scroll and snapping to grid intervals.
- Introduces a `calculateFreePosition` method to allow events to follow the mouse exactly during auto-scroll.
- Modifies the drag move event to emit the snapped position during normal drag behavior.
- Updates event rendering to use grid settings for snap intervals.
- Updates grid styles to configure CSS variables dynamically.
Refines the drag and drop autoscroll functionality to correctly update the position of the dragged element relative to the scrolling container.
Calculates the snapped position based on the column's bounding rectangle and scroll movement, ensuring accurate placement during autoscroll. This provides a smoother and more responsive user experience when dragging elements near the edges of the scrollable area.
Streamlines calendar configuration by adopting a singleton pattern for consistent access and simplifies event handling.
- Removes direct `CalendarConfig` dependency injection in favor of the `calendarConfig` singleton, reducing code complexity.
- Replaces specific event emissions for grid, date, and resource settings updates with a general `REFRESH_REQUESTED` event.
- Updates event names to be more descriptive and consistent ("NAVIGATION_COMPLETED", "PERIOD_INFO_UPDATE").
- Removes the need to pass the calendar config to renderers since it is now a singleton.
This improves code maintainability and simplifies the event emission process.
This change refactors the DateCalculator class to be a static class.
This removes the need to instantiate DateCalculator in multiple
managers and renderers, simplifying dependency management and
ensuring consistent date calculations across the application.
The configuration is now initialized once at the application start.
Caches frequently accessed DOM elements in NavigationManager and
EventRenderer to reduce redundant queries, improving performance.
Updates the event renderer to trigger all-day height animations and
introduces a destroy method for resource management.
Refactors time formatting in EventRenderer to handle both total
minutes and Date objects using a unified method.
Refactors all-day event handling to enhance user experience.
Introduces dynamic height animation for all-day event rows, adapting to the number of overlapping events. This ensures efficient use of screen space and prevents unnecessary scrolling.
Additionally, events now store all relevant data, and the header height is checked and animated after navigation.
The previous HeaderRenderer.ts file has been refactored.
Simplifies and improves the all-day event rendering process, ensuring
consistent container creation and proper placement of events.
- Ensures all-day containers are consistently created during header
rendering, preventing potential issues with event placement.
- Removes the complex and unreliable mouseover detection for all-day
conversion, simplifying the event dragging logic.
- Eliminates the dynamic all-day row height calculation, relying on
CSS for layout control.
- Prevents errors when the all-day container is missing.
Cleans up the codebase by removing unnecessary console log statements.
These logs were primarily used for debugging and are no longer needed in the production code.
This reduces noise in the console and improves overall performance.
Allows users to drag timed events to the header area to convert them to all-day events.
This also enables dragging all-day events to different days
by updating the grid column position.
A header mouseover detection is set up to emit the 'header:mouseover' event,
handling both the timed event to all-day conversion and the
all-day event movement to different days.
Refines the drag and drop functionality in the event renderer.
Ensures proper cleanup and normalization of event clones after a drag operation.
Adds logging for debugging purposes.
Initializes drag event listeners within the DateEventRenderer class to ensure listeners are set up.
Introduces a DragDropManager to handle event dragging and dropping, replacing the ColumnDetector.
This change centralizes drag and drop logic, improving code organization and maintainability.
The EventRenderer now uses the DragDropManager's events to visually update the calendar during drag operations.
Removes ColumnDetector which is now replaced by the drag and drop manager.
Ensures the all-day event container's grid layout is correctly updated to reflect the number of rows needed, even when the overall height doesn't change.
This prevents layout issues when events are rearranged without triggering a height recalculation.
Also updates the grid template when the height is updated in the BaseEventRenderer.
Refactors all-day event container handling to improve rendering and event delegation.
Ensures all-day containers are consistently created and managed,
preventing issues with event display and drag-and-drop functionality.
Moves event listener setup into dedicated methods for better
organization and reusability.
Handles dragging of both timed events (converting to all-day) and existing all-day events to different days.
Refactors all-day height recalculation to support animated transitions for a smoother user experience when all-day event counts change.
Uses event delegation for header mouseover detection.
Updates ScrollManager to listen for header height changes.
Enhances the drag and drop experience for all-day events by expanding the header to display the all-day row when dragging an event over it.
Introduces constants for all-day event layout.
Improves event rendering by introducing dedicated event
renderers and streamlining event display logic.
- Adds a base event renderer and specialized date and
resource-based renderers to handle event display logic.
- Renders all-day events within a dedicated container in the
calendar header.
- Removes the direct filtering of all-day events from the
`GridManager`.
- Fixes an issue where the 'Summer Festival' event started on the
wrong date.
The changes enhance the flexibility and maintainability of the
calendar, provide dedicated containers and styling for allday events and fix date issues related to certain events
Introduces work hours management with weekly default and date-specific overrides to support per-column scheduling.
Calculates and applies non-work hour overlays to columns.
This allows users to visualize working and non-working times.
Adjusts event rendering to prevent overlap with horizontal timelines.
Introduces basic month view structure and styling with week numbers.
Creates expanded month view with event details and duration-based sizing.
Moves event color handling to CSS classes for better flexibility and theming.
Improves calendar performance and data flow by streamlining event emissions and grid rendering logic.
- Replaces generic CONFIG_UPDATE events with REFRESH_REQUESTED
for more specific refresh triggers.
- Removes redundant grid re-renders on DATE_CHANGED and
WEEK_CHANGED events, delegating navigation to NavigationManager.
- Introduces VIEW_CHANGED and DATE_CHANGED events for calendar
mode and date selection, respectively.
- NavigationManager now handles date validation.
- Moves rendering logic from NavigationManager to NavigationRenderer.
- Syncs scroll position based on PERIOD_CHANGED instead of
NAVIGATION_ANIMATION_COMPLETE.
This change optimizes the calendar's responsiveness and reduces
unnecessary re-renders, leading to a smoother user experience.
Centralizes all date calculations into a new `DateCalculator` class for better maintainability and consistency.
Ensures correct ISO week handling (Monday as the first day) throughout the calendar.
Updates `CalendarConfig` to use ISO day numbering (1-7 for Mon-Sun) for work week definitions.
Fixes issue where date calculations were inconsistent.
Enhances event rendering and navigation.
Updates navigation logic to use pre-rendered events.
Removes the need for `CONTAINER_READY_FOR_EVENTS` event.