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.
This commit is contained in:
Janus Knudsen 2025-08-02 00:28:45 +02:00
parent c510994ca2
commit f29613e55f
7 changed files with 66 additions and 73 deletions

View file

@ -36,8 +36,8 @@ export class EventManager {
{
id: '1',
title: 'Team Standup',
start: '2024-01-15T09:00:00',
end: '2024-01-15T09:30:00',
start: '2025-07-28T09:00:00',
end: '2025-07-28T09:30:00',
type: 'meeting',
allDay: false,
syncStatus: 'synced',
@ -46,8 +46,8 @@ export class EventManager {
{
id: '2',
title: 'Client Meeting',
start: '2024-01-15T14:00:00',
end: '2024-01-15T15:30:00',
start: '2025-07-28T14:00:00',
end: '2025-07-28T15:30:00',
type: 'meeting',
allDay: false,
syncStatus: 'synced',
@ -56,8 +56,8 @@ export class EventManager {
{
id: '3',
title: 'Lunch',
start: '2024-01-15T12:00:00',
end: '2024-01-15T13:00:00',
start: '2025-07-28T12:00:00',
end: '2025-07-28T13:00:00',
type: 'meal',
allDay: false,
syncStatus: 'synced',
@ -66,8 +66,8 @@ export class EventManager {
{
id: '4',
title: 'Deep Work Session',
start: '2024-01-16T10:00:00',
end: '2024-01-16T12:00:00',
start: '2025-07-29T10:00:00',
end: '2025-07-29T12:00:00',
type: 'work',
allDay: false,
syncStatus: 'synced',
@ -76,8 +76,8 @@ export class EventManager {
{
id: '5',
title: 'Team Standup',
start: '2024-01-16T09:00:00',
end: '2024-01-16T09:30:00',
start: '2025-07-29T09:00:00',
end: '2025-07-29T09:30:00',
type: 'meeting',
allDay: false,
syncStatus: 'synced',
@ -86,8 +86,8 @@ export class EventManager {
{
id: '6',
title: 'Lunch',
start: '2024-01-16T12:30:00',
end: '2024-01-16T13:30:00',
start: '2025-07-29T12:30:00',
end: '2025-07-29T13:30:00',
type: 'meal',
allDay: false,
syncStatus: 'synced',
@ -96,8 +96,8 @@ export class EventManager {
{
id: '7',
title: 'Project Review',
start: '2024-01-17T15:00:00',
end: '2024-01-17T16:00:00',
start: '2025-07-30T15:00:00',
end: '2025-07-30T16:00:00',
type: 'meeting',
allDay: false,
syncStatus: 'synced',
@ -106,8 +106,8 @@ export class EventManager {
{
id: '8',
title: 'Lunch',
start: '2024-01-17T12:00:00',
end: '2024-01-17T13:00:00',
start: '2025-07-30T12:00:00',
end: '2025-07-30T13:00:00',
type: 'meal',
allDay: false,
syncStatus: 'synced',
@ -116,8 +116,8 @@ export class EventManager {
{
id: '9',
title: 'Sprint Planning',
start: '2024-01-18T10:00:00',
end: '2024-01-18T12:00:00',
start: '2025-07-31T10:00:00',
end: '2025-07-31T12:00:00',
type: 'meeting',
allDay: false,
syncStatus: 'synced',
@ -126,8 +126,8 @@ export class EventManager {
{
id: '10',
title: 'Coffee Break',
start: '2024-01-18T15:00:00',
end: '2024-01-18T15:30:00',
start: '2025-07-31T15:00:00',
end: '2025-07-31T15:30:00',
type: 'meal',
allDay: false,
syncStatus: 'synced',
@ -136,16 +136,48 @@ export class EventManager {
{
id: '11',
title: 'Documentation',
start: '2024-01-19T13:00:00',
end: '2024-01-19T16:00:00',
start: '2025-08-01T13:00:00',
end: '2025-08-01T16:00:00',
type: 'work',
allDay: false,
syncStatus: 'synced',
metadata: { duration: 180 }
},
{
id: '12',
title: 'Early Morning Workout',
start: '2025-07-29T06:00:00',
end: '2025-07-29T07:00:00',
type: 'work',
allDay: false,
syncStatus: 'synced',
metadata: { duration: 60 }
},
{
id: '13',
title: 'Late Evening Call',
start: '2025-07-30T21:00:00',
end: '2025-07-30T22:00:00',
type: 'meeting',
allDay: false,
syncStatus: 'synced',
metadata: { duration: 60 }
},
{
id: '14',
title: 'Midnight Release',
start: '2025-07-31T23:00:00',
end: '2025-08-01T01:00:00',
type: 'work',
allDay: false,
syncStatus: 'synced',
metadata: { duration: 120 }
}
];
console.log(`EventManager: Loaded ${this.events.length} mock events`);
console.log('EventManager: First event:', this.events[0]);
console.log('EventManager: Last event:', this.events[this.events.length - 1]);
}
private syncEvents(): void {

View file

@ -19,6 +19,7 @@ export class EventRenderer {
this.eventBus.on(EventTypes.EVENTS_LOADED, (event: Event) => {
const customEvent = event as CustomEvent;
const { events } = customEvent.detail;
console.log('EventRenderer: Received EVENTS_LOADED with', events.length, 'events');
// Store events but don't render yet - wait for grid to be ready
this.pendingEvents = events;
this.tryRenderEvents();
@ -39,8 +40,10 @@ export class EventRenderer {
private tryRenderEvents(): void {
// Only render if we have both events and grid is ready
console.log('EventRenderer: tryRenderEvents called, pending events:', this.pendingEvents.length);
if (this.pendingEvents.length > 0) {
const dayColumns = document.querySelectorAll('swp-day-column');
console.log('EventRenderer: Found', dayColumns.length, 'day columns');
if (dayColumns.length > 0) {
this.renderEvents(this.pendingEvents);
this.pendingEvents = []; // Clear pending events after rendering

View file

@ -169,6 +169,7 @@ export class GridManager {
const timeAxisContent = document.createElement('swp-time-axis-content');
const startHour = calendarConfig.get('dayStartHour');
const endHour = calendarConfig.get('dayEndHour');
console.log('GridManager: Creating time axis - startHour:', startHour, 'endHour:', endHour);
for (let hour = startHour; hour < endHour; hour++) {
const marker = document.createElement('swp-hour-marker');