7.3 KiB
7.3 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 05-dashboard-calendar | 04 | ui |
|
|
|
|
|
|
|
|
|
5min | 2026-06-24 |
Phase 05 Plan 04: Calendar Frontend Summary
Calendar widget displaying aggregated events with source color dots, plus settings page for CalDAV/ICS/Exchange source management with visibility toggle and connection testing
Performance
- Duration: 5 min
- Started: 2026-06-24T13:21:01Z
- Completed: 2026-06-24T13:26:32Z
- Tasks: 2
- Files modified: 11
Accomplishments
- Calendar widget fetches and displays upcoming events from visible sources via
/api/calendar/eventswith 5-min refresh cycle - Three distinct empty states per UI-SPEC: no sources, no events, loading
- Source management settings page at
/settings/dashboard/calendarwith visibility toggle (CAL-02), type badges, color dots, connection status indicators - Calendar source form with conditional fields: Exchange-mode select for Exchange type, hidden credentials for ICS, 8-color palette picker
- Delete confirmation dialog per UI-SPEC destructive pattern
- Client-side https-only URL validation (T-05-14 threat mitigation)
- All 6 tests passing with TDD RED/GREEN commit flow
Task Commits
Each task was committed atomically:
- Task 1: Calendar API client + calendar widget (RED) -
2d8699e(test) - Task 1: Calendar API client + calendar widget (GREEN) -
c0f2f4c(feat) - Task 2: Calendar settings page (RED) -
f99ff9a(test) - Task 2: Calendar settings page (GREEN) -
24de136(feat)
TDD Gate Compliance
- RED gate:
2d8699e(test commit) exists beforec0f2f4c(feat commit) for Task 1 - RED gate:
f99ff9a(test commit) exists before24de136(feat commit) for Task 2 - Both tasks follow proper RED -> GREEN sequence
Files Created/Modified
apps/web/src/lib/calendar-api.ts- Calendar API client with typed interfaces mirroring 05-03 backend contractapps/web/src/components/dashboard/widgets/calendar-widget.tsx- Upcoming events list widget with color dots and three empty statesapps/web/src/components/dashboard/widgets/calendar-widget.test.tsx- 3 tests: events rendering, no-events, no-sourcesapps/web/src/components/settings/calendar-settings-panel.tsx- Source list with visibility toggle, edit/delete, connection statusapps/web/src/components/settings/calendar-source-form.tsx- Add/edit form with type-conditional fields and https validationapps/web/src/app/(portal)/settings/dashboard/calendar/page.tsx- Route page for calendar settingsapps/web/src/app/(portal)/settings/dashboard/calendar/calendar-settings.test.tsx- 3 tests: source list, visibility toggle, form validationapps/web/src/components/dashboard/widget-registry.tsx- Added wireCalendarWidget() functionapps/web/src/app/(portal)/page.tsx- Wired CalendarWidget into registryapps/web/src/messages/de.json- Added calendar.loading i18n keyapps/web/src/messages/en.json- Added calendar.loading i18n key
Decisions Made
- Optimistic UI for visibility toggle: Local state updated immediately on click, reverted on API error. Provides responsive UX without waiting for network roundtrip.
- Auto-run connection test after source creation: After addSource succeeds, testSource is called automatically and result displayed via connection status indicator (green check / error icon).
- URL validation via URL constructor: Uses
new URL()with protocol check rather than regex for robust https-only client-side validation (T-05-14). Server-side DTO validation remains authoritative.
Deviations from Plan
Auto-fixed Issues
1. [Rule 2 - Missing Critical] Added calendar.loading i18n key
- Found during: Task 1
- Issue: Widget uses
t('calendar.loading')for loading state but key was missing from i18n files - Fix: Added
calendar.loadingto both de.json and en.json - Files modified: de.json, en.json
- Committed in:
c0f2f4c(Task 1 commit)
Total deviations: 1 auto-fixed (1 missing critical) Impact on plan: Minor i18n key addition required for correctness. No scope creep.
Issues Encountered
None - all components implemented and tested without blocking issues.
Threat Mitigations Implemented
| Threat ID | Mitigation |
|---|---|
| T-05-14 | Client-side https-only URL validation via URL constructor before form submit |
| T-05-15 | CalendarWidget only consumes /api/calendar/events; no password fields in frontend types |
User Setup Required
None - no external service configuration required. Calendar backend from 05-03 must be running with CALENDAR_ENCRYPTION_KEY configured.
Next Phase Readiness
- Calendar frontend complete: widget + settings page fully wired to 05-03 backend
- Ready for Plan 05 (E2E testing / integration verification)
- Widget registry now has all four widget types wired with real components
Self-Check: PASSED
- All 7 created files verified present on disk
- All 4 task commits verified in git log (
2d8699e,c0f2f4c,f99ff9a,24de136)
Phase: 05-dashboard-calendar Completed: 2026-06-24