style(13-03): apply Prettier formatting across repo
Mechanical reformat — no logic changes. 398 files changed, 19125 insertions(+), 16457 deletions(-). Prettier 3.8.4 with .prettierrc (singleQuote:true, semi:true, tabWidth:2, trailingComma:all, printWidth:100). Isolated per D-13-08 for reviewability.
This commit is contained in:
@@ -66,11 +66,13 @@ CSS custom-property token layer with Schedule-X overrides, hex-blend color utili
|
||||
### Task 1: Schedule-X Stack + Token Layer + main.tsx Import Order
|
||||
|
||||
**Installed packages** in `apps/pwa`:
|
||||
|
||||
- `@schedule-x/calendar@4.6.0`, `@schedule-x/react@4.1.0`, `@schedule-x/theme-default@4.6.0`
|
||||
- `@schedule-x/event-modal@4.6.0`, `@schedule-x/events-service@4.6.0`
|
||||
- `temporal-polyfill@0.3.2`, `lucide-react@1.17.0`
|
||||
|
||||
**`apps/pwa/src/styles/tokens.css`** — CSS custom properties declaring:
|
||||
|
||||
- Surface/border/text palette: `--color-surface`, `--color-surface-dim`, `--color-surface-raised`, `--color-border`, `--color-border-subtle`, `--color-text-primary/secondary/muted`, `--color-focus-ring`, `--color-overlay`
|
||||
- Calendar colors: `--color-member-0..5` + `--color-shared-family: #F25C7A` + `--color-destructive`
|
||||
- Spacing scale: `--space-1..12` (multiples of 4px)
|
||||
@@ -84,6 +86,7 @@ CSS custom-property token layer with Schedule-X overrides, hex-blend color utili
|
||||
**`apps/pwa/src/styles/index.css`** — imports tokens.css + minimal global reset.
|
||||
|
||||
**`apps/pwa/src/main.tsx`** — updated with load-bearing import order:
|
||||
|
||||
1. `import 'temporal-polyfill/global'` (must be first)
|
||||
2. `import '@schedule-x/theme-default/dist/index.css'` (SX layout CSS)
|
||||
3. `import './styles/index.css'` (token overrides win cascade)
|
||||
@@ -91,11 +94,13 @@ CSS custom-property token layer with Schedule-X overrides, hex-blend color utili
|
||||
### Task 2: colorUtils + calendarConfig — RED Stubs Turned GREEN
|
||||
|
||||
**`apps/pwa/src/lib/colorUtils.ts`** exports:
|
||||
|
||||
- `hexToContainer(hex)` — alpha blends at 15% opacity over white
|
||||
- `hexToOnContainer(hex)` — darkens 40% (channel multiply by 0.6)
|
||||
- `deriveScheduleXColors(main)` returning `{ main, container, onContainer }`
|
||||
|
||||
**`apps/pwa/src/lib/calendarConfig.ts`** exports:
|
||||
|
||||
- `WEEK_START_DAY = 0` (JS Sunday convention)
|
||||
- `SX_FIRST_DAY_OF_WEEK = WEEK_START_DAY === 0 ? 7 : WEEK_START_DAY`
|
||||
- `buildCalendarConfig(members)` returning `{ firstDayOfWeek: 7, calendars }` with `'shared'` (rose) + per-member entries keyed by `String(userId)`
|
||||
@@ -105,6 +110,7 @@ CSS custom-property token layer with Schedule-X overrides, hex-blend color utili
|
||||
### Task 3: hydrateEvents + calendarStore + windowed fetchEvents — RED Stubs Turned GREEN
|
||||
|
||||
**`apps/pwa/src/lib/hydrateEvents.ts`**:
|
||||
|
||||
- `allDay:true` uses `Temporal.PlainDate.from(occ.start)` (guards all-day date shift)
|
||||
- `allDay:false` uses `Temporal.ZonedDateTime.from(occ.start/end)`
|
||||
- `calendarId = occ.isShared ? 'shared' : String(occ.ownerUserId)` — never `String(occ.calendarId)`
|
||||
@@ -113,11 +119,13 @@ CSS custom-property token layer with Schedule-X overrides, hex-blend color utili
|
||||
`hydrateEvents.test.ts` (Plan 01 RED stubs) — all 4 assertions now GREEN.
|
||||
|
||||
**`apps/pwa/src/store/calendarStore.ts`** Zustand store:
|
||||
|
||||
- `selectedView` — from localStorage per breakpoint group; D-05 defaults
|
||||
- `calendarRange` — month ± 7-day buffer for initial TanStack Query key
|
||||
- `openEventId`, `selectedDate` — UI-only, not persisted
|
||||
|
||||
**`apps/pwa/src/api/client.ts`**:
|
||||
|
||||
- Added `CalendarOccurrence`, `OccurrencesResponse`, `fetchEvents(start, end)`
|
||||
- Kept deprecated `CalendarEvent`, `EventsResponse`, `fetchEventsLegacy()` for EventProof.tsx (removed Plan 05)
|
||||
|
||||
@@ -131,6 +139,7 @@ tsc --noEmit: clean (0 errors)
|
||||
```
|
||||
|
||||
All Wave 1 RED stubs are GREEN:
|
||||
|
||||
- `calendarConfig.test.ts` — 4/4 pass
|
||||
- `hydrateEvents.test.ts` — 4/4 pass
|
||||
- `colorUtils.test.ts` — 10/10 pass
|
||||
@@ -140,6 +149,7 @@ All Wave 1 RED stubs are GREEN:
|
||||
### Auto-fixed Issues
|
||||
|
||||
**1. [Rule 2 - Missing Critical Functionality] Added temporal-polyfill/global to hydrateEvents.test.ts**
|
||||
|
||||
- **Found during:** Task 3 test run
|
||||
- **Issue:** Plan 01 RED stub lacked `import 'temporal-polyfill/global'`; jsdom has no native Temporal
|
||||
- **Fix:** Added as first import in `hydrateEvents.test.ts`
|
||||
@@ -147,6 +157,7 @@ All Wave 1 RED stubs are GREEN:
|
||||
- **Commit:** f377d7c
|
||||
|
||||
**2. [Rule 2 - Missing Critical Functionality] Added fetchEventsLegacy() to preserve EventProof**
|
||||
|
||||
- **Found during:** Task 3 — updating client.ts
|
||||
- **Issue:** EventProof.tsx called no-arg `fetchEvents()` and used `CalendarEvent` fields not on `CalendarOccurrence`
|
||||
- **Fix:** Added `fetchEventsLegacy()` (deprecated) + updated EventProof to use it; plan says it is replaced in Plan 05
|
||||
@@ -164,6 +175,7 @@ No new threat surface beyond the plan's threat model. All packages pre-approved
|
||||
## Self-Check: PASSED
|
||||
|
||||
Files created:
|
||||
|
||||
- [x] apps/pwa/src/styles/tokens.css
|
||||
- [x] apps/pwa/src/styles/tokens.ts
|
||||
- [x] apps/pwa/src/styles/index.css
|
||||
@@ -174,6 +186,7 @@ Files created:
|
||||
- [x] apps/pwa/src/store/calendarStore.ts
|
||||
|
||||
Commits:
|
||||
|
||||
- [x] 0911a23 — Task 1: Schedule-X stack + token layer + main.tsx
|
||||
- [x] 43554f4 — Task 2: colorUtils + calendarConfig; calendarConfig stubs GREEN
|
||||
- [x] f377d7c — Task 3: hydrateEvents + calendarStore + windowed fetchEvents; all stubs GREEN
|
||||
|
||||
Reference in New Issue
Block a user