Commit graph

91 commits

Author SHA1 Message Date
Janus C. H. Knudsen
cda201301c Remove resource calendar mode support
Simplifies calendar configuration and removes resource-specific code paths

Eliminates complexity around resource-based calendar rendering by:
- Removing ResourceCalendarData type
- Removing resource-specific renderers and managers
- Streamlining event and grid management logic
- Consolidating to single date-based calendar implementation
2025-11-01 01:10:10 +01:00
Janus C. H. Knudsen
7a79297854 Improves calendar header spacing.
Adds padding to the calendar header for better visual appearance.
2025-10-10 00:06:31 +02:00
Janus C. H. Knudsen
8ca49037e9 Improves date header localization
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.
2025-10-09 23:08:33 +02:00
Janus C. H. Knudsen
6f79954342 Improves event drag and drop highlighting
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.
2025-10-09 22:31:49 +02:00
Janus C. H. Knudsen
03f9fa48d2 Adds shadow to stacked events
Improves the visual appearance of stacked events
by adding a subtle shadow effect, enhancing depth and
distinction between overlapping elements.
2025-10-08 22:57:02 +02:00
Janus C. H. Knudsen
e83753a7d2 Improves event drag and drop
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.
2025-10-08 21:50:41 +02:00
Janus C. H. Knudsen
1e5b3166b2 Improves event resizing with smooth animation
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.
2025-10-08 21:43:02 +02:00
Janus C. H. Knudsen
3145752591 Improves event hover highlighting
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.
2025-10-08 18:15:00 +02:00
Janus C. H. Knudsen
8b8a1e3127 wip, resize, debugging 2025-10-08 00:58:38 +02:00
Janus C. H. Knudsen
e2cf4d1e04 Improves click handling on calendar elements
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.
2025-10-07 17:36:03 +02:00
Janus C. H. Knudsen
3982e2f25f Improves resize handle appearance
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.
2025-10-07 17:21:23 +02:00
Janus C. H. Knudsen
70dce9fd59 Improves event resize handle interaction
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.
2025-10-07 17:16:00 +02:00
Janus C. H. Knudsen
a9819a8bf1 Enables event resizing via drag handles
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.
2025-10-06 23:38:01 +02:00
Janus C. H. Knudsen
7d7a8d9208 wip 2025-10-06 22:29:31 +02:00
Janus C. H. Knudsen
9981a5a5af Trying to adjust top for clear time lines 2025-10-06 22:06:00 +02:00
Janus C. H. Knudsen
2f58ceccd4 Implements advanced event stacking and grid layout
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.
2025-10-05 23:54:50 +02:00
Janus C. H. Knudsen
a9d6d14c93 Refactors event element handling with web components
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.
2025-10-04 15:35:09 +02:00
Janus C. H. Knudsen
9bc082eed4 Improves date handling and event stacking
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.
2025-10-04 00:32:26 +02:00
Janus C. H. Knudsen
496be2f7ce Improves all-day event overflow handling
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.
2025-10-02 16:57:43 +02:00
Janus C. H. Knudsen
54acdb9b41 WIP 2025-10-02 15:57:11 +02:00
Janus C. H. Knudsen
135787146c Refines all-day event display
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.
2025-10-02 01:11:32 +02:00
Janus C. H. Knudsen
f2ad13776f Improves all-day event row height calculation
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.
2025-10-02 01:03:35 +02:00
Janus C. H. Knudsen
6223bcd176 Improves all-day event display in collapsed mode
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.
2025-09-30 15:24:58 +02:00
Janus C. H. Knudsen
c705869c9e Implements all-day event row collapsing
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.
2025-09-30 00:34:27 +02:00
Janus C. H. Knudsen
5417a2b6b1 Improves drag and drop functionality
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.
2025-09-30 00:13:52 +02:00
Janus C. H. Knudsen
83e01f9cb7 Improves all-day event drag and drop
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.
2025-09-29 20:50:52 +02:00
Janus C. H. Knudsen
0553089085 Improves all-day event drag and drop
Refactors all-day event drag and drop handling for improved accuracy and performance.

Introduces a shared `ColumnDetectionUtils` for consistent column detection.

Simplifies all-day conversion during drag, placing events in row 1 and calculating the column from the target date.

Implements differential updates during drag end, updating only changed events for smoother transitions.
2025-09-26 22:11:57 +02:00
Janus C. H. Knudsen
c682c30e23 Improves all-day drag-and-drop conversion
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.
2025-09-21 21:30:51 +02:00
Janus C. H. Knudsen
2cdbc8f1a3 Unifies all-day event element tag
Removes the `swp-allday-event` custom element, using `swp-event` for all-day events instead. All-day events are now distinguished by their parent `swp-allday-container`. Simplifies element management and CSS selectors.
2025-09-21 16:03:34 +02:00
Janus Knudsen
b4af5a9211 Improves all-day event hover detection
Enhances the all-day event selection by creating transparent, full-height columns for each day, which enables more accurate and reliable hover detection across all-day events.

Now selects all-day events by hovering on the entire column, not just day headers.
2025-09-17 22:08:27 +02:00
Janus Knudsen
b95a516806 Improves drag and drop event handling
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.
2025-09-16 23:09:10 +02:00
Janus Knudsen
9cdf4fbe96 Improves drag and drop functionality and fixes issues
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.
2025-09-13 20:47:42 +02:00
Janus Knudsen
c07d83d86f Refactors calendar event rendering and management
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.
2025-09-12 00:36:02 +02:00
Janus Knudsen
72019a3d9a wip 2025-09-09 14:35:21 +02:00
Janus Knudsen
6afea2571b Fixes event overlap detection and stacking logic
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.
2025-09-04 19:22:26 +02:00
Janus Knudsen
ff067cfac3 Implements event overlap rendering
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.
2025-09-04 00:16:35 +02:00
Janus Knudsen
7a1c776bc1 Improves drag and drop functionality
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.
2025-09-03 20:48:23 +02:00
Janus Knudsen
7f387cfa30 Improves header animation performance.
Refactors the header animation to animate the calendar header's height instead of just the all-day container.

This change improves the perceived performance of the animation. It also reduces animation duration.
2025-09-03 00:12:47 +02:00
Janus Knudsen
8332f2c748 Prepares for Web Animations API integration.
Removes a height transition and sets an initial height,
paving the way for future integration with the Web Animations API.
2025-09-01 23:44:37 +02:00
Janus Knudsen
58d6ad2ed2 Improves header animation performance
Simplifies header animation logic by leveraging CSS Grid for height transitions.

This change removes the direct height animation of the calendar header and relies on CSS Grid's auto row feature to manage the header expansion.
It also removes the manual spacer height calculations in Typescript, and relies on CSS variables to control this.
This results in a smoother and more efficient animation, especially when all-day events are present.
2025-09-01 20:13:15 +02:00
Janus Knudsen
ae42de1f3b Improves all-day event rendering and placement
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.
2025-08-31 23:48:34 +02:00
Janus Knudsen
2c934a7a1a Improves all-day event container creation and animation
Refactors all-day event container creation to be lazy, improving
initial load performance. The container is now created and animated
into view only when needed, specifically when the first event is
dragged into the all-day section. This avoids unnecessary DOM
manipulation and improves the perceived responsiveness of the
calendar.
2025-08-28 00:13:11 +02:00
Janus Knudsen
be4a8af7c4 Updates all-day event grid row layout
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.
2025-08-27 20:54:06 +02:00
Janus Knudsen
f9b7686b22 Back to a single swp-allday-container 2025-08-26 00:05:42 +02:00
Janus Knudsen
f2763ad826 Improves all-day event drag and drop
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.
2025-08-25 21:20:51 +02:00
Janus Knudsen
eb08a28495 Improves all-day event drag and drop
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.
2025-08-24 23:31:11 +02:00
Janus Knudsen
9c65143df2 Refactors event rendering and display
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
2025-08-24 00:13:07 +02:00
Janus Knudsen
25522bfe17 A working test of an all-day-event 2025-08-23 23:01:22 +02:00
Janus Knudsen
12df6a9b06 Adds fuzzy search filter system
Implements a fuzzy search filter system using Fuse.js to enhance event searching.

This system allows users to quickly find events by typing partial matches of event titles or descriptions, providing visual feedback by dimming non-matching events. The filter persists during navigation and includes escape key support for quick clearing. It also includes performance optimizations like requestAnimationFrame debouncing.
2025-08-23 00:01:59 +02:00
Janus Knudsen
a3ed03ff44 Adds work hours management with day-specific overrides
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.
2025-08-22 22:57:35 +02:00