|
1 | 1 | # training-app |
2 | 2 |
|
| 3 | +## 1.1.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 143180b: Add Share Links feature (Phase 1 & 2): new `share-links` Payload collection with token auto-generation, expiry date, and per-link permissions (plan preview / results). Custom admin UI component shows the full share URL with a one-click copy button. |
| 8 | +- 60adf5f: Add Share Links — Phase 3: readOnly mode across component chain and share page refactor. Adds `readOnly` prop to `SeriesRow`, `ExerciseCard`, `WorkoutTracker`, and `WorkoutPlansAccordion` — hides all mutation controls when true. Replaces the hardcoded `PlanSection` on the share page with `WorkoutPlansAccordion readOnly={true}`. Bug fixes: microcycles and workouts collections now expose `read: isAuthenticated`; `training-plan-loader` calls `loadPlansItems` with `overrideAccess: true`. Refactoring: `fmtMinSec`, `isValidValue`, `buildExerciseMeta`, and `workoutGroupLabel` extracted to `lib/date.ts` / `lib/metrics.ts`; loader renamed to `load-plans-items.ts`. |
| 9 | +- 275c280: Add Share Links — Phase 4: results (logs) via share-token cookie. Middleware sets an HttpOnly `share-token` cookie on `/share/*` routes. New `canReadViaShareToken` access function validates the cookie and gates read access to `workout-logs` and `set-logs` for the plan owner's data. `WorkoutTracker` and `WorkoutPlansAccordion` gain a `showResults` prop — when true, logs are fetched client-side in read-only mode using the cookie for authorization. |
| 10 | + |
| 11 | +### Patch Changes |
| 12 | + |
| 13 | +- 9ec4638: Split `ExerciseCard` into sub-components (`ExerciseHeader`, `MetaLine`, `SeriesList`, `AddSetActions`), rename its `ex` prop to `exercise`, and use `sets.at(-1)`. |
| 14 | + |
| 15 | + Adopt a one-folder-per-component convention for feature components: every sub-component now lives in its own `components/{name}/` folder with an `index.ts` barrel (no flat sub-component files). Restructured `exercise-card`, `series-form`, and `workout-plans` accordingly. This is documented in the new `frontend-build-components` skill. |
| 16 | + |
| 17 | +- 1375bb9: Extract reusable UI components and split large workout components. |
| 18 | + |
| 19 | + Add two generic primitives in `components/ui`: `Alert` (error banner with an optional dismiss button, replacing inline `errorBannerClass` usage in login, series-form, and workout-tracker) and `Field` (label + control wrapper, replacing the inline label pattern in series-form, session-times, and the metric field router). |
| 20 | + |
| 21 | + Split `MetricFieldInput` into focused files (`DurationInput`, `BodyweightField`) so it becomes a thin branch router, and extract `ActiveContextBanner`, `MicrocyclePicker`, and `WorkoutPicker` out of `WorkoutPlansAccordion`. No behavior changes - markup and classes are preserved. |
| 22 | + |
| 23 | +- c695fab: Extract shared page-level UI components and tidy the frontend pages. |
| 24 | + |
| 25 | + Add `PageContainer`, `Logo`, and `PageHeader` (with `inline`/`stacked` layouts and a `right` slot) to `components/ui`, and use them across the home, login, and share pages. Extend `Field` to render a real `<label htmlFor>` and use it for the login inputs. |
| 26 | + |
| 27 | + Make the share page date locale-aware via `getFormatter` (instead of a hardcoded `pl-PL`), add an empty state with a new `share.noPlan` message, simplify the login submit cleanup with `finally`, and use a single conditional for the home empty state. |
| 28 | + |
| 29 | + Rename `WorkoutPlansAccordion` to `WorkoutPlans` (component, file, and folder) since it is no longer an accordion-specific abstraction. |
| 30 | + |
| 31 | +- 275c280: Refactor `lib/date` and `lib/metrics` for readability and consistency. |
| 32 | + |
| 33 | + `lib/date`: rename `fmt*` helpers to `format*` (`formatDuration`, `formatMinSec`, `formatSec`), document the local-timezone behavior of the ISO/input helpers, and make `pad2` accept `string | number`. Behavior changes: `combineDateTime` now returns `null` for an invalid date/time instead of throwing, and `formatDuration` returns `null` for a zero-length duration instead of `"0min"`. The seconds label in `formatMinSec` is now `"s"` to match `formatSec`. |
| 34 | + |
| 35 | + `lib/metrics`: extract a `unitFactor` helper to remove duplicated unit lookups, dedupe the bodyweight check in `metricBody`, add a clarifying note for the `'x'` placeholder in `isValidValue`, and reuse `PROTOCOL_LABEL` (with a new `Protocol` type) in `workoutGroupLabel` instead of hardcoded protocol names. |
| 36 | + |
| 37 | + Introduce `lib/metric-keys` with shared composite-field key helpers (`minKey`, `secKey`, `unitKey`, `BODYWEIGHT_KEY`) used by `metrics`, `series-form`, and `metric-field-input`, so the write and read sides of the form cannot drift apart. |
| 38 | + |
| 39 | +- f71ee34: Extend spec-writing skill with stack-specific compliance reviews. Split the Medusa-only compliance matrix into a universal dispatcher plus separate `compliance-review-medusa.md` and `compliance-review-payload.md` reference files. Update `SKILL.md` and `spec-template.md` to point to the correct file per project stack. |
| 40 | + |
3 | 41 | ## 1.0.1 |
4 | 42 |
|
5 | 43 | ### Patch Changes |
|
0 commit comments