Complete TASK-008 history and progress
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# TASK-008 UI and calculation brief
|
||||
|
||||
2026-11-11. Extend the existing dark UI after Captain engaged Frontend UI Design → Webapp Feature with the lock-on defaults. Base e3bd365; source .task-worktrees/task-008, branch task/008-history-progress.
|
||||
|
||||
## Composition and interaction
|
||||
|
||||
History replaces its current placeholder. Retain header/clock/navigation. A history panel contains date From/To filters (initially all dates), period filter (all, Morning, Afternoon, earlier records whose period was not saved), Refresh and Clear filters. Invalid date range has associated error feedback. Below, newest-first recorded dates use semantic disclosures (row details mount only while a date is open, keeping long histories compact to render) showing read-only sessions, actual rows, notes and daily body weight. No edit/delete/automatic save actions. Empty store and no filter matches are distinct; loading hides stale data; errors offer retry. Reload on re-entering History or explicit Refresh, with cancellation after unmount/retry. Filters affect sessions and exercise progress; body weight follows date range only because it is date-level/shared across periods.
|
||||
|
||||
Exercise progress uses a select for compatible series and a metric select: completed reps, completed-row volume, highest recorded external load, recorded duration/distance, longest continuous hang/cumulative hang as applicable. Show latest vs previous compatible recorded date with explicit values/difference, not coaching. Simple locally rendered SVG chart has labelled units/date range and an accompanying accessible recorded-values list with partial-state labels. Missing points break lines rather than implying zero. One record shows a dot and no fabricated comparison; no records show an explanation. Daily body weight has its own chart/values, one point per date. Exercise series show the highest recorded metric within that compatible group (detailed completed rows or separate original legacy saved totals, with partial records labelled); body weight has no “best” direction. Chart scales/dates use normal HTML text rather than tiny scaled SVG labels on mobile. No new chart dependency, network, 1RM/estimated performance, calories, streaks or time-based rates.
|
||||
|
||||
Desktop filters wrap in a bounded row; disclosures and progress have intrinsic responsive widths. Below 576px filters stack, controls/actions keep 44px heights, row details/notes wrap, and charts scale within the container at 320px. Use semantic field labels, details/summary, headings, time, lists and focus outlines; selected options/partial/error meanings do not rely on color. Reuse Bootstrap Form/Button and existing tokens; do not redesign other screens. No independent browser validation claimed.
|
||||
|
||||
## Data and math contract
|
||||
|
||||
Read a consistent readonly transaction across performanceEntries, strengthEntries and workoutDetails. Validate stored keys/values; invalid data causes explicit error rather than silently manufacturing/skipping totals. No writes, schema upgrades beyond current v4, backups changes or new dependencies.
|
||||
|
||||
Group detailed entries by date/period/exercise. If an emom-total exists, it is current even if it is a draft; original minute/set data remains separate, never summed. Earlier legacy date/exercise records have no period/definition snapshot/completion flag. If any detailed representation exists for that date/exercise, preserve the legacy record at date level and exclude it from totals (do not infer its period). Otherwise show a separate Earlier records session: original externalKg × saved reps/total reps, explicitly labelled legacy saved rows with unknown completion; weight-only records have no inferred reps/volume. Do not reinterpret legacy load components/current seed definitions. Legacy series remain separate from detailed series.
|
||||
|
||||
Detailed calculations use only saved definition, actual load and completed rows. Reps-per-side sums both saved side values; show side semantics and original values. External kg sums recorded vest, dumbbell kg-each × saved count, and bar totals; body weight is excluded. Volume = sum(completed reps × recorded external kg), never timed/distance-only work. Explicit zero is valid. Draft/unknown loads/reps and arithmetic overflow must remain distinguishable from a true zero; show known completed-row totals with missing-data/partial qualifiers. Duration-only work has no rep-load volume. Longest continuous and cumulative attempts are distinct; daily hangs and finger-hang exercise IDs never combine. Session completion labels describe recorded rows, not completion of the whole prescribed workout. Notes-only/weight-only dates are not completed workouts.
|
||||
|
||||
Comparison groups use exercise ID, saved period/format, measurement/equipment signature and actual dumbbell-count modes. Changed measurement/equipment/count/legacy representation does not share a series. Partial sessions may show their known completed-row metrics but remain explicitly labelled; no normalized workload or invented missing actuals. Saved names/snapshots take precedence; legacy IDs are shown without inferring an old name from current routine data.
|
||||
|
||||
## Required verification
|
||||
|
||||
Pure calculation cases for mixed equipment, asymmetric sides, zeros, drafts, unknown loads, timed-only work, duplicate representations and overflow; trend compatibility and ordering; readonly IndexedDB snapshot/data preservation and failures; empty/loading/error/filter/detail/chart/notes/body-weight UI plus cancellation. Full tests with one worker, lint/build, context/whitespace/base-diff review and no-launch --check 008. Captain alone runs ./scripts/testtask.sh 008 for desktop/320px/keyboard and real save → history checks before Complete.
|
||||
Reference in New Issue
Block a user