Commit graph

383 commits

Author SHA1 Message Date
Janus C. H. Knudsen
a0c0ef9e8d Refactor calendar V2 core with DI and new features
Introduces dependency injection container and composition root
Adds core services like DateService and NavigationAnimator
Simplifies CalendarOrchestrator with improved store handling
Implements mock stores and demo application for V2 calendar
2025-12-07 14:31:16 +01:00
Janus C. H. Knudsen
1ad7d10266 Refactors calendar layout grid styles
Adjusts grid layout for time axis and calendar container
Simplifies CSS grid positioning and template rows
Removes redundant border styling
2025-12-06 10:52:20 +01:00
Janus C. H. Knudsen
cce4b77c96 wip 2025-12-06 01:25:03 +01:00
Janus C. H. Knudsen
b3f47e93e8 New renders+css 2025-12-06 01:22:04 +01:00
Janus C. H. Knudsen
73e284660f Adds EventId type for robust event ID handling
Introduces type-safe EventId with centralized normalization logic for clone and standard event IDs

Refactors event ID management across multiple components to use consistent ID transformation methods
Improves type safety and reduces potential ID-related bugs in drag-and-drop and event rendering
2025-12-03 14:43:25 +01:00
Janus C. H. Knudsen
d53af317bb Removes redundant event visibility filtering
Eliminates unnecessary event visibility check in layout engine

Assumes events are pre-filtered before reaching the layout calculation, simplifying the processing logic and reducing computational overhead

Removes local `isEventVisible` method and directly processes all input events
2025-11-26 14:42:42 +01:00
Janus C. H. Knudsen
be551f88e5 Enhances event color styling with flexible metadata system
Introduces a new color customization approach for calendar events using CSS custom properties and metadata

- Adds support for dynamic color assignment via event metadata
- Implements a flexible color utility class system
- Replaces hardcoded event type colors with a more generic color-mix() approach
- Provides broader color palette for event styling
2025-11-25 23:48:30 +01:00
Janus C. H. Knudsen
d8b9f6dabd Refactor calendar datasource and event management
Enhances calendar flexibility by introducing group-based column spanning and improving cross-mode event handling

Adds support for:
- Dynamic column grouping in date and resource modes
- Consistent event drag-and-drop across different calendar views
- More robust all-day event layout calculations

Improves event management logic to handle resource and date mode transitions more elegantly
2025-11-25 19:04:06 +01:00
Janus C. H. Knudsen
17909696ed Refactor event rendering with column-based event management
Improves event rendering by integrating event filtering directly into column data sources

Key changes:
- Moves event filtering responsibility to IColumnDataSource
- Simplifies event rendering pipeline by pre-filtering events per column
- Supports both date and resource-based calendar modes
- Enhances drag and drop event update mechanism

Optimizes calendar rendering performance and flexibility
2025-11-22 23:38:52 +01:00
Janus C. H. Knudsen
eeaeddeef8 Adds resource-based calendar view mode
Introduces new ResourceColumnDataSource and ResourceHeaderRenderer to support column rendering by resources instead of dates

Enables dynamic calendar mode switching between date and resource views
Updates core managers and services to support async column retrieval
Refactors data source interfaces to use Promise-based methods

Improves calendar flexibility and resource management capabilities
2025-11-22 19:42:12 +01:00
Janus C. H. Knudsen
a7d365b186 Implement event-driven audit trail sync architecture
Redesigns synchronization infrastructure using audit-based approach

- Replaces disconnected sync logic with event-driven architecture
- Adds AuditService to log entity changes with JSON diffs
- Implements chained events for reliable sync process
- Fixes EventBus injection and event emission in services
- Removes unused OperationQueue

Provides comprehensive audit trail for entity changes and backend synchronization
2025-11-22 11:52:56 +01:00
Janus C. H. Knudsen
185330402e Refactor event payload types and event handling
Extracts common event payload interfaces for entity saved, deleted, and audit logged events

Improves type safety and reduces code duplication by centralizing event payload definitions
2025-11-21 23:33:48 +01:00
Janus C. H. Knudsen
9ea98e3a04 Adds audit logging and sync management infrastructure
Introduces comprehensive audit trail system with:
- AuditService to track entity changes
- SyncManager for background sync of audit entries
- New CoreEvents for entity and audit tracking
- Simplified sync architecture with event-driven approach

Prepares system for enhanced compliance and change tracking
2025-11-21 23:23:04 +01:00
Janus C. H. Knudsen
dcd76836bd Refactors repository layer and IndexedDB architecture
Eliminates redundant repository abstraction layer by directly using EntityService methods

Implements key improvements:
- Removes unnecessary repository wrappers
- Introduces polymorphic DataSeeder for mock data loading
- Renames IndexedDBService to IndexedDBContext
- Fixes database injection timing with lazy access pattern
- Simplifies EventManager to use services directly

Reduces code complexity and improves separation of concerns
2025-11-20 21:45:09 +01:00
Janus C. H. Knudsen
5648c7c304 Adds comprehensive mock data repositories and seeding infrastructure
Implements polymorphic data seeding mechanism for initial application setup

- Adds Mock repositories for Event, Booking, Customer, and Resource entities
- Creates DataSeeder to automatically populate IndexedDB from JSON sources
- Enhances index.ts initialization process with data seeding step
- Adds mock JSON data files for comprehensive test data

Improves offline-first and development testing capabilities
2025-11-20 15:25:38 +01:00
Janus C. H. Knudsen
871f5c5682 Upgrades @novadi/core and refactors dependency registration
Updates package dependencies to latest version of @novadi/core

Simplifies dependency and service registration by removing automatic array resolution of stores, API repositories, and entity services

Adds DateColumnDataSource as a new column data source implementation
2025-11-18 22:34:12 +01:00
Janus C. H. Knudsen
cd2466426b Adds mock events data for November 2025
Expands mock events JSON with detailed schedule entries
Includes multiple event types: work, meetings, breaks, and all-day events
Provides realistic sample data covering November 17-23, 2025
2025-11-18 22:34:04 +01:00
Janus C. H. Knudsen
9d270217bd Refactor data source and configuration management
Abstracts column data source with interface
Updates managers to use configuration-driven view and date
Decouples datasource creation from individual managers

Improves flexibility and dependency injection for calendar components
2025-11-18 22:33:48 +01:00
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