feat(fitness): rename Measure route to Check-in / Erfassung (NotebookPen icon)
CI / update (push) Successful in 3m47s
CI / update (push) Successful in 3m47s
Route slugs and nav label rename only — storage, API endpoints (`/api/fitness/measurements`), and the `BodyMeasurement` Mongo model keep their technical names. - `/fitness/measure` → `/fitness/check-in` (EN) - `/fitness/messen` → `/fitness/erfassung` (DE) - Folder `[measure=fitnessMeasure]` → `[checkin=fitnessCheckIn]` (git rename; history preserved). - Param matcher `fitnessMeasure.ts` → `fitnessCheckIn.ts`, accepts `check-in` / `erfassung`. - `fitnessSlugs(lang).measure` and `fitnessLabels(lang).measure` code keys are unchanged — value returns "check-in"/"erfassung" and "Check-in"/"Erfassung" respectively, so no call site needs touching. - slugMap language-detection updated to `erfassung ↔ check-in`. - Service-worker cache list + the layout regex that gates the wider content width now reference the new slugs. - Nav icon swapped from `Ruler` to `NotebookPen` — reads as "logging entries" and spans weight / composition / period better. Bookmarks on the old URLs will 404; no redirect added.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
[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.
|
||||
[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
|
||||
[x] 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?
|
||||
[x] 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/<part> 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
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homepage",
|
||||
"version": "1.46.7",
|
||||
"version": "1.46.8",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/** Fitness route i18n — slug mappings and UI translations */
|
||||
|
||||
const slugMap: Record<string, Record<string, string>> = {
|
||||
en: { statistik: 'stats', verlauf: 'history', training: 'workout', aktiv: 'active', uebungen: 'exercises', messen: 'measure', ernaehrung: 'nutrition' },
|
||||
de: { stats: 'statistik', history: 'verlauf', workout: 'training', active: 'aktiv', exercises: 'uebungen', measure: 'messen', nutrition: 'ernaehrung' }
|
||||
en: { statistik: 'stats', verlauf: 'history', training: 'workout', aktiv: 'active', uebungen: 'exercises', erfassung: 'check-in', ernaehrung: 'nutrition' },
|
||||
de: { stats: 'statistik', history: 'verlauf', workout: 'training', active: 'aktiv', exercises: 'uebungen', 'check-in': 'erfassung', nutrition: 'ernaehrung' }
|
||||
};
|
||||
|
||||
const germanSlugs = new Set(Object.keys(slugMap.en));
|
||||
@@ -31,7 +31,7 @@ export function fitnessSlugs(lang: 'en' | 'de') {
|
||||
workout: lang === 'en' ? 'workout' : 'training',
|
||||
active: lang === 'en' ? 'active' : 'aktiv',
|
||||
exercises: lang === 'en' ? 'exercises' : 'uebungen',
|
||||
measure: lang === 'en' ? 'measure' : 'messen',
|
||||
measure: lang === 'en' ? 'check-in' : 'erfassung',
|
||||
nutrition: lang === 'en' ? 'nutrition' : 'ernaehrung'
|
||||
};
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export function fitnessLabels(lang: 'en' | 'de') {
|
||||
history: lang === 'en' ? 'History' : 'Verlauf',
|
||||
workout: lang === 'en' ? 'Workout' : 'Training',
|
||||
exercises: lang === 'en' ? 'Exercises' : 'Übungen',
|
||||
measure: lang === 'en' ? 'Measure' : 'Messen',
|
||||
measure: lang === 'en' ? 'Check-in' : 'Erfassung',
|
||||
nutrition: lang === 'en' ? 'Nutrition' : 'Ernährung'
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ParamMatcher } from '@sveltejs/kit';
|
||||
|
||||
export const match: ParamMatcher = (param) => {
|
||||
return param === 'measure' || param === 'messen';
|
||||
return param === 'check-in' || param === 'erfassung';
|
||||
};
|
||||
@@ -4,7 +4,7 @@
|
||||
import Header from '$lib/components/Header.svelte';
|
||||
import UserHeader from '$lib/components/UserHeader.svelte';
|
||||
import LanguageSelector from '$lib/components/LanguageSelector.svelte';
|
||||
import { BarChart3, Clock, Dumbbell, ListChecks, Ruler, UtensilsCrossed } from '@lucide/svelte';
|
||||
import { BarChart3, Clock, Dumbbell, ListChecks, NotebookPen, UtensilsCrossed } from '@lucide/svelte';
|
||||
import { getWorkout } from '$lib/js/workout.svelte';
|
||||
import { getWorkoutSync } from '$lib/js/workoutSync.svelte';
|
||||
import WorkoutFab from '$lib/components/fitness/WorkoutFab.svelte';
|
||||
@@ -27,7 +27,7 @@
|
||||
const slugs = [
|
||||
'workout', 'training', 'workout/active', 'training/aktiv',
|
||||
'exercises', 'uebungen', 'stats', 'statistik',
|
||||
'history', 'verlauf', 'measure', 'messen',
|
||||
'history', 'verlauf', 'check-in', 'erfassung',
|
||||
'nutrition', 'ernaehrung'
|
||||
];
|
||||
const urls = slugs.map((s) => `/fitness/${s}`);
|
||||
@@ -69,7 +69,7 @@
|
||||
!$page.url.pathname.startsWith(`/fitness/${s.nutrition}/meals`)
|
||||
);
|
||||
const isMeasureIndex = $derived(
|
||||
/^\/fitness\/(measure|messen)\/?$/.test($page.url.pathname)
|
||||
/^\/fitness\/(check-in|erfassung)\/?$/.test($page.url.pathname)
|
||||
);
|
||||
/** @param {number} secs */
|
||||
function formatElapsed(secs) {
|
||||
@@ -86,7 +86,7 @@
|
||||
<li style="--active-fill: var(--nord13)"><a href="/fitness/{s.history}" class:active={isActive(`/fitness/${s.history}`)}><Clock size={16} strokeWidth={1.5} class="nav-icon" /><span class="nav-label">{labels.history}</span></a></li>
|
||||
<li style="--active-fill: var(--nord8)"><a href="/fitness/{s.workout}" class:active={isActive(`/fitness/${s.workout}`)}><Dumbbell size={16} strokeWidth={1.5} class="nav-icon" /><span class="nav-label">{labels.workout}</span></a></li>
|
||||
<li style="--active-fill: var(--nord14)"><a href="/fitness/{s.exercises}" class:active={isActive(`/fitness/${s.exercises}`)}><ListChecks size={16} strokeWidth={1.5} class="nav-icon" /><span class="nav-label">{labels.exercises}</span></a></li>
|
||||
<li style="--active-fill: var(--nord12)"><a href="/fitness/{s.measure}" class:active={isActive(`/fitness/${s.measure}`)}><Ruler size={16} strokeWidth={1.5} class="nav-icon" /><span class="nav-label">{labels.measure}</span></a></li>
|
||||
<li style="--active-fill: var(--nord12)"><a href="/fitness/{s.measure}" class:active={isActive(`/fitness/${s.measure}`)}><NotebookPen size={16} strokeWidth={1.5} class="nav-icon" /><span class="nav-label">{labels.measure}</span></a></li>
|
||||
<li style="--active-fill: var(--nord15)"><a href="/fitness/{s.nutrition}" class:active={isActive(`/fitness/${s.nutrition}`)}><UtensilsCrossed size={16} strokeWidth={1.5} class="nav-icon" /><span class="nav-label">{labels.nutrition}</span></a></li>
|
||||
</ul>
|
||||
{/snippet}
|
||||
|
||||
Reference in New Issue
Block a user