Files

30 lines
4.7 KiB
Markdown

# TASK-015 UI and storage implementation brief
> Historical brief: TASK-017 / ADR-020 supersede every EMOM minute-table and format-switch requirement below. Current normal EMOM entry has only Weight (kg), Total reps and Save; existing minute history remains separately accessible.
Design mode: extend the existing React-Bootstrap layout and green/light visual language. TASK-016 owns dark theming. Captain engaged implementation on 2026-11-04; timer-free behavior is authoritative (ADR-018).
## Composition and interaction
Keep the app header, wall clock, date strip and exclusive period switch. Each exercise card presents name, optional state, a clearly labeled target, supported equipment and rest guidance. Below it, show actual logging rows derived from definition metadata. Desktop rows share column headings; at <=575px labels appear on stacked fields. Units and accessible names include row/side. No horizontal table scrolling.
Use a reusable performance editor for sets, EMOM minutes and hang attempts. New rows start blank except for copied preceding loads/count. EMOM starts with ten blank minute rows; conventional-set format remains available. There are no completion checkboxes. Explicit Save marks fully filled valid rows complete and retains incomplete rows as drafts; invalid entered values fail validation. Never auto-save on navigation or count suggested values as performed.
TASK-017 / ADR-021 supersede separate side controls: rep-per-side and duration-per-side now use one shared input applying to each side. Historical unequal values remain read-only text until explicitly replaced. Dumbbells use kg each with count supplied internally from the definition; no exercise shows a count field. Floor flys always use two, vest/bar loads have separate fields. Bodyweight-only work has no external-load inputs. The existing prescription remains separate from actual values; seed load presets never initialize actuals.
Use one Save performance action, Add set/attempt where relevant, optional Use previous session action with date and compatibility check, and clear saved/unsaved/error feedback. Suggestions require action and completion is reset. Initial loading disables logging; failure preserves drafts with retry. Save failures leave values intact. Validation errors identify the row and field; completed data and incomplete drafts are distinguished by saved summary counts and unsaved/saved feedback.
Daily hang shows editable continuous target, attempt seconds, longest continuous and cumulative duration separately. Only completed attempts contribute to achieved summaries. Finger hangs remain separate. Details use a keyboard-operable disclosure with existing notes, support-equipment distinction and explicit unavailable-content placeholders; no invented muscle/technique copy or unreviewed image.
Historical aggregate EMOM, rep sets and weight-only records remain in their original store and appear in a separate disclosure, with the existing editor available for explicit edits. They are not allocated to minute/side rows or counted together with new detailed entries. New logging is saved separately and captures definition/prescription snapshots. A clear label explains the two representations; a new detailed record never overwrites the old one.
## Responsive and state coverage
Desktop keeps compact headings and aligned fields; tablet wraps within the card; mobile stacks row fields with visible labels and full-width actions as needed. Labels/errors wrap and controls have min-width:0. Existing focus style extends to all new controls; use native semantic form controls and text status. Loading, empty, partial, saved/unsaved, storage-read failure, save failure, invalid completed row, legacy-only and changed-definition history are explicit states. No modal or new navigation is needed.
## Data contract
IndexedDB v3 adds performanceEntries and a compound exercise/period/format index. Existing strengthEntries and routineOverrides are retained verbatim. Each new record is schemaVersion 1 with date, period, exercise ID, format, immutable definition/prescription snapshots, and rows of measurement values/load/completion. Legacy readers remain intact. Partial values use null, not inferred zero. New JSON adapter exports all three stores with versioned validation and transactional import; no Settings backup interface is added (TASK-009).
Validation: all equipment/measurement assignments, units/count/side semantics, applicable and absent controls, variable/zero loads, completion and partial reload, suggestions, legacy isolation, v1/v2 upgrades, failed transactions, JSON old/new round trips, full tests/lint/build, diff review against codex, and browser mobile/desktop QA if a browser becomes available. Captain acceptance is required before Complete.