From 8611275bca8d7ed1dfe471d93577c553b3f7d7b9 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 23 Apr 2026 13:45:16 +0200 Subject: [PATCH] =?UTF-8?q?feat(fitness/body-parts):=20"Same=20as=20last"?= =?UTF-8?q?=20button=20+=20larger=20Copy=20L=E2=86=92R=20pill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New "Same as last" pill below each step's stepper. Clicking fills the input(s) with the prior recorded value(s) — for paired steps in split mode, both L and R — and advances to the next step. Only rendered when a previous measurement exists; the placeholder already surfaces the exact number so the button text stays terse. - Copy L→R button resized to match the same-as-last pill (0.88 rem text, 0.55 × 1.1 rem padding) and given top margin. Unicode → swapped for a proper ArrowRight icon between L and R. - i18n: added `same_as_last` and split `copy_l_to_r` into `copy_l_to_r_before` / `copy_l_to_r_after` so each language keeps its natural wrapping around the arrow (EN "Copy L / R", DE "L / R übernehmen"). --- TODO.md | 3 +- package.json | 2 +- src/lib/js/fitnessI18n.ts | 3 + .../body-parts/+page.svelte | 65 +++++++++++++++++-- 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index e4271852..b2fd8f97 100644 --- a/TODO.md +++ b/TODO.md @@ -4,9 +4,10 @@ [x] on /fitness/measure, fill "Past measurements" in SSR only for the last 10 measurements. anything further should be fetched client side on mount to decreae initial page load time. use a "show more" button and paginate measurments. [x] on /fitness/measure (resp. their associated logging API routes), consolidate measurements by day. If we want to log another measurement, overwriting an old one, show a warning to indicate this. disparate measurements (e.g., weight and bodyfat) should not show this warning but simply be merged into one log entry for that day. [x] on /fitness/measure in the past measurments tab, show more than "Body measurements only" if we don't have Bodyweight logged. we can be a bit more elaborate in our syntax here tbh. -[ ] add a button on /fitness/measure/body-parts for each measurement directly below to say "Same value", instead of having to hit +, then - to lock in same number +[x] add a button on /fitness/measure/body-parts for each measurement directly below to say "Same value", instead of having to hit +, then - to lock in same number [ ] BF graph (with trend line like weight graph) on /fitness/stats page. Emphasize relative changes, not absolute numbers in design (as we cannot trust those) (e.g., use start day of overview as 0% and then show +/- x % on the graph) [ ] Workshop better names than "Measure" for the /fitness/measure route. It's about body data points (i.e., non-food related). What's a better, short name than "Measure" to capture the logging of weight, body composition, body part measurements, and period tracking? +[ ] on /fitness/stats/histoy/ for body measurement graphs, make the range reasonable. e.g., if we have 1 cm change, do not fill the entire y-height with 1 cm. Use reasonable padding for low ranges (i think we do something like htis already on the weight graph?) ## Refactor Recipe Search Component diff --git a/package.json b/package.json index ebd55080..7f0b63b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homepage", - "version": "1.46.5", + "version": "1.46.6", "private": true, "type": "module", "scripts": { diff --git a/src/lib/js/fitnessI18n.ts b/src/lib/js/fitnessI18n.ts index ec54a143..676b6737 100644 --- a/src/lib/js/fitnessI18n.ts +++ b/src/lib/js/fitnessI18n.ts @@ -292,6 +292,8 @@ const translations: Translations = { exit: { en: 'Exit', de: 'Schlie\u00dfen' }, same_both_sides: { en: 'Same on both sides', de: 'Auf beiden Seiten gleich' }, copy_l_to_r: { en: 'Copy L \u2192 R', de: 'L \u2192 R \u00fcbernehmen' }, + copy_l_to_r_before: { en: 'Copy L', de: 'L' }, + copy_l_to_r_after: { en: 'R', de: 'R \u00fcbernehmen' }, kbd_nav: { en: 'nav', de: 'Navigation' }, kbd_next: { en: 'next', de: 'weiter' }, kbd_skip: { en: 'skip', de: 'auslassen' }, @@ -319,6 +321,7 @@ const translations: Translations = { de: 'Für dieses Datum sind bereits Werte erfasst: {fields}. Überschreiben?' }, overwrite_confirm: { en: 'Overwrite', de: 'Überschreiben' }, + same_as_last: { en: 'Same as last', de: 'Wie zuletzt' }, // SetTable set_header: { en: 'SET', de: 'SATZ' }, diff --git a/src/routes/fitness/[measure=fitnessMeasure]/body-parts/+page.svelte b/src/routes/fitness/[measure=fitnessMeasure]/body-parts/+page.svelte index 9f780cb7..aca71cc5 100644 --- a/src/routes/fitness/[measure=fitnessMeasure]/body-parts/+page.svelte +++ b/src/routes/fitness/[measure=fitnessMeasure]/body-parts/+page.svelte @@ -1,7 +1,7 @@