fix(fitness): update slug + rename measureSlug → checkinSlug

Four pages had their own hardcoded `measureSlug = lang === 'en' ? 'measure' : 'messen'`
derived — all still pointing at the old route. Bumped the value to
check-in / erfassung and renamed the variable so future drift of
this kind is easier to grep for.

Affects links from:
- /fitness/check-in → body-parts card, inline "Edit all fields"
- body-parts flow → back / cancel navigation
- full-edit page → save / delete navigation
- /fitness/stats/history/[part] → "measure this now" CTA
This commit is contained in:
2026-04-23 14:31:41 +02:00
parent 934d0d981b
commit ebc59cbf6b
5 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "homepage",
"version": "1.46.10",
"version": "1.46.11",
"private": true,
"type": "module",
"scripts": {
@@ -16,7 +16,7 @@
);
const lang = $derived(detectFitnessLang($page.url.pathname));
const measureSlug = $derived(lang === 'en' ? 'measure' : 'messen');
const checkinSlug = $derived(lang === 'en' ? 'check-in' : 'erfassung');
import { getWorkout } from '$lib/js/workout.svelte';
import PeriodTracker from '$lib/components/fitness/PeriodTracker.svelte';
@@ -529,7 +529,7 @@
</div>
</div>
<a class="bp-card" href="/fitness/{measureSlug}/body-parts">
<a class="bp-card" href="/fitness/{checkinSlug}/body-parts">
<div class="bp-figure" aria-hidden="true">
<div class="muscle-base">{@html bpFrontSvg}</div>
<svg class="dot-overlay" viewBox="0 {BP_VIEW_TOP} 660.46 {BP_VIEW_H}" preserveAspectRatio="xMidYMid meet">
@@ -621,7 +621,7 @@
<span class="edit-unit">%</span>
</div>
<div class="edit-actions">
<a class="edit-more" href="/fitness/{measureSlug}/edit/{m._id}" aria-label={t('edit_measurement', lang)}>
<a class="edit-more" href="/fitness/{checkinSlug}/edit/{m._id}" aria-label={t('edit_measurement', lang)}>
<Pencil size={11} />
<span class="edit-more-label">{lang === 'en' ? 'Edit all fields' : 'Alle Felder bearbeiten'}</span>
<ChevronRight size={11} />
@@ -15,7 +15,7 @@
let { data } = $props();
const lang = $derived(detectFitnessLang($page.url.pathname));
const measureSlug = $derived(lang === 'en' ? 'measure' : 'messen');
const checkinSlug = $derived(lang === 'en' ? 'check-in' : 'erfassung');
/** @typedef {{ key: string, labelKey: string, img: string | null, paired: boolean, tipKey: string, dbSingle?: string, dbLeft?: string, dbRight?: string }} Step */
@@ -241,7 +241,7 @@
}
if (res.ok) {
toast.success(lang === 'en' ? 'Measurement saved' : 'Messung gespeichert');
await goto(`/fitness/${measureSlug}`);
await goto(`/fitness/${checkinSlug}`);
} else {
const err = await res.json().catch(() => null);
toast.error(err?.error ?? 'Failed to save measurement');
@@ -251,7 +251,7 @@
}
function exit() {
goto(`/fitness/${measureSlug}`);
goto(`/fitness/${checkinSlug}`);
}
// ----- Chart -----
@@ -9,7 +9,7 @@
import DatePicker from '$lib/components/DatePicker.svelte';
const lang = $derived(detectFitnessLang($page.url.pathname));
const measureSlug = $derived(lang === 'en' ? 'measure' : 'messen');
const checkinSlug = $derived(lang === 'en' ? 'check-in' : 'erfassung');
let { data } = $props();
// svelte-ignore state_referenced_locally
@@ -73,7 +73,7 @@
body: JSON.stringify(buildBody())
});
if (res.ok) {
await goto(`/fitness/${measureSlug}`);
await goto(`/fitness/${checkinSlug}`);
} else {
const err = await res.json().catch(() => null);
toast.error(err?.error ?? 'Failed to save measurement');
@@ -88,7 +88,7 @@
try {
const res = await fetch(`/api/fitness/measurements/${m._id}`, { method: 'DELETE' });
if (res.ok) {
await goto(`/fitness/${measureSlug}`);
await goto(`/fitness/${checkinSlug}`);
} else {
const err = await res.json().catch(() => null);
toast.error(err?.error ?? 'Failed to delete measurement');
@@ -9,7 +9,7 @@
const lang = $derived(detectFitnessLang($page.url.pathname));
const statsSlug = $derived(lang === 'en' ? 'stats' : 'statistik');
const measureSlug = $derived(lang === 'en' ? 'measure' : 'messen');
const checkinSlug = $derived(lang === 'en' ? 'check-in' : 'erfassung');
const card = $derived(data.card);
const historyAsc = $derived(
@@ -169,7 +169,7 @@
{#if !hasData}
<div class="empty">
<p>{t('no_measurements_yet', lang)}</p>
<a class="cta" href="/fitness/{measureSlug}/body-parts">
<a class="cta" href="/fitness/{checkinSlug}/body-parts">
<Ruler size={16} /> {t('measure_body_parts', lang)}
</a>
</div>