Commit graph

339 commits

Author SHA1 Message Date
Janus C. H. Knudsen
29ba0bfa37 Refactors view management in calendar component
Introduces ViewSelectorManager to handle view state and UI interactions

Separates view logic from configuration management
Adds explicit tracking of current calendar view
Enhances view selection and state management

Improves modularity and separation of concerns
2025-11-07 23:07:00 +01:00
Janus C. H. Knudsen
8970dd954b Merge branch 'debug-gridstyle' 2025-11-07 21:55:26 +01:00
Janus C. H. Knudsen
c1e0da056c Refactor workweek presets into dedicated manager
Extracts workweek preset logic from ViewManager into WorkweekPresetsManager

Improves separation of concerns by:
- Creating a dedicated manager for workweek preset UI
- Simplifying ViewManager to focus only on view selector
- Implementing event-driven CSS updates
- Reducing code duplication in ConfigManager

Follows "each UI element has its own manager" architectural principle
2025-11-07 21:50:07 +01:00
Janus C. H. Knudsen
c72ab9aaf1 Adds WorkweekPresetsManager and ConfigManager integration
Registers new managers in the dependency injection container
Exposes WorkweekPresetsManager and ConfigManager in calendar debugging context

Enhances calendar initialization with additional management capabilities
2025-11-07 21:05:59 +01:00
Janus C. H. Knudsen
024ad45bfd Refactor workweek preset change handling
Simplifies workweek change event propagation across managers

Removes redundant grid rerendering logic and focuses on clean event communication
Prepares infrastructure for more flexible workweek configuration updates

Relates to debug-gridstyle branch
2025-11-07 15:12:05 +01:00
Janus C. H. Knudsen
1fa7aa26e5 Unused function 2025-11-06 23:56:20 +01:00
Janus C. H. Knudsen
34cf4fbfca Refactor resize and event rendering with performance improvements
Optimizes event resize and rendering logic by:
- Simplifying resize handle management
- Improving single column event rendering
- Reducing unnecessary DOM operations
- Removing redundant event caching and subscriptions

Improves performance and reduces complexity in event interaction flow
2025-11-06 23:05:20 +01:00
Janus C. H. Knudsen
133cf34906 Adds event resize handle mouse enter tracking
Implements mouse enter event listener on calendar container to log resize handle visibility for debugging

Enhances event resize handle interaction tracking
2025-11-06 22:14:50 +01:00
Janus C. H. Knudsen
ccfc1a99b2 Refactor ResizeHandleManager with improved resize logic
Enhances event resizing functionality with smoother animation and more robust handling

Removes complex resize zone tracking in favor of simplified resize mechanism
Improves performance and simplifies event resize interactions
Cleans up unnecessary complexity in pointer and animation management
2025-11-06 22:14:35 +01:00
Janus C. H. Knudsen
04b6847f55 Remove DragHoverManager and update hover styles
Replaces custom hover tracking with native CSS :hover pseudo-class
Simplifies event hover handling by removing dedicated manager

Reduces complexity of hover interactions
2025-11-06 21:11:45 +01:00
Janus C. H. Knudsen
3b6f0407fb Refactors event rendering and drag-and-drop logic
Simplifies event drag handling by removing redundant clone management
Optimizes single column event rendering and cleanup process
Removes unnecessary logging and console output
Improves event update and re-rendering strategies

Enhances performance and reduces complexity in event manipulation
2025-11-06 21:11:22 +01:00
Janus C. H. Knudsen
fba85094d7 Tracks original column during drag and drop
Introduces originalSourceColumn to accurately track the starting column during drag events

Improves event rendering by ensuring correct column updates and maintaining drag context
Modifies drag end handling to use original source column for re-rendering
Adds async support for column rendering methods
2025-11-06 16:18:31 +01:00
Janus C. H. Knudsen
fb174e7403 WIP 2025-11-05 22:19:48 +01:00
Janus C. H. Knudsen
202074e391 Refactors resize and position utility handling
Extracts position calculation logic into a separate utility class

Introduces PositionUtils to centralize pixel and minute conversion methods
Removes redundant calculation methods from ResizeHandleManager
Updates Configuration to include default API endpoint

Simplifies resize and height management across components
2025-11-05 21:53:08 +01:00
Janus C. H. Knudsen
a1bee99d8e Refactor offline-first architecture with IndexedDB
Improves dependency injection and service initialization for IndexedDB-based calendar application

Implements lazy initialization for IndexedDB
Fixes race conditions in async event handling
Adds proper dependency injection with registerType
Enhances sync manager and repository pattern

Key improvements:
- Lazy database initialization
- Proper service lifecycle management
- Improved network awareness for sync operations
- Cleaned up initialization logic in index.ts
2025-11-05 20:35:21 +01:00
Janus C. H. Knudsen
e7011526e3 Implements offline-first calendar sync infrastructure
Adds IndexedDB and operation queue for robust offline synchronization
Introduces SyncManager to handle background data synchronization
Supports local event operations with automatic remote sync queuing

Enhances application reliability and user experience in low/no connectivity scenarios
2025-11-05 00:37:57 +01:00
Janus C. H. Knudsen
9c765b35ab Cleanup test files and move to another folder 2025-11-05 00:07:19 +01:00
Janus C. H. Knudsen
8456d8aa28 Enhances CSS grid configuration synchronization
Replaces isolated grid column update with comprehensive CSS property management

Extends configuration synchronization to include:
- Dynamic grid layout dimensions
- Hour height configuration
- Work and day hour boundaries

Provides more flexible and configurable grid styling
2025-11-03 23:07:30 +01:00
Janus C. H. Knudsen
d3f4667b61 Adds dynamic CSS grid column management
Updates ConfigManager to dynamically set CSS grid columns based on work week settings

Ensures the grid layout accurately reflects the number of visible days in the calendar view
Automatically updates grid columns when work week configuration changes

Improves responsive design and layout flexibility
2025-11-03 22:52:48 +01:00
Janus C. H. Knudsen
989c9bd69d Batch update, WIP 2025-11-03 22:04:37 +01:00
Janus C. H. Knudsen
8ec5f52872 Adds I-prefix to all interfaces 2025-11-03 21:30:50 +01:00
Janus C. H. Knudsen
80aaab46f2 WIP on master 2025-11-03 14:54:57 +01:00
Janus C. H. Knudsen
b6ab1ff50e Refactors and optimizes core calendar managers
Streamlines several core managers by removing unnecessary complexity, caching, and redundant methods

Key improvements:
- Simplified event and view management logic
- Removed unnecessary caching mechanisms
- Reduced method complexity in managers
- Improved code readability and performance
2025-11-01 21:07:07 +01:00
Janus C. H. Knudsen
1ae4f00f2b Refactor renderer interfaces and update type names
Renames renderer interfaces to use 'I' prefix for clarity
Updates type references across related files
Improves type consistency in rendering strategies
2025-11-01 16:28:45 +01:00
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
349e1e8293 Refactor CalendarConfig to static configuration class
Converts CalendarConfig to a pure static configuration management class with improved initialization and dependency handling

Removes event bus dependencies and simplifies configuration loading
Adds static methods for config management and initialization
Improves flexibility and reduces class complexity
2025-10-31 15:26:07 +01:00
Janus C. H. Knudsen
8bbb2f05d3 Refactors dependency injection and configuration management
Replaces global singleton configuration with dependency injection
Introduces more modular and testable approach to configuration
Removes direct references to calendarConfig in multiple components
Adds explicit configuration passing to constructors

Improves code maintainability and reduces global state dependencies
2025-10-30 23:47:30 +01:00
Janus C. H. Knudsen
fb48e410ea Refactors calendar configuration and DI container setup
Removes singleton export for CalendarConfig
Updates dependency injection to use type registration
Adds more flexible renderer and service configuration
Integrates CalendarConfig with DateService initialization
2025-10-30 22:05:06 +01:00
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
a80e4a7603 Implements dependency injection with Brandi
Replaces manual manager creation with Brandi DI container
for improved dependency management and testability.

Removes the ManagerFactory and its usages.
2025-10-15 20:09:12 +02:00
Janus C. H. Knudsen
b3b930c1f9 wip 2025-10-15 00:58:29 +02:00
Janus C. H. Knudsen
bf4b9b5064 Implements dynamic renderer injection
Uses dependency injection to dynamically resolve renderers based on the calendar mode.

This change decouples the HeaderManager from specific renderer implementations,
allowing for more flexible configuration and easier addition of new calendar types.
The appropriate renderer is bound to a token in the DI container at startup.
2025-10-15 00:40:51 +02:00
Janus C. H. Knudsen
f7c67e6253 Implements dependency injection with Brandi
Introduces Brandi DI container for managing application dependencies.

This change replaces the existing factory pattern with a proper
dependency injection mechanism, improving code modularity,
testability, and maintainability. It configures all managers and core
services within the container, ensuring proper dependency resolution.
2025-10-14 22:53:28 +02:00
Janus C. H. Knudsen
020d5c3efc Adds header manager to calendar
Adds a header manager to handle header related
functionality within the calendar. Removes unused
methods from CalendarManager.
2025-10-14 21:27:54 +02:00
Janus C. H. Knudsen
4bd94d3be2 More cleanup 2025-10-14 19:21:28 +02:00
Janus C. H. Knudsen
ee4b9b3707 Refactors event emission for date and workweek changes
Moves event emission responsibilities for date and
workweek changes to the calling components. This allows
for consolidated updates and optimized event handling,
avoiding redundant emissions and ensuring that events
are triggered with the correct payload.
2025-10-14 18:10:51 +02:00
Janus C. H. Knudsen
5b0ae0ca5c Improves edge scroll and drag handling
Increases edge scrolling speed for improved user experience.

Refactors header drag event handling to use handler methods for better organization.
2025-10-14 17:47:12 +02:00
Janus C. H. Knudsen
5f4a7fa9b1 Improves edge scrolling boundary detection.
Enhances edge scrolling logic to prevent over-scrolling
by checking boundaries based on dragged element position.
This prevents scrolling past the top or bottom edges
of the time grid during drag operations.
Also adds debugging logs for scroll check.
2025-10-13 23:57:12 +02:00
Janus C. H. Knudsen
82921e0643 Extracts drag hover logic into dedicated manager
Moves event hover handling from DragDropManager to a new DragHoverManager.

This improves separation of concerns and makes the hover logic more modular and reusable. The DragHoverManager is now responsible for tracking when the mouse hovers over events, and it emits events for other parts of the application to react to.

The drag:start event is used to deactivate hover tracking when a drag operation starts.
2025-10-13 23:05:03 +02:00
Janus C. H. Knudsen
78ad5d3bc0 Animates drag cancellation
Improves user experience by animating the dragged element back to its original position when the drag operation is cancelled due to the mouse leaving the grid container.
2025-10-13 22:41:20 +02:00
Janus C. H. Knudsen
1d04f0ce0a Improves drag and drop conversion behavior
Resets scroll state and stops edge scrolling when a drag event converts between all-day and timed events, preventing unexpected scrolling behavior during conversion.
2025-10-13 22:17:17 +02:00
Janus C. H. Knudsen
3fd42f1f9b Improves drag scroll compensation accuracy
Refactors drag scroll compensation to use a direct scroll delta instead of accumulating the scroll.

This improves accuracy and responsiveness during drag operations when the scrollable content is being scrolled. It now updates the target position immediately as the user scrolls.
2025-10-13 21:22:33 +02:00
Janus C. H. Knudsen
b0894629df wip 2025-10-13 21:02:09 +02:00
Janus C. H. Knudsen
9a7a90c124 Improves drag-and-drop scroll compensation.
Enhances drag-and-drop functionality by accurately compensating for scroll during drag operations.
This ensures the dragged element remains correctly positioned relative to the mouse,
even when the user scrolls the content during the drag.

It achieves this by:
- Tracking whether scrolling has occurred during a drag operation.
- Factoring scroll delta into target position calculation.
- Updating targetY/currentY instead of directly manipulating the clone's style.
2025-10-13 20:24:19 +02:00
Janus C. H. Knudsen
dbbd19de13 wip 2025-10-13 18:03:08 +02:00
Janus C. H. Knudsen
d259620371 Refactors edge scroll start detection
Improves edge scroll detection by listening for actual scroll events instead of relying on mouse position.

This change ensures that the 'edgescroll:started' event is only emitted when scrolling has actually begun, preventing false positives and improving the accuracy of scroll compensation. It also removes the unnecessary scroll listener from the DragDropManager, consolidating scroll handling in the EdgeScrollManager.
2025-10-13 17:49:19 +02:00
Janus C. H. Knudsen
faf8b50593 Improves drag and drop with edge scrolling
Enhances the drag and drop experience by integrating edge scrolling,
allowing users to scroll the calendar view while dragging events.

Fixes issues with event positioning during scrolling by compensating
for scroll changes during drag operations. Also, adds mock events
to data.
2025-10-13 17:20:17 +02:00
Janus C. H. Knudsen
a0344c6143 Improves drag event handling and scrolling
Refactors drag and drop event handling for smoother updates.

Tracks the current mouse position during drag operations to improve the accuracy of position updates.

Adjusts edge scrolling behavior.
2025-10-12 23:17:22 +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