Commit graph

41 commits

Author SHA1 Message Date
Janus C. H. Knudsen
10cb3792f4 Updates build config and removes unused dependencies
Migrates from Brandi DI to @novadi/core dependency injection
Simplifies project structure by removing deprecated modules
Adds Novadi unplugin to esbuild configuration for enhanced build process
2025-10-30 21:46:38 +01:00
Janus C. H. Knudsen
b3b930c1f9 wip 2025-10-15 00:58:29 +02:00
Janus C. H. Knudsen
4bd94d3be2 More cleanup 2025-10-14 19:21:28 +02:00
Janus C. H. Knudsen
e620c919aa Improves drag and drop functionality
Refactors drag and drop to use the original element as the source and introduces edge scrolling.

This change aims to enhance the user experience during drag and drop operations by ensuring the correct element is used as the source, fixing issues, and by automatically scrolling the view when the dragged element reaches the edge of the scrollable area.
2025-10-12 22:00:02 +02:00
Janus C. H. Knudsen
8df1f6c4f1 Implements edge scrolling functionality
Adds edge scrolling to automatically scroll the calendar
when dragging an event near the edges of the view.

This improves the drag-and-drop experience by allowing users
to move events beyond the visible area.

Removes auto-scroll logic from the event renderer, centralizing
the scrolling behavior within the new edge scroll manager.
2025-10-12 09:21:32 +02:00
Janus C. H. Knudsen
9b073a15b7 Refactors all-day event conversion to timed events
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.
2025-10-11 01:30:41 +02:00
Janus C. H. Knudsen
0a3d274164 Enables all-day event to timed event conversion
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.
2025-10-10 19:37:10 +02:00
Janus C. H. Knudsen
78ca23c07a Enables all-day event conversion on column hover
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.
2025-10-10 16:41:48 +02:00
Janus C. H. Knudsen
5d406201b8 Refactors drag and drop logic
Improves drag and drop initialization and handling by extracting methods for clarity.
This enhances code readability and maintainability.
2025-10-08 23:29:56 +02:00
Janus C. H. Knudsen
ecb1729c28 Enhances event drag and resize functionality
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.
2025-10-08 22:18:06 +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
89e8a3f7b2 wip 2025-10-02 23:11:26 +02:00
Janus C. H. Knudsen
88702e574a Improves drag and drop all-day event handling
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.
2025-10-02 17:40:58 +02:00
Janus C. H. Knudsen
5cdcd12e0a Updates all-day event overflow indicator
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.
2025-10-02 17:30:48 +02:00
Janus C. H. Knudsen
a1e1c5d185 Removes unnecessary destroy methods 2025-10-01 22:38:15 +02:00
Janus C. H. Knudsen
d7867d4a9f Renders all-day events based on header data
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.
2025-10-01 21:27:13 +02:00
Janus C. H. Knudsen
ae3aab5dd0 Improves all-day event layout and drag behavior
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.
2025-10-01 18:41:28 +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
6ccc071587 Refactors drag and drop column detection
Improves drag and drop functionality by refactoring column detection to use column bounds instead of dates.
This change enhances the accuracy and efficiency of determining the target column during drag operations.
It also removes redundant code and simplifies the logic in both the DragDropManager and AllDayManager.
2025-09-28 13:25:09 +02:00
Janus C. H. Knudsen
4141bffca4 Refactors all-day event layout calculation
Simplifies all-day event rendering by streamlining the layout
calculation and event placement process, using the AllDayLayoutEngine
to determine the grid positions. This removes deprecated methods
and improves overall code clarity.
2025-09-27 15:01:22 +02:00
Janus C. H. Knudsen
9dfd4574d8 Improves drag and drop for timed and all-day events
Refactors drag and drop handling to use a cloned event element,
ensuring correct positioning and styling during drag operations
for both regular timed events and all-day events.

This change streamlines the drag and drop process by:
- Creating a clone of the dragged event at the start of the drag.
- Passing the clone through the drag events.
- Handling all-day events with the AllDayManager
- Handling regular timed events with the EventRendererManager

This resolves issues with event positioning and styling during
drag, especially when moving events across columns or between
all-day and timed sections.
2025-09-26 22:53:49 +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
a624394ffb Improves all-day event layout calculation
Refactors all-day event rendering to use a layout engine
for overlap detection and positioning, ensuring events
are placed in available rows and columns.

Removes deprecated method and adds unit tests.
2025-09-25 23:38:17 +02:00
Janus C. H. Knudsen
48d1fd681c Major refactor into type safe TS
With a risk oof rolling it all back
2025-09-23 20:44:15 +02:00
Janus C. H. Knudsen
6498b0ba8e Refactors all-day event rendering and DOM access
Decouples all-day event rendering, making it reactive to header readiness with period data.
Eliminates explicit DOM element caching, simplifying element access.
Enhances the `header:ready` event payload with `startDate` and `endDate`.
Improves all-day row height animation and calculation.
2025-09-22 23:37:43 +02:00
Janus C. H. Knudsen
f5e9909935 Separates all-day event rendering; handles header lifecycle
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.
2025-09-22 21:53:18 +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
c7dcfbbaed Improves drag-drop event system with type safety
Introduces dedicated TypeScript interfaces for all drag-and-drop event payloads, enhancing type safety and developer experience.

Centralizes drag event detection and emission within `DragDropManager`. Refactors `AllDayManager`, `HeaderManager`, and `EventRendererManager` to subscribe to these typed events, improving decoupling and clarifying responsibilities.

Resolves known inconsistencies in drag event payloads, especially for all-day event conversions. Adds a comprehensive analysis document (`docs/EventSystem-Analysis.md`) detailing the event system and planned improvements.
2025-09-21 15:48:13 +02:00
Janus C. H. Knudsen
b4f5b29da3 Refactors event drag-drop and cloning logic
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.
2025-09-20 09:40:56 +02:00
Janus C. H. Knudsen
0b7499521e Enables all-day event drag and drop
Implements comprehensive drag and drop for all-day events, allowing movement within the header and conversion to timed events when dragged into the calendar grid.

Optimizes column detection with a cached bounding box strategy, improving performance and accuracy. Refactors event conversion logic and renames related event bus events for clarity.
2025-09-19 00:20:30 +02:00
Janus Knudsen
2083c6921e Refactors calendar configuration and event handling
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.
2025-09-03 20:04:47 +02:00
Janus Knudsen
fafad16926 Removes excessive logging statements
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.
2025-08-31 22:39:09 +02:00
Janus Knudsen
07402a07d9 Improves all-day event rendering and handling
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.
2025-08-25 22:05:57 +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
0ea4e47324 Refactors calendar type to calendar mode
Updates the codebase to utilize `CalendarMode` instead of the deprecated `CalendarType`.

Simplifies `CalendarConfig` by removing legacy methods and related type aliases, enhancing code maintainability and clarity.

Improves event rendering by ensuring `GRID_RENDERED` events include explicit start and end dates, preventing errors and ensuring correct data filtering.
2025-08-20 21:51:49 +02:00
Janus Knudsen
4b4dbdc0d6 Refactors event system to use CoreEvents
Migrates the application to use a new CoreEvents system.

This change removes the legacy EventTypes constant file and updates all managers, renderers, and core components to use the CoreEvents constant file for event emission and subscription.

This improves code maintainability and promotes a consistent eventing strategy across the application. Adds validation to EventBus emit and extractCategory functions.
2025-08-20 20:22:51 +02:00
Janus Knudsen
414ef1caaf Implements strategy pattern for calendar views
Refactors the grid management to use a strategy pattern, allowing for different calendar views (week, month, day) to be rendered using separate strategy implementations.

This approach improves code organization, reduces complexity within the main grid manager, and makes it easier to add new view types in the future.

The strategy pattern centralizes view-specific logic, improves testability, and reduces code duplication.

A month view strategy has been added and is now selectable via UI.
2025-08-20 19:52:18 +02:00
Janus Knudsen
3ddc6352f2 Refactors calendar architecture for month view
Prepares the calendar component for month view implementation
by introducing a strategy pattern for view management,
splitting configuration settings, and consolidating events
into a core set. It also removes dead code and enforces type safety,
improving overall code quality and maintainability.

Addresses critical issues identified in the code review,
laying the groundwork for efficient feature addition.
2025-08-20 19:42:13 +02:00
Janus Knudsen
7d513600d8 Refactors date handling for ISO week compatibility
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.
2025-08-20 00:39:31 +02:00
Janus Knudsen
26f0cb8aaa Refactors calendar initialization with factory
Implements a factory pattern for manager creation and
initialization, improving dependency management and
extensibility.

This change replaces direct manager instantiation with a
`ManagerFactory` that handles dependency injection. This
enhances code organization and testability. It also includes
an initialization sequence diagram for better understanding
of the calendar's architecture and data flow.
2025-08-17 23:44:30 +02:00
Janus Knudsen
32ee35eb02 Refactors grid and navigation rendering
Attempt 1
2025-08-17 22:54:00 +02:00
Renamed from src/managers/EventRenderer.ts (Browse further)