Commit Graph

654 Commits

Author SHA1 Message Date
Alexander f3f5145081 android: native GPS tracking with foreground service for screen-off support
Move GPS collection from WebView JS (watchPosition) to native Android
LocationForegroundService, which survives screen-off. JS polls native
side for accumulated points. Also: auto-enable GPS for cardio exercises,
filter saved track to workout duration only, fix live map batch updates,
notification tap opens active workout, and fix build script for pnpm.
2026-03-23 17:05:15 +01:00
Alexander e7ffc3d454 android: add Tauri v2 shell with GPS tracking for cardio workouts
Wraps the web app in a Tauri Android shell that provides native GPS
via the geolocation plugin. Includes foreground service for background
tracking, live map display, GPS data storage in workout sessions,
and route visualization in workout history.
2026-03-23 17:03:14 +01:00
Alexander 77e2d8118f fitness: add speed-based MET tables for swimming and rowing kcal estimation
Add SWIMMING_METS and ROWING_METS lookup tables from Ainsworth
Compendium for speed-based calorie estimation when distance+duration
are available. Add per-exercise flat-rate fallbacks (FLAT_RATE map)
instead of hardcoded if/else chains.
2026-03-23 12:37:06 +01:00
Alexander c91abe065d fitness: improve workouts chart with goal line, max bar width, and full 10-week range
Add weekly goal as a solid horizontal line on the bar chart via a
custom Chart.js plugin. Cap bar width at 40px. Always show all 10
weeks including empty ones instead of trimming leading zeros.
2026-03-23 12:35:50 +01:00
Alexander 5e16e41f4f fitness: add cardio kcal estimation with Minetti/Ainsworth models
Add cardioKcalEstimate.ts implementing tiered calorie estimation for
cardio exercises: Minetti gradient-dependent polynomials for GPS
run/walk/hike, cycling physics model, MET-based fallbacks from
Ainsworth Compendium, and flat-rate estimates. Wire cardio kcal into
SessionCard, workout completion screen, history detail, and stats
overview API alongside existing strength kcal (Lytle). Move citation
info from stats overview to clickable DOI links on workout detail
kcal pill.
2026-03-23 12:26:19 +01:00
Alexander 8fda2a6cfb fitness: add streak aura with fire and lightning effects on stats page
Separate streak counter from stat tiles into its own component with
animated aura effects: glow (1w), particles (2w), fire (3w), and
fire + lightning bolts (6/12/24w). Fire animations tuned for energetic
workout feel with faster durations and upward-anchored scaling.
On desktop, streak sits beside the workouts chart; on mobile, above it.
2026-03-23 12:25:51 +01:00
Alexander ac6364ae28 fitness: add kcal estimation based on Lytle et al. (2019) regression model
Estimate strength workout energy expenditure using the Lytle et al. multiple
linear regression model. Maps all 77 exercises to 7 studied categories with
confidence levels. Shows kcal on stats page (cumulative), session cards,
workout detail, and workout completion screen. Supports sex/height demographics
via profile section on measure page. Includes info tooltip with DOI reference.
2026-03-23 10:23:06 +01:00
Alexander b42a8340ef replace ß with ss for Swiss High German throughout codebase 2026-03-23 07:46:42 +01:00
Alexander ee8cc8ec20 fitness: add German translations for all 77 exercises
Add per-exercise de property with translated name and instructions.
Add shared term translation map for bodyPart, equipment, target, and
muscle names. Add localizeExercise() and translateTerm() helpers.
Update all display components to use localized fields (localName,
localBodyPart, localEquipment, etc.) and pass lang to search/lookup.
2026-03-23 07:44:35 +01:00
Alexander 80479c0312 fitness: add weekly workout goal with streak counter on stats page
Store a per-user weekly workout target (1-14) in a new FitnessGoal model.
Compute consecutive-week streak from WorkoutSession history via a new
/api/fitness/goal endpoint. Display streak as a 4th lifetime card on the
stats page with an inline goal editor modal.
2026-03-22 21:56:54 +01:00
Alexander 0fae3d6d14 fitness: add bilingual EN/DE support for all fitness routes and components
Use SvelteKit param matchers for bilingual URL routing (e.g. /fitness/stats
and /fitness/statistik). Add centralized i18n module with translation
dictionary, language detection from URL, and path conversion utilities.
Translate all UI text across pages, components, and navigation.
2026-03-22 21:25:03 +01:00
Alexander 32b0b369f5 fitness: add page titles to all fitness routes 2026-03-22 21:00:04 +01:00
Alexander c4301893b7 fitness: restart rest timer when completing a new set while one is running 2026-03-22 19:54:02 +01:00
Alexander 6436a214d3 fitness: add RPE input to template editor 2026-03-22 19:48:48 +01:00
Alexander bc6096b44e fitness: move workout controls to FAB, track rest timer position in store 2026-03-22 19:44:25 +01:00
Alexander 60c378f23a fitness: rest timer dark styling, wider weight input, hide spinners, shorten PREV header 2026-03-22 19:37:19 +01:00
Alexander 1c6594e814 fitness: more space for map-preview 2026-03-22 15:54:03 +01:00
Alexander 6f3512d7cf fitness: add exercise reorder buttons in template editor and active workout 2026-03-21 16:46:42 +01:00
Alexander 7534b8151f fitness: move add-template to header, remove FAB, fix dark mode contrast
- Replace floating action button with a subdued + icon in the templates
  header row next to the Schedule button
- Use --primary-contrast (white/nord0) instead of hardcoded white for
  text on primary-colored backgrounds so dark mode has proper contrast
- Respect data-theme="light"/"dark" attrs in addition to prefers-color-scheme
2026-03-21 10:59:49 +01:00
Alexander 3505f2fa01 fitness: add workout schedule rotation with next-workout suggestion
Users can define a custom order of templates (e.g., Push → Pull → Legs).
Based on the last completed session, the next workout in rotation is
recommended via a prominent banner and the floating action button.

- New WorkoutSchedule MongoDB model (per-user template order)
- GET/PUT /api/fitness/schedule API endpoints
- Schedule editor modal with reorder and add/remove
- Action button starts next scheduled workout when schedule exists
2026-03-21 10:53:44 +01:00
Alexander e189379d55 fitness: rename to "Fitness" on homepage 2026-03-21 10:40:32 +01:00
Alexander 25146861a7 fitness: offer to update template with new weights/reps on workout completion
When finishing a template-based workout, compares completed sets against
the source template. If weights, reps, or set counts differ, shows a
visual diff with old→new values and a button to update the template,
letting templates grow with the user's strength progression.
2026-03-21 09:44:44 +01:00
Alexander 456dc19a66 fitness: fix template edit validation and allow empty sets
- Validate exerciseId instead of name (templates use exerciseId, not name)
- Remove mandatory reps minimum from template sets
- Allow exercises with empty sets in schema and API validation
2026-03-21 09:39:32 +01:00
Alexander f8daf7f295 fix: cache auth session on locals to prevent cookies.set after response
The authorization hook already calls locals.auth() which can set cookies.
Layout server loads calling auth() again caused a race where cookies.set()
fired after the response started streaming. Now the hook stashes the session
on locals.session and all layouts reuse it.
2026-03-20 16:28:31 +01:00
Alexander 386c0b7ddb fitness: fix workout name input losing characters during sync
Decouple name input from live sync by using a local variable that only
commits to workout state on blur/Enter. Remote name updates are applied
only when the input is not focused, preventing the sync layer from
overwriting in-progress edits.
2026-03-20 16:21:08 +01:00
Alexander da0aed2f44 fitness: theme-reactive chart colors, bar outline fix, and stats label polish
- Stats and exercise pages: chart colors adapt to light/dark theme reactively
- FitnessChart: remove bar outline (borderWidth 0 for bar type)
- Stats: workouts icon/card use --color-primary, plural-aware label, rename labels
2026-03-20 15:46:08 +01:00
Alexander 014640d82b fitness: fix GPS preview aspect ratio, theme-reactive colors, and UI polish
- SessionCard SVG: cosine-corrected coordinates with proper aspect ratio (xMidYMid meet)
- SessionCard: use --color-primary for track/distance/pace, add Gauge icon for pace
- History detail: theme-reactive pace chart colors via MutationObserver + matchMedia
- History detail: add Gauge icon, accent color for distance/pace stats, remove "avg" label
- Move GPS remove button from info view to edit screen
- Add Leaflet map preview to edit screen
- Remove data points count from GPS indicators
2026-03-20 14:59:31 +01:00
Alexander 3778f53115 fitness: disable chart grow-in animation, add trendlines to exercise charts
Disable initial animation on all Chart.js charts (FitnessChart and
cospend BarChart) while keeping transition animations for interactions.
Add linear regression trendline with ±1σ uncertainty bands to exercise
charts (Est. 1RM, Max Weight, Total Volume).
2026-03-20 13:44:04 +01:00
Alexander d1527b2572 fitness: add GPX upload with map, pace chart, and km splits
Add GPX file upload for cardio exercises in workout history. Parses
GPX track points and stores them in the session. Shows route map
(Leaflet), pace-over-distance chart (Chart.js), and per-km splits
table with color-coded fast/slow pacing. Auto-fills distance and
duration on single-set exercises. Disables Chart.js animations.
2026-03-20 13:30:52 +01:00
Alexander d1e5fb375d fitness: add workout completion summary with PR detection
Show summary screen after finishing a workout instead of immediately
redirecting. Displays duration, tonnage, distance, per-exercise stats
(pace, e1RM, top weight), and detected PRs compared to previous session.
2026-03-20 07:14:24 +01:00
Alexander 401028edd2 fitness: make recorded measurements editable with history list
Show measurement history with edit/delete per entry. Editing reuses the
add form pre-filled with existing values and saves via PUT.
2026-03-20 07:00:57 +01:00
Alexander fa3c40d6de fitness: require authentication for all fitness routes 2026-03-20 06:53:06 +01:00
Alexander aec1d54841 fitness: add inline rest timer, set removal, previous set improvements, and session editing
Redesign rest timer as inline bar with linear decay placed after completed set.
Add set removal (X button), @ separator column for RPE, and N/A for missing
previous values. Enable editing past workouts (date, duration, exercises, sets)
from the history detail page.
2026-03-20 06:50:23 +01:00
Alexander de55e51301 fitness: add per-exercise metrics, cardio support, and stats page
- Add metrics system (weight/reps/rpe/distance/duration) per exercise type
  so cardio exercises show distance+duration instead of weight+reps
- Add 8 new cardio exercises: swimming, hiking, rowing outdoor, cycling
  outdoor, elliptical, stair climber, jump rope, walking
- Add bilateral flag to dumbbell exercises for accurate tonnage calculation
- Make SetTable, SessionCard, history detail, template editor, and exercise
  stats API all render/compute dynamically based on exercise metrics
- Rename Profile to Stats with lifetime cards: workouts, tonnage, cardio km
- Move route /fitness/profile -> /fitness/stats, API /stats/profile -> /stats/overview
2026-03-19 18:57:52 +01:00
Alexander 2deb2c6c09 add fzf-style fuzzy search to exercises, recipes, and prayers
Replace substring matching with a shared fuzzy scorer that matches
characters in order (non-contiguous) with bonuses for consecutive
and word-boundary hits. Results are ranked by match quality.
2026-03-19 10:10:38 +01:00
Alexander 620b955ea2 fitness: fix duration display treating minutes as seconds
The DB stores duration in minutes but formatDuration was dividing
by 3600/60 as if receiving seconds, always showing 0m.
2026-03-19 09:46:25 +01:00
Alexander dff67c7059 fitness: add multi-device workout sync via SSE and rest timer improvements
Enables real-time workout synchronization across devices using
Server-Sent Events and an ephemeral MongoDB document (24h TTL).
Rest timers now use absolute timestamps instead of interval-based
countdown for accurate cross-device sync. Adds +/-30s rest timer
adjust buttons.
2026-03-19 09:44:24 +01:00
Alexander 620687f8f3 fitness: limit workouts-per-week chart to 10 weeks and trim empty leading weeks
Reduce the chart window from 12 to 10 weeks and trim leading weeks
with zero workouts so the chart starts from the first week with data.
2026-03-19 09:14:47 +01:00
Alexander 2fdfa2df6a fitness: fix light/dark theme with semantic CSS variables
Replace hardcoded Nord color references with semantic CSS variables
across all fitness components and pages. Use --color-primary instead
of --nord8 for interactive elements (auto-switches between --nord10
in light mode and --nord8 in dark mode). Change RPE color from
--nord13 (yellow) to --nord12 (orange) for better light mode contrast.
Fix mobile responsiveness on measure page form inputs.
2026-03-19 09:08:30 +01:00
Alexander cd7b1e21f2 fitness: fix type errors, hydration warning, and add gym link
- Add exerciseId to WorkoutSession model (interface + schema)
- Fix button-in-button hydration warning in TemplateCard (use div)
- Expand FitnessChart dataset type to include all Chart.js properties
- Fix getTime type error in session update with proper cast
- Fix weight nullable type in profile stats with non-null assertion
- Fix $or query typing in templates list endpoint
- Re-add gym link on homepage pointing to /fitness
2026-03-19 08:42:51 +01:00
Alexander 0618cf7f73 homepage: re-add gym link pointing to /fitness
Re-introduce the dumbbell SVG icon and "Gym" link that previously
pointed to health.bocken.org, now linking to the internal /fitness route.
2026-03-19 08:35:46 +01:00
Alexander 1228677498 fitness: add 5 default workout templates and new exercises
Add all 5 PPL+Upper/Lower templates matching the target split,
with Day 3 (Legs) adjusted to include Bulgarian split squats and
standing calf raises, and Day 5 (Lower) reworked with front squats,
hip thrusts, and goblet squats — all equipment-free of machines.

Also adds incline row, decline crunch, flat leg raise, and nordic
hamstring curl to the exercise list, and updates the WorkoutTemplate
model to use exerciseId instead of name for exercise references.
2026-03-19 08:32:41 +01:00
Alexander c5e3719a0c fitness: add complete fitness tracker frontend
- 5-tab layout (Profile, History, Workout, Exercises, Measure) with shared header nav
- Workout system: template CRUD, active workout on /fitness/workout/active with localStorage persistence, pause/resume timer, rest timer, RPE input
- Shared workout singleton (getWorkout) so active workout state is accessible across all fitness routes
- Floating workout FAB indicator on all /fitness routes when workout is active
- AddActionButton component for button-based FABs (measure + template creation)
- Profile page with workouts-per-week bar chart and weight line chart with SMA trend line + ±1σ confidence band
- Exercise detail with history, charts, and records tabs using static exercise data
- Session history with grouped-by-month list, session detail with stats/PRs
- Body measurements with latest values, body part display, add form
- Card styling matching rosary/prayer route patterns (accent-dark, nord5 light, box-shadow, hover lift)
- FitnessChart: fix SSR hang by moving Chart.register to client-side, remove redundant $effect
- Exercise API: use static in-repo data instead of empty MongoDB collection
- Workout finish: include exercise name for WorkoutSession model validation
2026-03-19 08:17:55 +01:00
Alexander 28d5f4b0a0 recipes: fix filter panel on category, tag, and favorites pages
Search component needs access to all recipes to filter across
categories/tags/etc. Previously these pages only passed their
pre-filtered subset, so selecting additional filters yielded
no results. Now each page fetches allRecipes in parallel and
passes it to Search, falling back to the route-specific subset
when no filters are active.
2026-03-10 10:36:24 +01:00
Alexander 202c2c749b readme: add features overview and clean up completed TODOs 2026-03-10 10:29:54 +01:00
Alexander 482de5d589 recipes: pass lang prop to LanguageSelector for no-JS support 2026-03-10 10:27:02 +01:00
Alexander d24c4b6633 rosary: fix missing space after comma in painting caption 2026-03-10 10:26:49 +01:00
Alexander dcc8403d78 pwa: fix offline caching for prayer/faith routes
The glob in sync.ts targeted a nonexistent /src/routes/glaube/ directory
instead of the actual [faithLang=faithLang] parameterized route. This meant
zero prayer pages were ever precached for offline use.

- Fix glob to match [faithLang=faithLang] and expand param segments to
  both language variants (glaube/faith, gebete/prayers, rosenkranz/rosary)
- Extract validPrayerSlugs to shared module for build-time route enumeration
- Add faith to service worker cacheable route regex
2026-03-09 17:49:32 +01:00
Alexander 23bd5a55ee rosary: fix mystery image timing and SVG container clipping
Show first mystery image at the Pater Noster instead of the Gloria Patri
by removing the early lbead2 trigger. Fix IntersectionObserver to prefer
the topmost intersecting entry so short _pater sections aren't skipped.
Use full viewport height (100dvh) for the SVG container to prevent
clipping at edges.
2026-03-08 20:46:07 +01:00
Alexander df34ed0628 searxng: add Nord theme and deploy script
Override SearXNG's native CSS variables with Nord palette (cream white
light mode, true black dark mode). Replace SearXNG logo with Bocken
logo. Custom base.html template injects the CSS. Deploy script supports
reset to restore original state.
2026-03-08 20:33:26 +01:00