Complete workout recording baseline and project context

This commit is contained in:
rob
2026-11-04 21:41:17 +00:00
parent e86a2e7850
commit 669bfc3910
29 changed files with 3288 additions and 297 deletions
+14 -2
View File
@@ -14,7 +14,8 @@ Read:
4. `docs/DECISIONS.md`.
5. `docs/TASKS.md`.
6. `docs/HANDOFF.md`.
7. Relevant current code/config/tests for the task.
7. `docs/WORKFLOW.md` and any repository-specific development, testing, Git, styling, deployment, or contributor guidance relevant to the work.
8. Relevant current code/config/tests for the task.
For current-state facts, repository code/configuration takes precedence over maintained docs, task text, handoff snapshots, and old chat assumptions, in that order. Report conflicts instead of silently following stale context.
@@ -28,6 +29,17 @@ The user's current explicit instruction controls the requested change. Preserve
- Do not invent features or perform unrelated refactors.
- Run the validation required by the task before marking it complete.
## Roborto Workflow 2.0
The project owner is Captain. Use a restrained chief-engineer/bridge voice while keeping status, risks, and technical details precise. Context System 1.0 remains the documentation format; Workflow 2.0 governs how work proceeds around it.
- Before changing application code, inspect and report the current branch and worktree, Git status including untracked changes, the active accepted task, relevant decisions, and dependencies. Preserve pre-existing changes.
- Use one accepted numbered implementation task per dedicated branch/worktree by default. Run concurrent tasks in separate worktrees, and keep task code, tests, decisions, and context together. Read-only diagnosis, review, planning, and design need no task worktree. Context administration is documentation-only by default and does not trigger branch changes.
- Brief substantial tasks before implementation when useful. Validate against the task requirements, review the diff against the correct base, update context, and prepare a handoff.
- Distinguish Accepted, In progress, Implementation-ready / awaiting Captain validation, and Complete. Passing automated checks alone does not satisfy a required Captain review or manual acceptance gate.
- For UI work, read existing styling, design guidance, decisions, and approved references before proposing or changing visuals. Discover and follow any repository manual-test/testtask workflow; its snapshots are test evidence, not implementation worktrees.
- Follow `docs/WORKFLOW.md` for the detailed task, branch/worktree, validation, authority, and specialist-skill rules. Missing integration, worktree, merge, and release conventions remain open decisions; do not silently assume defaults.
## Context maintenance
- Stable product/architecture facts: `docs/PROJECT_OVERVIEW.md`.
@@ -38,4 +50,4 @@ The user's current explicit instruction controls the requested change. Preserve
Update durable documents when work makes them stale. Refresh `HANDOFF.md` rather than appending chat history.
Do not commit, push, switch branches, deploy, or expose secrets without explicit user instruction.
Do not commit, push, switch branches, merge, rebase, reset, deploy, or expose secrets without explicit user instruction. Do not perform destructive operations without authority. Captain retains merge and release authority unless an explicit repository rule delegates it.
+39 -14
View File
@@ -1,31 +1,56 @@
# Exercise Tracker current state
- Last updated: 2026-10-18
- Last updated: 2026-11-04
- Current branch: `task/001-foundation`
Update this file whenever meaningful work changes application, deployment, test, or known-issue status. Verify it against the repository before relying on it.
Code and configuration take precedence over this summary.
## Application status
The repository has a React/Vite application shell with React-Bootstrap, local CSS, top-level section navigation, and placeholder content. No workout routine data, date/period navigation, IndexedDB persistence, logging, or timers are implemented. The repository still has no commits.
The React/Vite app shows a version 7 seven-day routine with 30 exercise definitions, actual-date navigation, exclusive Morning/Afternoon views, title-only Monday/Friday full body stretch routines, and no dog walks. A large local time-of-day clock stays in the header. Afternoon isometric holds have no prescribed time. The daily hanging goal starts at two minutes, can be edited, and persists in IndexedDB without vest details.
## Confirmed by implementation and validation
TASK-014 removes the workout, exercise, rest, and EMOM timers and all timer audio. Morning EMOM cards accept one total-reps entry and exercise-specific actual load. Regular repetition exercises accept separate reps and load for each entered set. The next set copies the preceding set's load fields but leaves reps blank. Vest, dumbbell, and EZ-bar inputs follow the routine seed; exercises using both vest and dumbbells show separate fields. A paired-dumbbell field records kilograms per dumbbell, with two dumbbells reflected in the saved total external kilograms. Bodyweight-only work records zero added weight. Earlier single-total entries remain readable and editable as legacy totals rather than being reinterpreted as components. Entries are keyed by local date and exercise in IndexedDB; browsing alone does not save a record. The database remains version 2 and preserves the hanging-goal override store. Prescribed EMOM timing and rest guidance remain visible as targets, with no app timer or volume-per-minute feature.
- TASK-001 automated shell test, lint, and production build passed.
Broader recording, a full history view, routine editing, backup, and offline reload are still planned work. The latest commit is `e86a2e7` (`Initialize Workout Tracker app shell`); the later task work is uncommitted.
## Partial or externally dependent areas
## Validation and limits
- TASK-001 requires a phone/desktop browser visual check, but no browser surface was available in this session. Licensed/reviewed exercise illustrations and a deployment location are not yet selected.
- On 2026-11-04, TASK-014 lock-on verification passed all 27 tests across 7 files, lint and production build in the current worktree. No application changes or browser/manual checks were made; Captain validation remains pending.
## Known issues
- On 2026-10-27, all 23 tests across 7 files passed, including strength-entry UI, date isolation, validation, IndexedDB v1-to-v2 upgrade, and hanging-goal preservation. Lint and production build passed.
- On 2026-10-28, the revised strength-entry flow passed 27 tests across 7 files, lint, production build, context validation, and `git diff --check`. Tests cover flys, mixed vest/dumbbell entries, next-set weight defaults, legacy totals, and storage consistency. The browser inventory remained empty, so visual/manual verification is still pending.
- The available computer-use inventory had no browser, so phone/desktop visual checks could not be run here. The owner previously confirmed TASK-003's UI check; the current TASK-014 layout has not been independently checked in a browser.
- Node 24.21.0 is installed outside the default shell PATH at `/home/rob/.nvm/versions/node/v24.21.0/bin`.
- Exercise illustrations and detailed technique copy are not supplied; TASK-004 can use placeholders, while TASK-011 requires reviewed assets/content. Deployment location is not selected.
- `docs/SPEC.md` contains an apparent pull-up progression typo ("4 × 10 minutes"); `docs/WORKOUT_ROUTINE.md` specifies a 10-minute EMOM with 3–4 reps each minute. The authoritative routine controls seed data.
- Exercise illustrations and detailed technique copy are not supplied; TASK-004 can use labeled placeholders, while TASK-011 requires reviewed assets/content.
## Current work and priorities
## Current work in progress
TASK-014 is Complete following Captain's explicit acceptance on 2026-11-04, including suitcase-carry dumbbell inputs and front/side-plank vest inputs. Final automated checks passed 32 tests, lint and build; agent browser QA remained unavailable. TASK-006's timer scope is superseded. TASK-005 remains accepted for additional recording, including hang attempts, hold checkoffs, notes, and other previously accepted records. TASK-008 remains accepted for history and total external-load volume from recorded reps and external weight, without a time denominator.
- TASK-001: Application foundation and responsive shell.
## Workflow state
## Immediate priorities
Roborto Workflow 2.0 operating guidance is in `AGENTS.md` and `docs/WORKFLOW.md`; Context System remains 1.0. This is the sole worktree on `task/001-foundation`. It contains uncommitted work spanning multiple tasks. No integration branch, remote, merge policy, worktree directory convention, release branch, or repository testtask adapter is defined. Proposed defaults are documented for Captain review, not yet adopted.
1. Complete TASK-001 browser visual verification, then close the task. Do not start TASK-002 until separately selected.
## TASK-015 planning status — 2026-11-04
The matching TASK-015 record was expanded after inspection, not duplicated. This session changed documentation only; the running application/database remain unchanged. TASK-015 awaits implementation approval, the exact timer scope, and a safe agreed Git base/worktree arrangement. The latest request clarifies per-minute EMOM logging, actual per-side hold durations, continuous daily-hang target and bodyweight-only walk classification; see ADR-017 and the explicit planning overlays in SPEC/WORKOUT_ROUTINE. Existing TASK-014 Captain validation remains pending. No app tests or browser QA were rerun for this planning-only update.
## TASK-014 engaged validation — 2026-11-04
No app changes were needed based on source review; automated checks passed earlier in this session. Browser inventory is empty and in-app browser unavailable, so real-browser QA remains unverified. A loopback-only Vite acceptance endpoint is running at `http://127.0.0.1:5174/` from this worktree; it uses a distinct browser-storage origin from port 5173. Captain validation remains the completion gate; see HANDOFF for the checklist and environment.
## Suitcase-carry weight correction — 2026-11-04
TASK-014 now shows a single-dumbbell kilogram input per suitcase-carry set without requiring repetitions. Different loads (including zero) save/reload by date; a new set copies the preceding load. Existing 30–60-second-per-side targets remain separate and no actual duration is invented. Storage adds `load-sets` records in the existing v2 store without rewriting prior data. All 29 tests across 7 files, lint and build pass. Browser QA remains unavailable and Captain validation is pending.
## Plank vest correction — 2026-11-04
TASK-014 now exposes vest kilograms per set for front planks (weight-only, no reps) and side-plank hip raises (reps plus vest). Seed v7 adds unspecified vest load for these two exercises; no prescribed targets or historical records are rewritten. Old bodyweight-only rows remain readable as prior totals and require explicit conversion to component entry. All 32 tests across 7 files, lint and build pass. Browser QA remains unavailable; Captain validation is pending.
## TASK-014 acceptance — 2026-11-04
Captain explicitly confirmed “task complete” after reviewing the implemented corrections. TASK-014 is Complete. Earlier pending-validation entries above record the sequence before acceptance, not an outstanding gate. No further task was engaged, and no commit, merge or deployment was performed. TASK-015 and TASK-016 remain awaiting implementation authority.
## Authorized baseline integration — 2026-11-04
Captain selected timer-free TASK-015 and authorized committing all current pending work and merging it into local codex before implementation. Branch inspection found only task/001-foundation and no remote; codex will be created from the original foundation commit. ADR-018 and WORKFLOW establish codex as TASK-015's integration base and sequential task/015-equipment-ui branch in this worktree. No TASK-015 merge/push/deployment is authorized. Earlier unresolved timer/Git notes are superseded by this explicit instruction.
+227 -2
View File
@@ -41,8 +41,8 @@ Changes stay within accepted scope and avoid accidental product redesign.
1. Discuss/receive requirements.
2. Record important accepted durable decisions here.
3. Record accepted implementation scope and acceptance criteria in `TASKS.md`.
4. Implement and test.
5. Update `CURRENT_STATE.md`.
4. Follow `docs/WORKFLOW.md` for task isolation, implementation, validation, Captain review, and completion status.
5. Update `CURRENT_STATE.md` with verified current state.
6. Refresh `HANDOFF.md` when transferring work.
## ADR-003: Offline local application architecture
@@ -95,3 +95,228 @@ Bundle the documented programme as versioned seed data, initialize a new local s
### Consequences
Routine versions and dated records require distinct identities. Reseeding and schema migrations must never silently replace user edits or completed performance.
## ADR-006: Separate workout clock and interval timer with optional audio
- Status: Superseded by ADR-014
- Date: 2026-10-25
### Decision
A manually started whole-workout elapsed clock may run alongside one exercise, rest, or EMOM timer. Changing the active exercise/rest/EMOM timer requires an explicit action. Timer use does not itself create a completed workout record. Short audible cues for approaching and actual timer transitions are optional and muted by default, with equivalent visible feedback; background audio is not guaranteed.
### Context
The owner asked to time the entire workout and to hear timer cues during exercises where the screen cannot be watched. This supersedes the earlier `docs/SPEC.md` wording that allowed only one active timer of any kind.
### Consequences
The workout clock and interval timer need independent elapsed-time state and clock-controlled tests. The interface must expose sound on/off clearly and keep timing usable if browser audio is unavailable.
## ADR-007: External-load volume per workout minute
- Status: Superseded by ADR-014
- Date: 2026-10-25
### Decision
For a saved workout, calculate external-load volume as the sum of actual repetitions multiplied by actual external kilograms moved for each completed rep set. External load includes recorded vest mass, dumbbell mass multiplied by the number used, and EZ-bar total as applicable; body weight is excluded. Divide by the whole-workout clock's running minutes, including breaks and excluding paused time, and label the rate kg·reps/min. Show raw volume and elapsed time alongside the rate. Label partial workouts and incomplete loads; do not show a rate when duration is zero/missing or no qualifying loaded sets exist. Timed holds, hangs, and walks are tracked separately.
### Context
The owner requested a volume-per-minute workout measure and chose external load only and whole-workout time including breaks.
### Consequences
Set logs must retain actual reps and separate load components, including dumbbell count where needed. Workout and rest timing must remain distinguishable. History calculations use saved actuals and surface missing data rather than substituting prescribed values.
The walk-tracking clause in this decision is superseded by ADR-012; walks remain reference context and do not enter recorded workout volume.
## ADR-008: Wall clock instead of afternoon hold timers
- Status: Accepted
- Date: 2026-10-26
### Decision
Show the current local time in a persistent header across the app. Do not show per-exercise timer controls for the afternoon isometric holds and daily hanging practice. Show their prescribed durations as targets. The afternoon view may still show an already-running workout or interval timer so its state remains accessible. Morning exercise, rest, walk, and EMOM timers remain available.
### Context
The owner said the afternoon holds do not need timers and requested a clock visible at all times instead.
### Consequences
The wall clock is distinct from the manually started whole-workout elapsed clock and does not record performed duration. Future workout logging may capture actual afternoon hold and hang durations without requiring a timer.
The prescribed-duration display for afternoon holds in this decision is superseded by ADR-011.
The walk-timer clause is superseded by ADR-012.
The remaining workout and interval-timer clauses are superseded by ADR-014; the wall clock remains.
## ADR-009: Remove unrequested stretch exercises
- Status: Accepted
- Date: 2026-10-26
### Decision
Remove every previously listed stretch exercise from the initial programme and exercise definitions. Do not add exercises without the owner's request. Show the persistent local time clock more prominently.
### Context
The owner said the stretch movements had been added without specifying which ones and explicitly requested their removal and a larger clock. This updates the previous routine baseline in `docs/WORKOUT_ROUTINE.md` and seed data.
### Consequences
Version the revised seed and update routine tests and product documentation. Future plan editing and logging must not reintroduce the removed movements by default.
The temporary Monday/Friday rest-day presentation was corrected by ADR-010; the removal of unrequested exercise entries remains in force.
## ADR-010: Monday and Friday stretch routine placeholder
- Status: Accepted
- Date: 2026-10-26
### Decision
Label Monday and Friday mornings “Full body stretch routine” without listing exercises or durations. The owner will provide the specific stretches later. Keep the previously removed stretch definitions out of the seed until then.
### Context
The owner clarified that these mornings are for a full body stretching routine, while the specific movements are still undecided. This supersedes the rest-day presentation in ADR-009.
### Consequences
The routine seed stores a stretching session with an empty exercise list for both mornings. The UI shows the title without a rest badge or invented movement rows.
## ADR-011: Untimed isometrics and editable daily hang goal
- Status: Accepted
- Date: 2026-10-26
### Decision
Do not prescribe or display times for the five daily afternoon isometric holds. Keep their side guidance and day-specific effort guidance. The daily hanging goal starts at two minutes but can be changed by the owner and must persist locally across dates and reloads. Do not show daily-hang vest load yet; the owner may add weighted hangs later.
### Context
The owner explicitly removed the need for isometric hold times, asked to change the hang goal, and said vest use is for later.
### Consequences
The initial routine seed has no isometric duration targets or daily-hang load component. A narrow IndexedDB routine override stores the hang goal independently from the seed. Future storage migrations and routine editing must preserve that override; workout logging does not require timed isometric holds.
## ADR-012: Dog walks are reference context, not records
- Status: Superseded by ADR-013
- Date: 2026-10-26
### Decision
Keep the owner's usual three daily dog walks, typical 30–60 minute duration, and current 6 kg vest use as a compact routine reference. Do not offer walk slots, timers, completion controls, or saved walk records. A future calorie calculation may use the reference only when separately requested; do not estimate calories now or present typical values as measured activity.
### Context
The owner said walk recording is unnecessary and asked to mention walks as reference for possible later calorie calculations.
### Consequences
This replaces earlier walk-slot and walk-logging requirements in TASK-002, TASK-003, TASK-005, TASK-009, and the specification. The routine seed stores one reference rather than three daily walk exercises. Future backup and recording work must not require walk logs.
## ADR-013: Remove dog walks from the workout tracker
- Status: Accepted
- Date: 2026-10-26
### Decision
Remove dog walks entirely from the app's UI, routine seed, and active product requirements. No walk reference, timer, record, or calorie calculation is in scope.
### Context
After reviewing the reference-only presentation, the owner requested “remove dog walks.”
### Consequences
ADR-012's reference display and routine data are superseded. Keep prior decisions and completed tasks as history, while current implementation and specifications omit dog walks.
## ADR-014: Untimed strength recording
- Status: Accepted
- Date: 2026-10-27
### Decision
Remove workout, exercise, rest, and EMOM timers and their audio cues. Keep the large current local-time clock and editable daily hang goal. Record one actual total-repetition count and actual external weight for an EMOM exercise; record actual repetitions and external weight separately for each regular set. Store entries by date and exercise locally. Do not calculate or display volume per minute; future progress may show total external-load volume from these records.
### Context
The owner removed timers, specified EMOM totals and per-set rep/weight counts, and chose to remove volume per minute rather than manually enter workout duration.
### Consequences
TASK-006's timer scope and ADR-006/ADR-007 are superseded. Prescribed EMOM timing and rest guidance remain part of the programme, but the app does not run timers or turn those targets into performed records. TASK-014 adds initial strength entry and TASK-005 covers later accepted recording details. Existing hang-goal storage must survive the new IndexedDB store.
## ADR-015: Apply Roborto Workflow 2.0 around Context System 1.0
- Status: Accepted
- Date: 2026-10-28
### Decision
Keep the repository's Context System 1.0 files and project-specific rules. Use the task isolation, pre-implementation Git checks, Captain validation gate, manual-test handoff, diff review, and authority rules in `AGENTS.md` and `docs/WORKFLOW.md`. Do not silently establish an integration branch, worktree path, merge policy, or release branch while those conventions are undefined.
### Context
The owner explicitly requested a documentation-only reconciliation with Roborto Workflow 2.0. The repository already specified numbered tasks and isolated task work, but had no complete Git or Captain validation policy; uncommitted changes from multiple tasks are present on `task/001-foundation`.
### Consequences
Future implementation work must identify its accepted task and branch/worktree safely. Agent checks alone leave work awaiting Captain validation when that review is required. Captain must resolve the open Git conventions and existing mixed work before isolated task implementation proceeds.
## ADR-016: Record exercise-specific loads and carry weight into the next set
- Status: Accepted
- Date: 2026-10-28
### Decision
Strength entry fields follow the exercise's documented load type. Record vest, dumbbell, and EZ-bar weights by their actual component; exercises using vest and dumbbells have separate inputs. For paired dumbbells, enter kilograms per dumbbell and derive the total external load from two dumbbells. Adding a set copies the preceding set's entered weights but leaves repetitions blank. Do not prefill actual weights from prescribed targets. Keep earlier single-total entries as legacy totals without silently interpreting them as components.
### Context
The owner reported that dumbbell flys should record dumbbell weight, not vest weight; only some exercises use a vest, while some use vest and dumbbells. The owner also requested that the last entered set weight be the next set's default. This refines ADR-014's initial total-weight entry behavior.
### Consequences
TASK-014's strength entry UI and stored records use exercise-specific load components where the seed defines them. The stored `externalKg` remains a derived total for new records and an unclassified total for earlier entries. TASK-005 must preserve both forms and may extend recording beyond these strength entries.
## ADR-017: Equipment capabilities and measurements separate from performance
- Status: Accepted requirements; implementation pending TASK-015 approval
- Date: 2026-11-04
### Decision
Use the Captain's equipment assignments in WORKOUT_ROUTINE section 8 for TASK-015. Exercise capabilities contain equipment types and applicable measurements, not fixed weights. Prescriptions and actual performances remain independent. Actual equipment-specific load varies per set/minute; dumbbell load is per dumbbell and bar load includes the bar. Handles are support equipment, excluded from lifted load. Preserve historical values and original semantics rather than recomputing them from current definitions.
New EMOM tracking supports per-minute reps/load with derived totals, superseding ADR-014's aggregate-only rule for new records when implemented; old aggregates remain intact. Actual per-side hold duration does not restore prescribed afternoon hold times under ADR-011. Daily hang is bodyweight-only and its initial editable two-minute goal is continuous, with longest and cumulative actuals independent. Dog walks remain excluded from app UI/records under ADR-013, with bodyweight-only classification taking precedence over historical vest descriptions.
### Consequences
TASK-015 will add metadata-driven controls, versioned compatible storage and JSON contracts. ADR-016's per-dumbbell and explicit actual-load rules remain; controls will derive from definition capabilities rather than prescription load keys. Timer restoration remains unresolved: ADR-014's no-timer behavior stays in force until Captain approves a precise change. This decision records explicit requirements, not authority to implement in this planning turn.
## ADR-018: Timer-free TASK-015 and codex integration baseline
- Status: Accepted
- Date: 2026-11-04
### Decision
Captain explicitly selected timer-free behavior for TASK-015. Retain the local wall clock and prescribed rest/EMOM guidance without workout, exercise, rest or EMOM timers or audio.
Captain authorized committing the existing uncommitted work and merging it into `codex` before TASK-015 implementation. No codex branch or remote existed at inspection; create local codex from the original foundation commit, commit the reviewed pending work on task/001-foundation, and fast-forward merge it into codex. Use codex as the integration baseline for TASK-015 and a dedicated task/015-equipment-ui branch in the sole worktree once clean. No concurrent worktree is needed for sequential work. No push or deployment is authorized.
### Consequences
This resolves TASK-015's timer and dirty-baseline gates. Existing TASK-014 acceptance and completed prerequisites travel in the baseline commit. Further merges remain Captain-controlled unless explicitly authorized. The present merge instruction covers the pre-existing work, not the future TASK-015 implementation.
+9 -44
View File
@@ -1,47 +1,12 @@
# Exercise Tracker handoff
> **This handoff is supplementary context. Current repository code and maintained documentation take precedence if they conflict with this file.**
> This is a replaceable snapshot. Repository code and maintained current context take precedence.
This file is a replaceable snapshot for conversation/work transfer. Refresh it rather than appending a long transcript.
- Updated: 2026-10-18
- Branch at update: `task/001-foundation`
- Commit at update: No commits yet
- Working tree: New context files are untracked
## Current active task
TASK-001 is in progress. Implementation and automated validation are done; phone/desktop browser visual verification remains.
## Recently completed
- Created the React/Vite and React-Bootstrap foundation with responsive shell, top-level navigation, local CSS, and shell test.
## Relevant files
- `AGENTS.md` — agent entry instructions
- `docs/PROJECT_OVERVIEW.md` — stable project/architecture context
- `docs/CURRENT_STATE.md` — current verified state and known issues
- `docs/DECISIONS.md` — durable accepted decisions
- `docs/TASKS.md` — scoped implementation work
- `docs/HANDOFF.md` — replaceable transfer snapshot
- `docs/SPEC.md` — application behavior and acceptance criteria
- `docs/WORKOUT_ROUTINE.md` — authoritative initial prescriptions
- `src/App.jsx` and `src/styles.css` — application shell
- `package.json` — scripts and dependencies
## Recent validation record
- `npm test` (1 test), `npm run lint`, and `npm run build` passed on Node 24.21.0. Browser visual verification was unavailable because the computer-use browser inventory was empty.
## Work remaining
- Finish TASK-001 phone/desktop visual verification and review final diff. Keep TASK-002 proposed until separately selected; do not merge without approval.
## Blockers and uncertainties
- Browser visual verification for TASK-001 could not run in this session. The spec's pull-up phrase "4 × 10 minutes" conflicts with the authoritative routine's 10-minute EMOM at 3–4 reps/min; use the routine for seed data and clarify the typo. Exercise illustrations and detailed technique copy require reviewed sources. Editor add/remove scope, backup merge semantics, image source, and deployment remain open decisions for later tasks.
## Recommended next action
Visually verify TASK-001 at phone and desktop widths when a browser surface is available, then mark it complete.
- Updated: 2026-11-04
- Baseline source: task/001-foundation at e86a2e7 plus reviewed pending work.
- Captain accepted TASK-014 including suitcase-carry and plank-load corrections. Final baseline checks: 32 tests across 7 files, lint and build pass. Browser QA unavailable; Captain explicitly accepted completion.
- Captain authorized committing existing uncommitted source/context and merging it into local codex before TASK-015 implementation. No codex branch or remote existed at inspection; create codex from the foundation commit and fast-forward the reviewed baseline. ADR-018 and WORKFLOW record the operation and sequential task-branch convention.
- TASK-015 timer gate resolved: retain timer-free behavior, wall clock and rest/EMOM guidance. No audio/timers return. Task branch after clean merge: task/015-equipment-ui based on codex. The future TASK-015 merge is not authorized by the baseline merge instruction.
- Current seed is v7 with 30 exercises. IndexedDB is v2, storing routineOverrides and strengthEntries. Strength entries include sets, aggregate emom and weight-only load-sets. Legacy bodyweight/total records must survive TASK-015.
- No remote, deployment or repository testtask adapter exists. Browser inventory was empty; in-app browser unavailable. Loopback Vite test server was started at http://127.0.0.1:5174/; verify runtime state before relying on it. Different ports have separate browser storage.
- TASK-015 scoped implementation follows baseline integration, focused UI design, metadata/storage/schema adapters, reusable controls, tests and Captain acceptance. Dark theme remains TASK-016; history, routine editor and backup interface remain separate tasks. Do not fabricate technique content/assets.
+5 -3
View File
@@ -6,11 +6,11 @@ This is a newly initialized repository. The user calls the planned product "Work
## Product
Planned: a personal, offline-first workout tracker with seven-day date navigation; exclusive Morning and Afternoon views; strength sets, repetitions, and weight components; daily isometrics and hanging practice; separate walk logging; Monday/Friday stretching; exercise details and local illustrations; rest, EMOM, and hold timers; workout history and progress; editable routines; JSON backup and restoration; and responsive mobile and desktop layouts. No product behavior is implemented. `docs/SPEC.md` defines application behavior and `docs/WORKOUT_ROUTINE.md` defines the authoritative initial programme.
Planned: a personal, offline-first workout tracker with seven-day date navigation; exclusive Morning and Afternoon views; strength sets, repetitions, and weight components; untimed daily isometrics and daily hanging practice with an editable time goal; Monday/Friday “Full body stretch routine” headings with no exercise entries until the owner provides them; exercise details and local illustrations; a prominent persistent local time clock; no workout timers; EMOM total reps/weight and regular per-set reps/weight recorded by date; workout history and progress including total external-load volume; editable routines; JSON backup and restoration; and responsive mobile and desktop layouts. The owner removed the previously listed stretch exercises. The authoritative initial programme is bundled as data and has a Today/Week routine view. The large local time-of-day clock remains, while workout, exercise, rest and EMOM timers have been removed. Strength rep/weight entry is implemented locally with exercise-specific vest, dumbbell, and EZ-bar fields; the daily hang shows no vest load yet. Other recording behavior remains future work. `docs/SPEC.md` defines application behavior and `docs/WORKOUT_ROUTINE.md` defines the authoritative initial programme.
## Technology and architecture
The application foundation now uses React, Vite, and React-Bootstrap. IndexedDB is planned for persistent local storage in TASK-005. The application has no backend, authentication, or cloud dependency.
The application foundation now uses React, Vite, and React-Bootstrap. IndexedDB stores the user-edited daily hanging goal and dated strength entries; TASK-005 will extend local storage for additional workout records while preserving those values. The application has no backend, authentication, or cloud dependency.
The planned design keeps routine templates, exercise definitions, historical workout records, and UI state separate. The initial routine is bundled as versioned seed data; subsequent user edits are local data and must not be overwritten by updates. A storage adapter separates React components from IndexedDB. A service worker and locally bundled assets are required for offline reload in the release scope.
@@ -20,7 +20,8 @@ The planned design keeps routine templates, exercise definitions, historical wor
- `docs/` — project overview, current state, decisions, tasks, and handoff.
- `docs/SPEC.md` — application requirements and behavior.
- `docs/WORKOUT_ROUTINE.md` — authoritative initial training programme.
- `src/` — React shell, local styling, and shell test; future domain, storage, timer, and view code will be added here.
- `docs/WORKFLOW.md` — repository operating workflow and open Git conventions.
- `src/` — React shell, local styling, routine view, dated strength-entry storage/UI, a daily hang-goal storage adapter, tests, and versioned initial routine data; broader workout storage remains future work.
- `package.json` — development, test, lint, and build commands.
## Development environment
@@ -37,3 +38,4 @@ No deployment architecture is defined or verified.
- Accepted decisions: `docs/DECISIONS.md`
- Active scope: `docs/TASKS.md`
- Recent handoff: `docs/HANDOFF.md`
- Operating workflow: `docs/WORKFLOW.md`
+99 -100
View File
@@ -11,16 +11,31 @@
**Primary devices:** Debian laptop/desktop browser; responsive mobile browser
**Maintainer workflow:** Codex CLI + `roborto-project-context`, Git, isolated per-task branches/worktrees
## TASK-015 planning overlay — 2026-11-04
TASK-015 is scoped in `docs/TASKS.md`; implementation awaits Captain approval. The current app and the earlier sections below describe the timer-free, aggregate-EMOM baseline. This overlay records the latest requested changes without claiming they are implemented.
- Exercise definitions describe supported equipment and applicable measurements, independent of prescription targets and performed values. Use the complete assignment matrix in `WORKOUT_ROUTINE.md` section 8. No fixed vest weight belongs in definitions. Dumbbells used as push-up handles do not contribute lifted resistance.
- Reusable UI derives controls from repetitions, repetitions per side, duration, duration per side, distance when applicable, EMOM reps per minute and equipment-specific loads. Bodyweight-only work has no external-weight fields; supported external resistance accepts explicit zero. Dumbbells are entered per dumbbell; bars include the bar's weight.
- Log each set/minute with independent load components, explicit completion and partial state. New EMOM records support per-minute reps/load and derived totals; old aggregate records must never be split into invented minutes. Keep previous-session suggestions distinct from actuals and preserve next-set weight defaults.
- Show compact name/target/equipment/rest information and applicable logging, with expandable available instructions, muscles, technique and local media/placeholders. Reduce repeated visible labels while retaining accessible names; stack at mobile width without horizontal scrolling. Preserve date navigation, Morning/Afternoon switching and the wall clock.
- Afternoon holds may record actual seconds (per side where applicable) without repetitions, weights or prescribed hold times. Daily hang is bodyweight-only with an editable initial two-minute **continuous** target, optional attempts and independent longest/cumulative totals. Do not treat cumulative duration as continuous success.
- Preserve historical records and local edits independently of metadata changes. Version new record schemas and JSON serialization; review IndexedDB v2 for an additive migration only where needed. Test old total-only/component records, existing goal overrides and old/new JSON round trips. TASK-009 still owns backup UI and import conflict policy; none exists in the current app.
- Dog-walk classification is bodyweight-only; restoring walks to the UI/seed/logs is outside this task. No straight-bar exercise is added merely to support the equipment vocabulary.
- Captain resolved the timer question on 2026-11-04: keep the app timer-free. Preserve the local wall clock and prescribed rest/EMOM guidance; no timers or audio are added (ADR-018).
Full acceptance tests, dependencies, ownership boundaries, likely files and implementation gates are recorded under TASK-015. Earlier 6/10 kg prescriptions remain distinguishable from definitions and actuals; their optional future display must never determine equipment controls or prefill performance.
## 1. Purpose and success criteria
Build a small, maintainable, private workout application that replaces the weekly schedule document. It should make it easy to see today's session, understand correct exercise technique, time sets, record performance and change the programme without editing React source.
Build a small, maintainable, private workout application that replaces the weekly schedule document. It should make it easy to see today's session, understand correct exercise technique, record performance and change the programme without editing React source.
A successful first version enables the user to:
1. See the complete seven-day plan and today's prescribed sessions using a weekday strip and exclusive Morning/Afternoon switch.
2. Open each exercise's instructions, muscles involved, equipment, and image(s), with offline availability.
3. Complete and log morning strength sessions, afternoon isometric holds, daily walks and Monday/Friday stretching.
4. Use rest/countdown and 10-minute EMOM timers during workouts.
5. Edit routine parameters through the UI; log actual per-set reps, loads and hold/hang times, with a durable dated performance history and progress views.
3. Complete and log morning strength sessions and afternoon isometric holds. Monday and Friday mornings are labeled Full body stretch routine; specific stretches will be provided later.
4. Record one total repetition count and actual exercise-specific load for each EMOM exercise, and reps and exercise-specific load for each regular set.
5. Edit routine parameters through the UI; retain dated performance history and progress views, including total external-load volume without a time-based rate.
6. Back up and restore their own data without cloud accounts, analytics or external services.
### Out of scope for v1
@@ -39,7 +54,7 @@ A successful first version enables the user to:
- **Editable routine:** Store prescribed programme separately from UI code. Changes made in-app must survive updates; historical sessions must retain what was actually performed even when the plan later changes.
- **No premature backend:** Keep storage behind an adapter to permit optional sync later without redoing the UI.
- **Transparent progress:** Track prescribed versus actual reps, load and duration; avoid made-up estimates.
- **Accessibility:** Keyboard navigation, clear focus states, readable text, screen-reader labels, reduced-motion respect, adequate touch targets and accessible timers.
- **Accessibility:** Keyboard navigation, clear focus states, readable text, screen-reader labels, reduced-motion respect and adequate touch targets.
- **Safety:** Show exercise descriptions as guidance rather than diagnosis. Allow pain/discomfort notes; do not force floor movements that hurt the user's prominent spine. Make vest load explicit per exercise.
- **Scope discipline:** Do not invent pages, new exercises or functionality beyond this spec without an approved decision/task.
@@ -49,11 +64,11 @@ Use **one responsive application** with these surfaces:
| Surface | Primary functions |
|---|---|
| **Today** | Current calendar day selected automatically; seven-day navigation strip; **Morning/Afternoon exclusive toggle**; show only selected period, not both stacked; timers and logging |
| **Today** | Current calendar day selected automatically; seven-day navigation strip; **Morning/Afternoon exclusive toggle**; show only selected period, not both stacked; strength recording |
| **Week** | Seven-day horizontal navigation strip and date navigation; changing weekday preserves selected Morning/Afternoon period |
| **Exercise detail** | Images, setup, step-by-step movement, technique cues, main/secondary muscles, equipment, common mistakes, variations, personal notes |
| **History & Progress** | Browse completed sessions by date; actual sets/reps/weights/times and notes; personal bests and basic trends, including longest continuous hang |
| **Plan editor** | Edit exercises, order, sets, rep ranges, hold durations, weight presets, rest and session assignment |
| **Plan editor** | Edit exercises, order, sets, rep ranges, the daily hang goal, weight presets, rest and session assignment |
| **Settings & data** | Export/import backup, unit preferences (kg), storage explanation, offline status |
Navigation should remain simple (top tabs or bottom navigation on mobile). Avoid creating an account or dashboard-heavy UI. **The day/period selector is the primary workout navigation**, not a page showing both periods. Weekday browsing alone must never create or complete a workout record.
@@ -62,32 +77,33 @@ Navigation should remain simple (top tabs or bottom navigation on mobile). Avoid
- Use a seven-day horizontal weekday strip, current calendar day selected initially; the user can navigate other actual dates for past/future weeks.
- Place a **Morning | Afternoon** segmented switch above the weekday strip. Only one period is displayed at a time; changing day preserves the period. Remember the last selected period locally.
- Morning contains the strength workout, or full-body stretching on Monday/Friday. Afternoon contains the five isometric holds and daily hanging practice, with day-specific targets.
- Dog walks are always accessible via a separate compact activity log/control rather than appearing as a third large workout section within either period.
- Morning contains the strength workout on five days and the Full body stretch routine heading, without exercise entries, on Monday/Friday. Afternoon contains the five isometric holds and daily hanging practice, with day-specific targets.
- Each exercise presents prescription and recorded progress, with access to an exercise detail panel (local images, form description).
- Viewing a day or changing the Morning/Afternoon toggle does **not** automatically start or mark a session complete.
## 4. Current programme — initial seed data
The following is **initial editable programme data**, not a permanent hardcoded schedule. Day order and exercise order are significant. Unless specified otherwise, exercises are performed in the **morning**, isometric holds in the **afternoon** and dog walks throughout the day.
The following is **initial editable programme data**, not a permanent hardcoded schedule. Day order and exercise order are significant. Unless specified otherwise, exercises are performed in the **morning** and isometric holds in the **afternoon**.
### 4.1 Weekly structure
| Day | Morning | Afternoon | Additional |
|---|---|---|---|
| Monday | Rest from resistance exercise | Moderate isometric holds (RPE 5–6) | Full-body stretch; three dog walks |
| Tuesday | Pull 1 — Back + Core | Easy isometric holds (RPE 3–4) | Three dog walks |
| Wednesday | Push 1 — Chest + Serratus | Easy isometric holds (RPE 3–4) | Three dog walks |
| Thursday | Legs + Posterior Chain + Core | Easy isometric holds (RPE 3–4) | Three dog walks |
| Friday | Rest from resistance exercise | Challenging isometric holds (RPE 6–7) | Full-body stretch; three dog walks |
| Saturday | Pull 2 — Biceps + Grip + Abs | Easy isometric holds (RPE 3–4) | Three dog walks |
| Sunday | Push 2 — Shoulders + Triceps + Core | Easy isometric holds (RPE 3–4) | Three dog walks |
| Day | Morning | Afternoon |
|---|---|---|
| Monday | Full body stretch routine | Moderate isometric holds (RPE 5–6) |
| Tuesday | Pull 1 — Back + Core | Easy isometric holds (RPE 3–4) |
| Wednesday | Push 1 — Chest + Serratus | Easy isometric holds (RPE 3–4) |
| Thursday | Legs + Posterior Chain + Core | Easy isometric holds (RPE 3–4) |
| Friday | Full body stretch routine | Challenging isometric holds (RPE 6–7) |
| Saturday | Pull 2 — Biceps + Grip + Abs | Easy isometric holds (RPE 3–4) |
| Sunday | Push 2 — Shoulders + Triceps + Core | Easy isometric holds (RPE 3–4) |
No individual stretches or durations are specified for the Monday/Friday routine until the owner provides them.
### 4.2 Tuesday — Pull 1
| Order | Exercise | Prescription | Rest | Notes |
|---|---|---|---|---|
| 1 | Pull-ups | 10-minute EMOM; aim 3–4 reps/min | Until next minute | **6 kg vest.** Start at 4/min and drop to 3 as needed; work toward 4 × 10 minutes. Occasionally switch to traditional sets. |
| 1 | Pull-ups | 10-minute EMOM; aim 3–4 reps/min | Until next minute | **6 kg vest.** Start at 4/min and drop to 3 as needed; work toward 4 reps each minute for 10 minutes. Occasionally switch to traditional sets. |
| 2 | EZ-bar bent-over rows | 4 × 8–12 | 2–3 min | Controlled torso position. |
| 3 | Single-arm dumbbell rows | 3–4 × 8–15 per side | 2 min | Alternative to previously easy shrugs. |
| 4 | Suitcase carries | 3 × 30–60 seconds per side | 1–2 min | Walk with weight on one side; avoid leaning. |
@@ -134,56 +150,31 @@ The following is **initial editable programme data**, not a permanent hardcoded
### 4.7 Daily isometric routine — afternoon
Each row is **one hold**, with per-side durations as shown. Start at one round; optionally progress to two rounds if recovery is good. Rest around 30–60 sec between holds.
Each row is **one hold**, without a prescribed time. Start at one round; optionally progress to two rounds if recovery is good. Do not show duration targets. The persistent local time clock remains visible.
| Exercise | Monday (moderate) | Tue–Thu (easy) | Friday (challenging) | Sat–Sun (easy) |
|---|---|---|---|---|
| Deep squat hold | 45 sec | 30 sec | 60 sec | 30 sec |
| 90/90 hip hold | 45 sec / side | 30 sec / side | 60 sec / side | 30 sec / side |
| Bird-dog hold | 20 sec / side | 15 sec / side | 30 sec / side | 15 sec / side |
| Single-leg balance | 45 sec / leg | 30 sec / leg | 60 sec / leg | 30 sec / leg |
| Prone swimmer isometric | 20 sec | 15 sec | 30 sec | 15 sec |
| Target intensity (RPE) | 5–6 | 3–4 | 6–7 | 3–4 |
| Exercise | Side guidance |
|---|---|
| Deep squat hold | — |
| 90/90 hip hold | Per side |
| Bird-dog hold | Per side |
| Single-leg balance | Per leg |
| Prone swimmer isometric | — |
Bird-dog repetitions were removed from Tuesday because these holds occur daily. Longer holds should not become maximal effort or undermine morning training.
Target intensity (RPE): Monday **5–6**; Tuesday–Thursday **3–4**; Friday **6–7**; Saturday–Sunday **3–4**. Bird-dog repetitions were removed from Tuesday because these holds occur daily.
### 4.8 Daily hanging practice — afternoon
- Hang from the pull-up bar **every day**, during the afternoon isometric session.
- Goal is **120 seconds**, but this is a **target**, not an assumed current ability or default completed duration.
- Current successful continuous duration, number of attempts, whether hangs are weighted, and whether the two-minute goal is presently cumulative **are not specified**; do not invent these.
- Goal starts at **120 seconds** and can be changed in the app; it is a target, not an assumed current ability or default completed duration.
- Current successful continuous duration, number of attempts, and whether the initial two-minute goal is presently cumulative **are not specified**; do not invent these. Vest use may be added later but is not shown in the current daily-hang UI.
- Allow logging multiple attempts separately, in seconds, with **longest continuous hang** and **total cumulative hang time** computed independently. A 120-second cumulative total is not equivalent to one continuous 120-second hang.
- Keep Saturday finger hangs as distinct morning exercises, independent of the daily afternoon hang.
- Watch for accumulated grip, finger, elbow and shoulder fatigue; exercise logging must not force completion.
### 4.9 Full-body stretching — Monday and Friday
| Exercise | Prescription |
|---|---|
| Standing calf stretch | 30 sec / leg |
| Standing quadriceps stretch | 30 sec / leg |
| Kneeling hip-flexor stretch | 30 sec / side |
| Seated hamstring stretch | 30 sec / leg |
| Figure-four glute stretch | 30 sec / side |
| Doorway chest stretch | 30 sec |
| Cross-body shoulder stretch | 30 sec / arm |
| Child's pose with side reach | 30 sec / side |
| Cat-cow | 8–10 slow repetitions |
Target 15–20 min, gentle stretching, one or two rounds as appropriate. Modify movements causing pain or uncomfortable spinal pressure.
### 4.10 Daily dog walks
- Three walks **every day**, each typically **30–60 min**.
- **6 kg weighted vest** currently used during walks.
- Record *actual minutes* and optional vest load per walk rather than assuming every walk lasts the same time.
- Permit a walk to be logged without a vest, particularly when fatigued after Thursday legs or when joints/back need reduced loading.
- No automatic calorie-burn calculations in v1.
### 4.11 Global strength-training rules
### 4.9 Global strength-training rules
- Usually **2 min** rest between sets, **2–3 min** for demanding compounds, **~3 min** between different exercises.
- EMOM is time-based: each new set starts on a 60-second boundary, for 10 rounds. Count performed reps by round.
- EMOM remains a prescribed ten-minute protocol with a new start each minute. Record total performed reps and actual external weight for the exercise.
- Increase load or exercise difficulty after consistently reaching the top of a rep range with clean technique.
- Allow recording actual load, reps and time even when they differ from the plan.
- Morning resistance training takes priority over optional higher-effort afternoon sessions.
@@ -202,23 +193,28 @@ Each exercise has a stable `exerciseId` and human-readable name, category, equip
## 6. Interaction and session flow
1. Default to **Today**, selecting its actual date and the last-used Morning/Afternoon period; show only that period. Walk tracking stays accessible separately.
1. Default to **Today**, selecting its actual date and the last-used Morning/Afternoon period; show only that period.
2. Allow navigating to any date/day, not just a repeating abstract weekday; records are tied to actual local dates.
3. Tap an exercise to open details. Start a set, log **actual** reps, load and/or duration and mark it completed; log individual sets independently and prefill only suggested values from the previous matching session (never mark them completed automatically).
4. Timer presets based on the exercise; audible alert **optional/muted by default**, with visible completion feedback.
5. End the session with a compact summary (completed sets, deviations and free-text notes).
6. Partial workouts remain saved, and future plan edits do not rewrite previously logged performance.
7. Log three independent walks (actual duration, optional vest load, completion); support more/fewer walks in future via editor.
8. Check off isometric and stretch exercises and capture actual duration; log daily hang attempts in seconds and surface personal best and 120-second continuous-hang progress.
9. Show previous performance and basic progress views without confusing prescribed and achieved values; retain previous records after routine edits.
3. Tap an exercise to open details. For EMOM exercises, enter the **total** actual reps and relevant load. For regular strength exercises, enter actual reps and relevant load separately for each set. Show vest, dumbbell, and EZ-bar fields only where the exercise calls for them; mixed vest/dumbbell work needs both. Adding a set copies the previous set's entered weights but not its reps. Never mark prescribed values as performed automatically.
4. End the session with a compact summary (recorded sets, deviations and free-text notes) when session summaries are implemented.
5. Partial records remain saved, and future plan edits do not rewrite previously logged performance.
6. Check off isometric exercises without requiring times; log daily hang attempts in seconds and surface personal best and progress toward the current editable hang goal when extended recording is implemented.
7. Show previous performance and basic progress views without confusing prescribed and achieved values; retain previous records after routine edits.
### Timer behavior
### Suitcase-carry load recording — TASK-014 correction
- **Rest countdown:** pause/resume/reset, selectable presets including 60, 90, 120 and 180 seconds; custom duration later if useful.
- **EMOM:** ten one-minute rounds, clear round number, visible countdown to next boundary, and per-round rep entry. Work/rest timing must use elapsed timestamps rather than incrementing an interval counter (avoid browser-tab drift).
- **Hold timer:** countdown from prescribed hold length; optional per-side steps for bilateral holds.
- Timers should remain accurate after tab/background throttling on return, although browser restrictions may limit background notification/audio. Never promise guaranteed background alarms.
- One active timer at a time in v1; changing timers requires explicit cancel/replace.
Suitcase carries retain their prescribed duration per side and accept actual dumbbell kilograms per set, without requiring repetitions or inventing performed duration. Record one dumbbell's weight, with independent set values and next-set load copying. Save dated weight-only rows as `kind: load-sets`; no repetitions or rep-load volume are implied. Broader duration/per-side performance remains TASK-015.
### Plank vest recording — TASK-014 correction
Front planks and side-plank hip raises accept vest kilograms per set with no dumbbell/bar inputs or assumed vest weight. Front planks use the existing weight-only set shape without repetition entry; side-plank hip raises retain reps-per-side guidance and reps/load set recording. Different sets may use different loads or zero. Existing bodyweight-only records stay readable as prior totals; changing them to component weights requires an explicit action. Broader actual-duration logging remains separate work.
### Clock and recording behavior
- Show the current local time in the persistent app header across all views. It is a time-of-day display and does not record workout duration.
- Do not show workout, exercise, rest, or EMOM timers or audio cues.
- Keep EMOM duration and rest guidance as prescriptions only. One saved EMOM entry has total actual reps and the applicable load components; regular strength work has one saved rep/load row per performed set. A paired-dumbbell field means kilograms per dumbbell. Preserve older single-total entries without interpreting them as components.
- Browsing dates does not create workout records. Saving a strength entry writes the selected date and exercise only.
## 7. Local data architecture
@@ -235,27 +231,28 @@ IndexedDB is **per browser profile and origin**, not a server database; a laptop
| `ExerciseDefinition` | `id`, `name`, `category`, `equipment`, `muscles`, `instructions`, `cues`, `warnings`, `imageAssets`, `version` |
| `Routine` | `id`, `name`, `version`, `effectiveDate`, `weeklySchedule` |
| `RoutineExercise` | `exerciseId`, `day`, `sessionType`, `order`, `sets`, `repMin`, `repMax`, `targetDurationSec`, `perSide`, `restSec`, `loadKg`, `optional`, `notes` |
| `WorkoutSession` | `id`, `date`, `sessionType`, `routineVersion`, `startedAt`, `endedAt`, `status`, `notes`, `sets` |
| `CompletedSet` | `sessionId`, `exerciseId`, `sequence`, `reps`, `durationSec`, `side`, `completedAt`, `notes`, **load components** (`vestKg`, `dumbbellKgEach` / `dumbbellKg`, `ezBarTotalKg`, `bodyweightOnly` when relevant) |
| `RoutineOverride` | `dailyHangGoalSec` stored separately from the bundled seed |
| `StrengthEntry` | `date`, `exerciseId`, `kind` (`emom` or `sets`), EMOM `totalReps` and applicable `load` or regular `sets` with each set's `reps` and `load`; new records also retain derived `externalKg`, while older records may have only `externalKg` |
| `CompletedSet` | `exerciseId`, `sequence`, `reps`, `side`, `notes`, and load components (`vestKg`, `dumbbellKgEach` / `dumbbellKg`, `ezBarTotalKg`, `bodyweightOnly` when relevant); later work may support variable dumbbell counts |
| `HangAttempt` | `date`, `sessionId`, `exerciseId`, `attemptNumber`, `durationSec`, `completedAt`, `notes` (daily hangs distinct from Saturday finger hangs) |
| `WalkLog` | `date`, `walkNumber`, `durationMin`, `vestKg`, `completed`, `notes` |
| `BodyWeightLog` | `date`, `weightKg`, `notes` (optional entry) |
| `Settings` | `preferredUnit`, `soundsEnabled`, `timerPresets`, `dataSchemaVersion` |
| `Settings` | `preferredUnit`, `dataSchemaVersion` |
The implementation may normalize or refine this model. **Do not treat the suggested shape as frozen API contracts.** Store actual loads, not just vest presets; the 6 kg and 10 kg loads are initial values. For dumbbells distinguish **per-dumbbell mass** from total load; for the EZ bar record **bar plus plates** as total load. Where a prescribed exercise involves vest plus dumbbells, store both rather than merging them into an ambiguous number.
The implementation may normalize or refine this model. **Do not treat the suggested shape as frozen API contracts.** TASK-014 now stores actual load components for the seeded strength exercises and derives total external kilograms; existing entries with only a total remain valid and unclassified. `dumbbellKgEach` represents each of two dumbbells; `dumbbellKg` represents one. TASK-005 may later support variable counts and additional recording. The 6 kg and 10 kg programme values are prescriptions, not assumed actuals.
### 7.1 Tracking requirements (v1, agreed)
1. Save sets independently: achieved reps, any supported time/duration, actual resistance, side and optional notes. Preserve incomplete/partial sessions.
2. For EMOM pull-ups and chin-ups, log **ten distinct minutes**, each with actual repetitions and vest load (initial 6 kg); permit zero/missed rounds. Support conventional-set sessions when the user switches training format.
3. For weighted push-ups, track vest load (initial 10 kg); for applicable leg exercises record 10 kg vest plus any dumbbell load separately. No made-up dumbbell weights.
4. For daily hangs, track each timed attempt, longest single attempt, accumulated time across attempts, and progression toward a **continuous** two-minute goal. Record Saturday finger-hang work separately.
5. For other timed activities (isometrics, planks, carries, walks, stretches), log **actual** duration rather than treating the prescribed value as achieved. Per-side timing should remain distinguishable where relevant.
6. Prefill suggested starting weights/reps/durations from the previous matching exercise/session, but require user action before recording completion.
1. Save regular strength sets independently with actual reps and external weight, including 0 kg for bodyweight-only work. Preserve partial records and separate them from prescription values.
2. For EMOM pull-ups and chin-ups, save **total actual repetitions and vest weight** for the exercise. Keep the ten-minute, one-minute-round prescription visible without timing or per-round logging. Support conventional-set sessions when the user switches training format.
3. For weighted push-ups, track vest load (initial prescription 10 kg); for applicable leg exercises record actual vest and dumbbell load separately. Dumbbell flys record kilograms per dumbbell, without a vest field. No made-up actual weights.
4. For daily hangs, track each timed attempt, longest single attempt, accumulated time across attempts, and progression toward the current editable goal (initially two minutes). Record Saturday finger-hang work separately.
5. For other timed workout activities (planks and carries), log **actual** duration rather than treating the prescribed value as achieved. Isometric holds do not require times. Per-side timing should remain distinguishable where relevant.
6. Later, suggest starting weights/reps from the previous matching exercise/session, but require user action before recording completion.
7. Show dated exercise history, previous vs current performance and straightforward progress charts/personal bests (particularly vest load, reps, hang duration, optional body weight). Do not fabricate missing data or equate different loading modes in comparisons.
8. Never rewrite completed history following routine edits, reseeding, changes to exercise definitions or app upgrades. Future routine edits only change future prescriptions.
9. Export all workouts, hang attempts, plan edits, walks, and optional body-weight records to a **versioned JSON backup**; validate on import and ask before overwriting/merging existing records.
9. Export all workouts, hang attempts, plan edits, and optional body-weight records to a **versioned JSON backup**; validate on import and ask before overwriting/merging existing records.
10. Avoid external analytics and automatic calorie estimates; training data remains local and private.
11. For a workout's **total external-load volume** (kg·reps), sum `actual reps × actual external kilograms moved` across recorded regular sets and EMOM totals. External load includes recorded vest mass, actual dumbbell mass times count, and EZ-bar total as applicable; it excludes body weight. Do not invent missing load components. Show the formula and raw total, and mark partial or incomplete data. Timed holds and hangs do not contribute rep-load volume. Do not calculate volume per minute.
### Data integrity and update rules
@@ -269,9 +266,9 @@ The implementation may normalize or refine this model. **Do not treat the sugges
## 8. Visual and UX direction
- Calm, minimal, readable, keyboard-usable layout; neutral/dark styling with clear completion emphasis. Respect light/dark preference if feasible without a large theme system.
- The weekday strip and **Morning/Afternoon toggle** should be immediately visible. Display **only one selected session period** on screen, never both together. Walk controls are a separate compact accessible element.
- Exercise cards show: name, prescription, prescribed rest, load/vest preset, completed/remaining sets and an expandable description/image view.
- Timers must be highly legible and operate with large touch targets.
- The weekday strip and **Morning/Afternoon toggle** should be immediately visible. Display **only one selected session period** on screen, never both together.
- Exercise cards show: name, prescription, prescribed rest, load/vest preset, rep/weight entry for applicable strength work, and an expandable description/image view when details are implemented.
- The persistent local time clock remains legible at phone and desktop widths.
- Avoid busy gamification, badges/streaks and unnecessary dashboards.
- Responsive at mobile widths; no horizontal scrolling for primary interaction.
- Keep the content editable and data-centric, rather than a static copy of this document.
@@ -284,12 +281,13 @@ Use separate Codex tasks and isolated branches/worktrees in the repository conte
|---|---|---|
| T001 | Repo/bootstrap: Vite + React + React-Bootstrap; project context docs; lint/test scripts; basic responsive shell | None |
| T002 | Exercise definitions and accurate **seed** routine for all seven days; validation tests | T001 |
| T003 | Day navigation and exclusive Morning/Afternoon views; walk controls accessible separately; selected period persists | T002 |
| T003 | Day navigation and exclusive Morning/Afternoon views; selected period persists | T002 |
| T004 | Exercise-detail screen and local media placeholders; accessibility | T002–T003 |
| T005 | IndexedDB repository, per-set and per-minute EMOM logging, weight components, hangs, walks/holds, history-safe migrations, JSON backup round-trip | T002–T003 |
| T006 | Rest, hold and EMOM timers, elapsed-time correctness tests | T003 |
| T005 | Extend TASK-014 records with hangs, holds, other performance details and history-safe migrations | T014 |
| T006 | Superseded timer task; the local time clock and hang-goal editor remain | T003 |
| T014 | Remove timers; save EMOM total reps/weight and regular per-set reps/weight by date | T002–T003 |
| T007 | Routine editor: reorder, adjust prescription, optional exercises, persistence | T005 |
| T008 | History and progress views (hang PB, loads, reps), responsive/accessibility polish, offline/PWA build, test pass and documentation | T004–T007 |
| T008 | History and progress views (hang PB, loads, reps, total external-load volume), responsive/accessibility polish, offline/PWA build, test pass and documentation | T004–T007, T014 |
| T009 (content) | Produce and review licensed/local exercise illustrations for the actual variants | T004; may run separately |
Do not implement all tasks as a single unreviewed change. Define task boundaries, run unit/integration tests and manually review the UI before merge.
@@ -297,25 +295,26 @@ Do not implement all tasks as a single unreviewed change. Define task boundaries
## 10. Acceptance tests
- [ ] Today defaults to current local calendar date; seven-day strip works across weeks; exclusive Morning/Afternoon toggle remembers its state and does not show both periods at once.
- [ ] Monday and Friday show full-body stretching in the morning, and holds plus hangs in the afternoon; walks remain accessible independently.
- [ ] Tuesday pull-ups and Saturday chin-ups are **10 × 60-second EMOMs** with 6 kg vest presets and reps logged per round.
- [ ] Monday and Friday mornings show “Full body stretch routine” with no invented exercise entries; afternoon holds and hangs remain.
- [ ] The local time clock remains prominent and readable at phone and desktop widths while navigating the app.
- [ ] Tuesday pull-ups and Saturday chin-ups retain the **10 × 60-second EMOM** prescription and 6 kg vest presets, while actual total reps and external weight are recorded once for each exercise.
- [ ] Wednesday flys have **no floor-press drop set**; push-up plus precedes feet-elevated push-ups.
- [ ] Thursday includes single-leg RDLs and front planks, **not weighted floor crunches**.
- [ ] Saturday includes hanging knee raises, 2–3 finger-hang sets, preacher curls and hammer curls; **no EZ curls or wrist curls**.
- [ ] Sunday includes optional single-arm triceps extensions and side-plank hip raises.
- [ ] Holds correctly change between Monday, Tue–Thu, Friday and Sat–Sun targets.
- [ ] Daily afternoon hangs appear all seven days with **2:00 goal**, but no invented achieved value; multiple attempts produce longest-continuous and cumulative totals independently. Saturday finger hangs remain separate.
- [ ] Monday/Friday full-body stretching lists all nine agreed movements.
- [ ] Three daily walk slots initially show 30–60 min and 6 kg vest, but actual duration/load can be changed.
- [ ] Afternoon isometric holds show no time targets; day-specific effort guidance remains.
- [ ] Daily afternoon hangs appear all seven days with an initially **2:00 goal** that can be changed and survives reload, but no invented achieved value or vest detail; multiple attempts produce longest-continuous and cumulative totals independently. Saturday finger hangs remain separate.
- [ ] Weight presets on pull-ups/chin-ups (6 kg) and weighted push-ups/vested leg work (10 kg) display correctly; dumbbell loads are **not invented**.
- [ ] Users can enter vest and dumbbell loads separately, total EZ-bar load, per-side values, recorded reps, hold/carry durations, and optional body-weight entries.
- [ ] Ten EMOM rounds accept different actual rep counts, including missed rounds; completed sets persist and previous recorded numbers can be offered as **suggestions**, not already-logged results.
- [ ] EMOM total reps and actual external weight, plus separate regular-set reps and weights, survive reload by date and exercise; prescribed values are never saved as performed automatically.
- [ ] Exercise-specific load components, hang attempts and untimed hold checkoffs can be extended without replacing existing strength records; old total-only entries remain available.
- [ ] Exercise history and simple progress charts display actual saved values; editing a future prescription leaves existing entries unchanged.
- [ ] Timers pause/resume/reset correctly and EMOM remains accurate after background tab throttling.
- [ ] Total external-load volume uses recorded reps and actual external weight without a time denominator; the display shows raw totals and flags partial or missing data.
- [ ] No workout, exercise, rest, or EMOM timer or audio control is present; the local time-of-day clock remains visible and updates across views.
- [ ] All exercise details work offline with useful text even if an image is absent.
- [ ] Routine edits persist after refresh/build updates and do not rewrite previous session logs.
- [ ] IndexedDB survives refresh/browser restart, saves partial sessions, and handles blocked/unavailable storage or upgrade errors clearly.
- [ ] Export → clear/test profile → import round-trip restores all records, including independent hang attempts, historical loads, walk entries and plan edits.
- [ ] Export → clear/test profile → import round-trip restores all records, including independent hang attempts, historical loads and plan edits.
- [ ] All major controls work with keyboard and on phone viewport.
- [ ] No login, API calls, analytics, third-party remote imagery or browser storage sync is required.
+150 -33
View File
@@ -4,40 +4,40 @@ This file holds accepted, scoped implementation work. It is not a speculative ba
## Proposed implementation sequence
Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 is accepted and in progress; TASK-002 through TASK-011 remain proposed. Implement one task per isolated branch/worktree. Preserve the documented initial programme, including optional/ranged prescriptions and distinct session types.
Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 through TASK-003 and TASK-012–TASK-013 are complete; TASK-014 is complete following Captain acceptance on 2026-11-04; TASK-006 is superseded; TASK-005 and TASK-008 are accepted; TASK-015 is scoped and awaiting implementation approval; TASK-016 is accepted for planning only; the remaining tasks are proposed. Implement one task per isolated branch/worktree under `docs/WORKFLOW.md`. Preserve the documented initial programme, including optional/ranged prescriptions and distinct session types. TASK-013 supersedes the dog-walk reference added by TASK-012; TASK-014 supersedes timer work.
### TASK-001: Application foundation and responsive shell
- Status: In progress
- Status: Complete
- Objective: Establish the React/Vite, React-Bootstrap, and test foundation with a responsive application shell.
- Scope: App entry, local styling, navigation frame, lint/build/test scripts, and boundaries for routine data, storage, timers, and views.
- Acceptance criteria: The shell builds and renders at phone and desktop widths with keyboard-usable navigation; no backend, authentication, remote assets, or tracking SDKs are introduced.
- Relevant areas: Package configuration, app source, tests.
- Required validation: Lint, build, shell test, and mobile/desktop visual check.
- Non-goals: Workout data, date navigation, logging, persistence, and timers.
- Dependencies or blockers: None; owner selected TASK-001 and branch `task/001-foundation` is active.
- Dependencies or blockers: None. The owner confirmed the phone and desktop visual check on 2026-10-25. Automated checks passed in the earlier validation record and again with Node 24.21.0 on 2026-10-26.
### TASK-002: Exercise definitions and authoritative routine seed
- Status: Proposed
- Status: Complete
- Objective: Encode the full seven-day baseline as structured, versioned data.
- Scope: Stable exercise IDs, prescriptions, order, session types, rest/load components, optional flags, daily hangs, Monday/Friday stretches, and three initial daily walk slots. Keep the exercise library separate from routine prescriptions.
- Acceptance criteria: Data matches `docs/WORKOUT_ROUTINE.md`, including ranges and unspecified values; no removed or invented exercises; Saturday finger hangs and daily hangs are distinct.
- Scope: Stable exercise IDs, prescriptions, order, session types, rest/load components, optional flags, untimed afternoon holds, daily hangs with an initial two-minute goal, and Monday/Friday “Full body stretch routine” headings with no exercise entries until supplied. Keep the exercise library separate from routine prescriptions. Earlier dog-walk data was removed under TASK-013.
- Acceptance criteria: Data matches the owner-revised `docs/WORKOUT_ROUTINE.md`, including ranges and unspecified values; no invented stretch exercises or replacements; Saturday finger hangs and daily hangs are distinct.
- Relevant areas: Bundled data, domain model, validation tests.
- Required validation: Automated data invariants and manual source-to-data audit of every day and exercise.
- Non-goals: Exercise imagery, logging, user edits.
- Dependencies or blockers: TASK-001; resolve the noted spec/routine wording differences by source-of-truth rule.
- Dependencies or blockers: TASK-001 is complete. The owner selected this task on 2026-10-25 and removed the previously listed stretch exercises on 2026-10-26. The seed follows `docs/WORKOUT_ROUTINE.md` for the pull-up EMOM discrepancy. Data invariants and the seven-day source audit passed; the repository's npm tests passed with Node 24.21.0 on 2026-10-26.
### TASK-003: Date and period navigation with routine views
- Status: Proposed
- Status: Complete
- Objective: Show the correct routine for an actual local date and one selected period.
- Scope: Today default, navigation across weeks, seven-day strip, exclusive Morning/Afternoon switch above it, locally remembered period, morning stretching on rest days, and separately accessible compact walk controls.
- Scope: Today default, navigation across weeks, seven-day strip, exclusive Morning/Afternoon switch above it, locally remembered period, and Monday/Friday morning “Full body stretch routine” headings with no exercise rows yet. Earlier dog-walk UI was removed under TASK-013.
- Acceptance criteria: Day changes preserve period; only one period is shown; browsing never creates a record; targets and exercise order match the seed.
- Relevant areas: Navigation and session UI, preference state, tests.
- Required validation: Interaction and keyboard tests, mobile/desktop visual check, build.
- Non-goals: Saving performed work or timers.
- Dependencies or blockers: TASK-002.
- Dependencies or blockers: TASK-002 is complete. The owner confirmed TASK-003 complete on 2026-10-26. Interaction tests, lint, and build passed with Node 24.21.0.
### TASK-004: Exercise detail and local media placeholders
@@ -50,33 +50,33 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 is accept
- Non-goals: Producing final illustrations or logging notes.
- Dependencies or blockers: TASK-002 and TASK-003; detailed technique text requires reviewed source/content.
### TASK-005: IndexedDB repository and workout recording
### TASK-005: Extended workout recording
- Status: Proposed
- Objective: Persist local plans and dated performance while preserving partial and historical records.
- Scope: Storage adapter/migrations; first-run seed; per-set strength and per-minute EMOM logs; separate weight components; hangs, holds, stretching, walks, notes, optional body weight; previous-session suggestions; error states.
- Acceptance criteria: Actual values survive reload; zero/missed EMOM rounds and multiple hang attempts are distinct; edits/reseeding do not rewrite history; browsing alone writes no workout; storage failures are surfaced.
- Status: Accepted
- Objective: Extend the initial dated rep/weight records from TASK-014 with other requested performance details while preserving partial and historical records.
- Scope: Storage migrations building on the existing hang-goal override and TASK-014 strength entries; additional load variants or counts when needed beyond TASK-014's exercise-specific strength fields; hangs, untimed hold checkoffs, notes, optional body weight, previous-session suggestions, and error states. No timer-derived workout or break duration, per-round EMOM logging, or volume-per-minute rate.
- Acceptance criteria: Additional performance details and hang attempts survive reload and remain distinguishable from prescribed targets; multiple hang attempts are distinct; edits/reseeding do not rewrite history; browsing alone writes no workout; storage failures are surfaced. TASK-014's EMOM total, regular per-set reps/weight, and legacy total-weight records remain available.
- Relevant areas: IndexedDB adapter, domain model, recording UI, tests.
- Required validation: IndexedDB integration tests, migration/error cases, reload and partial-session checks, build.
- Required validation: IndexedDB integration tests, migration/error cases, load-component and hang reload checks, partial-session checks, build.
- Non-goals: Progress charts, routine editor, backup UI.
- Dependencies or blockers: TASK-002 and TASK-003.
- Dependencies or blockers: TASK-002, TASK-003, and TASK-014. The owner narrowed logging to EMOM totals and per-set reps/weight on 2026-10-27; further load and hang details remain accepted from earlier requests.
### TASK-006: Rest, hold, and EMOM timers
### TASK-006: Timers during and between exercises
- Status: Proposed
- Objective: Provide one active, accessible timer with accurate elapsed-time behavior.
- Scope: Rest presets and pause/resume/reset, prescribed hold countdown with optional side steps, ten one-minute EMOM rounds, visible completion, muted-by-default optional sound.
- Acceptance criteria: EMOM timing uses timestamps; background-tab return shows correct state; replacing an active timer needs explicit action; per-round logging remains independent.
- Status: Superseded by TASK-014
- Objective: Show current local time, time the whole workout and relevant exercises/sets/rests, and let the owner change the daily hanging goal.
- Scope: A larger persistent local time clock in the header; a manually started whole-workout elapsed clock with pause/resume/stop/reset; count-up timing for open-ended morning work such as finger hangs; countdowns from prescribed morning hold/carry durations, with a user choice when the prescription is a range and optional side steps; no times or per-exercise timers for afternoon isometric holds; an editable daily hang goal saved through a narrow IndexedDB routine override with no vest display yet; rest presets of 60, 90, 120, and 180 seconds, including the documented between-exercise rest; ten one-minute EMOM rounds; visible completion and optional short bleeps for impending and actual timer transitions, muted by default.
- Acceptance criteria: Current local time is prominent, readable, and updates across views, including phone width; afternoon isometric holds show no time targets or timer controls, while the daily hang goal can be changed, survives reload, and shows no vest load; already-running timers remain accessible; the workout clock can run alongside one exercise, rest, or EMOM timer and both show correct elapsed time after background-tab return; only one exercise/rest/EMOM timer runs at once, and replacing it requires an explicit action; timers are available from the relevant morning exercise or rest context; prescribed targets and clock readings do not automatically create a completed workout record; EMOM uses timestamps and displays the correct round; when sound is enabled, distinguishable bleeps announce approaching and actual transitions without requiring sight of the screen, with equivalent visible feedback and no promise of background audio; per-round logging remains independent.
- Relevant areas: Timer logic and UI, tests.
- Required validation: Clock-controlled unit tests, interaction tests, background-throttling check, build.
- Non-goals: Guaranteed background alarms or custom rest presets.
- Dependencies or blockers: TASK-003; integrate with TASK-005 logging when both exist.
- Required validation: Clock-controlled unit tests for concurrent workout/interval timing and pause/resume, wall-clock updates and afternoon timer absence, hang-goal IndexedDB read/write/error/reload checks, keyboard/interaction tests, sound-on/off and unavailable-audio checks, background-throttling check, build, and phone/desktop visual check.
- Non-goals: Guaranteed background alarms, custom rest presets, or automatic workout completion/logging.
- Dependencies or blockers: TASK-003 is complete. The owner removed timers on 2026-10-27. TASK-014 removes the timer implementation while retaining the time-of-day clock and editable hang goal.
### TASK-007: Routine editor
- Status: Proposed
- Objective: Edit future prescriptions through the UI without changing past records.
- Scope: Exercise order, day/period assignment, sets/ranges, durations, load presets, rest and optional state; validation and persistence.
- Scope: Exercise order, day/period assignment, sets/ranges, durations, load presets, rest and optional state beyond the already-editable daily hang goal; validation and persistence.
- Acceptance criteria: Valid edits survive reload and app updates; historical sessions retain their performed values and prior prescription context; invalid entries are rejected clearly.
- Relevant areas: Editor UI, routine versioning, storage, tests.
- Required validation: Edit/reload/migration/history-isolation tests and responsive check.
@@ -85,21 +85,21 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 is accept
### TASK-008: History and progress
- Status: Proposed
- Objective: Browse actual dated performance and transparent basic trends.
- Scope: Completed/partial session history, prior vs current performance, reps and load trends, longest continuous and cumulative hang separately, optional body-weight trend.
- Acceptance criteria: Charts and personal bests derive only from saved comparable values; no fabricated data; routine edits leave history intact.
- Status: Accepted
- Objective: Browse actual dated performance and transparent basic trends without a time-based rate.
- Scope: Completed/partial session history, prior vs current performance, reps and load trends, total external-load volume from recorded EMOM totals and regular sets, longest continuous and cumulative hang separately, optional body-weight trend.
- Acceptance criteria: External-load volume is the sum, across recorded regular sets and EMOM totals, of actual reps multiplied by recorded external kilograms moved (vest, dumbbell total based on count, and/or EZ-bar total; body weight excluded). Show the formula and raw totals; label partial workouts and incomplete load data. Timed-only work contributes no rep-load volume; routine edits leave history intact. Do not show volume per minute.
- Relevant areas: Queries/aggregations, history/progress UI, tests.
- Required validation: Calculation and view tests with mixed loading modes and missing values, responsive check.
- Required validation: Calculation and view tests with mixed loading modes, missing weights, partial workouts, and timed-only exercises; responsive check.
- Non-goals: Coaching, calorie estimates, streaks.
- Dependencies or blockers: TASK-005.
- Dependencies or blockers: TASK-014 and TASK-005. The owner removed volume per minute on 2026-10-27 while keeping rep and weight recording.
### TASK-009: JSON backup and restoration
- Status: Proposed
- Objective: Transfer all local data using a versioned JSON file.
- Scope: Export, schema validation, import preview/confirmation, replace/merge handling, and failure recovery.
- Acceptance criteria: Round trip restores plans, logs, hangs, walks, body weight, notes and settings; invalid files do not corrupt current records; replacement/merge requires explicit confirmation.
- Acceptance criteria: Round trip restores plans, logs, hangs, body weight, notes and settings; invalid files do not corrupt current records; replacement/merge requires explicit confirmation.
- Relevant areas: Backup format, storage transaction, settings UI, tests.
- Required validation: Full round trip in a fresh profile, invalid/old-version tests, transaction rollback test.
- Non-goals: Cloud synchronization or CSV export.
@@ -126,3 +126,120 @@ Reconciled with `docs/SPEC.md` and `docs/WORKOUT_ROUTINE.md`. TASK-001 is accept
- Required validation: Human technique/rights review and offline visual check.
- Non-goals: Unreviewed generated or hotlinked imagery.
- Dependencies or blockers: TASK-004; approved image source/review process. May proceed independently after that task.
### TASK-012: Dog walks as reference only
- Status: Complete
- Objective: Keep the owner's usual dog walks visible as context without asking for walk entries or timing them.
- Scope: Replace three daily walk slots and their timer controls with a compact reference to the documented typical frequency, duration, and current vest use; remove walk-recording requirements from future storage, history, and backup scope; preserve the routine facts for possible later calorie calculations without implementing estimates.
- Acceptance criteria: Today/Week shows the walk reference, no individual walk slots or timer controls; no walk logs are planned; the source routine and seed carry the same reference facts; calorie estimates remain out of scope.
- Relevant areas: Routine seed and tests, Today/Week UI, specification, task/context documents.
- Required validation: Routine data and UI tests, full test suite, lint, build, context validation, and `git diff --check`.
- Non-goals: Calorie calculations, walk completion, duration or vest entry, and logging.
- Dependencies or blockers: TASK-002 and TASK-003 are complete. The owner requested this change on 2026-10-26.
- Completion evidence: Version 5 seed and Today/Week UI use one walk reference with no walk slots or timer controls. The full suite passed (25 tests across 7 files), as did lint, build, context validation, and `git diff --check` on 2026-10-26. Browser visual checks were unavailable in this environment.
### TASK-013: Remove dog walks from the app
- Status: Complete
- Objective: Remove dog walks from the workout tracker and its current product scope.
- Scope: Remove the dog-walk reference from Today/Week, the routine seed, and current specification/source-routine requirements. Keep completed task and decision history as historical evidence.
- Acceptance criteria: No dog-walk UI or seed data remains; tests assert the absence; active specification and future task scope do not require walks or calorie calculations.
- Relevant areas: Routine view, seed, tests, specification and context documents.
- Required validation: Full test suite, lint, build, context validation, and `git diff --check`.
- Non-goals: Calorie calculation or changes to unrelated workout features.
- Dependencies or blockers: The owner explicitly requested removal on 2026-10-26. Supersedes TASK-012's reference behavior.
- Completion evidence: Version 6 seed, Today/Week UI, and current product documents omit dog walks. All 25 tests passed across 7 files, as did lint, build, context validation, and `git diff --check` on 2026-10-26. Browser visual checks were unavailable in this environment.
### TASK-014: Remove timers and record strength reps and weight
- Status: Complete
- Objective: Keep the local time-of-day clock but replace workout timers with dated strength recording.
- Scope: Remove workout, exercise, rest, and EMOM timers and sound controls; retain the large wall clock and editable hang goal; save one actual total-reps and exercise-specific load entry for each EMOM exercise, and actual reps plus exercise-specific load for each regular set, by date and exercise in local IndexedDB. Vest, dumbbell, and EZ-bar inputs follow the documented seed; mixed vest/dumbbell work has separate fields. Keep the prescribed EMOM protocol visible as reference without a timer.
- Acceptance criteria: No timer controls or audio remain; the wall clock still updates; EMOM totals and regular set rows can be edited and survive reload and date navigation; flys request dumbbell kilograms per dumbbell without a vest field; exercises with vest and dumbbells request both separately; a new set copies the previous set's weights and leaves reps blank; older single-total records remain available without reinterpretation; browsing without saving creates no workout record; invalid or unavailable storage is surfaced; no volume-per-minute display or requirement remains.
- Relevant areas: React routine cards and styling, IndexedDB adapter, tests, task/decision/spec context.
- Required validation: UI entry, load-component, next-set default, legacy-record, and reload tests; storage migration/error tests preserving the hang-goal override; full test suite, lint, build, context validation, and `git diff --check`.
- Non-goals: Per-round EMOM logs, timed workout/break records, volume per minute, and a full history view.
- Dependencies or blockers: TASK-002 and TASK-003 are complete. The owner requested this change on 2026-10-27.
- Agent-side evidence: On 2026-10-27, the original EMOM and regular-set entries persisted by date and exercise in the version 2 IndexedDB store while the prior hanging goal remained available. Timer UI/audio/engine files were removed; 23 tests across 7 files, lint, build, context validation, and `git diff --check` passed. The 2026-10-28 component and next-set correction passed its focused tests; full validation results are recorded in `CURRENT_STATE.md` and `HANDOFF.md`. Captain validation of the revised entry flow remains open.
- Engaged validation evidence (2026-11-04): Current-worktree tests (27 across 7 files), lint and build pass. Source/test review established no new defect; no app code changed. Browser inventory is empty and in-app browser unavailable, leaving visual/runtime QA unverified. Exact current worktree is served loopback-only at `http://127.0.0.1:5174/` for Captain acceptance; see HANDOFF. Status remains awaiting Captain validation.
- Accepted TASK-014 correction (2026-11-04): Add suitcase-carry dumbbell kilograms per set, accepting zero and different loads across sets, copying the prior set load, and preserving save/reload/date isolation. Keep the duration-per-side prescription visible without requiring repetition inputs or inventing performed duration. Extend storage additively without rewriting existing records. Validate UI and storage regression coverage plus full checks; Captain validation remains required.
- Correction evidence (2026-11-04): Suitcase-carry weight-only set inputs implemented with `load-sets` storage, explicit zero, independent loads, next-set copying, save/reload and date isolation. All 29 tests across 7 files, lint and build pass. No database version bump or historical rewrite; browser QA remains unavailable and Captain validation remains pending.
- Accepted TASK-014 correction (2026-11-04): Add vest-only load metadata and per-set inputs for front planks (weight only, no reps) and side-plank hip raises (reps and vest). Preserve existing records and targets; accept zero and different weights per set, next-set copying and reload. This explicitly implements only these two equipment assignments from TASK-015; the broader task remains pending.
- Plank correction evidence (2026-11-04): Seed v7 and shared editor show vest-only inputs for front planks and side-plank hip raises, without invented target loads. UI regressions verify per-set/zero loads, next-set copying, reload, absence of irrelevant fields/reps, and explicit conversion of historical bodyweight-only hip raises. All 32 tests across 7 files, lint and build pass. No database migration; awaiting Captain validation.
- Completion evidence (2026-11-04): Captain explicitly confirmed “task complete” after the suitcase-carry and plank vest corrections. Final agent checks passed all 32 tests across 7 files, lint, build, context validation and whitespace checks. Agent browser QA was unavailable; Captain acceptance is recorded without claiming a separate agent visual check. No commit, merge or deployment was authorized or performed.
### TASK-015: Exercise equipment specifications and context-aware UI
- Status: Accepted for scoping; awaiting Captain approval before implementation
- Lock-on: Captain selected TASK-015 for briefing on 2026-11-04 after accepting TASK-014. Implementation has not begun; timer scope and Git arrangement remain unresolved.
- Brief refreshed: 2026-11-04. This is the existing matching task, expanded rather than duplicated. No application implementation is authorized by this planning turn.
- Objective: Separate exercise capabilities, workout prescriptions, and actual performance, and use equipment/measurement metadata to drive a compact exercise interface.
#### Scope and boundaries
1. Add versioned equipment and measurement metadata to all 30 current exercise definitions, following the assignment matrix in `WORKOUT_ROUTINE.md`'s TASK-015 planning addendum. Supported equipment vocabulary: bodyweight, weighted vest, dumbbell(s), EZ curl bar, straight bar. No exercise is assigned a straight bar by this request; support the type without adding exercises. Multiple equipment types may be used simultaneously. Deep-push-up dumbbells are support handles, excluded from lifted load.
2. Remove fixed resistance from exercise capabilities. Retain prescription targets separately, and record actual equipment-specific resistance independently for each set/minute. Dumbbell entry is kilograms per dumbbell with count represented explicitly; EZ/straight-bar entry is total kilograms including the bar. Zero is valid where additional resistance is supported; blank is not an inferred zero.
3. Define repetitions, repetitions per side, duration, duration per side, distance where appropriate, and EMOM repetitions per minute. Preserve existing rep/set ranges, order, optional exercises, and unspecified targets. Carries currently prescribe duration per side; do not invent a distance target. Bird-dog and other unilateral holds allow actual seconds per side without inventing prescribed times.
4. Replace prescription-load-key-driven fields with reusable metadata-driven controls. Support independent set completion, partial drafts, per-set loads, EMOM minute rows, duration attempts, previous matching session suggestions, and existing next-set load defaults. Suggestions are editable drafts, never automatically performed/completed records. Match by exercise, period, format, measurement/side semantics, and compatible equipment; do not suggest future sessions, reinterpret legacy totals, or overwrite current-date work.
5. Compact cards show name, target sets/reps/duration, relevant equipment and rest guidance; actual entry is distinct. Use shared field headings on desktop with accessible row labels, stacked controls on mobile, and expandable details for available instructions, muscles, technique notes and local images/placeholders. Review this proposal through Frontend UI Design before code. Keep Today/Week navigation, exclusive Morning/Afternoon switching, local clock and editable hang goal. Timer behavior requires the decision below.
6. Daily hang is bodyweight-only with an initial editable 120-second continuous target, actual seconds per attempt, optional additional attempts, longest continuous and total duration separately. Never infer success from cumulative duration or prefill 120 as achieved. Keep Saturday weighted finger hangs distinct.
7. Preserve old records, load interpretation, hang-goal overrides and any local plan edits through versioned storage/record upgrades. Define and test versioned JSON serialization and legacy import compatibility at the adapter boundary; the Settings backup interface and merge policy remain TASK-009.
8. Update SPEC, WORKOUT_ROUTINE, relevant decisions, data README, tasks/current state and handoff with approved requirements, schema rules, validation and Captain acceptance evidence.
#### Acceptance criteria and required tests
- Audit all 30 exercise IDs against the authoritative equipment matrix; test each exercise's visible and absent controls, not just example cards. Validate schema vocabulary, measurement units, side semantics and equipment combinations.
- Bodyweight-only hanging knee raises, afternoon holds and daily hang show no external-load input. Vest-only exercises show no dumbbell or barbell inputs; handles never add resistance. Straight-bar support has a schema/control test without a seeded assignment.
- Bulgarian split squats and all four specified mixed leg exercises support separate vest and dumbbell values. Different sets and EMOM minutes retain different loads after save/reload/date navigation, including explicit zero. Dumbbell counts and bar-inclusive totals produce correct saved external load.
- Rep exercises show reps or reps per side as appropriate; timed exercises show seconds or seconds per side without requiring reps. Carry distance is supported only when relevant metadata selects it. Finger-hang duration remains unspecified as a target.
- EMOM supports ten minute-by-minute rep/load entries, partial rounds and derived totals. Legacy aggregate EMOM records remain aggregate, available without invented minute allocations. No default targets become actuals; mixed-load volume, if calculated, uses the sum of each minute's reps times its own load, never total reps times one assumed weight.
- Completion is an explicit action independent of entering/suggesting values. Partial records survive reload; previous-session prefills and next-set defaults do not mark work complete or write records on browsing.
- Daily hang attempts preserve actual seconds independently, compute longest and cumulative totals, and compare the continuous target to the longest attempt. Editable goal persists independently; unilateral isometric logging requires neither reps nor invented duration targets.
- Metadata/prescription changes, reseeding and upgrades leave existing actuals and historical load semantics unchanged. Test old total-only and component sets/EMOM, v1 hang-goal-only database and v2 database, unknown historical equipment, blocked/unavailable storage and failed transaction rollback. No legacy total is decomposed or per-minute load fabricated.
- Versioned JSON round trips restore both old and new records and relevant definition/prescription context; old versions are accepted through explicit adapters and invalid/unsupported input leaves data unchanged. No claim that old app binaries can read new records is required.
- Keyboard and screen-reader labels remain useful despite reduced repeated visible text. Verify mobile (including 320px) and desktop layouts without horizontal scrolling, expanded details, errors, mixed equipment, many sets and EMOM rows.
- Preserve exercise order/ranges/optional state, Monday/Friday empty stretch headings, date/period navigation, clock, storage errors and existing recording. Timer tests follow the approved timer decision. Run full `npm test`, lint, build, context validator and `git diff --check`; review diff against the confirmed base; perform mobile/desktop browser QA and obtain Captain validation before Complete.
#### Inspected implementation and likely affected files
- `src/data/exerciseDefinitions.json`: currently only IDs/names/categories; add equipment, measurement, support-role and version metadata.
- `src/data/initialRoutine.json`, `src/data/index.js`, `src/data/README.md`, `src/data/initialRoutine.test.js`: versioned prescription seed (currently v7), target/load separation and assignment invariants.
- `src/App.jsx`, `src/StrengthEntryEditor.jsx`, `src/HangGoalEditor.jsx`, `src/routineView.js`, `src/strengthLoad.js`, `src/styles.css`: exercise cards, metadata selectors, reusable set/minute/attempt fields, details and responsive layout; add focused domain/components as needed rather than hardcoding exercise IDs.
- `src/localDatabase.js`, `src/strengthStorage.js`, `src/hangGoalStorage.js` and their tests: versioned reads/writes, new performance shapes, compatible prior-session queries, historical context and overrides. Current strength validation accepts repetition sets, weight-only `load-sets`, and aggregate EMOM. The editor derives fields from prescription `load` keys; it cannot store actual duration/side/attempt/completion/minute data yet. TASK-014 already supplies suitcase-carry weight-only sets and vest inputs for front planks/side-plank hip raises; preserve those behaviors while replacing the exercise-ID exceptions with metadata.
- `src/App.test.jsx`, `src/StrengthEntryEditor.test.jsx`, `src/routineView.test.js` and new focused metadata/storage/serialization tests.
- Documentation listed above; future TASK-009 consumes the serialization contract. No export/import implementation exists today.
#### Migration implications and proposed implementation sequence
1. Approve unresolved timer/Git decisions and UI brief; reconcile task ownership below. Establish a safe dedicated task worktree from the agreed base without losing current uncommitted prerequisites.
2. Define separate versioned exercise capabilities, prescriptions and performance records. New records retain actual units, side, equipment/count and sufficient definition/prescription context for historical interpretation. Review whether old preset weights remain optional prescription information; never use them to generate actual loads or capabilities.
3. Add metadata and audited seed updates, then a versioned performance reader/writer with legacy adapters. IndexedDB is currently version 2 with `routineOverrides` and `strengthEntries`, keyed by date/exercise. Record schema versioning is needed; an IndexedDB version bump is required only if stores/indexes change. Prefer additive storage and preserving legacy records verbatim; decide exact stores/indexes after schema review. Test before integrating UI.
4. Build reusable card/measurement/load/row/detail components; add minute and duration flows plus compatible prior-session lookup. Apply the focused layout proposal, preserving the existing visual language.
5. Add JSON codec/version compatibility fixtures, regression tests and browser QA; update context and hand off an exact testable representation. No repository testtask adapter currently exists; recheck at handoff.
#### Dependencies, decisions and implementation gate
- TASK-014 is Complete following Captain acceptance on 2026-11-04; its uncommitted dated-load implementation is the technical baseline. No separate application work starts in this turn.
- TASK-015 owns metadata, applicable per-side/duration/hang logging, completion and previous-session suggestions requested here, replacing the overlapping portions of TASK-005 when engaged. TASK-005 retains notes, optional body weight and other unrelated extended recording. TASK-004 supplies reviewed detail content; TASK-015 can provide the expandable shell and honest missing-content placeholders without waiting for TASK-011's final illustrations. TASK-008 consumes the new performance shapes; TASK-009 owns backup UI/import policy. Do not duplicate those features.
- **Timer decision resolved (2026-11-04):** Captain selected timer-free behavior. Keep only the wall clock and prescribed rest/EMOM guidance; no timers/audio return (ADR-018).
- **Git decision resolved (2026-11-04):** Captain authorized committing existing work and merging it into local `codex` before implementation. Create TASK-015 branch from that clean integration baseline per ADR-018 and WORKFLOW. Do not merge TASK-015 without further authority.
- The current explicit request resolves earlier planning questions: minute-by-minute EMOM is required (derived totals supplement it; existing aggregate history stays aggregate); isometric duration means actual logging, not prescribed hold targets; daily hang goal means continuous; dog walks are bodyweight-only classification context without authorized restoration of removed app screens/records. No fixed vest values enter definitions. These do not require repeated approval.
- Non-goals: unrelated redesign, new exercises, fabricated technique content/assets, dog-walk UI/logging, calorie calculations, routine editor, full history/backup UI, volume per minute, merge or deployment.
- Recommended skills when approved: Frontend UI Design → Webapp Feature → Frontend Visual QA → Code Review. No implementation or visual QA has run for TASK-015.
### TASK-016: Apply a consistent dark theme
- Status: Accepted for planning; awaiting implementation instruction
- Requested: 2026-11-04
- Objective: Make the application consistently dark themed while preserving existing layout, navigation and workout behavior.
- Scope: Dark page backgrounds and layered card/panel surfaces; readable primary/secondary text; coordinated borders, green accents, buttons, links, badges, form inputs and native controls. Cover selected, hover, focus, disabled, loading, saved/success and error states. Use shared CSS color tokens and compatible React-Bootstrap theme settings rather than scattered overrides. Retain the existing typography, spacing and component hierarchy.
- Acceptance criteria: All existing Today, Week, History, Plan and Settings surfaces use the dark palette consistently, including exercise cards, strength-entry rows, hang-goal controls, header and clock. No unintended light panels or inputs remain. Text meets WCAG AA contrast (4.5:1 normal text, 3:1 large text); essential control boundaries and focus indicators meet 3:1 against adjacent colors. Selected/error/completion states are distinguishable without relying solely on color. Keyboard focus, touch targets and readability remain clear on mobile and desktop; no new horizontal overflow. Navigation, Morning/Afternoon switching, recording, date isolation and goal persistence remain operational. Dark theme applies consistently on initial load and reload, including when the OS uses a light theme.
- Relevant areas: `src/styles.css`, `src/main.jsx`, `src/App.jsx`, shared React-Bootstrap configuration, strength/hang editors where required, existing interaction tests and `docs/SPEC.md`. No workout data or IndexedDB migration is expected.
- Proposed approach: Inspect current UI and approve a restrained dark palette; centralize semantic colors for surfaces/text/borders/accent/status/focus; apply the supported Bootstrap dark theme plus local tokens; inspect all controls and states in the browser and correct contrast or native-control mismatches. Preserve existing green identity where contrast permits.
- Required validation: Mobile (including 320px) and desktop browser review across all sections and both workout periods; keyboard/focus and measured contrast checks; input, disabled, saved and error-state review; existing test suite, lint, build, context validation and `git diff --check`; Captain visual acceptance before Complete. Avoid tests that merely duplicate CSS declarations.
- Dependencies or blockers: Resolve the existing dirty-checkout/base/worktree arrangement under WORKFLOW before implementation. Coordinate styling with TASK-015 if it proceeds first; neither task requires implementing the other's behavior. No new app behavior is authorized here.
- Non-goals: New layouts, unrelated UX redesign, light-mode variants, a theme picker, OS-theme switching, new settings or persistent preferences, and changes to workout definitions/storage/timers.
- Decisions required before implementation: Review the exact palette through the UI brief; default scope is a single dark theme. A light/dark switch would require separately approved scope.
- Recommended skills when engaged: Frontend UI Design → Webapp Feature → Frontend Visual QA. This record does not authorize implementation.
+48
View File
@@ -0,0 +1,48 @@
# Exercise Tracker operating workflow
Roborto Context System: 1.0. Roborto Workflow: 2.0. The six maintained context files and their responsibilities remain unchanged. This document records operating rules; it does not change application scope or behavior.
The project owner is **Captain**. Reports may use a restrained Starfleet chief-engineer/bridge voice, with exact evidence, uncertainty, and risks stated plainly.
## Authority and scope
- Work only on the Captain's explicit request or an accepted, numbered task in `TASKS.md`. Do not create speculative implementation tasks or features.
- The Captain's current explicit request controls scope. Current code/configuration and Git state establish current-state facts; report conflicts with maintained docs.
- Do not commit, push, switch branches, merge, rebase, reset, deploy, or expose secrets without explicit Captain instruction. Branch/worktree preparation must also respect pre-existing work and the unresolved base convention below. Captain controls merge and release unless a later explicit repository rule delegates authority.
- Read-only diagnosis, review, planning, task briefing, and design do not require a task worktree. Context administration and workflow reconciliation are documentation-only by default; they do not trigger application changes or Git branch operations.
## Before implementation
1. Read `AGENTS.md`, the five maintained `docs/` context files, this workflow, and relevant application/specification, styling, testing, or operations guidance.
2. Verify and report the current worktree path, checked-out branch, all tracked modifications and untracked files, and other worktrees. Protect unrelated changes. Identify the active accepted numbered task, relevant decisions, dependencies, and unresolved choices.
3. For a substantial task, briefly state the objective, scope, non-goals, acceptance criteria, dependencies, risks, unresolved decisions, relevant surfaces, specialist skill sequence, and validation/manual-test plan. A “lock on” or “set course” request is a briefing unless the Captain also asks to implement.
4. Resolve only decisions needed for that task. Do not infer product, security, privacy, commercial, deployment, or branch policy from a task title.
## Branch and worktree policy
- Default target: one accepted numbered implementation task per dedicated task branch/worktree. Concurrent tasks use separate worktrees. Keep the code, tests, task-specific decisions, and context updates for a task together; never use another task's manual-test snapshot as an editing worktree.
- Captain authorized baseline reconciliation on 2026-11-04: commit reviewed pending work on `task/001-foundation`, create local `codex` from the original foundation commit, and merge that baseline into `codex` before TASK-015 implementation. No remote exists. See ADR-018.
- `codex` is the approved TASK-015 integration/base branch. Sequential task work may use the sole `/home/rob/projects/exercise-tracker` worktree after a clean switch to its dedicated numbered branch; TASK-015 uses `task/015-equipment-ui`. Concurrent tasks still require separate worktrees. Do not switch a dirty or separately occupied worktree.
- Worktree directory convention, general merge strategy and release/deployment convention remain unspecified. Future merges, commits/pushes and deployments require the applicable Captain authority; baseline reconciliation does not authorize merging TASK-015.
- Review each meaningful task diff against its confirmed integration base and acceptance criteria. Do not treat the current task branch as the base merely because it is checked out. Leave merge/release authority with Captain.
## Task status and handoff
| Status | Meaning |
|---|---|
| Proposed | Candidate scope; no implementation authorization. |
| Accepted | Captain-approved scope, not yet started. |
| In progress | Implementation is underway in its task worktree. |
| Implementation-ready / awaiting Captain validation | Implementation and required agent-side checks are complete; any required manual/Captain review is pending. |
| Complete | Acceptance criteria and all required validation, including Captain/manual acceptance when required, are satisfied and recorded. |
| Superseded | A later accepted task or decision replaced the scope; retain history. |
Record the status and evidence in `TASKS.md`; keep verified operational state in `CURRENT_STATE.md`; put durable decisions in `DECISIONS.md`; refresh `HANDOFF.md` with the testable state, exact validation, open risks, and next action. Tests passing alone do not promote a task past a required Captain review. Do not retroactively invent acceptance evidence.
Before asking Captain for manual testing, identify an exact testable representation of the task. No `.roborto/testtask.conf`, `scripts/testtask.sh`, or other repository testtask adapter currently exists. Recheck for one before future test handoffs and use it if introduced. Manual-test snapshots are evidence environments, not implementation worktrees; refresh them after further changes. Record any test snapshot and its source state in `HANDOFF.md`.
## Validation and design authority
- Use each task's `Required validation` and acceptance criteria. Repository commands are `npm test`, `npm run lint`, and `npm run build` from the root; `package.json` requires Node.js 20.19 or newer. Run context validation and `git diff --check` when context changes. State any test that could not run and do not claim an unperformed visual or manual check.
- For UI work, read `docs/SPEC.md`, relevant `docs/DECISIONS.md`, `src/styles.css`, and any later styling/design-system document or approved reference before designing or editing. Preserve the approved visual language unless the task changes it. No separate styling/design-system document is currently present.
- Recommend the smallest useful specialist-skill sequence: Roborto New Project for a new template-based app; Frontend UI Design for unsettled UI; Webapp Feature for accepted functionality; Webapp Debug for faults; Frontend Visual QA for visible UI; Safe Refactor for behavior-preserving structure changes; Code Review for task diff; Production Readiness Review before launch; Deployment Check for an authorized release; Project Commercial Management for commercial scope; Roborto Contributor for contributor guidance. Recommend only applicable skills and do not claim one ran when it was merely suggested.
+89 -63
View File
@@ -2,7 +2,7 @@
**Status:** Current agreed baseline
**Last consolidated:** 2026-10-18
**Last revised:** 2026-10-26
**Purpose:** Authoritative description of the user's present training programme for the workout application.
**Proposed repository location:** `docs/WORKOUT_ROUTINE.md`
@@ -12,27 +12,28 @@
## 1. Goals and constraints
- Primary goals: gradual muscle and body-weight gain; improved chest, back, core and spinal-support musculature; stronger grip; better mobility, balance and posture; a relatively stable waist.
- Training: five morning strength sessions weekly, two non-lifting days, daily afternoon isometric holds **plus a daily hanging practice (2-minute target)**, and full-body stretching at least Monday and Friday.
- Walks: walk the dog **three times every day**, generally **30–60 minutes per walk**, currently with a **6 kg weighted vest**.
- Training: five morning strength sessions weekly, Monday and Friday mornings reserved for a full body stretch routine, and daily afternoon isometric holds **plus a daily hanging practice (2-minute target)**. The owner will provide the specific stretches later; none are listed yet.
- Equipment: pull-up bar, dumbbells, EZ-curl bar, weighted vest, chair, bed and available floor space.
- Weighted vest: **6 kg** for pull-ups, chin-ups and walks; **10 kg** total for weighted push-ups and applicable leg exercises. Dumbbells may be added for leg movements as described.
- Weighted vest: **6 kg** for pull-ups and chin-ups; **10 kg** total for weighted push-ups and applicable leg exercises. Dumbbells may be added for leg movements as described.
- The user experiences discomfort when bony spinal structures press against the floor. Avoid prescribing direct pressure on the spine as a necessary part of a movement; floor flys should be performed only if comfortable, with appropriate cushioning if helpful. Some lying triceps extensions are done on a bed; replace or adapt if uncomfortable.
- Intermittent fasting has been **postponed** while prioritising muscle and weight gain.
## 2. Weekly overview
| Day | Morning strength | Afternoon isometric intensity | Other activity |
|---|---|---|---|
| Monday | Rest from strength training | Moderate (RPE 5–6) + daily hang | Full-body stretching; three dog walks |
| Tuesday | Pull 1 — Back + Core | Easy (RPE 3–4) + daily hang | Three dog walks |
| Wednesday | Push 1 — Chest + Serratus | Easy (RPE 3–4) + daily hang | Three dog walks |
| Thursday | Legs + Posterior Chain + Core | Easy (RPE 3–4) + daily hang | Three dog walks |
| Friday | Rest from strength training | Challenging (RPE 6–7) + daily hang | Full-body stretching; three dog walks |
| Saturday | Pull 2 — Biceps + Grip + Abs | Easy (RPE 3–4) + daily hang | Three dog walks |
| Sunday | Push 2 — Shoulders + Triceps + Core | Easy (RPE 3–4) + daily hang | Three dog walks |
| Day | Morning strength | Afternoon isometric intensity |
|---|---|---|
| Monday | Full body stretch routine | Moderate (RPE 5–6) + daily hang |
| Tuesday | Pull 1 — Back + Core | Easy (RPE 3–4) + daily hang |
| Wednesday | Push 1 — Chest + Serratus | Easy (RPE 3–4) + daily hang |
| Thursday | Legs + Posterior Chain + Core | Easy (RPE 3–4) + daily hang |
| Friday | Full body stretch routine | Challenging (RPE 6–7) + daily hang |
| Saturday | Pull 2 — Biceps + Grip + Abs | Easy (RPE 3–4) + daily hang |
| Sunday | Push 2 — Shoulders + Triceps + Core | Easy (RPE 3–4) + daily hang |
## 3. Morning strength sessions
Monday and Friday mornings are labeled **Full body stretch routine**. Specific movements and durations are not specified yet.
### Tuesday — Pull 1: Back + Core
| Order | Exercise | Prescription | Rest | Notes |
@@ -61,7 +62,7 @@
| 2 | Single-leg Romanian deadlifts | 3–4 × 8–12 per leg | 2–3 min | Hip hinge; use suitable dumbbell loading and controlled balance. |
| 3 | Squats | 4 × 8–12 | 2–3 min | **10 kg vest + dumbbells**. |
| 4 | Single-leg calf raises | 4 × 10–20 per leg | ~2 min | Weighted vest; dumbbell if appropriate. |
| 5 | Front plank | 3 × 30–60 sec | 1–2 min | Replaces weighted floor crunches to avoid spinal pressure. |
| 5 | Front plank | 3 × 30–60 sec | 1–2 min | Weighted vest; actual load per set, no fixed weight. Replaces weighted floor crunches to avoid spinal pressure. |
### Saturday — Pull 2: Biceps + Grip + Abs
@@ -82,22 +83,23 @@
| 3 | Bent-over rear-delt flys | 3 × 12–20 | ~2 min | Added for rear delts. |
| 4 | Lying dumbbell triceps extensions | 3–4 × 8–15 | ~2 min | Performed on bed with head over edge if comfortable; use safe, supported positioning. |
| 5 | Single-arm triceps extensions | **Optional** 2–3 × 10–15 | ~2 min | Additional work only if recovery and time allow. |
| 6 | Side-plank hip raises | 3 × 10–20 per side | 1–2 min | Lateral core/obliques. |
| 6 | Side-plank hip raises | 3 × 10–20 per side | 1–2 min | Weighted vest; actual load per set, no fixed weight. Lateral core/obliques. |
## 4. Daily afternoon isometric routine
Perform **separately in the afternoon**, after the morning workout on lifting days. Begin with **one round**; a second round is a progression only if recovery remains good. Approximate rest between holds: **30–60 seconds**, or longer if needed. Times below are targets, not mandatory minimums. Keep controlled positions and do not aim for failure.
Perform **separately in the afternoon**, after the morning workout on lifting days. Begin with **one round**; a second round is a progression only if recovery remains good. No hold durations or rest times are prescribed. Keep controlled positions and do not aim for failure.
| Exercise | Monday (moderate) | Tue–Thu (easy) | Friday (challenging) | Sat–Sun (easy) |
|---|---:|---:|---:|---:|
| Deep squat hold | 45 sec | 30 sec | 60 sec | 30 sec |
| 90/90 hip hold | 45 sec/side | 30 sec/side | 60 sec/side | 30 sec/side |
| Bird-dog hold | 20 sec/side | 15 sec/side | 30 sec/side | 15 sec/side |
| Single-leg balance | 45 sec/leg | 30 sec/leg | 60 sec/leg | 30 sec/leg |
| Prone swimmer iso | 20 sec | 15 sec | 30 sec | 15 sec |
| Target effort (RPE) | 5–6 | 3–4 | 6–7 | 3–4 |
| Exercise | Side guidance |
|---|---|
| Deep squat hold | — |
| 90/90 hip hold | Per side |
| Bird-dog hold | Per side |
| Single-leg balance | Per leg |
| Prone swimmer iso | — |
- Friday is the longer-hold progression day, **not a maximal-effort workout**.
Target effort (RPE): Monday **5–6**; Tuesday–Thursday **3–4**; Friday **6–7**; Saturday–Sunday **3–4**.
- Friday is the higher-effort day, **not a maximal-effort workout**.
- Keep squat holds gentle if fatigued after Thursday leg day, and prone swimmers gentle after Sunday shoulders.
- Avoid pain, loss of balance or excessive spinal arching. Use suitable padding/support when needed.
@@ -108,43 +110,15 @@ Perform **separately in the afternoon**, after the morning workout on lifting da
| Activity | Hang from pull-up bar |
| Frequency | **Every day**, including Monday and Friday |
| Timing | **Afternoon**, alongside isometric holds, separate from morning strength training |
| Goal | Work toward a **2-minute hang** |
| Goal | Start at **2 minutes**; the owner can change the goal in the app |
| Current duration | **Not specified** — 2 minutes is the target, not a confirmed current ability |
| Sets / breaks | **Not specified** — do not assume 2 minutes continuous or cumulative |
| Weight | **Not specified** for daily hangs — do not assume weighted vest |
| Weight | Vest use may be added later; it is not shown for daily hangs in the current app |
The daily hang is **additional to the existing programme**. Saturday also currently lists 2–3 sets of finger hangs in the morning; retain those for now rather than silently replacing them. Track the daily hang and Saturday finger hangs separately. Since pull-ups, chin-ups, hanging knee raises and finger hangs already load the hands and elbows, ease off if grip, finger, elbow or shoulder discomfort develops.
## 5. Full-body stretching — Monday and Friday (at least)
Target **15–20 minutes**, gently and without forcing positions. The same stretches may be done on other days if desired.
| Exercise | Duration |
|---|---|
| Standing calf stretch | 30 sec/leg |
| Standing quadriceps stretch | 30 sec/leg |
| Kneeling hip-flexor stretch | 30 sec/side |
| Seated hamstring stretch | 30 sec/leg |
| Figure-four glute stretch | 30 sec/side |
| Doorway chest stretch | 30 sec |
| Cross-body shoulder stretch | 30 sec/arm |
| Child's pose with side reach | 30 sec/side |
| Cat-cow | 8–10 slow reps |
## 6. Daily dog walks
| Item | Current routine |
|---|---|
| Number of walks | **3 every day** |
| Duration per walk | **30–60 minutes** |
| Total walking time | **90–180 minutes/day**, approximately **10.5–21 hours/week** |
| Added load | **6 kg weighted vest** |
| Recovery adjustment | On leg day or if fatigue/discomfort develops, lower vest load or walk without it. |
Walking remains part of the user's overall training load, including on Monday and Friday rest days.
## 7. General training rules
## 5. General training rules
| Topic | Agreed rule |
|---|---|
@@ -154,25 +128,77 @@ Walking remains part of the user's overall training load, including on Monday an
| Pull-up and chin-up EMOM | Begin work every **60 seconds**; remaining time is rest |
| Rep progression | When the top of a rep range is consistently completed with good form, increase difficulty/load or use a harder progression |
| Limited equipment load | Progress using available weight, weighted vest, unilateral variants, control, range of motion and pauses |
| Isometric progression | Increase by around **5 seconds** when easy, with form and recovery maintained |
| Recovery priority | Do not allow afternoon isometrics, stretching or vest walks to compromise morning strength progression |
| Recovery priority | Do not allow afternoon isometrics to compromise morning strength progression |
| Nutrition priority | Support gradual muscle/weight gain; don't deliberately reduce calories to chase a small amount of belly fat |
## 8. Implementation notes for the workout app
## 6. Implementation notes for the workout app
- Preserve **exercise order**, **prescription ranges**, **optional status**, and **vest load** in structured data; do not flatten a range (e.g. `3–4 sets`) to a mandatory count without representing the difference.
- Separate the routine template from workout logs. Logged sets, weights, repetitions, timings and notes are **historical user data**.
- The EMOM is a 10-minute protocol and is different from a normal 10-set workout timer.
- Daily walks, afternoon isometrics, **daily hanging practice**, and rest-day stretching are separate session types; track them independently from morning strength workouts.
- The EMOM remains a 10-minute protocol. Record actual total reps and external weight for the exercise; the app does not run an EMOM timer or require per-round entries.
- Afternoon isometrics and **daily hanging practice** are separate from morning strength workouts. Monday and Friday mornings show the full body stretch routine heading without exercise entries until the owner supplies them.
- Record daily hang duration and whether the 2-minute goal was achieved; do not default duration to 120 seconds or assume it is one continuous attempt. Keep Saturday finger hangs independently logged.
- Include exercise instructions/images as independent exercise-library data; this source document records the *agreed programme*, not an exhaustive technique manual.
- Any exercise weight omitted above is **not specified**. Do not infer a dumbbell or EZ-bar load.
- No fixed finger-hang duration is agreed.
- This is the initial baseline, not evidence that every listed exercise has already been performed on every date.
## 9. Revision log
## 7. Revision log
| Date | Change |
|---|---|
| 2026-10-27 | Removed app timers. EMOM exercises record total actual reps and external weight; regular strength sets record reps and weight separately. |
| 2026-10-26 | Removed dog walks from the app and current routine scope at the owner's request. |
| 2026-10-26 | Dog walks changed to reference context only; removed individual walk timing and recording from app scope. Typical walking details may inform a separately requested calorie calculation later. |
| 2026-10-26 | Removed time targets from afternoon isometric holds; kept the daily hang goal editable from its initial two minutes and hid daily hang vest details for now. |
| 2026-10-26 | Owner reserved Monday and Friday mornings for a full body stretch routine; specific stretches will be supplied later, so no exercise entries were added. |
| 2026-10-26 | Removed the previously listed stretch exercises. A temporary rest-day presentation was superseded by the title-only stretch routine clarification above. |
| 2026-10-18 | Added daily afternoon hangs alongside isometric holds, with a goal of 2 minutes; current duration and continuous/cumulative format remain unspecified. |
| 2026-10-18 | Consolidated current strength routine, seven-day isometrics, Monday/Friday stretching, walking volume and known vest loads into one authoritative document. |
| 2026-10-18 | Consolidated the then-current strength routine, seven-day isometrics, walking volume and known vest loads into one document. |
## 8. TASK-015 equipment and measurement planning addendum — 2026-11-04
These are the Captain's latest requested assignments for TASK-015, awaiting implementation approval. They take precedence over older equipment wording above for this task; the running seed is unchanged. Numeric vest references above are historical prescription context, never exercise capabilities or assumed actuals. Exercise definition, workout prescription and actual performance must remain separate.
| Session | Exercise | Supported resistance equipment | Performance measurement |
|---|---|---|---|
| Tuesday | Pull-ups | Weighted vest | Reps per EMOM minute, or reps per conventional set |
| Tuesday | EZ-bar bent-over rows | EZ curl bar | Reps |
| Tuesday | Single-arm dumbbell rows | Dumbbell(s) | Reps per side |
| Tuesday | Suitcase carries | Dumbbell(s) | Duration per side; distance only if a future prescription selects it |
| Wednesday | Deep push-ups on dumbbells | Weighted vest | Reps; dumbbells are handles, not lifted resistance |
| Wednesday | Dumbbell floor flys | Dumbbell(s) | Reps |
| Wednesday | Push-up plus | Weighted vest | Reps; zero added load is valid |
| Wednesday | Feet-elevated push-ups | Weighted vest | Reps |
| Thursday | Bulgarian split squats | Weighted vest + dumbbell(s) | Reps per leg |
| Thursday | Single-leg Romanian deadlifts | Weighted vest + dumbbell(s) | Reps per leg |
| Thursday | Squats | Weighted vest + dumbbell(s) | Reps |
| Thursday | Single-leg calf raises | Weighted vest + dumbbell(s) | Reps per leg |
| Thursday | Front plank | Weighted vest | Duration |
| Saturday | Chin-ups | Weighted vest | Reps per EMOM minute, or reps per conventional set |
| Saturday | Hanging knee raises | Bodyweight only | Reps |
| Saturday | Finger hangs | Weighted vest | Duration; no fixed target duration supplied |
| Saturday | Single-arm preacher curls | Dumbbell(s) | Reps per arm |
| Saturday | Hammer curls | Dumbbell(s) | Reps |
| Sunday | Standing single-arm shoulder press | Dumbbell(s) | Reps per arm |
| Sunday | Leaning lateral raises | Dumbbell(s) | Reps per arm |
| Sunday | Bent-over rear-delt flys | Dumbbell(s) | Reps |
| Sunday | Lying triceps extensions | Dumbbell(s) | Reps |
| Sunday | Single-arm triceps extensions | Dumbbell(s) | Reps per arm |
| Sunday | Side-plank hip raises | Weighted vest | Reps per side |
| Daily afternoon | Deep squat hold | Bodyweight only | Actual duration, no prescribed time |
| Daily afternoon | 90/90 hip hold | Bodyweight only | Actual duration per side, no prescribed time |
| Daily afternoon | Bird-dog hold | Bodyweight only | Actual duration per side, no reps or prescribed time |
| Daily afternoon | Single-leg balance | Bodyweight only | Actual duration per leg, no prescribed time |
| Daily afternoon | Prone swimmer iso | Bodyweight only | Actual duration, no prescribed time |
| Daily afternoon | Daily hang | Bodyweight only | Actual seconds per attempt; initial editable 120-second continuous target |
- Dog walks are bodyweight-only under the latest assignment. This classification does not restore dog-walk UI, seed entries or logging removed by ADR-013; ignore earlier vest descriptions for classification.
- Straight bar is a supported equipment type with total load including the bar, but no current exercise is assigned it. EZ curl bar uses the same total-weight convention. Dumbbell weights are per dumbbell; preserve the number used separately.
- Actual vest/dumbbell/bar load may vary per set or EMOM minute, including explicit zero where applicable. Do not prescribe particular weights through exercise definitions.
- Daily hanging supports multiple optional attempts. Longest continuous and cumulative duration are different results; only a continuous attempt meets the continuous target. This clarifies the earlier unspecified continuous/cumulative goal without inventing current ability.
- Minute-by-minute EMOM supersedes aggregate-only logging for new performance once TASK-015 is approved and implemented. Existing aggregate history stays intact. Existing prescription ranges/order/rest/optional flags remain unless explicitly changed here.
### Implemented equipment correction — 2026-11-04
At Captain's explicit request, seed v7 now assigns weighted vest support with unspecified load to front planks and side-plank hip raises. Both accept actual vest kilograms per set, including zero. Front planks remain duration-prescribed and require no reps; hip raises retain repetitions per side. This implements only these two assignments from the planning matrix, not the rest of TASK-015. Existing bodyweight-only performances remain historical data.
+183 -16
View File
@@ -1,28 +1,192 @@
import { useState } from 'react'
import { useEffect, useState } from 'react'
import { Button, Container, Nav, Navbar } from 'react-bootstrap'
import { exerciseDefinitions, initialRoutine } from './data/index.js'
import { addCalendarDays, loadLabel, localCalendarDate, localDateKey, prescriptionLabel, restLabel, routineForDate, startOfWeek } from './routineView.js'
import HangGoalEditor from './HangGoalEditor.jsx'
import StrengthEntryEditor from './StrengthEntryEditor.jsx'
import { readDailyHangGoal, writeDailyHangGoal } from './hangGoalStorage.js'
const sections = [
{ id: 'today', label: 'Today', title: 'Your workout, at a glance', description: 'Your daily sessions will appear here when the routine is added.' },
{ id: 'week', label: 'Week', title: 'The week ahead', description: 'The seven-day programme will appear here when the routine is added.' },
{ id: 'today', label: 'Today', title: "Today's plan" },
{ id: 'week', label: 'Week', title: 'Your week' },
{ id: 'history', label: 'History', title: 'Your training history', description: 'Completed workouts will appear here once tracking is available.' },
{ id: 'plan', label: 'Plan', title: 'Your training plan', description: 'Routine editing will become available in a later task.' },
{ id: 'settings', label: 'Settings', title: 'Your data and preferences', description: 'Local backup and app settings will become available in a later task.' },
]
const exerciseNames = new Map(exerciseDefinitions.map(({ id, name }) => [id, name]))
const initialHangGoalSeconds = initialRoutine.days.monday.afternoon.exercises.find(({ exerciseId }) => exerciseId === 'daily-hang').prescription.goalDurationSec
const dateFormatter = new Intl.DateTimeFormat('en-IE', { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' })
const weekdayFormatter = new Intl.DateTimeFormat('en-IE', { weekday: 'short' })
const weekFormatter = new Intl.DateTimeFormat('en-IE', { day: 'numeric', month: 'long', year: 'numeric' })
const clockFormatter = new Intl.DateTimeFormat('en-IE', { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false })
function WallClock() {
const [currentTime, setCurrentTime] = useState(() => new Date())
useEffect(() => {
const refresh = () => setCurrentTime(new Date())
const id = window.setInterval(refresh, 1000)
window.addEventListener('focus', refresh)
document.addEventListener('visibilitychange', refresh)
return () => {
window.clearInterval(id)
window.removeEventListener('focus', refresh)
document.removeEventListener('visibilitychange', refresh)
}
}, [])
return <span className="wall-clock"><span>Local time</span><time aria-label="Current local time" aria-live="off">{clockFormatter.format(currentTime)}</time></span>
}
function savedPeriod() {
try {
return window.localStorage.getItem('workout-period') === 'afternoon' ? 'afternoon' : 'morning'
} catch {
return 'morning'
}
}
function ExerciseList({ exercises, dateKey, hangGoalSeconds, hangGoalLoading, hangGoalError, onSaveHangGoal }) {
return (
<ol className="exercise-list">
{exercises.map(({ order, exerciseId, prescription, optional, rest, load }) => (
<li className="exercise-card" key={`${order}-${exerciseId}`}>
<span className="exercise-number" aria-hidden="true">{order}</span>
<div className="exercise-copy">
<div className="exercise-title-row">
<h3>{exerciseNames.get(exerciseId)}</h3>
{optional && <span className="optional-tag">Optional</span>}
</div>
<p className="prescription">{prescriptionLabel(exerciseId === 'daily-hang' ? { ...prescription, goalDurationSec: hangGoalSeconds } : prescription)}</p>
{(rest || load) && <p className="exercise-meta">{[restLabel(rest), loadLabel(load)].filter(Boolean).join(' · ')}</p>}
{(['emom', 'repetitions'].includes(prescription.kind) || ['suitcase-carry', 'front-plank'].includes(exerciseId)) && <StrengthEntryEditor key={`${dateKey}-${exerciseId}`} dateKey={dateKey} exerciseId={exerciseId} kind={prescription.kind === 'emom' ? 'emom' : ['suitcase-carry', 'front-plank'].includes(exerciseId) ? 'load-sets' : 'sets'} load={load} />}
{exerciseId === 'daily-hang' && <HangGoalEditor goalSeconds={hangGoalSeconds} loading={hangGoalLoading} storageError={hangGoalError} onSave={onSaveHangGoal} />}
</div>
</li>
))}
</ol>
)
}
function RoutineView({ selectedDate, setSelectedDate, period, setPeriod, setActiveId, hangGoalSeconds, hangGoalLoading, hangGoalError, onSaveHangGoal }) {
const today = localCalendarDate(new Date())
const weekStart = startOfWeek(selectedDate)
const days = Array.from({ length: 7 }, (_, index) => addCalendarDays(weekStart, index))
const routine = routineForDate(selectedDate)
const session = routine[period]
const isToday = localDateKey(selectedDate) === localDateKey(today)
function chooseDate(date) {
setSelectedDate(date)
setActiveId(localDateKey(date) === localDateKey(today) ? 'today' : 'week')
}
function changePeriod(nextPeriod) {
setPeriod(nextPeriod)
try {
window.localStorage.setItem('workout-period', nextPeriod)
} catch {
// The period still works for this page if browser storage is unavailable.
}
}
return (
<div className="routine-view">
<div className="period-switch" role="group" aria-label="Workout period">
{['morning', 'afternoon'].map((value) => (
<Button key={value} type="button" variant="link" aria-pressed={period === value} onClick={() => changePeriod(value)}>
{value === 'morning' ? 'Morning' : 'Afternoon'}
</Button>
))}
</div>
<div className="week-controls">
<Button type="button" variant="link" onClick={() => chooseDate(addCalendarDays(selectedDate, -7))} aria-label="Previous week">← Previous week</Button>
<span className="week-range">Week of {weekFormatter.format(days[0])}</span>
<Button type="button" variant="link" onClick={() => chooseDate(addCalendarDays(selectedDate, 7))} aria-label="Next week">Next week →</Button>
</div>
<nav className="day-strip" aria-label="Choose workout date">
{days.map((date) => {
const selected = localDateKey(date) === localDateKey(selectedDate)
return (
<Button
key={localDateKey(date)}
type="button"
variant="link"
className="day-button"
aria-label={dateFormatter.format(date)}
aria-pressed={selected}
onClick={() => chooseDate(date)}
>
<span>{weekdayFormatter.format(date)}</span>
<strong>{date.getDate()}</strong>
</Button>
)
})}
</nav>
<section className="routine-panel" aria-labelledby="session-title">
<div className="routine-heading">
<div>
<p className="panel-kicker">{isToday ? 'Today' : dateFormatter.format(selectedDate)} · {period}</p>
<h2 id="session-title">{session.title}</h2>
</div>
{session.exercises.length > 0 && <span className="session-count">{session.exercises.length} exercises</span>}
</div>
{session.targetEffortRpe && <p className="session-guidance">Target effort: RPE {session.targetEffortRpe.min}–{session.targetEffortRpe.max} · One round to start; a second round only if recovery remains good.</p>}
{session.exercises.length > 0 && <ExerciseList exercises={session.exercises} dateKey={localDateKey(selectedDate)} hangGoalSeconds={hangGoalSeconds} hangGoalLoading={hangGoalLoading} hangGoalError={hangGoalError} onSaveHangGoal={onSaveHangGoal} />}
</section>
<p className="shell-note">Enter actual reps and the relevant weights for strength work. Other recording will be added later.</p>
</div>
)
}
export default function App() {
const [activeId, setActiveId] = useState('today')
const [selectedDate, setSelectedDate] = useState(() => localCalendarDate(new Date()))
const [period, setPeriod] = useState(savedPeriod)
const [hangGoalSeconds, setHangGoalSeconds] = useState(initialHangGoalSeconds)
const [hangGoalLoading, setHangGoalLoading] = useState(true)
const [hangGoalError, setHangGoalError] = useState('')
const activeSection = sections.find((section) => section.id === activeId)
const showingRoutine = activeId === 'today' || activeId === 'week'
useEffect(() => {
let mounted = true
readDailyHangGoal().then((savedGoal) => {
if (!mounted) return
if (savedGoal != null) setHangGoalSeconds(savedGoal)
setHangGoalLoading(false)
}).catch((error) => {
if (!mounted) return
setHangGoalError(error.message)
setHangGoalLoading(false)
})
return () => { mounted = false }
}, [])
async function saveHangGoal(seconds) {
await writeDailyHangGoal(seconds)
setHangGoalSeconds(seconds)
setHangGoalError('')
}
function selectSection(id) {
setActiveId(id)
if (id === 'today') setSelectedDate(localCalendarDate(new Date()))
}
return (
<div className="app-shell">
<a className="skip-link" href="#main-content">Skip to content</a>
<Navbar className="site-header" aria-label="Main navigation">
<Container className="header-inner">
<Navbar.Brand className="brand" href="#main-content" onClick={() => setActiveId('today')}>
<Navbar.Brand className="brand" href="#main-content" onClick={() => selectSection('today')}>
<span className="brand-mark" aria-hidden="true">W</span>
<span>Workout Tracker</span>
</Navbar.Brand>
<span className="header-note">A private space to keep moving</span>
<span className="header-trailing"><span className="header-note">A private space to keep moving</span><WallClock /></span>
</Container>
</Navbar>
@@ -31,7 +195,7 @@ export default function App() {
<div>
<p className="eyebrow">YOUR TRAINING SPACE</p>
<h1>{activeSection.title}</h1>
<p className="intro">A simple place for your plan, sessions and progress.</p>
<p className="intro">{showingRoutine ? 'Browse your week and choose the session you want to see.' : 'A simple place for your plan, sessions and progress.'}</p>
</div>
<span className="local-badge">Local to this browser</span>
</div>
@@ -43,7 +207,7 @@ export default function App() {
className="section-link"
variant="link"
aria-current={activeId === section.id ? 'page' : undefined}
onClick={() => setActiveId(section.id)}
onClick={() => selectSection(section.id)}
>
{section.label}
</Button>
@@ -52,15 +216,18 @@ export default function App() {
</Nav>
<main id="main-content" tabIndex="-1">
<section className="content-panel" aria-labelledby="panel-title">
<div className="panel-icon" aria-hidden="true">{activeId === 'today' ? '↗' : '•'}</div>
<div>
<p className="panel-kicker">{activeSection.label}</p>
<h2 id="panel-title">A clear place to begin</h2>
<p>{activeSection.description}</p>
</div>
</section>
<p className="shell-note">Your workout data will stay on this device when local storage is added.</p>
{showingRoutine ? (
<RoutineView selectedDate={selectedDate} setSelectedDate={setSelectedDate} period={period} setPeriod={setPeriod} setActiveId={setActiveId} hangGoalSeconds={hangGoalSeconds} hangGoalLoading={hangGoalLoading} hangGoalError={hangGoalError} onSaveHangGoal={saveHangGoal} />
) : (
<section className="content-panel" aria-labelledby="panel-title">
<div className="panel-icon" aria-hidden="true">•</div>
<div>
<p className="panel-kicker">{activeSection.label}</p>
<h2 id="panel-title">A clear place to begin</h2>
<p>{activeSection.description}</p>
</div>
</section>
)}
</main>
</Container>
</div>
+79 -10
View File
@@ -1,15 +1,84 @@
import { fireEvent, render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'
import App from './App.jsx'
describe('application shell', () => {
it('shows the Today section and changes sections without workout behavior', () => {
beforeEach(() => {
vi.useFakeTimers()
vi.setSystemTime(new Date(2026, 9, 25, 12))
window.localStorage.clear()
})
afterEach(() => {
cleanup()
vi.useRealTimers()
})
describe('routine navigation', () => {
it('keeps the large local clock across views without workout timers', () => {
render(<App />)
expect(screen.getByRole('heading', { level: 1, name: 'Your workout, at a glance' })).toBeTruthy()
const week = screen.getByRole('button', { name: 'Week' })
fireEvent.click(week)
expect(screen.getByRole('heading', { level: 1, name: 'The week ahead' })).toBeTruthy()
expect(week.getAttribute('aria-current')).toBe('page')
expect(screen.getByRole('main')).toBeTruthy()
const clock = screen.getByLabelText('Current local time')
expect(clock.textContent).toBe('12:00:00')
expect(screen.queryByRole('region', { name: 'Workout timers' })).toBeNull()
expect(screen.queryByRole('button', { name: /Start EMOM|Start workout clock|Sound on|Sound off/ })).toBeNull()
act(() => vi.advanceTimersByTime(2000))
expect(clock.textContent).toBe('12:00:02')
fireEvent.click(screen.getByRole('button', { name: 'History' }))
expect(screen.getByLabelText('Current local time')).toBe(clock)
})
it('shows today’s morning exercises without dog walks', () => {
render(<App />)
expect(screen.getByRole('heading', { level: 1, name: "Today's plan" })).toBeTruthy()
expect(screen.getByRole('heading', { name: 'Push 2 — Shoulders + Triceps + Core' })).toBeTruthy()
expect(screen.getByText('Standing single-arm dumbbell shoulder press')).toBeTruthy()
expect(screen.getByText('Single-arm triceps extensions')).toBeTruthy()
expect(screen.getByText('Optional')).toBeTruthy()
expect(screen.queryByText('Daily hanging practice')).toBeNull()
expect(screen.queryByText(/dog walks/i)).toBeNull()
})
it('shows one period, preserves it across date changes, and remembers it locally', () => {
const view = render(<App />)
fireEvent.click(screen.getByRole('button', { name: 'Afternoon' }))
expect(screen.getByText('Daily hanging practice')).toBeTruthy()
expect(screen.queryByText('Standing single-arm dumbbell shoulder press')).toBeNull()
expect(screen.getByRole('button', { name: 'Afternoon' }).getAttribute('aria-pressed')).toBe('true')
expect(window.localStorage.getItem('workout-period')).toBe('afternoon')
fireEvent.click(screen.getByRole('button', { name: /Monday.*19 October 2026/ }))
expect(screen.getByText('Daily hanging practice')).toBeTruthy()
expect(screen.getByText('Target effort: RPE 5–6 · One round to start; a second round only if recovery remains good.')).toBeTruthy()
fireEvent.click(screen.getByRole('button', { name: 'Next week' }))
expect(screen.getByText('Week of 26 October 2026')).toBeTruthy()
expect(screen.getByRole('button', { name: 'Afternoon' }).getAttribute('aria-pressed')).toBe('true')
view.unmount()
render(<App />)
expect(screen.getByRole('button', { name: 'Afternoon' }).getAttribute('aria-pressed')).toBe('true')
fireEvent.click(screen.getByRole('button', { name: 'Today' }))
expect(screen.getByRole('heading', { name: 'Afternoon isometrics and daily hang' })).toBeTruthy()
})
it('shows the stretch routine heading without invented movements and uses focusable buttons', () => {
render(<App />)
const monday = screen.getByRole('button', { name: /Monday.*19 October 2026/ })
monday.focus()
expect(document.activeElement).toBe(monday)
fireEvent.click(monday)
expect(screen.getByRole('heading', { name: 'Full body stretch routine' })).toBeTruthy()
expect(screen.queryByText('Rest day')).toBeNull()
expect(document.querySelectorAll('.exercise-card')).toHaveLength(0)
expect(screen.queryByText('Pull-ups')).toBeNull()
expect(window.localStorage.length).toBe(0)
expect(screen.getByRole('button', { name: 'Morning' }).getAttribute('aria-pressed')).toBe('true')
})
it('keeps existing top-level sections accessible', () => {
render(<App />)
fireEvent.click(screen.getByRole('button', { name: 'History' }))
expect(screen.getByRole('heading', { level: 1, name: 'Your training history' })).toBeTruthy()
fireEvent.click(screen.getByRole('button', { name: 'Today' }))
expect(screen.getByRole('heading', { name: 'Push 2 — Shoulders + Triceps + Core' })).toBeTruthy()
})
})
+40
View File
@@ -0,0 +1,40 @@
import { useEffect, useState } from 'react'
import { Button } from 'react-bootstrap'
export default function HangGoalEditor({ goalSeconds, loading, storageError, onSave }) {
const [draft, setDraft] = useState(String(goalSeconds))
const [saving, setSaving] = useState(false)
const [error, setError] = useState('')
useEffect(() => setDraft(String(goalSeconds)), [goalSeconds])
async function submit(event) {
event.preventDefault()
const seconds = Number(draft)
if (!Number.isSafeInteger(seconds) || seconds <= 0) {
setError('Enter a whole number of seconds above zero.')
return
}
setSaving(true)
setError('')
try {
await onSave(seconds)
} catch (saveError) {
setError(saveError.message || 'Could not save the hanging goal.')
} finally {
setSaving(false)
}
}
return (
<div className="hang-goal-editor">
<form onSubmit={submit}>
<label htmlFor="daily-hang-goal">Hang goal (seconds)</label>
<input id="daily-hang-goal" type="number" min="1" step="1" value={draft} disabled={loading || saving} onChange={(event) => setDraft(event.target.value)} />
<Button type="submit" size="sm" variant="outline-success" disabled={loading || saving}>Save goal</Button>
</form>
{loading && <p role="status">Loading saved goal…</p>}
{(error || storageError) && <p className="goal-error" role="alert">{error || storageError}</p>}
</div>
)
}
+55
View File
@@ -0,0 +1,55 @@
import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
const saved = vi.hoisted(() => ({ goal: null, fail: false }))
vi.mock('./hangGoalStorage.js', () => ({
readDailyHangGoal: vi.fn(async () => saved.goal),
writeDailyHangGoal: vi.fn(async (seconds) => {
if (saved.fail) throw new Error('Could not save the hanging goal.')
saved.goal = seconds
}),
}))
import App from './App.jsx'
beforeEach(() => {
saved.goal = null
saved.fail = false
window.localStorage.clear()
})
afterEach(() => cleanup())
describe('daily hanging goal', () => {
it('changes the goal across days and reloads without hold times or vest details', async () => {
const view = render(<App />)
fireEvent.click(screen.getByRole('button', { name: 'Afternoon' }))
await waitFor(() => expect(screen.getByLabelText('Hang goal (seconds)').disabled).toBe(false))
expect(screen.getByText('Goal: 2 min')).toBeTruthy()
expect(screen.getByText('Deep squat hold').closest('.exercise-card').querySelector('.prescription').textContent).toBe('Hold')
expect(screen.queryByText(/Vest load not specified/)).toBeNull()
fireEvent.change(screen.getByLabelText('Hang goal (seconds)'), { target: { value: '180' } })
fireEvent.click(screen.getByRole('button', { name: 'Save goal' }))
await screen.findByText('Goal: 3 min')
fireEvent.click(screen.getByRole('button', { name: 'Next week' }))
expect(screen.getByText('Goal: 3 min')).toBeTruthy()
view.unmount()
render(<App />)
fireEvent.click(screen.getByRole('button', { name: 'Afternoon' }))
await screen.findByText('Goal: 3 min')
})
it('shows a save failure without changing the displayed goal', async () => {
saved.fail = true
render(<App />)
fireEvent.click(screen.getByRole('button', { name: 'Afternoon' }))
await waitFor(() => expect(screen.getByLabelText('Hang goal (seconds)').disabled).toBe(false))
fireEvent.change(screen.getByLabelText('Hang goal (seconds)'), { target: { value: '240' } })
fireEvent.click(screen.getByRole('button', { name: 'Save goal' }))
expect((await screen.findByRole('alert')).textContent).toMatch(/Could not save/)
expect(screen.getByText('Goal: 2 min')).toBeTruthy()
})
})
+142
View File
@@ -0,0 +1,142 @@
import { useEffect, useState } from 'react'
import { Button } from 'react-bootstrap'
import { fieldsForExercise, totalExternalKg } from './strengthLoad.js'
import { readStrengthEntry, writeStrengthEntry } from './strengthStorage.js'
function emptyWeight(load) {
const fields = fieldsForExercise(load)
return { load: fields.length ? Object.fromEntries(fields.map(({ key }) => [key, ''])) : { bodyweightOnly: true } }
}
function weightDraft(record, load) {
if (!record) return emptyWeight(load)
if (!record.load || (record.load.bodyweightOnly && fieldsForExercise(load).length > 0)) return { legacy: true, externalKg: String(record.externalKg) }
return { load: Object.fromEntries(Object.entries(record.load).map(([key, value]) => [key, typeof value === 'number' ? String(value) : value])) }
}
function emptySet(load, previous) {
return { reps: '', ...(previous ? previous.legacy ? { legacy: true, externalKg: previous.externalKg } : { load: { ...previous.load } } : emptyWeight(load)) }
}
function entryDraft(entry, kind, load) {
if (kind === 'emom') return { totalReps: entry?.totalReps?.toString() ?? '', ...weightDraft(entry, load) }
return entry?.sets?.map((row) => ({ reps: row.reps?.toString() ?? '', ...weightDraft(row, load) })) ?? [emptySet(load)]
}
function numberFromInput(value, whole) {
if (String(value).trim() === '') return null
const number = Number(value)
return Number.isFinite(number) && number >= 0 && (!whole || Number.isSafeInteger(number)) ? number : null
}
function recordedWeight(draft) {
if (draft.legacy) {
const externalKg = numberFromInput(draft.externalKg, false)
return externalKg == null ? null : { externalKg }
}
const load = Object.fromEntries(Object.entries(draft.load).map(([key, value]) => [key, key === 'bodyweightOnly' ? value : numberFromInput(value, false)]))
const externalKg = totalExternalKg(load)
return externalKg == null ? null : { externalKg, load }
}
export default function StrengthEntryEditor({ dateKey, exerciseId, kind, load }) {
const fields = fieldsForExercise(load)
const [draft, setDraft] = useState(() => entryDraft(null, kind, load))
const [loading, setLoading] = useState(true)
const [saving, setSaving] = useState(false)
const [error, setError] = useState('')
const [saved, setSaved] = useState(false)
useEffect(() => {
let active = true
readStrengthEntry(dateKey, exerciseId).then((entry) => {
if (!active) return
setDraft(entryDraft(entry, kind, load))
setLoading(false)
}).catch((failure) => {
if (!active) return
setError(failure.message)
setLoading(false)
})
return () => { active = false }
}, [dateKey, exerciseId, kind, load])
function updateSet(index, field, value) {
setDraft((rows) => rows.map((row, rowIndex) => rowIndex === index
? field === 'reps' || field === 'externalKg' ? { ...row, [field]: value } : { ...row, load: { ...row.load, [field]: value } }
: row))
setSaved(false)
}
function updateEmom(field, value) {
setDraft((current) => field === 'totalReps' || field === 'externalKg'
? { ...current, [field]: value }
: { ...current, load: { ...current.load, [field]: value } })
setSaved(false)
}
function replaceLegacyWeight(index) {
if (index == null) setDraft((current) => ({ totalReps: current.totalReps, ...emptyWeight(load) }))
else setDraft((rows) => rows.map((row, rowIndex) => rowIndex === index ? { reps: row.reps, ...emptyWeight(load) } : row))
setSaved(false)
}
function weightInputs(row, index) {
const prefix = index == null ? '' : `Set ${index + 1} `
if (row.legacy) return <>
<label>Previously recorded total external weight (kg)<input type="number" min="0" step="any" aria-label={`${prefix}previously recorded total external weight (kg)`} value={row.externalKg} disabled={loading || saving} onChange={(event) => index == null ? updateEmom('externalKg', event.target.value) : updateSet(index, 'externalKg', event.target.value)} /></label>
{fields.length > 0 && <Button type="button" variant="link" disabled={loading || saving} onClick={() => replaceLegacyWeight(index)}>Enter specific weights</Button>}
</>
if (fields.length === 0) return <small>No added weight</small>
return fields.map(({ key, label }) => <label key={key}>{label}<input type="number" min="0" step="any" aria-label={`${prefix}${label.toLowerCase()}`} value={row.load[key]} disabled={loading || saving} onChange={(event) => index == null ? updateEmom(key, event.target.value) : updateSet(index, key, event.target.value)} /></label>)
}
async function save(event) {
event.preventDefault()
const entry = kind === 'emom'
? { kind, totalReps: numberFromInput(draft.totalReps, true), ...recordedWeight(draft) }
: { kind, sets: draft.map((row) => ({ ...(kind === 'load-sets' ? {} : { reps: numberFromInput(row.reps, true) }), ...recordedWeight(row) })) }
if (kind === 'emom' ? entry.totalReps == null || entry.externalKg == null : entry.sets.some(({ reps, externalKg }) => (kind !== 'load-sets' && reps == null) || externalKg == null)) {
setError(kind === 'load-sets' ? 'Enter each shown weight as zero or more kilograms for every row.' : 'Enter whole-number reps and each shown weight as zero or more kilograms for every row.')
return
}
setSaving(true)
setError('')
try {
await writeStrengthEntry(dateKey, exerciseId, entry)
setSaved(true)
} catch (failure) {
setError(failure.message)
setSaved(false)
} finally {
setSaving(false)
}
}
return (
<form className="strength-entry" onSubmit={save}>
<strong>{kind === 'emom' ? 'Record EMOM total' : 'Record sets'}</strong>
{kind === 'emom' ? (
<div className="strength-fields">
<label>Total reps<input type="number" min="0" step="1" value={draft.totalReps} disabled={loading || saving} onChange={(event) => updateEmom('totalReps', event.target.value)} /></label>
{weightInputs(draft, null)}
</div>
) : (
<>
{draft.map((row, index) => (
<div className="strength-set" key={index}>
<span>Set {index + 1}</span>
{kind !== 'load-sets' && <label>Reps<input type="number" min="0" step="1" aria-label={`Set ${index + 1} reps`} value={row.reps} disabled={loading || saving} onChange={(event) => updateSet(index, 'reps', event.target.value)} /></label>}
{weightInputs(row, index)}
{draft.length > 1 && <Button type="button" variant="link" disabled={loading || saving} onClick={() => { setDraft((rows) => rows.filter((_, rowIndex) => rowIndex !== index)); setSaved(false) }}>Remove</Button>}
</div>
))}
<Button type="button" variant="outline-secondary" size="sm" disabled={loading || saving} onClick={() => { setDraft((rows) => [...rows, emptySet(load, rows.at(-1))]); setSaved(false) }}>Add set</Button>
</>
)}
<div className="strength-actions"><Button type="submit" size="sm" disabled={loading || saving}>{saving ? 'Saving…' : kind === 'load-sets' ? 'Save weight' : 'Save reps and weight'}</Button>{saved && <span role="status">Saved</span>}</div>
{error && <p className="strength-error" role="alert">{error}</p>}
<small>Record actual weights, not prescribed targets. Body weight is excluded.</small>
</form>
)
}
+229
View File
@@ -0,0 +1,229 @@
import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
const saved = vi.hoisted(() => ({ entries: new Map(), fail: false }))
vi.mock('./strengthStorage.js', () => ({
readStrengthEntry: vi.fn(async (dateKey, exerciseId) => saved.entries.get(`${dateKey}:${exerciseId}`) ?? null),
writeStrengthEntry: vi.fn(async (dateKey, exerciseId, entry) => {
if (saved.fail) throw new Error('Could not save the strength entry.')
saved.entries.set(`${dateKey}:${exerciseId}`, entry)
}),
}))
vi.mock('./hangGoalStorage.js', () => ({ readDailyHangGoal: vi.fn(async () => null), writeDailyHangGoal: vi.fn(async () => {}) }))
import App from './App.jsx'
beforeEach(() => {
saved.entries.clear()
saved.fail = false
vi.useFakeTimers({ toFake: ['Date'] })
vi.setSystemTime(new Date(2026, 9, 27, 12))
window.localStorage.clear()
})
afterEach(() => {
cleanup()
vi.useRealTimers()
})
describe('strength recording without timers', () => {
it('saves one EMOM total and actual external weight by date', async () => {
const view = render(<App />)
const pullUps = screen.getByText('Pull-ups').closest('.exercise-card')
await waitFor(() => expect(within(pullUps).getByLabelText('Total reps').disabled).toBe(false))
expect(within(pullUps).getByText('10 min EMOM · 3–4 reps each minute')).toBeTruthy()
expect(screen.queryByRole('region', { name: 'Workout timers' })).toBeNull()
expect(screen.queryByRole('button', { name: /Start EMOM|Start workout clock|Sound on|Sound off/ })).toBeNull()
fireEvent.change(within(pullUps).getByLabelText('Total reps'), { target: { value: '36' } })
fireEvent.change(within(pullUps).getByLabelText('vest weight (kg)'), { target: { value: '6' } })
fireEvent.click(within(pullUps).getByRole('button', { name: 'Save reps and weight' }))
await within(pullUps).findByText('Saved')
expect(saved.entries.get('2026-10-27:pull-up')).toEqual({ kind: 'emom', totalReps: 36, externalKg: 6, load: { vestKg: 6 } })
view.unmount()
render(<App />)
const again = screen.getByText('Pull-ups').closest('.exercise-card')
await waitFor(() => expect(within(again).getByLabelText('Total reps').value).toBe('36'))
expect(within(again).getByLabelText('vest weight (kg)').value).toBe('6')
})
it('saves separate regular sets and keeps dates separate', async () => {
render(<App />)
fireEvent.click(screen.getByRole('button', { name: 'Previous week' }))
fireEvent.click(screen.getByRole('button', { name: /Sunday.*25 October 2026/ }))
const press = screen.getByText('Standing single-arm dumbbell shoulder press').closest('.exercise-card')
await waitFor(() => expect(within(press).getByLabelText('Set 1 reps').disabled).toBe(false))
fireEvent.change(within(press).getByLabelText('Set 1 reps'), { target: { value: '10' } })
fireEvent.change(within(press).getByLabelText('Set 1 dumbbell weight (kg)'), { target: { value: '12' } })
fireEvent.click(within(press).getByRole('button', { name: 'Add set' }))
expect(within(press).getByLabelText('Set 2 dumbbell weight (kg)').value).toBe('12')
expect(within(press).getByLabelText('Set 2 reps').value).toBe('')
fireEvent.change(within(press).getByLabelText('Set 2 reps'), { target: { value: '8' } })
fireEvent.change(within(press).getByLabelText('Set 2 dumbbell weight (kg)'), { target: { value: '14' } })
fireEvent.click(within(press).getByRole('button', { name: 'Add set' }))
expect(within(press).getByLabelText('Set 3 dumbbell weight (kg)').value).toBe('14')
fireEvent.change(within(press).getByLabelText('Set 3 reps'), { target: { value: '7' } })
fireEvent.click(within(press).getByRole('button', { name: 'Save reps and weight' }))
await within(press).findByText('Saved')
expect(saved.entries.get('2026-10-25:single-arm-shoulder-press')).toEqual({ kind: 'sets', sets: [{ reps: 10, externalKg: 12, load: { dumbbellKg: 12 } }, { reps: 8, externalKg: 14, load: { dumbbellKg: 14 } }, { reps: 7, externalKg: 14, load: { dumbbellKg: 14 } }] })
fireEvent.click(screen.getByRole('button', { name: 'Next week' }))
fireEvent.click(screen.getByRole('button', { name: /Sunday.*1 November 2026/ }))
const future = screen.getByText('Standing single-arm dumbbell shoulder press').closest('.exercise-card')
await waitFor(() => expect(within(future).getByLabelText('Set 1 reps').disabled).toBe(false))
expect(within(future).getByLabelText('Set 1 reps').value).toBe('')
expect(saved.entries.size).toBe(1)
})
it('records flys as dumbbell weight per dumbbell, without a vest field', async () => {
render(<App />)
fireEvent.click(screen.getByRole('button', { name: /Wednesday.*28 October 2026/ }))
const flys = screen.getByText('Dumbbell floor flys').closest('.exercise-card')
await waitFor(() => expect(within(flys).getByLabelText('Set 1 dumbbell weight (kg each)').disabled).toBe(false))
expect(within(flys).queryByLabelText(/vest weight/i)).toBeNull()
fireEvent.change(within(flys).getByLabelText('Set 1 reps'), { target: { value: '12' } })
fireEvent.change(within(flys).getByLabelText('Set 1 dumbbell weight (kg each)'), { target: { value: '8' } })
fireEvent.click(within(flys).getByRole('button', { name: 'Add set' }))
expect(within(flys).getByLabelText('Set 2 dumbbell weight (kg each)').value).toBe('8')
fireEvent.change(within(flys).getByLabelText('Set 2 reps'), { target: { value: '10' } })
fireEvent.click(within(flys).getByRole('button', { name: 'Save reps and weight' }))
await within(flys).findByText('Saved')
expect(saved.entries.get('2026-10-28:dumbbell-floor-fly')).toEqual({ kind: 'sets', sets: [
{ reps: 12, externalKg: 16, load: { dumbbellKgEach: 8 } },
{ reps: 10, externalKg: 16, load: { dumbbellKgEach: 8 } },
] })
})
it('keeps vest and dumbbell weights separate for mixed-load sets', async () => {
render(<App />)
fireEvent.click(screen.getByRole('button', { name: /Thursday.*29 October 2026/ }))
const squats = screen.getByText('Squats').closest('.exercise-card')
await waitFor(() => expect(within(squats).getByLabelText('Set 1 vest weight (kg)').disabled).toBe(false))
fireEvent.change(within(squats).getByLabelText('Set 1 reps'), { target: { value: '10' } })
fireEvent.change(within(squats).getByLabelText('Set 1 vest weight (kg)'), { target: { value: '10' } })
fireEvent.change(within(squats).getByLabelText('Set 1 dumbbell weight (kg each)'), { target: { value: '12' } })
fireEvent.click(within(squats).getByRole('button', { name: 'Add set' }))
expect(within(squats).getByLabelText('Set 2 vest weight (kg)').value).toBe('10')
expect(within(squats).getByLabelText('Set 2 dumbbell weight (kg each)').value).toBe('12')
fireEvent.change(within(squats).getByLabelText('Set 2 reps'), { target: { value: '8' } })
fireEvent.click(within(squats).getByRole('button', { name: 'Save reps and weight' }))
await within(squats).findByText('Saved')
expect(saved.entries.get('2026-10-29:squat')).toEqual({ kind: 'sets', sets: [
{ reps: 10, externalKg: 34, load: { vestKg: 10, dumbbellKgEach: 12 } },
{ reps: 8, externalKg: 34, load: { vestKg: 10, dumbbellKgEach: 12 } },
] })
})
it('keeps older total-weight entries as totals rather than reinterpreting them', async () => {
saved.entries.set('2026-10-27:ez-bar-bent-over-row', { kind: 'sets', sets: [{ reps: 10, externalKg: 25 }] })
render(<App />)
const rows = screen.getByText('EZ-bar bent-over rows').closest('.exercise-card')
await waitFor(() => expect(within(rows).getByLabelText('Set 1 previously recorded total external weight (kg)').value).toBe('25'))
fireEvent.click(within(rows).getByRole('button', { name: 'Add set' }))
expect(within(rows).getByLabelText('Set 2 previously recorded total external weight (kg)').value).toBe('25')
fireEvent.change(within(rows).getByLabelText('Set 2 reps'), { target: { value: '8' } })
fireEvent.click(within(rows).getByRole('button', { name: 'Save reps and weight' }))
await within(rows).findByText('Saved')
expect(saved.entries.get('2026-10-27:ez-bar-bent-over-row')).toEqual({ kind: 'sets', sets: [{ reps: 10, externalKg: 25 }, { reps: 8, externalKg: 25 }] })
fireEvent.click(within(rows).getAllByRole('button', { name: 'Enter specific weights' })[0])
expect(within(rows).getByLabelText('Set 1 ez-bar total weight (kg)').value).toBe('')
fireEvent.change(within(rows).getByLabelText('Set 1 ez-bar total weight (kg)'), { target: { value: '25' } })
fireEvent.click(within(rows).getByRole('button', { name: 'Save reps and weight' }))
await within(rows).findByText('Saved')
expect(saved.entries.get('2026-10-27:ez-bar-bent-over-row')).toEqual({ kind: 'sets', sets: [{ reps: 10, externalKg: 25, load: { ezBarTotalKg: 25 } }, { reps: 8, externalKg: 25 }] })
})
it('records suitcase-carry weights per set without requiring reps and restores them', async () => {
const view = render(<App />)
const carry = screen.getByText('Suitcase carries').closest('.exercise-card')
await waitFor(() => expect(within(carry).getByLabelText('Set 1 dumbbell weight (kg)').disabled).toBe(false))
expect(within(carry).queryByLabelText(/reps/i)).toBeNull()
expect(within(carry).queryByLabelText(/vest/i)).toBeNull()
fireEvent.click(within(carry).getByRole('button', { name: 'Save weight' }))
expect(within(carry).getByRole('alert').textContent).toMatch(/each shown weight/)
fireEvent.change(within(carry).getByLabelText('Set 1 dumbbell weight (kg)'), { target: { value: '20' } })
fireEvent.click(within(carry).getByRole('button', { name: 'Add set' }))
expect(within(carry).getByLabelText('Set 2 dumbbell weight (kg)').value).toBe('20')
fireEvent.change(within(carry).getByLabelText('Set 2 dumbbell weight (kg)'), { target: { value: '0' } })
fireEvent.click(within(carry).getByRole('button', { name: 'Save weight' }))
await within(carry).findByText('Saved')
expect(saved.entries.get('2026-10-27:suitcase-carry')).toEqual({ kind: 'load-sets', sets: [
{ externalKg: 20, load: { dumbbellKg: 20 } },
{ externalKg: 0, load: { dumbbellKg: 0 } },
] })
view.unmount()
render(<App />)
const restored = screen.getByText('Suitcase carries').closest('.exercise-card')
await waitFor(() => expect(within(restored).getByLabelText('Set 1 dumbbell weight (kg)').value).toBe('20'))
expect(within(restored).getByLabelText('Set 2 dumbbell weight (kg)').value).toBe('0')
fireEvent.click(screen.getByRole('button', { name: 'Next week' }))
const nextWeek = screen.getByText('Suitcase carries').closest('.exercise-card')
await waitFor(() => expect(within(nextWeek).getByLabelText('Set 1 dumbbell weight (kg)').disabled).toBe(false))
expect(within(nextWeek).getByLabelText('Set 1 dumbbell weight (kg)').value).toBe('')
expect(saved.entries.size).toBe(1)
})
it.each([
['Thursday', '29 October 2026', 'Front plank', 'front-plank', '2026-10-29', 'load-sets'],
['Sunday', '1 November 2026', 'Side-plank hip raises', 'side-plank-hip-raise', '2026-11-01', 'sets'],
])('records vest weights for %s plank work without irrelevant load fields', async (day, date, name, id, dateKey, kind) => {
const view = render(<App />)
fireEvent.click(screen.getByRole('button', { name: new RegExp(`${day}.*${date}`) }))
const card = screen.getByText(name).closest('.exercise-card')
await waitFor(() => expect(within(card).getByLabelText('Set 1 vest weight (kg)').disabled).toBe(false))
expect(within(card).queryByLabelText(/dumbbell|bar total/i)).toBeNull()
expect(within(card).getByLabelText('Set 1 vest weight (kg)').value).toBe('')
if (kind === 'load-sets') expect(within(card).queryByLabelText(/reps/i)).toBeNull()
else fireEvent.change(within(card).getByLabelText('Set 1 reps'), { target: { value: '12' } })
fireEvent.change(within(card).getByLabelText('Set 1 vest weight (kg)'), { target: { value: '6' } })
fireEvent.click(within(card).getByRole('button', { name: 'Add set' }))
expect(within(card).getByLabelText('Set 2 vest weight (kg)').value).toBe('6')
fireEvent.change(within(card).getByLabelText('Set 2 vest weight (kg)'), { target: { value: '0' } })
if (kind === 'sets') fireEvent.change(within(card).getByLabelText('Set 2 reps'), { target: { value: '10' } })
fireEvent.click(within(card).getByRole('button', { name: kind === 'sets' ? 'Save reps and weight' : 'Save weight' }))
await within(card).findByText('Saved')
expect(saved.entries.get(`${dateKey}:${id}`)).toEqual({ kind, sets: [
{ ...(kind === 'sets' ? { reps: 12 } : {}), externalKg: 6, load: { vestKg: 6 } },
{ ...(kind === 'sets' ? { reps: 10 } : {}), externalKg: 0, load: { vestKg: 0 } },
] })
view.unmount()
render(<App />)
fireEvent.click(screen.getByRole('button', { name: new RegExp(`${day}.*${date}`) }))
const restored = screen.getByText(name).closest('.exercise-card')
await waitFor(() => expect(within(restored).getByLabelText('Set 1 vest weight (kg)').value).toBe('6'))
expect(within(restored).getByLabelText('Set 2 vest weight (kg)').value).toBe('0')
})
it('keeps historical bodyweight-only hip raises until explicitly entering vest weights', async () => {
const old = { kind: 'sets', sets: [{ reps: 12, externalKg: 0, load: { bodyweightOnly: true } }] }
saved.entries.set('2026-11-01:side-plank-hip-raise', old)
render(<App />)
fireEvent.click(screen.getByRole('button', { name: /Sunday.*1 November 2026/ }))
const card = screen.getByText('Side-plank hip raises').closest('.exercise-card')
await waitFor(() => expect(within(card).getByLabelText('Set 1 previously recorded total external weight (kg)').value).toBe('0'))
expect(saved.entries.get('2026-11-01:side-plank-hip-raise')).toEqual(old)
fireEvent.click(within(card).getByRole('button', { name: 'Enter specific weights' }))
expect(within(card).getByLabelText('Set 1 vest weight (kg)').value).toBe('')
fireEvent.change(within(card).getByLabelText('Set 1 vest weight (kg)'), { target: { value: '5' } })
fireEvent.click(within(card).getByRole('button', { name: 'Save reps and weight' }))
await within(card).findByText('Saved')
expect(saved.entries.get('2026-11-01:side-plank-hip-raise')).toEqual({ kind: 'sets', sets: [{ reps: 12, externalKg: 5, load: { vestKg: 5 } }] })
})
it('rejects incomplete rows and shows storage failures', async () => {
saved.fail = true
render(<App />)
const pullUps = screen.getByText('Pull-ups').closest('.exercise-card')
await waitFor(() => expect(within(pullUps).getByLabelText('Total reps').disabled).toBe(false))
fireEvent.click(within(pullUps).getByRole('button', { name: 'Save reps and weight' }))
expect(within(pullUps).getByRole('alert').textContent).toMatch(/whole-number reps/)
expect(saved.entries.size).toBe(0)
fireEvent.change(within(pullUps).getByLabelText('Total reps'), { target: { value: '0' } })
fireEvent.change(within(pullUps).getByLabelText('vest weight (kg)'), { target: { value: '0' } })
fireEvent.click(within(pullUps).getByRole('button', { name: 'Save reps and weight' }))
await waitFor(() => expect(within(pullUps).getByRole('alert').textContent).toMatch(/Could not save/))
})
})
+15
View File
@@ -0,0 +1,15 @@
# Initial routine data
`exerciseDefinitions.json` holds stable IDs, names, and categories. `initialRoutine.json` holds the versioned seven-day prescription and refers to definitions by ID. Neither file contains completed workout records or user edits.
Each day has separate `morning` and `afternoon` sessions. An exercise's `order` is one-based within its session. A `{ "min", "max" }` pair preserves a documented range; equal bounds represent a single target. Durations use seconds unless the field says `Min`. `null` means the source does not specify a value, especially for current hanging ability, finger-hang duration, and unknown loads. A `goalDurationSec` is a goal, not an achieved duration.
Loads keep vest, dumbbell, and EZ-bar components separate. The 6 kg and 10 kg values are prescribed vest settings only. The source is [`docs/WORKOUT_ROUTINE.md`](../../docs/WORKOUT_ROUTINE.md); any approved change to the initial programme must update that document and this seed together. A future broader storage adapter must copy this seed only when creating a new local routine, then preserve user edits and history.
Strength entry fields follow each exercise's `load` keys. `dumbbellKgEach` means the mass of each of two dumbbells; `dumbbellKg` means one dumbbell. Mixed `vestKg` and dumbbell keys produce separate inputs. Actual entries do not assume the seed's prescribed weights. New records retain components and a derived total external weight; older entries with only `externalKg` remain legacy totals.
Afternoon isometric holds have no prescribed duration. The daily hang starts with a two-minute goal but no vest field. A user-changed hanging goal is stored separately in IndexedDB by `hangGoalStorage.js`; seed updates must not overwrite it.
Suitcase carries also expose their single-dumbbell load as dated weight-only set entries (`kind: load-sets`). These contain actual load and derived external kilograms, without fabricated repetitions or performed duration. The carry duration-per-side prescription remains separate. Existing repetition sets and EMOM totals are unchanged; no IndexedDB store upgrade is needed.
Seed v7 adds vest-only support (`vestKg: null`) to front planks and side-plank hip raises without prescribing a numeric load. Front planks reuse weight-only `load-sets`; hip raises retain repetition sets. Historical bodyweight-only entries remain prior totals until the user explicitly chooses component entry. No database migration is required.
+32
View File
@@ -0,0 +1,32 @@
[
{"id":"pull-up","name":"Pull-ups","category":"strength"},
{"id":"ez-bar-bent-over-row","name":"EZ-bar bent-over rows","category":"strength"},
{"id":"single-arm-dumbbell-row","name":"Single-arm dumbbell rows","category":"strength"},
{"id":"suitcase-carry","name":"Suitcase carries","category":"strength"},
{"id":"weighted-deep-push-up","name":"Weighted deep push-ups using dumbbells as handles","category":"strength"},
{"id":"dumbbell-floor-fly","name":"Dumbbell floor flys","category":"strength"},
{"id":"push-up-plus","name":"Push-up plus","category":"strength"},
{"id":"feet-elevated-weighted-push-up","name":"Feet-elevated weighted push-ups","category":"strength"},
{"id":"bulgarian-split-squat","name":"Bulgarian split squats","category":"strength"},
{"id":"single-leg-romanian-deadlift","name":"Single-leg Romanian deadlifts","category":"strength"},
{"id":"squat","name":"Squats","category":"strength"},
{"id":"single-leg-calf-raise","name":"Single-leg calf raises","category":"strength"},
{"id":"front-plank","name":"Front plank","category":"strength"},
{"id":"chin-up","name":"Chin-ups","category":"strength"},
{"id":"hanging-knee-raise","name":"Hanging knee raises","category":"strength"},
{"id":"finger-hang","name":"Finger hangs","category":"strength"},
{"id":"single-arm-preacher-curl","name":"Single-arm preacher curls over a chair","category":"strength"},
{"id":"hammer-curl","name":"Hammer curls","category":"strength"},
{"id":"single-arm-shoulder-press","name":"Standing single-arm dumbbell shoulder press","category":"strength"},
{"id":"leaning-single-arm-lateral-raise","name":"Leaning single-arm lateral raises","category":"strength"},
{"id":"bent-over-rear-delt-fly","name":"Bent-over rear-delt flys","category":"strength"},
{"id":"lying-dumbbell-triceps-extension","name":"Lying dumbbell triceps extensions","category":"strength"},
{"id":"single-arm-triceps-extension","name":"Single-arm triceps extensions","category":"strength"},
{"id":"side-plank-hip-raise","name":"Side-plank hip raises","category":"strength"},
{"id":"deep-squat-hold","name":"Deep squat hold","category":"isometric"},
{"id":"ninety-ninety-hip-hold","name":"90/90 hip hold","category":"isometric"},
{"id":"bird-dog-hold","name":"Bird-dog hold","category":"isometric"},
{"id":"single-leg-balance","name":"Single-leg balance","category":"isometric"},
{"id":"prone-swimmer-iso","name":"Prone swimmer iso","category":"isometric"},
{"id":"daily-hang","name":"Daily hanging practice","category":"hang"}
]
+4
View File
@@ -0,0 +1,4 @@
import exerciseDefinitions from './exerciseDefinitions.json'
import initialRoutine from './initialRoutine.json'
export { exerciseDefinitions, initialRoutine }
File diff suppressed because it is too large Load Diff
+107
View File
@@ -0,0 +1,107 @@
import { describe, expect, it } from 'vitest'
import { exerciseDefinitions, initialRoutine } from './index.js'
const weekdays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
const isometricIds = ['deep-squat-hold', 'ninety-ninety-hip-hold', 'bird-dog-hold', 'single-leg-balance', 'prone-swimmer-iso']
const morningIds = {
monday: [],
tuesday: ['pull-up', 'ez-bar-bent-over-row', 'single-arm-dumbbell-row', 'suitcase-carry'],
wednesday: ['weighted-deep-push-up', 'dumbbell-floor-fly', 'push-up-plus', 'feet-elevated-weighted-push-up'],
thursday: ['bulgarian-split-squat', 'single-leg-romanian-deadlift', 'squat', 'single-leg-calf-raise', 'front-plank'],
friday: [],
saturday: ['chin-up', 'hanging-knee-raise', 'finger-hang', 'single-arm-preacher-curl', 'hammer-curl'],
sunday: ['single-arm-shoulder-press', 'leaning-single-arm-lateral-raise', 'bent-over-rear-delt-fly', 'lying-dumbbell-triceps-extension', 'single-arm-triceps-extension', 'side-plank-hip-raise'],
}
const exercise = (day, period, id) => initialRoutine.days[day][period].exercises.find((item) => item.exerciseId === id)
const range = (min, max = min) => ({ min, max })
describe('documented initial routine', () => {
it('is versioned, has one stable definition per used exercise, and retains every day and exercise order', () => {
expect(initialRoutine.version).toBe(7)
expect(initialRoutine.source).toBe('docs/WORKOUT_ROUTINE.md')
expect(Object.keys(initialRoutine.days)).toEqual(weekdays)
const definitionIds = exerciseDefinitions.map(({ id }) => id)
expect(new Set(definitionIds).size).toBe(definitionIds.length)
const usedIds = new Set()
for (const day of weekdays) {
const sessions = initialRoutine.days[day]
expect(sessions.morning.sessionType).toBe(day === 'monday' || day === 'friday' ? 'stretching' : 'strength')
expect(sessions.morning.exercises.map(({ exerciseId }) => exerciseId)).toEqual(morningIds[day])
expect(sessions.afternoon.sessionType).toBe('isometrics-and-hang')
expect(sessions.afternoon.exercises.map(({ exerciseId }) => exerciseId)).toEqual([...isometricIds, 'daily-hang'])
expect(sessions).not.toHaveProperty('walks')
for (const session of Object.values(sessions)) {
expect(session.exercises.map(({ order }) => order)).toEqual(session.exercises.map((_, index) => index + 1))
for (const item of session.exercises) {
expect(definitionIds).toContain(item.exerciseId)
expect(typeof item.optional).toBe('boolean')
usedIds.add(item.exerciseId)
}
}
}
expect([...usedIds].sort()).toEqual([...definitionIds].sort())
expect(definitionIds).toHaveLength(30)
expect(definitionIds).not.toContain('dog-walk')
expect(initialRoutine).not.toHaveProperty('activityReference')
expect(exerciseDefinitions.some(({ category }) => category === 'stretch')).toBe(false)
})
it('preserves strength ranges, EMOM timing, rest, and separate known and unknown load components', () => {
for (const [day, id] of [['tuesday', 'pull-up'], ['saturday', 'chin-up']]) {
const item = exercise(day, 'morning', id)
expect(item.prescription).toMatchObject({ kind: 'emom', rounds: 10, intervalSec: 60, repsPerRound: range(3, 4) })
expect(item.rest).toEqual({ kind: 'remainder-of-interval', intervalSec: 60 })
expect(item.load).toEqual({ vestKg: 6 })
}
expect(exercise('tuesday', 'morning', 'pull-up').prescription.initialRepsPerRound).toBe(4)
expect(exercise('tuesday', 'morning', 'single-arm-dumbbell-row').prescription).toMatchObject({ sets: range(3, 4), reps: range(8, 15), per: 'side' })
expect(exercise('tuesday', 'morning', 'suitcase-carry').prescription).toMatchObject({ sets: range(3), durationSec: range(30, 60), per: 'side' })
expect(exercise('wednesday', 'morning', 'weighted-deep-push-up').load).toEqual({ vestKg: 10 })
expect(exercise('wednesday', 'morning', 'feet-elevated-weighted-push-up').load).toEqual({ vestKg: 10 })
expect(exercise('wednesday', 'morning', 'dumbbell-floor-fly').load).toEqual({ dumbbellKgEach: null })
expect(exercise('thursday', 'morning', 'bulgarian-split-squat').load).toEqual({ vestKg: 10, dumbbellKgEach: null })
expect(exercise('thursday', 'morning', 'squat').load).toEqual({ vestKg: 10, dumbbellKgEach: null })
expect(exercise('thursday', 'morning', 'front-plank').prescription.durationSec).toEqual(range(30, 60))
expect(exercise('thursday', 'morning', 'front-plank').load).toEqual({ vestKg: null })
expect(exercise('sunday', 'morning', 'side-plank-hip-raise').load).toEqual({ vestKg: null })
expect(exercise('saturday', 'morning', 'finger-hang').prescription).toMatchObject({ sets: range(2, 3), durationSec: null })
expect(exercise('sunday', 'morning', 'single-arm-triceps-extension')).toMatchObject({ optional: true, prescription: { sets: range(2, 3), reps: range(10, 15), per: 'arm' } })
expect(initialRoutine.days.sunday.morning.exercises.filter(({ optional }) => optional).map(({ exerciseId }) => exerciseId)).toEqual(['single-arm-triceps-extension'])
})
it('keeps untimed afternoon holds and daily hanging practice separate from Saturday finger hangs', () => {
const efforts = {
monday: range(5, 6), tuesday: range(3, 4), wednesday: range(3, 4),
thursday: range(3, 4), friday: range(6, 7), saturday: range(3, 4), sunday: range(3, 4),
}
for (const day of weekdays) {
const afternoon = initialRoutine.days[day].afternoon
expect(afternoon.targetEffortRpe).toEqual(efforts[day])
expect(afternoon.exercises.slice(0, 5).every(({ prescription }) => prescription.kind === 'isometric-hold' && !('durationSec' in prescription))).toBe(true)
expect(afternoon.exercises[1].prescription.per).toBe('side')
expect(afternoon.exercises[2].prescription.per).toBe('side')
expect(afternoon.exercises[3].prescription.per).toBe('leg')
expect(afternoon.initialRounds).toBe(1)
expect(afternoon.optionalProgressionRounds).toBe(2)
expect(afternoon.progressionCondition).toBe('Only if recovery remains good')
expect(afternoon).not.toHaveProperty('restBetweenHoldsSec')
expect(afternoon.targetsAreMandatory).toBe(false)
expect(exercise(day, 'afternoon', 'daily-hang')).toMatchObject({
prescription: { goalDurationSec: 120, currentDurationSec: null, attemptCount: null, breaks: null, goalFormat: null },
})
expect(exercise(day, 'afternoon', 'daily-hang')).not.toHaveProperty('load')
}
expect(exercise('saturday', 'morning', 'finger-hang').exerciseId).not.toBe(exercise('saturday', 'afternoon', 'daily-hang').exerciseId)
})
it('keeps Monday and Friday stretch headings free of unspecified exercises', () => {
for (const day of ['monday', 'friday']) {
const morning = initialRoutine.days[day].morning
expect(morning).toEqual({ sessionType: 'stretching', title: 'Full body stretch routine', exercises: [] })
}
})
})
+34
View File
@@ -0,0 +1,34 @@
import { openLocalDatabase } from './localDatabase.js'
const STORE_NAME = 'routineOverrides'
const GOAL_KEY = 'dailyHangGoalSec'
export async function readDailyHangGoal() {
const db = await openLocalDatabase()
return new Promise((resolve, reject) => {
const transaction = db.transaction(STORE_NAME, 'readonly')
const request = transaction.objectStore(STORE_NAME).get(GOAL_KEY)
request.onsuccess = () => {
const value = request.result
if (value == null) resolve(null)
else if (Number.isSafeInteger(value) && value > 0) resolve(value)
else reject(new Error('The saved hanging goal is invalid.'))
}
request.onerror = () => reject(new Error('Could not read the hanging goal.'))
transaction.oncomplete = () => db.close()
transaction.onerror = () => { db.close(); reject(new Error('Could not read the hanging goal.')) }
transaction.onabort = () => { db.close(); reject(new Error('Could not read the hanging goal.')) }
})
}
export async function writeDailyHangGoal(seconds) {
if (!Number.isSafeInteger(seconds) || seconds <= 0) throw new Error('Enter a whole number of seconds above zero.')
const db = await openLocalDatabase()
return new Promise((resolve, reject) => {
const transaction = db.transaction(STORE_NAME, 'readwrite')
transaction.objectStore(STORE_NAME).put(seconds, GOAL_KEY)
transaction.oncomplete = () => { db.close(); resolve() }
transaction.onerror = () => { db.close(); reject(new Error('Could not save the hanging goal.')) }
transaction.onabort = () => { db.close(); reject(new Error('Could not save the hanging goal.')) }
})
}
+74
View File
@@ -0,0 +1,74 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { readDailyHangGoal, writeDailyHangGoal } from './hangGoalStorage.js'
function memoryIndexedDB() {
const values = new Map()
const stores = new Set()
const db = {
objectStoreNames: { contains: (name) => stores.has(name) },
createObjectStore: (name) => stores.add(name),
close() {},
transaction() {
const transaction = {
objectStore() {
return {
get(key) {
const request = {}
queueMicrotask(() => {
request.result = values.get(key)
request.onsuccess?.()
queueMicrotask(() => transaction.oncomplete?.())
})
return request
},
put(value, key) {
values.set(key, value)
queueMicrotask(() => transaction.oncomplete?.())
},
}
},
}
return transaction
},
}
return {
open() {
const request = { result: db }
queueMicrotask(() => {
if (!stores.has('routineOverrides')) request.onupgradeneeded?.()
request.onsuccess?.()
})
return request
},
}
}
afterEach(() => vi.unstubAllGlobals())
describe('daily hanging goal storage', () => {
it('reads and writes a local goal without changing the seed', async () => {
vi.stubGlobal('indexedDB', memoryIndexedDB())
expect(await readDailyHangGoal()).toBeNull()
await writeDailyHangGoal(180)
expect(await readDailyHangGoal()).toBe(180)
})
it('rejects invalid values and unavailable storage', async () => {
vi.stubGlobal('indexedDB', memoryIndexedDB())
await expect(writeDailyHangGoal(0)).rejects.toThrow('whole number')
await expect(writeDailyHangGoal(2.5)).rejects.toThrow('whole number')
vi.stubGlobal('indexedDB', undefined)
await expect(readDailyHangGoal()).rejects.toThrow('unavailable')
})
it('reports a blocked database upgrade', async () => {
vi.stubGlobal('indexedDB', {
open() {
const request = {}
queueMicrotask(() => request.onblocked?.())
return request
},
})
await expect(readDailyHangGoal()).rejects.toThrow('blocked by another tab')
})
})
+25
View File
@@ -0,0 +1,25 @@
const DATABASE_NAME = 'workout-tracker'
const DATABASE_VERSION = 2
export function openLocalDatabase() {
return new Promise((resolve, reject) => {
if (!globalThis.indexedDB) {
reject(new Error('Local workout storage is unavailable in this browser.'))
return
}
const request = globalThis.indexedDB.open(DATABASE_NAME, DATABASE_VERSION)
let blocked = false
request.onupgradeneeded = () => {
for (const store of ['routineOverrides', 'strengthEntries']) {
if (!request.result.objectStoreNames.contains(store)) request.result.createObjectStore(store)
}
}
request.onsuccess = () => {
if (blocked) request.result.close()
else resolve(request.result)
}
request.onerror = () => reject(new Error('Could not open local workout storage.'))
request.onblocked = () => { blocked = true; reject(new Error('Local workout storage is blocked by another tab.')) }
})
}
+76
View File
@@ -0,0 +1,76 @@
import { initialRoutine } from './data/index.js'
const weekdayKeys = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']
export function localCalendarDate(date) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12)
}
export function addCalendarDays(date, days) {
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days, 12)
}
export function startOfWeek(date) {
return addCalendarDays(date, -((date.getDay() + 6) % 7))
}
export function localDateKey(date) {
const pad = (value) => String(value).padStart(2, '0')
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`
}
export function routineForDate(date) {
return initialRoutine.days[weekdayKeys[date.getDay()]]
}
function rangeLabel(range) {
return range.min === range.max ? String(range.min) : `${range.min}–${range.max}`
}
function durationLabel(range) {
if (range.min % 60 === 0 && range.max % 60 === 0) {
return `${rangeLabel({ min: range.min / 60, max: range.max / 60 })} min`
}
return `${rangeLabel(range)} sec`
}
export function prescriptionLabel(prescription) {
const per = prescription.per ? ` per ${prescription.per}` : ''
switch (prescription.kind) {
case 'emom':
return `${prescription.rounds} min EMOM · ${rangeLabel(prescription.repsPerRound)} reps each minute`
case 'repetitions':
return prescription.sets
? `${rangeLabel(prescription.sets)} × ${rangeLabel(prescription.reps)} reps${per}`
: `${rangeLabel(prescription.reps)} ${prescription.tempo || ''} reps${per}`.replace(/\s+/g, ' ').trim()
case 'timed-sets':
return prescription.durationSec
? `${rangeLabel(prescription.sets)} × ${durationLabel(prescription.durationSec)}${per}`
: `${rangeLabel(prescription.sets)} sets · duration not specified`
case 'timed-hold':
return `${durationLabel(prescription.durationSec)}${per}`
case 'isometric-hold':
return `Hold${per}`
case 'hanging-practice':
return `Goal: ${durationLabel({ min: prescription.goalDurationSec, max: prescription.goalDurationSec })}`
default:
return ''
}
}
export function restLabel(rest) {
if (!rest) return null
if (rest.kind === 'remainder-of-interval') return 'Rest: remainder of each minute'
if (rest.kind === 'approximate') return `Rest: about ${durationLabel({ min: rest.seconds, max: rest.seconds })}`
return `Rest: ${durationLabel(rest.seconds)}`
}
export function loadLabel(load) {
if (!load) return null
if (load.bodyweightOnly) return 'Bodyweight only'
const parts = []
if ('vestKg' in load) parts.push(load.vestKg === null ? 'Vest load not specified' : `${load.vestKg} kg vest`)
if ('dumbbellKg' in load || 'dumbbellKgEach' in load) parts.push('Dumbbell load not specified')
if ('ezBarTotalKg' in load) parts.push('EZ-bar load not specified')
return parts.join(' · ')
}
+21
View File
@@ -0,0 +1,21 @@
import { describe, expect, it } from 'vitest'
import { addCalendarDays, loadLabel, localDateKey, prescriptionLabel, restLabel, routineForDate, startOfWeek } from './routineView.js'
describe('routine view helpers', () => {
it('uses local calendar dates across month and year boundaries', () => {
const newYear = new Date(2026, 0, 1, 12)
expect(localDateKey(startOfWeek(newYear))).toBe('2025-12-29')
expect(localDateKey(addCalendarDays(newYear, -1))).toBe('2025-12-31')
expect(localDateKey(addCalendarDays(newYear, 7))).toBe('2026-01-08')
expect(routineForDate(new Date(2026, 9, 25, 12)).morning.title).toBe('Push 2 — Shoulders + Triceps + Core')
})
it('shows ranges and unknown values without treating goals as completed work', () => {
expect(prescriptionLabel({ kind: 'emom', rounds: 10, repsPerRound: { min: 3, max: 4 } })).toBe('10 min EMOM · 3–4 reps each minute')
expect(prescriptionLabel({ kind: 'timed-sets', sets: { min: 2, max: 3 }, durationSec: null })).toBe('2–3 sets · duration not specified')
expect(prescriptionLabel({ kind: 'hanging-practice', goalDurationSec: 120 })).toBe('Goal: 2 min')
expect(prescriptionLabel({ kind: 'isometric-hold', per: 'side' })).toBe('Hold per side')
expect(restLabel({ kind: 'range', seconds: { min: 120, max: 180 } })).toBe('Rest: 2–3 min')
expect(loadLabel({ vestKg: 10, dumbbellKgEach: null })).toBe('10 kg vest · Dumbbell load not specified')
})
})
+26
View File
@@ -0,0 +1,26 @@
export const loadFields = [
{ key: 'vestKg', label: 'Vest weight (kg)', multiplier: 1 },
{ key: 'dumbbellKgEach', label: 'Dumbbell weight (kg each)', multiplier: 2 },
{ key: 'dumbbellKg', label: 'Dumbbell weight (kg)', multiplier: 1 },
{ key: 'ezBarTotalKg', label: 'EZ-bar total weight (kg)', multiplier: 1 },
]
export function fieldsForExercise(load) {
return loadFields.filter(({ key }) => load && Object.hasOwn(load, key))
}
export function totalExternalKg(load) {
if (!load || typeof load !== 'object' || Array.isArray(load)) return null
const keys = Object.keys(load)
if (keys.length === 1 && load.bodyweightOnly === true) return 0
if (keys.length === 0 || keys.some((key) => !loadFields.some((field) => field.key === key))) return null
let total = 0
for (const { key, multiplier } of loadFields) {
if (!Object.hasOwn(load, key)) continue
const weight = load[key]
if (typeof weight !== 'number' || !Number.isFinite(weight) || weight < 0) return null
total += weight * multiplier
}
return Number.isFinite(total) ? total : null
}
+62
View File
@@ -0,0 +1,62 @@
import { openLocalDatabase } from './localDatabase.js'
import { totalExternalKg } from './strengthLoad.js'
const STORE_NAME = 'strengthEntries'
function entryKey(dateKey, exerciseId) {
if (!/^\d{4}-\d{2}-\d{2}$/.test(dateKey) || !exerciseId) throw new Error('A date and exercise are required.')
return `${dateKey}:${exerciseId}`
}
function validReps(value) {
return Number.isSafeInteger(value) && value >= 0
}
function validWeight(value) {
return typeof value === 'number' && Number.isFinite(value) && value >= 0
}
function validRecordedWeight(record) {
if (!validWeight(record.externalKg)) return false
if (record.load == null) return true // Entries saved before separate load fields remain valid.
const total = totalExternalKg(record.load)
return total != null && Math.abs(total - record.externalKg) < 1e-9
}
function validEntry(entry) {
if (entry?.kind === 'emom') return validReps(entry.totalReps) && validRecordedWeight(entry)
if (entry?.kind === 'load-sets') return Array.isArray(entry.sets) && entry.sets.length > 0 && entry.sets.every((row) => row && validRecordedWeight(row))
if (entry?.kind === 'sets') return Array.isArray(entry.sets) && entry.sets.length > 0 && entry.sets.every((row) => row && validReps(row.reps) && validRecordedWeight(row))
return false
}
export async function readStrengthEntry(dateKey, exerciseId) {
const key = entryKey(dateKey, exerciseId)
const db = await openLocalDatabase()
return new Promise((resolve, reject) => {
const transaction = db.transaction(STORE_NAME, 'readonly')
const request = transaction.objectStore(STORE_NAME).get(key)
request.onsuccess = () => {
if (request.result == null) resolve(null)
else if (validEntry(request.result)) resolve(request.result)
else reject(new Error('The saved strength entry is invalid.'))
}
request.onerror = () => reject(new Error('Could not read the strength entry.'))
transaction.oncomplete = () => db.close()
transaction.onerror = () => { db.close(); reject(new Error('Could not read the strength entry.')) }
transaction.onabort = () => { db.close(); reject(new Error('Could not read the strength entry.')) }
})
}
export async function writeStrengthEntry(dateKey, exerciseId, entry) {
const key = entryKey(dateKey, exerciseId)
if (!validEntry(entry)) throw new Error('Enter whole-number reps and external weight of zero or more kilograms.')
const db = await openLocalDatabase()
return new Promise((resolve, reject) => {
const transaction = db.transaction(STORE_NAME, 'readwrite')
transaction.objectStore(STORE_NAME).put(entry, key)
transaction.oncomplete = () => { db.close(); resolve() }
transaction.onerror = () => { db.close(); reject(new Error('Could not save the strength entry.')) }
transaction.onabort = () => { db.close(); reject(new Error('Could not save the strength entry.')) }
})
}
+118
View File
@@ -0,0 +1,118 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { readDailyHangGoal, writeDailyHangGoal } from './hangGoalStorage.js'
import { readStrengthEntry, writeStrengthEntry } from './strengthStorage.js'
function existingV1Database() {
const stores = new Map([['routineOverrides', new Map([['dailyHangGoalSec', 180]])]])
let version = 1
const db = {
objectStoreNames: { contains: (name) => stores.has(name) },
createObjectStore(name) { stores.set(name, new Map()) },
close() {},
transaction(name) {
const transaction = {
objectStore() {
return {
get(key) {
const request = {}
queueMicrotask(() => {
request.result = stores.get(name).get(key)
request.onsuccess?.()
queueMicrotask(() => transaction.oncomplete?.())
})
return request
},
put(value, key) {
stores.get(name).set(key, value)
queueMicrotask(() => transaction.oncomplete?.())
},
}
},
}
return transaction
},
}
return {
stores,
indexedDB: {
open(name, requestedVersion) {
const request = { result: db }
queueMicrotask(() => {
if (name !== 'workout-tracker') throw new Error('Unexpected database')
if (requestedVersion > version) {
request.onupgradeneeded?.()
version = requestedVersion
}
request.onsuccess?.()
})
return request
},
},
}
}
afterEach(() => vi.unstubAllGlobals())
describe('strength entry storage', () => {
it('upgrades the existing hanging-goal database and keeps dated entries separate', async () => {
const database = existingV1Database()
vi.stubGlobal('indexedDB', database.indexedDB)
expect(await readDailyHangGoal()).toBe(180)
expect(database.stores.has('strengthEntries')).toBe(true)
await writeStrengthEntry('2026-10-27', 'pull-up', { kind: 'emom', totalReps: 36, externalKg: 6 })
await writeStrengthEntry('2026-10-26', 'pull-up', { kind: 'emom', totalReps: 32, externalKg: 6 })
await writeStrengthEntry('2026-10-27', 'squat', { kind: 'sets', sets: [{ reps: 10, externalKg: 20 }, { reps: 8, externalKg: 22.5 }] })
expect(await readStrengthEntry('2026-10-27', 'pull-up')).toEqual({ kind: 'emom', totalReps: 36, externalKg: 6 })
expect(await readStrengthEntry('2026-10-26', 'pull-up')).toEqual({ kind: 'emom', totalReps: 32, externalKg: 6 })
expect(await readStrengthEntry('2026-10-27', 'squat')).toEqual({ kind: 'sets', sets: [{ reps: 10, externalKg: 20 }, { reps: 8, externalKg: 22.5 }] })
expect(await readStrengthEntry('2026-10-28', 'pull-up')).toBeNull()
await writeDailyHangGoal(240)
expect(await readDailyHangGoal()).toBe(240)
})
it('rejects missing or invalid reps and weights without saving', async () => {
const database = existingV1Database()
vi.stubGlobal('indexedDB', database.indexedDB)
await expect(writeStrengthEntry('2026-10-27', 'pull-up', { kind: 'emom', totalReps: 2.5, externalKg: 6 })).rejects.toThrow('whole-number reps')
await expect(writeStrengthEntry('2026-10-27', 'squat', { kind: 'sets', sets: [{ reps: 8, externalKg: -1 }] })).rejects.toThrow('whole-number reps')
expect(database.stores.get('strengthEntries')).toBeUndefined()
})
it('stores separate load components and rejects an inconsistent total', async () => {
const database = existingV1Database()
vi.stubGlobal('indexedDB', database.indexedDB)
const entry = { kind: 'sets', sets: [{ reps: 10, externalKg: 34, load: { vestKg: 10, dumbbellKgEach: 12 } }] }
await writeStrengthEntry('2026-10-29', 'squat', entry)
expect(await readStrengthEntry('2026-10-29', 'squat')).toEqual(entry)
await expect(writeStrengthEntry('2026-10-29', 'squat', { kind: 'sets', sets: [{ reps: 10, externalKg: 22, load: { vestKg: 10, dumbbellKgEach: 12 } }] })).rejects.toThrow('whole-number reps')
expect(await readStrengthEntry('2026-10-29', 'squat')).toEqual(entry)
})
it('preserves weight-only carry sets without fabricating repetitions', async () => {
const database = existingV1Database()
vi.stubGlobal('indexedDB', database.indexedDB)
const entry = { kind: 'load-sets', sets: [
{ externalKg: 20, load: { dumbbellKg: 20 } },
{ externalKg: 22, load: { dumbbellKg: 22 } },
] }
await writeStrengthEntry('2026-11-03', 'suitcase-carry', entry)
expect(await readStrengthEntry('2026-11-03', 'suitcase-carry')).toEqual(entry)
await expect(writeStrengthEntry('2026-11-03', 'suitcase-carry', { kind: 'load-sets', sets: [] })).rejects.toThrow()
await expect(writeStrengthEntry('2026-11-03', 'suitcase-carry', { kind: 'load-sets', sets: [{ externalKg: 20, load: { dumbbellKg: 22 } }] })).rejects.toThrow()
expect(await readStrengthEntry('2026-11-03', 'suitcase-carry')).toEqual(entry)
expect(await readDailyHangGoal()).toBe(180)
})
it('reports unavailable local storage', async () => {
vi.stubGlobal('indexedDB', undefined)
await expect(readStrengthEntry('2026-10-27', 'pull-up')).rejects.toThrow('unavailable')
})
it('reports a malformed saved entry', async () => {
const database = existingV1Database()
vi.stubGlobal('indexedDB', database.indexedDB)
await readStrengthEntry('2026-10-27', 'squat')
database.stores.get('strengthEntries').set('2026-10-27:squat', { kind: 'sets', sets: [null] })
await expect(readStrengthEntry('2026-10-27', 'squat')).rejects.toThrow('invalid')
})
})
+89 -10
View File
@@ -1,29 +1,108 @@
:root { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #202923; background: #f4f1ea; }
:root {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
color: #202923;
background: #f4f1ea;
}
body { min-width: 320px; margin: 0; }
button { font: inherit; }
.app-shell { min-height: 100vh; background: #f4f1ea; }
.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 10; padding: .6rem 1rem; background: #fff; color: #173d32; }
.skip-link:focus { top: .5rem; }
.site-header { min-height: 76px; background: #173d32; color: #fff; }
.header-inner { display: flex; justify-content: space-between; gap: 1rem; }
.site-header { position: sticky; top: 0; z-index: 20; min-height: 92px; background: #173d32; color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand, .brand:hover, .brand:focus { display: inline-flex; align-items: center; gap: .75rem; color: #fff; font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #d6ec77; color: #173d32; font-weight: 800; }
.header-note { color: #d0e3db; font-size: .875rem; }
.page-content { padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: 3rem; }
.header-trailing { display: flex; align-items: center; gap: 1.5rem; }
.wall-clock { display: flex; flex-direction: column; align-items: flex-end; color: #e1eae4; font-size: .8rem; white-space: nowrap; }
.wall-clock time { color: #fff; font-size: clamp(1.65rem, 2.4vw, 2.2rem); font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .02em; line-height: 1.15; }
.page-content { padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: 3rem; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; }
.eyebrow, .panel-kicker { color: #476656; font-size: .73rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { max-width: 16ch; margin: .25rem 0 .7rem; font-size: clamp(2.2rem, 5vw, 3.75rem); line-height: 1.08; letter-spacing: -.045em; }
.intro { margin: 0; color: #5b685f; font-size: 1.08rem; }
h1 { margin: .25rem 0 .55rem; font-size: clamp(2.2rem, 4vw, 3.25rem); line-height: 1.08; letter-spacing: -.045em; }
.intro { margin: 0; color: #5b685f; font-size: 1.03rem; }
.local-badge { flex: 0 0 auto; margin-bottom: .25rem; padding: .45rem .75rem; border: 1px solid #bbccc0; border-radius: 999px; color: #315847; font-size: .8rem; font-weight: 600; }
.section-nav { display: flex; flex-wrap: wrap; gap: .2rem; margin: 2.5rem 0 1.25rem; padding-bottom: .55rem; border-bottom: 1px solid #d4dcd4; }
.section-nav { display: flex; flex-wrap: wrap; gap: .2rem; margin: 1.7rem 0 1.25rem; padding-bottom: .55rem; border-bottom: 1px solid #d4dcd4; }
.section-link.btn { min-height: 44px; padding: .55rem 1rem; border-radius: 8px; color: #445e50; font-weight: 650; text-decoration: none; }
.section-link.btn:hover { background: #e6ebe2; color: #173d32; }
.section-link.btn[aria-current="page"] { background: #173d32; color: #fff; }
.section-link.btn:focus-visible, .brand:focus-visible { outline: 3px solid #9fc45c; outline-offset: 3px; }
.section-link.btn:focus-visible, .brand:focus-visible, .period-switch .btn:focus-visible, .week-controls .btn:focus-visible, .day-button.btn:focus-visible, .strength-entry button:focus-visible, .strength-entry input:focus-visible { outline: 3px solid #9fc45c; outline-offset: 3px; }
.content-panel { display: flex; align-items: flex-start; gap: 1.5rem; min-height: 280px; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid #e0e5dd; border-radius: 20px; background: #fff; box-shadow: 0 14px 36px rgba(22, 54, 43, .045); }
.panel-icon { display: grid; flex: 0 0 56px; width: 56px; height: 56px; place-items: center; border-radius: 16px; background: #e8efd9; color: #315847; font-size: 2rem; line-height: 1; }
.content-panel h2 { margin: .4rem 0 .7rem; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; }
.content-panel p:last-child { max-width: 48ch; color: #5b685f; line-height: 1.6; }
.shell-note { margin: 1rem 0; color: #627067; font-size: .875rem; }
@media (max-width: 575px) { .site-header { min-height: 68px; } .header-note, .local-badge { display: none; } .page-heading { display: block; } .section-nav { flex-wrap: wrap; margin-top: 2rem; } .section-link.btn { white-space: nowrap; padding-inline: .75rem; } .content-panel { gap: 1rem; min-height: 240px; border-radius: 16px; } .panel-icon { flex-basis: 42px; width: 42px; height: 42px; font-size: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.routine-view { max-width: 1100px; }
.period-switch { display: inline-flex; padding: 4px; border: 1px solid #c8d4c9; border-radius: 12px; background: #e9ede6; }
.period-switch .btn { min-width: 118px; min-height: 44px; border-radius: 8px; color: #365548; font-weight: 700; text-decoration: none; }
.period-switch .btn[aria-pressed="true"] { background: #173d32; color: #fff; }
.period-switch .btn:hover:not([aria-pressed="true"]) { background: #dce5da; }
.week-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; margin: 1.25rem 0 .55rem; }
.week-controls .btn { min-height: 44px; padding: .35rem .5rem; color: #315847; font-weight: 700; text-decoration: none; }
.week-controls .btn:first-child { justify-self: start; }
.week-controls .btn:last-child { justify-self: end; }
.week-range { color: #52665a; font-size: .9rem; font-weight: 650; text-align: center; }
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.25rem; }
.day-button.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 68px; padding: .4rem .2rem; border: 1px solid #d6dfd4; border-radius: 12px; background: #fff; color: #3d5e4d; text-decoration: none; }
.day-button span { font-size: .78rem; font-weight: 650; }
.day-button strong { font-size: 1.15rem; }
.day-button.btn:hover { border-color: #819e86; background: #ecf1e8; }
.day-button.btn[aria-pressed="true"] { border-color: #173d32; background: #173d32; color: #fff; }
.routine-panel { padding: clamp(1.15rem, 2.8vw, 2rem); border: 1px solid #e0e5dd; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(22, 54, 43, .04); }
.routine-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.routine-heading .panel-kicker { margin: 0 0 .35rem; }
.routine-heading h2 { margin: 0; font-size: clamp(1.5rem, 2.8vw, 2rem); letter-spacing: -.03em; }
.session-count { flex: 0 0 auto; padding: .35rem .65rem; border-radius: 999px; background: #eaf0e3; color: #315847; font-size: .8rem; font-weight: 700; }
.session-guidance { margin: .8rem 0 0; color: #53675a; line-height: 1.5; }
.exercise-list { display: grid; gap: .65rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.exercise-card { display: flex; align-items: flex-start; gap: .9rem; padding: .9rem 1rem; border: 1px solid #e2e8e0; border-radius: 12px; background: #fbfcf9; }
.exercise-number { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; background: #e8efd9; color: #315847; font-size: .8rem; font-weight: 800; }
.exercise-copy { min-width: 0; flex: 1; }
.exercise-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.exercise-title-row h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.optional-tag { padding: .12rem .4rem; border-radius: 999px; background: #f4eecf; color: #66521e; font-size: .72rem; font-weight: 700; }
.prescription { margin: .3rem 0 0; color: #315847; font-weight: 700; }
.exercise-meta { margin: .25rem 0 0; color: #5f6c62; font-size: .86rem; line-height: 1.4; }
.strength-entry { display: grid; justify-items: start; gap: .55rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid #e2e8e0; }
.strength-entry > strong { color: #315847; font-size: .88rem; }
.strength-fields, .strength-set { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; }
.strength-set > span { align-self: center; min-width: 3rem; color: #52665a; font-size: .84rem; font-weight: 700; }
.strength-entry label { display: grid; gap: .2rem; color: #52665a; font-size: .8rem; font-weight: 650; }
.strength-entry input { width: 7rem; min-height: 38px; padding: .3rem .45rem; border: 1px solid #b6c7b8; border-radius: 6px; color: #254838; }
.strength-entry button { min-height: 38px; }
.strength-actions { display: flex; align-items: center; gap: .7rem; }
.strength-actions span { color: #315847; font-size: .84rem; font-weight: 700; }
.strength-entry small { color: #657468; }
.strength-error { margin: 0; color: #9b3126; font-size: .84rem; }
.hang-goal-editor { margin-top: .65rem; }
.hang-goal-editor form { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.hang-goal-editor label { color: #53675a; font-size: .82rem; font-weight: 650; }
.hang-goal-editor input { width: 5.5rem; min-height: 38px; padding: .3rem .45rem; border: 1px solid #b6c7b8; border-radius: 6px; color: #254838; }
.hang-goal-editor .btn { min-height: 38px; }
.hang-goal-editor p { margin: .35rem 0 0; font-size: .82rem; }
.hang-goal-editor .goal-error { color: #9b3126; }
@media (max-width: 575px) {
.site-header { min-height: 80px; }
.header-inner { gap: .5rem; }
.header-note, .local-badge { display: none; }
.brand { gap: .5rem; font-size: .95rem; }
.wall-clock span { line-height: 1.1; }
.wall-clock time { font-size: 1.6rem; }
.page-heading { display: block; }
.section-nav { margin-top: 1.4rem; }
.section-link.btn { white-space: nowrap; padding-inline: .75rem; }
.content-panel { gap: 1rem; min-height: 240px; border-radius: 16px; }
.panel-icon { flex-basis: 42px; width: 42px; height: 42px; font-size: 1.5rem; }
.week-controls { grid-template-columns: 1fr 1fr; }
.week-range { grid-column: 1 / -1; grid-row: 1; }
.day-strip { gap: .25rem; }
.day-button.btn { min-height: 60px; border-radius: 8px; }
.routine-heading { display: block; }
.session-count { display: inline-block; margin-top: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}