diff --git a/FEATURES_CHECKLIST.md b/FEATURES_CHECKLIST.md new file mode 100644 index 0000000..392e5f3 --- /dev/null +++ b/FEATURES_CHECKLIST.md @@ -0,0 +1,54 @@ +# TimeToLeave — Features Implementation Checklist + +## Phase 1 — New Settings Infrastructure (Steps 1-3) + +| # | Step | ✅ | ✔️ | +|---|---|----|----| +| 1 | Extend ReminderSettings type with 3 new fields | [x] | [x] | +| 2 | Update useReminderSettings hook with defaults + setters | [x] | [x] | +| 3 | Update ReminderSettingsPanel UI (slider + 2 toggles) | [x] | [x] | + +## Phase 2 — Walk Routing Infrastructure (Steps 4-6) + +| # | Step | ✅ | ✔️ | +|---|---|----|----| +| 4 | Create WalkRoutingClient (OSRM foot profile) | [x] | [x] | +| 5 | Create /api/walk-route endpoint | [x] | [x] | +| 6 | Add getWalkRoute to api-client package | [x] | [x] | + +## Phase 3 — Departure Time Calculation (Steps 7-8) + +| # | Step | ✅ | ✔️ | +|---|---|----|----| +| 7 | Create useDepartureTime hook | [x] | [x] | +| 8 | Update useClock to accept departureTime override | [x] | [x] | + +## Phase 4 — Mode Selector & EventCard Updates (Steps 9-11) + +| # | Step | ✅ | ✔️ | +|---|---|----|----| +| 9 | Create useWalkRoute hook | [x] | [x] | +| 10 | Create WalkingOption component | [x] | [x] | +| 11 | Update EventCard with mode selector + conditional rendering | [x] | [x] | + +## Phase 5 — TrainSection & JourneyList Updates (Steps 12-13) + +| # | Step | ✅ | ✔️ | +|---|---|----|----| +| 12 | Update TrainSection props (arrival buffer + walk option) | [x] | [ ] | +| 13 | Update JourneyList with arrival buffer filtering | [x] | [ ] | + +## Phase 6 — Verification & Testing (Steps 14-16) + +| # | Step | ✅ | ✔️ | +|---|---|----|----| +| 14 | Integration verification (manual testing) | [ ] | [ ] | +| 15 | Build verification (typecheck, lint, test, build) | [ ] | [ ] | +| 16 | Update api-client exports | [ ] | [ ] | + +--- + +**Legend:** +- ✅ = Done (code written) +- ✔️ = Verified (tests/builds pass) +- `[~]` = Optional or deferred (never blocks phase advancement) diff --git a/FEATURES_PLAN.md b/FEATURES_PLAN.md new file mode 100644 index 0000000..3484327 --- /dev/null +++ b/FEATURES_PLAN.md @@ -0,0 +1,604 @@ +## Phase 1 — New Settings Infrastructure (Steps 1-3) + +Extend the `ReminderSettings` type, hook, and UI panel with three new options. + +--- + +#### Step 1: Extend ReminderSettings Type (~5 min) + +**File:** `packages/core/src/types.ts` + +**Goal:** Add three new fields to `ReminderSettings` for arrival buffer, walking, and bike toggles. + +**Change `ReminderSettings` interface:** + +```typescript +export interface ReminderSettings { + bufferMinutes: number; + enabled: boolean; + arrivalBufferMinutes: number; // arrive X minutes before event (default 5) + showWalkingOption: boolean; // show walk-from-station option (default true) + showBikeOption: boolean; // show bike route section (default true) +} +``` + +**Actions:** +1. Add the three new fields to the interface +2. No changes needed to other types + +**Acceptance criteria:** +- [ ] `packages/core` compiles without errors +- [ ] `npm run typecheck -w packages/core` passes + +--- + +#### Step 2: Update useReminderSettings Hook (~10 min) + +**File:** `apps/web/src/hooks/useReminderSettings.tsx` + +**Goal:** Add default values and setters for the three new settings fields. + +**Changes:** + +Update DEFAULTS: +```typescript +const DEFAULTS: ReminderSettings = { + bufferMinutes: 15, + enabled: true, + arrivalBufferMinutes: 5, + showWalkingOption: true, + showBikeOption: true, +}; +``` + +Update context interface: +```typescript +interface ReminderContextType extends ReminderSettings { + setBufferMinutes: (minutes: number) => void; + setEnabled: (enabled: boolean) => void; + setArrivalBufferMinutes: (minutes: number) => void; + setShowWalkingOption: (show: boolean) => void; + setShowBikeOption: (show: boolean) => void; +} +``` + +Add setter implementations: +```typescript +const setArrivalBufferMinutes = useCallback((minutes: number) => { + setSettings((prev) => ({ ...prev, arrivalBufferMinutes: Math.max(0, Math.min(30, minutes)) })); +}, []); + +const setShowWalkingOption = useCallback((show: boolean) => { + setSettings((prev) => ({ ...prev, showWalkingOption: show })); +}, []); + +const setShowBikeOption = useCallback((show: boolean) => { + setSettings((prev) => ({ ...prev, showBikeOption: show })); +}, []); +``` + +Update Provider value to include new setters. + +**Acceptance criteria:** +- [ ] Hook exports all three new setters +- [ ] localStorage serialization includes new fields +- [ ] `npm run typecheck -w apps/web` passes + +--- + +#### Step 3: Update ReminderSettingsPanel UI (~15 min) + +**File:** `apps/web/src/app/ui/ReminderSettingsPanel.tsx` + +**Goal:** Add UI controls for the three new settings. + +**Add after the buffer minutes slider, before the permission status section:** + +```tsx +{/* Arrival buffer slider */} +
Manual event
+