Commit graph

115 commits

Author SHA1 Message Date
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
Janus Knudsen
18c12cd3e6 Adds month view design and styling
Introduces basic month view structure and styling with week numbers.

Creates expanded month view with event details and duration-based sizing.

Moves event color handling to CSS classes for better flexibility and theming.
2025-08-21 22:09:15 +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
83c0ce801c Refactors event handling and grid rendering
Improves calendar performance and data flow by streamlining event emissions and grid rendering logic.

- Replaces generic CONFIG_UPDATE events with REFRESH_REQUESTED
  for more specific refresh triggers.
- Removes redundant grid re-renders on DATE_CHANGED and
  WEEK_CHANGED events, delegating navigation to NavigationManager.
- Introduces VIEW_CHANGED and DATE_CHANGED events for calendar
  mode and date selection, respectively.
- NavigationManager now handles date validation.
- Moves rendering logic from NavigationManager to NavigationRenderer.
- Syncs scroll position based on PERIOD_CHANGED instead of
  NAVIGATION_ANIMATION_COMPLETE.

This change optimizes the calendar's responsiveness and reduces
unnecessary re-renders, leading to a smoother user experience.
2025-08-20 21:38:54 +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
efc1742dad Refactors date calculations to use ISO week
Adopts ISO week date calculation (Monday-based) for consistency
and accuracy across calendar components. This change ensures
standardized week determination, resolving potential discrepancies
in week-based operations.
2025-08-19 23:04:56 +02:00
Janus Knudsen
18f7953db4 Refactors date calculations into DateCalculator
Centralizes date calculation logic into a dedicated DateCalculator
class for improved maintainability and testability.

Removes redundant date calculation methods from CalendarManager,
ColumnRenderer, HeaderRenderer and NavigationRenderer, and utilizes
the DateCalculator for these calculations.

Updates components to use DateCalculator for consistent date
handling, including week start determination, date formatting,
and "is today" checks.
2025-08-18 23:42:03 +02:00
Janus Knudsen
2f854b2c64 Updates calendar week info and event rendering
Refactors how the calendar week information is updated to use the actual rendered column dates, ensuring accuracy after workweek changes. It also adjusts event rendering to target the swp-calendar-container element, preventing rendering issues. The change also addresses a styling issue that was preventing the scroll bar from appearing in the correct location.
2025-08-18 23:24:22 +02:00
Janus Knudsen
d017d48bd6 Adds work week configuration feature
Implements configurable work week presets, allowing users to customize the days displayed in the calendar.

This includes:
- Defining work week settings (work days, day names, total days).
- Providing predefined work week presets (standard, compressed, weekend, full week).
- Adding UI elements to switch between presets.
- Updating grid and header rendering logic to reflect the selected work week.
- Emitting events when the work week changes, triggering necessary UI updates and data re-renders.

This provides a more flexible and personalized calendar experience.
2025-08-18 22:27:17 +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
Janus Knudsen
6026d28e6f Improves calendar event rendering and UX
Refactors calendar rendering for improved user experience and performance.

- Removes unused function for rendering week content directly, streamlining the rendering process.
- Updates mock events to better reflect realistic all-day events.
- Adds file system search permission to claude settings.
- Removes console logs in scroll and navigation managers.
2025-08-17 22:09:50 +02:00
Janus Knudsen
a03f314c4a Refactors event rendering to be event-driven
Moves event rendering logic into a dedicated EventRenderer class that uses a strategy pattern for different calendar types.

The rendering is now triggered by `GRID_RENDERED` and `CONTAINER_READY_FOR_EVENTS` events, emitted by the GridManager and NavigationManager respectively.

This change decouples the CalendarManager from direct event rendering and allows for more flexible and efficient event updates. The EventManager now has a method to fetch events for a given time period.

Removes direct calls to event rendering from CalendarManager. Improves animation transitions by using pre-rendered containers in the NavigationManager.
2025-08-16 00:51:12 +02:00
Janus Knudsen
afe5b6b899 Improves calendar navigation animation
Replaces the setTimeout-based animation with the Web Animations API for smoother transitions.

This change also introduces an event to notify other managers when the navigation animation is complete, allowing them to synchronize their states.
2025-08-13 23:37:23 +02:00
Janus Knudsen
b03707853a Just some cleanup 2025-08-13 23:05:58 +02:00
Janus Knudsen
cdc7e55a92 Improves grid navigation animation
Refactors grid navigation to improve the animation flow.

Removes the immediate clearing of events to prevent visual glitches during the slide animation.  Instead, events are now rendered directly into the new container without clearing.  This change ensures a smoother transition between grids.

Also, cleans up old grid elements after the animation completes, reducing DOM clutter.
2025-08-12 00:31:02 +02:00
Janus Knudsen
f50f5ad53b Steps in the right direction for animated date change 2025-08-12 00:07:39 +02:00
Janus Knudsen
5e966ddea2 More events 2025-08-11 19:34:48 +02:00
Janus Knudsen
0b46f68ac1 Enhances resource calendar support
Improves resource calendar mode by passing resource data
to the grid manager for rendering, enabling specific
resource-based views. Also, it stores raw event data
to improve data management.
2025-08-10 23:06:03 +02:00
Janus Knudsen
b111f121ba wip 2025-08-09 01:16:04 +02:00
Janus Knudsen
59b3c64c55 Major refactorering to get a hold on all these events 2025-08-09 00:31:44 +02:00
Janus Knudsen
2a766cf685 Refactors week header to calendar header
Renames 'week header' to 'calendar header' for better representation
of the component's purpose, which includes more than just week-based
calendar views.

Updates related methods and references in GridManager and
ScrollManager to reflect the change.

Fixes incorrect calculation of the column width.
2025-08-07 00:26:33 +02:00
Janus Knudsen
29811fd4b5 Renaming part 1 2025-08-07 00:15:44 +02:00
Janus Knudsen
36ac8d18ab Implements native scrollbars with styling
Replaces custom scrollbar implementation with native scrollbars for better performance and accessibility.

Adds configuration options for scrollbar styling, including width, color, track color, hover color, and border radius.

Synchronizes week header and time axis scrolling with the scrollable content.
2025-08-05 23:03:08 +02:00
Janus Knudsen
e6d6599a1e Adds handling of fit to width bool 2025-08-05 21:56:06 +02:00
Janus Knudsen
58f98468a1 Fixes fill width hour lines on calendar 2025-08-05 20:02:51 +02:00
Janus Knudsen
3d3577045e Moves event styling to CSS
Refactors event rendering to leverage CSS for styling.

This change simplifies the event renderer by removing styling logic from the Typescript code and placing it in the CSS file.  This improves maintainability and allows for easier customization of event appearance. Hover effects are also moved to CSS for consistency.
2025-08-05 19:12:13 +02:00
Janus Knudsen
df4506238e Final changes for this grid, now it looks good 2025-08-05 19:07:09 +02:00
Janus Knudsen
a501f02d61 wip 2025-08-05 18:32:24 +02:00
Janus Knudsen
ca09fd13a6 wip 2025-08-05 16:41:29 +02:00
Janus Knudsen
914239fb70 wip 2025-08-05 00:49:00 +02:00
Janus Knudsen
dc5063729b Enhances event rendering and grid updates
Improves event rendering by adding styling, filtering out all-day events (handled by GridManager), and calculating accurate positioning within the time grid.

Optimizes grid updates to avoid unnecessary rebuilding, instead updating only the week header for all-day events, leading to better performance.
2025-08-05 00:41:59 +02:00
Janus Knudsen
7ac7e0f7f8 Working all day 2025-08-05 00:17:17 +02:00
Janus Knudsen
c164975494 wip 2025-08-04 23:55:04 +02:00
Janus Knudsen
e37b3d7004 small steps 2025-08-04 23:31:08 +02:00
Janus Knudsen
42901212da wip 2025-08-04 23:22:31 +02:00
Janus Knudsen
ce82b5286b wip 2025-08-04 23:11:56 +02:00
Janus Knudsen
4790f31a7b Fixes gridline in all day row 2025-08-04 22:43:02 +02:00
Janus Knudsen
3691ebea85 Adds header sections to calendar week view
Improves calendar week view by adding header sections.

This change introduces two new header sections, styled with an orange background, to the calendar week view. These sections are positioned in the second row of the week header, enhancing the visual organization and potentially providing space for additional information or actions related to the week view. The overall height of the header has also been adjusted to accommodate the new row.
2025-08-04 00:21:41 +02:00
Janus Knudsen
a097b41def wip 2025-08-04 00:06:45 +02:00
Janus Knudsen
73c290bb95 WIP on (no branch) 2025-08-03 23:29:27 +02:00
Janus Knudsen
5a686da7f5 Improves calendar event rendering and data
Updates mock event data to reflect a more recent week and includes events spanning early/late hours.

Enhances event rendering by adjusting the top and height styles for better visual appearance.

Refactors CSS to improve grid line display and event hover effects, and moves hour marker styles to a more appropriate CSS file.

Provides default fallback values for time boundaries using CSS variables.
2025-08-03 21:23:24 +02:00
Janus Knudsen
28ed131b9e wip 2025-08-02 23:59:52 +02:00
Janus Knudsen
f29613e55f Updates mock event data and adds logging
Updates mock event data to reflect future dates for testing purposes.

Adds console logging in various managers to aid in debugging and understanding the event loading and rendering process.
Specifically, logs the number of loaded events, the first and last event details, and information about event rendering and time axis creation.

Also, adds execution permission for PowerShell scripts in the .claude settings.
2025-08-02 00:28:45 +02:00
Janus Knudsen
c510994ca2 Makes calendar week view width dynamic
Changes the calendar week view to dynamically adjust its width based on the `--day-column-min-width` CSS variable.
This allows for more flexible and responsive layouts, avoiding fixed widths.
Also, the base calendar CSS file is now included in the index file.
2025-08-02 00:04:45 +02:00
Janus Knudsen
26a4544c09 wip 2025-08-01 23:58:30 +02:00