Commit graph

415 commits

Author SHA1 Message Date
Janus C. H. Knudsen
0f10d44037 Refactors date handling in calendar components
Updates event and column date parsing to use identifier instead of data attribute

Improves date handling consistency across multiple calendar managers and renderers
Replaces direct Date casting with dateService.parseISO() for more robust date parsing
2025-11-18 16:43:50 +01:00
Janus C. H. Knudsen
8e52d670d6 Refactor entity services with hybrid sync pattern
Introduces BaseEntityService and SyncPlugin to eliminate code duplication across entity services

Improves:
- Code reusability through inheritance and composition
- Sync infrastructure for all entity types
- Polymorphic sync status management
- Reduced boilerplate code by ~75%

Supports generic sync for Event, Booking, Customer, and Resource entities
2025-11-18 16:37:33 +01:00
Janus C. H. Knudsen
2aa9d06fab Refactor storage architecture with modular IndexedDB services
Implements a more flexible, modular approach to IndexedDB storage:
- Introduces IStore interface for dynamic store creation
- Adds specialized services for each entity (BookingService, CustomerService, etc.)
- Moves serialization logic to entity-specific classes
- Improves dependency injection and extensibility

Enables easier addition of new entity types with minimal configuration
2025-11-17 17:36:51 +01:00
Janus C. H. Knudsen
88cccb3456 Enhances IndexedDB service with booking and resource support
Updates IndexedDB database schema to version 2
Adds support for bookings, customers, and resources stores
Includes new serialization methods for booking data
Extends events store with additional indexes for improved querying
2025-11-16 19:56:31 +01:00
Janus C. H. Knudsen
6174dc895e Adds comprehensive mock data migration guide for booking architecture
Documents fundamental redesign of booking and calendar event architecture, focusing on:
- Service-level resource assignment
- Split-resource and equal-split booking scenarios
- Denormalized event data structure
- Clear separation between booking and calendar events

Provides detailed migration strategy and type references for future implementation
2025-11-14 23:25:50 +01:00
Janus C. H. Knudsen
a360fad265 Redesigns booking and resource architecture
Fundamentally refactors booking system to support:
- Split-resource bookings
- Service-level resource assignment
- Clear separation between booking and calendar events

Introduces new interfaces and type definitions to model complex booking scenarios, enabling more flexible and accurate resource management

Improves type safety by removing ambiguous type annotations
2025-11-14 23:05:57 +01:00
Janus C. H. Knudsen
f86ae09ec3 Refactor calendar datasource architecture
Centralizes date calculation logic into DateColumnDataSource
Improves separation of concerns across rendering components

Key changes:
- Introduces IColumnInfo interface for flexible column data
- Moves date calculation from multiple managers to dedicated datasource
- Removes duplicate date rendering logic
- Prepares architecture for future resource-based views
2025-11-14 16:25:03 +01:00
Janus C. H. Knudsen
75a2d4913e Refactor GridManager with new DateColumnDataSource
Introduces DateColumnDataSource to centralize date column generation logic
Simplifies GridManager by delegating date calculations to dedicated data source
Enhances flexibility for different calendar views and date rendering strategies

Improves separation of concerns and makes calendar view management more modular
2025-11-13 23:35:29 +01:00
Janus C. H. Knudsen
284c85b2f8 Simplify navigation event handling and week info rendering
Removes redundant period info update event and consolidates week information calculation

Streamlines navigation event flow by using navigation completed event for week info updates
Removes separate week info update method and moves calculation into renderer
Reduces complexity of event management and improves code efficiency
2025-11-13 21:33:53 +01:00
Janus C. H. Knudsen
f0cc9bb6ce Refactors grid date handling and event rendering
Replaces getPeriodRange with getDisplayDates approach
Simplifies event rendering by using flexible date array
Updates event rendering to work with dynamic date lists

Improves code modularity and reduces complexity
2025-11-13 21:22:28 +01:00
Janus C. H. Knudsen
5075b71eb2 Refactors navigation event handling and payload
Updates navigation button event emission to use a more consistent payload type

Simplifies navigation logic by centralizing date navigation in NavigationManager
Removes redundant method implementations and standardizes event handling
2025-11-13 20:41:33 +01:00
Janus C. H. Knudsen
a666a632bd Refactors navigation buttons with comprehensive logic
Enhances navigation buttons management with advanced date calculation and view-specific navigation

Separates navigation logic from GridManager into dedicated NavigationButtons component
Adds support for multiple calendar views (week, month, day)
Implements robust event-driven navigation mechanism
Improves date navigation with dynamic period label generation
2025-11-13 20:12:05 +01:00
Janus C. H. Knudsen
8faa3e2df2 Merge branch 'debug-gridstyle' 2025-11-12 23:52:03 +01:00
Janus C. H. Knudsen
b5dfd57d9e Migrates date handling from date-fns to day.js
Replaces date-fns library with day.js to reduce bundle size and improve tree-shaking

- Centralizes all date logic in DateService
- Reduces library footprint from 576 KB to 29 KB
- Maintains 99.4% test coverage during migration
- Adds timezone and formatting plugins for day.js

Improves overall library performance and reduces dependency complexity
2025-11-12 23:51:48 +01:00
Janus C. H. Knudsen
2d8577d539 Enhances calendar event styling with container queries
Improves event description display using modern CSS container queries
- Adds responsive layout techniques for event descriptions
- Implements dynamic hiding/showing of description based on event height
- Adds fade-out effect for long descriptions

Enables more flexible and adaptive calendar event rendering
2025-11-12 22:13:40 +01:00
Janus C. H. Knudsen
6583ed1063 Adds event description support in calendar UI
Extends event model to include optional description field

Enhances event rendering with:
- New description getter/setter in base event element
- Updated CSS grid layout for description display
- Dynamic description handling in event rendering
- Updated mock event data with descriptions

Improves visual information density and event context in calendar view
2025-11-12 21:17:20 +01:00
Janus C. H. Knudsen
03746afca4 Refactors all-day event drag-and-drop handling
Improves event conversion logic between timed and all-day events during drag operations

Simplifies event movement and conversion algorithms
Adds specific handling for timed → all-day and all-day → all-day drops
Enhances event repositioning and layout recalculation
2025-11-11 22:40:04 +01:00
Janus C. H. Knudsen
9987873601 Updates all-day event rendering selectors
Modifies element selectors for all-day events to use more specific tag names

Replaces generic 'swp-event' with 'swp-allday-event' in event removal
Adds exclusion for max event indicator elements when clearing events
2025-11-11 20:29:32 +01:00
Janus C. H. Knudsen
7cda973f59 Optimize all-day event layout rendering
Improves event removal and layout recalculation process

Enhances event removal by:
- Filtering out removed event
- Recalculating event layouts dynamically
- Re-rendering events with compressed layout
- Animating container height accordingly

Reduces visual gaps and improves layout responsiveness
2025-11-11 20:23:51 +01:00
Janus C. H. Knudsen
1011513b52 Add and remove mock event 2025-11-11 20:23:44 +01:00
Janus C. H. Knudsen
818ed50176 Optimize all-day event management and removal
Improves event removal process with enhanced fade-out and logging
Adds data-removing attribute to exclude events during height calculations
Prevents unnecessary removal of all-day events during drag operations

Enhances event rendering and management for better performance and user experience
2025-11-11 20:03:42 +01:00
Janus C. H. Knudsen
2656bae054 Refactors all-day event layout tracking logic
Removes redundant state tracking for all-day event layouts

Shifts from maintaining internal layout state to reading directly from DOM elements
Simplifies event handling and updates by using DOM as the source of truth
Improves performance by reducing unnecessary state management
2025-11-11 18:08:48 +01:00
Janus C. H. Knudsen
4cc110d9f2 Adds comprehensive refactoring failure documentation
Documents two consecutive failed attempts at AllDayManager architectural refactoring, including:

- Detailed analysis of architectural and implementation failures
- Lessons learned about upfront design and systematic debugging
- Root cause identification for repeated refactoring mistakes
- Recommendations for future implementation approaches

Highlights critical issues in code design, DI principles, and functional testing strategies
2025-11-11 16:29:15 +01:00
Janus C. H. Knudsen
95951358ff Refactor workweek presets management architecture
Introduces dedicated WorkweekPresetsManager to improve code organization and reduce coupling

Separates concerns by moving workweek preset logic from ViewManager
Implements event-driven CSS synchronization
Removes code duplication in configuration and CSS property updates

Enhances maintainability and testability of UI component interactions
2025-11-11 16:25:57 +01:00
Janus C. H. Knudsen
b566aafb19 Refactors calendar managers to components
Reorganizes navigation, view selector, and workweek preset managers into separate component files

Improves code organization by moving specialized manager classes to a more descriptive components directory

Adds enhanced logging for all-day event management and drag-and-drop interactions
2025-11-08 14:30:18 +01:00
Janus C. H. Knudsen
bd8f5ae6c6 Adds navigation buttons management and refactors navigation
Introduces NavigationButtonsManager to handle navigation button interactions
Renames NavigationRenderer to WeekInfoRenderer for clarity
Adds new NAV_BUTTON_CLICKED event for better separation of concerns

Improves event-driven navigation workflow
2025-11-07 23:23:19 +01:00
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