From 5fd8027d3ecfc122737c07050b4cbc2a5a812297 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sun, 10 May 2026 14:56:12 +0200 Subject: [PATCH] feat(fitness): label finish button "FINISH EARLY" with unfinished sets Switches the active-workout finish button to "FINISH EARLY" / "VORZEITIG BEENDEN" with an orange tint when any set in the workout is still incomplete, so users can tell at a glance whether they're wrapping up cleanly or cutting it short. --- package.json | 2 +- src/lib/i18n/fitness/de.ts | 1 + src/lib/i18n/fitness/en.ts | 1 + .../[active=fitnessActive]/+page.svelte | 12 +++++++++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1829975a..47688550 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homepage", - "version": "1.69.4", + "version": "1.69.5", "private": true, "type": "module", "scripts": { diff --git a/src/lib/i18n/fitness/de.ts b/src/lib/i18n/fitness/de.ts index 5ca67b6e..d39630a4 100644 --- a/src/lib/i18n/fitness/de.ts +++ b/src/lib/i18n/fitness/de.ts @@ -98,6 +98,7 @@ export const de = { workout_name_placeholder: "Trainingsname", cancel_workout: "TRAINING ABBRECHEN", finish: "BEENDEN", + finish_early: "VORZEITIG BEENDEN", new_set_added: "neuer Satz", new_sets_added: "neue Sätze", exercises_title: "Übungen", diff --git a/src/lib/i18n/fitness/en.ts b/src/lib/i18n/fitness/en.ts index 3b8104ea..b14e502c 100644 --- a/src/lib/i18n/fitness/en.ts +++ b/src/lib/i18n/fitness/en.ts @@ -98,6 +98,7 @@ export const en = { workout_name_placeholder: "Workout name", cancel_workout: "CANCEL WORKOUT", finish: "FINISH", + finish_early: "FINISH EARLY", new_set_added: "new set", new_sets_added: "new sets", exercises_title: "Exercises", diff --git a/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte b/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte index bd079c88..aea9a134 100644 --- a/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte +++ b/src/routes/fitness/[workout=fitnessWorkout]/[active=fitnessActive]/+page.svelte @@ -97,6 +97,7 @@ const workoutSetsTotal = $derived( workout.exercises.reduce((/** @type {number} */ n, /** @type {any} */ ex) => n + ex.sets.length, 0) ); + const hasUnfinishedSets = $derived(workoutSetsTotal > 0 && workoutSetsDone < workoutSetsTotal); /** @param {number} idx */ function setFocus(idx) { focusedIdx = idx; } @@ -1770,7 +1771,9 @@ - + @@ -2132,6 +2135,13 @@ .finish-btn:active { transform: scale(0.98); } + .finish-btn.premature { + background: var(--orange); + color: var(--nord0); + } + .finish-btn.premature:hover { + background: color-mix(in srgb, var(--orange) 85%, var(--nord0)); + } /* GPS section */ .gps-section {