Complete TASK-005 dated notes and daily body weight

This commit is contained in:
rob
2026-11-11 14:15:08 +00:00
parent be0ff2b2e4
commit e3bd365add
17 changed files with 512 additions and 22 deletions
+23
View File
@@ -0,0 +1,23 @@
# TASK-005 design and implementation brief
2026-11-11. Extend the approved dark theme, typography, compact input widths, date/period navigation and workout editors. Captain invoked Frontend UI Design → Webapp Feature and engaged the previously briefed scope: session notes, dated exercise notes, optional daily body weight.
## Composition
Routine heading/guidance → collapsed **Session notes and body weight** → existing exercise list. The disclosure remains available on empty stretch sessions. Its contents use existing Bootstrap Form/Button semantics: a labelled optional session-note textarea, and an optional Body weight (kg) field. Desktop/tablet >=768px groups them in two bounded columns; narrow widths stack them with wrapping labels/help/errors. Body weight retains compact 5.25rem numeric sizing. Textareas fill available width, resize vertically and have no horizontal overflow.
Each exercise card retains current performance editor, goal and exercise-details content. Add a separate collapsed **Your notes** disclosure with a textarea labelled using the exercise name. Notes are dated exercise-session observations, not permanent exercise-library instructions or per-set/minute notes. A single exercise note applies to that date/period/exercise independently of legacy/detailed performance representations. No notes copied by previous-session suggestions.
## Actions and states
Each field has its own explicit Save and secondary Clear action. Clear changes only the draft; Save confirms removal. No confirmation modal for editing a single optional field. Plain text, max 4000 characters. Body weight accepts a finite positive decimal number in kg; blank means no measurement, never assumed zero. One body-weight record per date, shared across Morning/Afternoon, no volume contribution. Session notes are separate per date/period; exercise notes additionally by exercise ID.
Loading disables controls; unavailable/invalid saved data disables Save and offers Retry loading. Validation/write failure retains input and surfaces an associated alert; successful Save announces saved/removed status in that form. Edits announce unsaved changes. Date/period/identity changes remount the owning form to prevent late reads/writes displaying in another context. Navigation follows the existing discard-of-unsaved-draft convention; browsing never writes. Saving notes/body weight never completes or modifies performance records. Persistent controls use visible labels, unique IDs, help/error associations, semantic forms/details/summary, 44px actions, dark native controls and offset keyboard focus. No hover-only actions.
## Storage and backup handoff
Add one independent workoutDetails store via additive IndexedDB v4 upgrade; leave all three original stores/records untouched. Records are schemaVersion 1 with explicit kind/date and applicable period/exercise identity; validated keys distinguish session-note, exercise-note and body-weight. Save empty text/weight deletes only that matching optional record. Backup envelope v4 includes this store and continues reading v1/v2/v3. Older envelopes omit it and must not erase it during an old-format replacement. New v4 replacements cover all stores atomically. No import/export UI (TASK-009).
## Verification
Automated migration from prior versions, literal old-data preservation, backup round trips/rollback/old imports, input validation, explicit clear/save, save/reload/date/period isolation, empty sessions, read/write failures and late read/save context changes. Full tests (one worker), lint/build, context, whitespace/base-diff and no-launch testtask preflight. Captain alone runs `./scripts/testtask.sh 005` for desktop/320px, keyboard/focus, disclosures and save/reload acceptance. No independent browser pass claimed.