Commit graph

52 commits

Author SHA1 Message Date
Janus Knudsen
ae42de1f3b Improves all-day event rendering and placement
Simplifies and improves the all-day event rendering process, ensuring
consistent container creation and proper placement of events.

- Ensures all-day containers are consistently created during header
  rendering, preventing potential issues with event placement.
- Removes the complex and unreliable mouseover detection for all-day
  conversion, simplifying the event dragging logic.
- Eliminates the dynamic all-day row height calculation, relying on
  CSS for layout control.
- Prevents errors when the all-day container is missing.
2025-08-31 23:48:34 +02:00
Janus Knudsen
2c934a7a1a Improves all-day event container creation and animation
Refactors all-day event container creation to be lazy, improving
initial load performance. The container is now created and animated
into view only when needed, specifically when the first event is
dragged into the all-day section. This avoids unnecessary DOM
manipulation and improves the perceived responsiveness of the
calendar.
2025-08-28 00:13:11 +02:00
Janus Knudsen
be4a8af7c4 Updates all-day event grid row layout
Ensures the all-day event container's grid layout is correctly updated to reflect the number of rows needed, even when the overall height doesn't change.
This prevents layout issues when events are rearranged without triggering a height recalculation.
Also updates the grid template when the height is updated in the BaseEventRenderer.
2025-08-27 20:54:06 +02:00
Janus Knudsen
f9b7686b22 Back to a single swp-allday-container 2025-08-26 00:05:42 +02:00
Janus Knudsen
f2763ad826 Improves all-day event drag and drop
Handles dragging of both timed events (converting to all-day) and existing all-day events to different days.

Refactors all-day height recalculation to support animated transitions for a smoother user experience when all-day event counts change.

Uses event delegation for header mouseover detection.

Updates ScrollManager to listen for header height changes.
2025-08-25 21:20:51 +02:00
Janus Knudsen
eb08a28495 Improves all-day event drag and drop
Enhances the drag and drop experience for all-day events by expanding the header to display the all-day row when dragging an event over it.

Introduces constants for all-day event layout.
2025-08-24 23:31:11 +02:00
Janus Knudsen
9c65143df2 Refactors event rendering and display
Improves event rendering by introducing dedicated event
renderers and streamlining event display logic.

- Adds a base event renderer and specialized date and
  resource-based renderers to handle event display logic.
- Renders all-day events within a dedicated container in the
  calendar header.
- Removes the direct filtering of all-day events from the
  `GridManager`.
- Fixes an issue where the 'Summer Festival' event started on the
  wrong date.

The changes enhance the flexibility and maintainability of the
calendar, provide dedicated containers and styling for allday events and fix date issues related to certain events
2025-08-24 00:13:07 +02:00
Janus Knudsen
25522bfe17 A working test of an all-day-event 2025-08-23 23:01:22 +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
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
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
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
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
f50f5ad53b Steps in the right direction for animated date change 2025-08-12 00:07:39 +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
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
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
Janus Knudsen
209ae0830d A step in the right direction for this time axis 2025-08-01 23:45:13 +02:00
Janus Knudsen
b6d3d22ce9 wip 2025-08-01 23:23:48 +02:00
Janus Knudsen
3bf2baf9e9 wip 2025-07-30 01:07:17 +02:00
Janus Knudsen
470fcb5e58 wip 2025-07-30 00:53:59 +02:00
Janus Knudsen
00b374617f wip 2025-07-30 00:34:50 +02:00
Janus Knudsen
a410088fa7 wip 2025-07-29 23:17:52 +02:00
Janus Knudsen
2e50679602 Refactors grid layout for scrollbar implementation
Updates the grid structure to correctly position the scrollbars.

Replaces fixed scrollbars with a grid-based layout using spacers and
a right column for a more integrated and maintainable solution.
This change addresses layout issues related to scrollbar positioning
and ensures better alignment across different browsers.
2025-07-29 23:01:00 +02:00
Janus Knudsen
bfd2ba0272 Adjusts week header z-index
Lowers the z-index of the week header to ensure it slides under the header-spacer during horizontal scrolling.

This prevents the week header from overlapping the header-spacer, improving the visual flow of the calendar layout.
2025-07-29 21:30:26 +02:00
Janus Knudsen
1d25ab7b53 Adds fixed scrollbars for improved navigation
Implements fixed scrollbars at the browser edges to enhance navigation within the calendar view. This ensures that the scrollbars remain visible regardless of the user's scroll position, providing consistent access to horizontal and vertical scrolling.

Removes the right header spacer and right column, integrating their functionality into the new fixed scrollbar components.

Additionally, synchronizes the week header position with the horizontal scroll, improving the user experience.

Scrollbar hiding is now handled in the CSS file.
2025-07-29 21:22:13 +02:00
Janus Knudsen
1822fa7287 Improves sticky header and time axis layering
Adjusts z-index values to ensure the week header and header spacer
elements cover the time axis during scrolling. This prevents visual
artifacts and improves the overall user experience.
2025-07-29 01:01:12 +02:00
Janus Knudsen
9f6d4333cb Implements custom scroll and event logging
Adds custom scroll management for the calendar week view, replacing native scrollbars with a custom handle.

Introduces categorized event logging with console grouping and styling, enhancing debug output. It also allows configuring logging for specific event categories.
2025-07-29 00:52:01 +02:00
Janus Knudsen
42c418e961 Snapshot 2025-07-25 23:31:25 +02:00