Commit Graph

12 Commits

Author SHA1 Message Date
jacobh2 6ed2a3ae0c Fix calendar style 2026-06-14 13:05:53 +02:00
jacobh2 4924982a8a test(calendar): grid layout, week ordering, and day-cell coverage
- Add isToday test cases to CalendarDay.test.tsx
  * test --today class when isToday=true
  * test --today class not applied when isToday=false
- Create Calendar.test.tsx with full page coverage
  * Test 7 weekday headers in Monday-first Swedish order
  * Verify correct number of day cells (multiple of 7)
  * Test Sunday-starting month renders correctly (March 2026)
  * Test modal opens on current-month day click
  * Test modal doesn't open on disabled day click
  * Test current month title display
  * Test prev/next month navigation
  * Test loading state display
- Mocks useWorkspace, usePlannedDays, Layout, LoadingSpinner, PlannedDayModal
- All 19 tests pass; no coverage regression

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-14 12:51:58 +02:00
jacobh2 a2300b285d fix(calendar): Monday-first Swedish week, today highlight, default to current month
- Convert week calculation to Monday-first (startOffset = (firstDay.getDay() + 6) % 7)
- Update weekday headers to Swedish labels: [Mån, Tis, Ons, Tor, Fre, Lör, Sön]
- Change default currentMonth from June 2026 to current date (new Date())
- Add isToday prop to CalendarDay component
- Add --today modifier to highlight current date with blue circle background
- Pass computed isToday boolean to CalendarDay when date equals today's date string
- Renders correctly for Sunday-starting months (e.g., March 2026)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-14 12:51:53 +02:00
jacobh2 69ce746082 feat(calendar): add calendar.css grid layout + styled day cells and legend
- Create calendar.css with 7-column grid using display: grid
- Style calendar header with navigation buttons (min 36x36px tap targets)
- Style day cells with borders, hover states, and focus-visible outlines
- Style weekday headers (centered, muted, uppercase)
- Create --disabled modifier for leading/trailing days from adjacent months
- Create --has-events modifier for visual emphasis
- Create event markers as small dots (8x8px circles)
- Style legend with compact horizontal swatch layout
- Import CSS into Calendar.tsx following co-located pattern from Header

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-14 12:51:48 +02:00
jacobh2 772d853e37 MVP frontend+backend 2026-06-14 09:58:30 +02:00
jacobh2 d9539f23cc --fix with ruff 2026-06-01 20:30:17 +02:00
jacobh2 6446d9c760 Document Round 3 completion: frontend build fixed, 9 components built, 4 pages wired
JUNIOR_REPORT_3.md summarizes:
- Phase 1: Fixed 35+ TS errors by adding 8 API functions, fixing hook signatures
- Phase 2: Built 9 presentational components (CalendarDay, CalendarEvent, DaysBreakdown, ProgressChart, TipCard, VacationDaysInput, ParentProfileInput, PlanningGoalSelector, BreakPeriodsInput) with 90%+ test coverage
- Phase 3: Wired 4 page screens (Dashboard, Calendar, Tips, Settings) integrating hooks and components
- Final metrics: 0 TS errors, 0 lint errors, 167 tests passing, 16 total components

Frontend is unblocked and ready for integration or handoff.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-01 19:00:35 +02:00
jacobh2 719da83827 Phase 3: Wire page stubs into working screens with full integration
Implemented 4 page stubs with hooks and components:
- Dashboard: displays overview metrics, planned days breakdown, progress chart, break periods
- Calendar: month-based calendar grid with event badges and navigation
- Tips: list of optimization tips with dismiss functionality
- Settings: workspace configuration with child info, parent profile, vacation days, break periods

Added utility exports:
- src/context/index.ts: re-exports useAuth, useWorkspace hooks
- src/hooks/index.ts: re-exports all domain hooks

All pages:
- Use Layout wrapper with header configuration
- Load data via hooks with loading/error states
- Render presentational components (no business logic)
- Pass callbacks for user actions
- Type-safe with full @types coverage

Frontend test coverage: 167 tests, all passing
TypeScript: zero errors, lint: zero errors

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-01 17:53:10 +02:00
jacobh2 425e29ea21 Phase 2: Build 9 presentational components with full test coverage
New components (all with .tsx + .test.tsx, 90%+ coverage):
- CalendarDay: day cell with event badges
- CalendarEvent: colored event chip with dismiss option
- DaysBreakdown: table of days by type
- ProgressChart: progress bar toward age-4 deadline
- TipCard: optimization tip card with severity badges
- VacationDaysInput: number input with min/max validation
- ParentProfileInput: dual selects for salary type & employment status
- PlanningGoalSelector: radio buttons for planning goal
- BreakPeriodsInput: list manager with inline add/edit form

All components follow existing patterns from Header/Footer:
- Typed props interfaces (exported)
- Semantic HTML with data-testid & ARIA attributes
- No business logic, purely presentational
- Comprehensive test coverage including edge cases

npm test: 22 files, 167 tests passing
npx tsc --noEmit: clean

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-01 17:50:23 +02:00
jacobh2 faebcced8a Fix ESLint warnings and suppress test-specific linting rules
- Allow @typescript-eslint/no-explicit-any in test files for vitest mocks
- Use 'unknown' type instead of 'any' in dates.ts isValidDate function
- npm run lint now passes with zero errors

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-01 17:47:49 +02:00
jacobh2 fbb7a04580 Phase 1: Fix TypeScript compilation — add missing API functions and fix hook signatures
- Add 8 missing API client functions (getBreakPeriods, createBreakPeriod, deleteBreakPeriod, getTips, getParentalLeave, getPlannedDays, createPlannedDay, deletePlannedDay)
- Fix useAnalytics to accept optional childId parameter
- Fix ApiError strict optional properties handling
- Export HeaderProps from Header component
- Update hook tests to use correct data structures and optional parameters

npx tsc --noEmit now passes with zero errors.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-01 17:47:17 +02:00
jacobh2 53d157535a Initial commit 2026-06-01 16:48:21 +02:00