docs: merge plan tasks 9-11 into one so every commit typechecks cleanly
This commit is contained in:
@@ -1596,11 +1596,16 @@ git commit -m "feat: source Garmin credentials from the profile instead of env v
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Task 9: Frontend types + API client
|
### Task 9: Frontend — types, API client, Profile page, WorkoutKinds page
|
||||||
|
|
||||||
|
Combined into a single task (rather than three separate ones) so every commit typechecks cleanly: splitting the API-client change (which removes `createWorkoutKind`/`deleteWorkoutKind`) from the `WorkoutKinds.tsx` rewrite that stops calling them would leave an intermediate commit with `tsc -b` failing.
|
||||||
|
|
||||||
**Files:**
|
**Files:**
|
||||||
- Modify: `frontend/src/types/api.ts` (add `Profile`, extend `WorkoutKind`)
|
- Modify: `frontend/src/types/api.ts` (add `Profile`, extend `WorkoutKind`)
|
||||||
- Modify: `frontend/src/api/client.ts` (add profile endpoints, remove create/delete, extend update)
|
- Modify: `frontend/src/api/client.ts` (add profile endpoints, remove create/delete, extend update)
|
||||||
|
- Create: `frontend/src/pages/Profile.tsx`
|
||||||
|
- Modify: `frontend/src/App.tsx` (add a "Profile" tab)
|
||||||
|
- Modify: `frontend/src/pages/WorkoutKinds.tsx` (full rewrite — shown complete below)
|
||||||
|
|
||||||
**Interfaces:**
|
**Interfaces:**
|
||||||
- Produces: `Profile` TS type, `api.getProfile()`, `api.updateProfile(profile)`.
|
- Produces: `Profile` TS type, `api.getProfile()`, `api.updateProfile(profile)`.
|
||||||
@@ -1758,31 +1763,12 @@ Replace it with:
|
|||||||
request<Profile>("/api/profile", { method: "PUT", body: JSON.stringify(profile) }),
|
request<Profile>("/api/profile", { method: "PUT", body: JSON.stringify(profile) }),
|
||||||
```
|
```
|
||||||
|
|
||||||
- [ ] **Step 3: Typecheck**
|
- [ ] **Step 3: Confirm the expected (temporary) typecheck errors**
|
||||||
|
|
||||||
Run: `cd frontend && npx tsc -b`
|
Run: `cd frontend && npx tsc -b`
|
||||||
Expected: fails at this point with errors in `src/pages/WorkoutKinds.tsx` (still calling the now-removed `api.createWorkoutKind`/`api.deleteWorkoutKind`) — that's expected here; Task 11 fixes that page. Confirm the *only* errors are in `WorkoutKinds.tsx` before moving on.
|
Expected: fails, with errors *only* in `src/pages/WorkoutKinds.tsx` (still calling the now-removed `api.createWorkoutKind`/`api.deleteWorkoutKind`). Confirm there are no errors anywhere else before continuing — this file is rewritten later in this same task (Step 6 below), not committed separately.
|
||||||
|
|
||||||
- [ ] **Step 4: Commit**
|
- [ ] **Step 4: Write the Profile page**
|
||||||
|
|
||||||
```bash
|
|
||||||
cd frontend && git add src/types/api.ts src/api/client.ts
|
|
||||||
git commit -m "feat: add Profile type/endpoints, drop workout-kind create/delete from the API client"
|
|
||||||
```
|
|
||||||
(This commit leaves the frontend in a temporarily non-compiling state until Task 11 — that's expected for an in-progress feature branch; if your workflow requires main to always build, squash Tasks 9-11 into one commit instead by holding off `git commit` until Task 11's Step 5.)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Task 10: Profile settings page
|
|
||||||
|
|
||||||
**Files:**
|
|
||||||
- Create: `frontend/src/pages/Profile.tsx`
|
|
||||||
- Modify: `frontend/src/App.tsx` (add a "Profile" tab)
|
|
||||||
|
|
||||||
**Interfaces:**
|
|
||||||
- Consumes: `api.getProfile`, `api.updateProfile` (Task 9).
|
|
||||||
|
|
||||||
- [ ] **Step 1: Write the page**
|
|
||||||
|
|
||||||
Create `frontend/src/pages/Profile.tsx`:
|
Create `frontend/src/pages/Profile.tsx`:
|
||||||
|
|
||||||
@@ -1971,7 +1957,7 @@ export function Profile() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- [ ] **Step 2: Add the "Profile" tab to `App.tsx`**
|
- [ ] **Step 5: Add the "Profile" tab to `App.tsx`**
|
||||||
|
|
||||||
In `frontend/src/App.tsx`, the current tab list and imports read:
|
In `frontend/src/App.tsx`, the current tab list and imports read:
|
||||||
|
|
||||||
@@ -2009,29 +1995,12 @@ const TABS = [
|
|||||||
] as const;
|
] as const;
|
||||||
```
|
```
|
||||||
|
|
||||||
- [ ] **Step 3: Typecheck**
|
- [ ] **Step 6: Confirm still only the same expected typecheck errors**
|
||||||
|
|
||||||
Run: `cd frontend && npx tsc -b`
|
Run: `cd frontend && npx tsc -b`
|
||||||
Expected: still fails only on `WorkoutKinds.tsx` (Task 11) — confirm no new errors from `Profile.tsx` or `App.tsx`.
|
Expected: still fails only on `WorkoutKinds.tsx` — confirm no new errors from `Profile.tsx` or `App.tsx`.
|
||||||
|
|
||||||
- [ ] **Step 4: Commit**
|
- [ ] **Step 7: Replace the full contents of `WorkoutKinds.tsx`**
|
||||||
|
|
||||||
```bash
|
|
||||||
cd frontend && git add src/pages/Profile.tsx src/App.tsx
|
|
||||||
git commit -m "feat: add profile settings page"
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Task 11: `WorkoutKinds` page — drop create/delete, add pace range + expected HR zone
|
|
||||||
|
|
||||||
**Files:**
|
|
||||||
- Modify: `frontend/src/pages/WorkoutKinds.tsx` (full rewrite — shown complete below)
|
|
||||||
|
|
||||||
**Interfaces:**
|
|
||||||
- Consumes: `api.listWorkoutKinds`, `api.updateWorkoutKind` (Task 9, extended), `api.reclassifyWorkoutKind` (existing, unchanged).
|
|
||||||
|
|
||||||
- [ ] **Step 1: Replace the full contents of `WorkoutKinds.tsx`**
|
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -2227,21 +2196,21 @@ export function WorkoutKinds() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- [ ] **Step 2: Typecheck**
|
- [ ] **Step 8: Typecheck the whole frontend**
|
||||||
|
|
||||||
Run: `cd frontend && npx tsc -b`
|
Run: `cd frontend && npx tsc -b`
|
||||||
Expected: no errors.
|
Expected: no errors — this confirms Steps 1-7 together leave the frontend fully compiling.
|
||||||
|
|
||||||
- [ ] **Step 3: Commit**
|
- [ ] **Step 9: Commit everything from this task together**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd frontend && git add src/pages/WorkoutKinds.tsx
|
cd frontend && git add src/types/api.ts src/api/client.ts src/pages/Profile.tsx src/App.tsx src/pages/WorkoutKinds.tsx
|
||||||
git commit -m "feat: fixed workout-kind taxonomy UI with pace range and HR zone editing"
|
git commit -m "feat: add profile settings page and fixed-taxonomy WorkoutKinds UI with pace/HR-zone editing"
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Task 12: Fix `cmd/seedsample` for the fixed taxonomy, then full manual verification
|
### Task 10: Fix `cmd/seedsample` for the fixed taxonomy, then full manual verification
|
||||||
|
|
||||||
`cmd/seedsample` currently calls `db.CreateWorkoutKind` with names `"Easy"`, `"Tempo"`, `"Interval"`. Migration 0004 (Task 2) already seeds a row named exactly `"Tempo"` and `"Interval"` (and `"Easy Run"`, not `"Easy"`) -- since `workout_kinds.name` is `UNIQUE`, `seedsample`'s `CreateWorkoutKind("Tempo", ...)`/`CreateWorkoutKind("Interval", ...)` calls would now fail with a unique-constraint error. It also still passes the now-removed `appsync.Config.MaxHR` field (Task 7 deleted it), which would fail to compile. Both must be fixed before this plan's changes are usable end-to-end.
|
`cmd/seedsample` currently calls `db.CreateWorkoutKind` with names `"Easy"`, `"Tempo"`, `"Interval"`. Migration 0004 (Task 2) already seeds a row named exactly `"Tempo"` and `"Interval"` (and `"Easy Run"`, not `"Easy"`) -- since `workout_kinds.name` is `UNIQUE`, `seedsample`'s `CreateWorkoutKind("Tempo", ...)`/`CreateWorkoutKind("Interval", ...)` calls would now fail with a unique-constraint error. It also still passes the now-removed `appsync.Config.MaxHR` field (Task 7 deleted it), which would fail to compile. Both must be fixed before this plan's changes are usable end-to-end.
|
||||||
|
|
||||||
@@ -2397,7 +2366,7 @@ git commit -m "fix: update seedsample for the fixed workout taxonomy and profile
|
|||||||
|
|
||||||
## Plan self-review
|
## Plan self-review
|
||||||
|
|
||||||
**Spec coverage:** Section 1 (profile, credential updates) → Tasks 1, 4, 5, 8. Section 2 (taxonomy + pace ranges) → Tasks 2, 3, 6, 9, 11. Section 5's profile-screen/pace-editing UI → Tasks 10, 11. The credential-update addition made during spec review → Task 4/5. Sections 3 (relative classification) and 4 (phase segmentation) are explicitly out of scope for this plan (Plans 2 and 3).
|
**Spec coverage:** Section 1 (profile, credential updates) → Tasks 1, 4, 5, 8. Section 2 (taxonomy + pace ranges) → Tasks 2, 3, 6, 9. Section 5's profile-screen/pace-editing UI → Task 9. The credential-update addition made during spec review → Task 4/5. Sections 3 (relative classification) and 4 (phase segmentation) are explicitly out of scope for this plan (Plans 2 and 3).
|
||||||
|
|
||||||
**Placeholder scan:** No TBD/TODO markers; every step shows complete code.
|
**Placeholder scan:** No TBD/TODO markers; every step shows complete code.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user