Commit Graph

685 Commits

Author SHA1 Message Date
Alexander 345d8110ec feat: add debug mode to Android build script
Adds a `debug` command that temporarily enables cleartext traffic and
points frontendDist at the local dev server, then restores release
config on exit via trap.
2026-03-26 10:05:59 +01:00
Alexander dd280aec08 fix: live-update GPS position marker and distance during tracking
- Make map variables reactive ($state) so effects fire when map initializes
- Split single effect into polyline update + marker/view tracking
- Marker now always follows latestPoint instead of staying at start position
- Reset prevTrackLen on GPS restart to avoid skipping points
- Hide marker until real GPS position arrives
- Round saved distance to nearest 10m to avoid long floating-point values
2026-03-26 10:05:41 +01:00
Alexander 47e85587dc feat: redesign GPS workout UI with Runkeeper-style map overlay
- Full-screen fixed map with controls overlaid at the bottom
- Activity type selector (running/walking/cycling/hiking) with proper
  exercise mapping for history display
- GPS starts immediately on entering workout screen for faster lock
- GPS track attached to cardio exercise (like GPX upload) so history
  shows distance, pace, splits, and map
- Add activityType field to workout state, session model, and sync
- Cancel button appears when workout is paused
- GPS Workout button only shown in Tauri app
2026-03-25 19:54:30 +01:00
Alexander 1a2ec40e7a feat: add TTS voice guidance during GPS-tracked workouts
Voice announcements run entirely in the Android foreground service
(works with screen locked). Configurable via web UI before starting
GPS: time-based or distance-based intervals, selectable metrics
(total time, distance, avg/split/current pace), language (en/de).

Also syncs workout pause/resume state to the native service — pausing
the workout timer now freezes the Android-side elapsed time, distance
accumulation, and TTS triggers.

Includes TTS engine detection with install prompt if none found, and
Android 11+ package visibility query for TTS service discovery.
2026-03-25 13:13:04 +01:00
Alexander d40a7fe7c5 fix: resolve all 58 TypeScript errors across codebase
- Add SvelteKit PageLoad/LayoutLoad/Actions types to recipe route files
- Fix possibly-undefined access on recipe.images, translations.en
- Fix parseFloat on number types in cospend split validation
- Use discriminated union guards for IngredientItem/InstructionItem
- Fix cache invalidation Promise<number> vs Promise<void> mismatch
- Suppress Mongoose model() complex union type error in WorkoutSession
2026-03-25 07:58:13 +01:00
Alexander 45bc9fca29 feat: add toast notification system, replace all alert() calls
Create shared toast store and Toast component mounted in root layout.
Wire toast.error() into all fitness API calls that previously failed
silently, and replace all alert() calls across recipes and cospend.
2026-03-25 07:40:52 +01:00
Alexander f80ddb7e78 fix: preserve GPS data when saving session edits
The PUT endpoint overwrote the exercises array with client data that
doesn't include gpsTrack/gpsPreview/totalDistance. Now merges existing
GPS data back into incoming exercises before saving.
2026-03-25 07:24:20 +01:00
Alexander a904a2bce8 fix: shorten dashboard labels to "Burned" and "Covered"
Values already include units (kcal, km), so verbose labels were redundant.
Remove unused distance_covered i18n key.
2026-03-25 07:18:57 +01:00
Alexander 22e0e90ea3 fix: preserve GPS data when recalculating workout sessions
Replace .save() with $set updateOne so only computed fields (totalVolume,
totalDistance, prs, gpsPreview) are written. Previously the full document
re-serialization could strip gpsTrack arrays.
2026-03-25 07:18:52 +01:00
Alexander 540c9ae2dd feat: add cardio PRs for longest distance and fastest pace by range
Track longestDistance and fastestPace PRs for cardio exercises with
activity-specific distance ranges: running (0-3, 3-7, 7-21.1, 21.1-42.2,
42.2+ km), swimming (0-0.4, 0.4-1.5, 1.5-5, 5-10, 10+ km), cycling
(0-15, 15-40, 40-100, 100-200, 200+ km), hiking (0-5, 5-15, 15-30,
30-50, 50+ km), rowing (0-2, 2-5, 5-10, 10-21.1, 21.1+ km).

Shared detection logic in cardioPrRanges.ts used by both session save
and recalculate endpoints. Display support in history detail and workout
completion summary.
2026-03-24 20:41:23 +01:00
Alexander 03f9194903 fix: persist and display Volume PRs in workout history
Volume PRs were calculated client-side in the workout summary but never
saved to the database, so they didn't appear in history detail pages.
Add bestSetVolume PR detection to both session save and recalculate
endpoints, and render the new type in the history detail view.
2026-03-24 20:31:18 +01:00
Alexander 17b7e1b29a remove Android CI workflow and Dockerfile
APK build and deploy is now handled by a local post-commit hook
using scripts/android-build-deploy.sh + rsync.
2026-03-24 20:25:17 +01:00
Alexander 97406962b1 fix: track Gradle wrapper in git so Docker build finds gradlew
The Gradle wrapper (gradlew, gradlew.bat, gradle/wrapper/) was
gitignored, causing the Docker APK build to fail with
"`gradlew` not found" since COPY doesn't include ignored files.
2026-03-24 19:06:08 +01:00
Alexander 72262adf83 fix: use rust:slim-trixie for JDK 21 and latest Rust, trim CI paths
- Switch to Debian Trixie base for native JDK 21 and latest Rust
- Remove Adoptium APT repo workaround
- Only trigger Android CI on src-tauri/ and build config changes
2026-03-24 18:48:08 +01:00
Alexander 4170845972 fix: use Adoptium APT repo for JDK 21 in Android Dockerfile
Bookworm only ships JDK 17. Add Adoptium's official APT repository
to install Temurin 21 via package manager.
2026-03-24 18:37:48 +01:00
Alexander 6357199b42 fix: stop GPS tracking on workout cancellation
The cancel button didn't stop the GPS foreground service, leaving it
running after the workout was dismissed.
2026-03-24 18:30:58 +01:00
Alexander f4398ddfe8 add Android app to README, CI workflow for APK builds
- README: add Fitness section with APK download link
- Dockerfile.android: containerized build with Rust, Android SDK/NDK,
  Java 21, Node 22, pnpm — builds and signs the APK
- CI workflow: builds APK in container on push, deploys to
  bocken.org/static/Bocken.apk via SCP
2026-03-24 18:29:38 +01:00
Alexander 31b5b68081 android: rich GPS notification with pace, request POST_NOTIFICATIONS
- Notification title: "Bocken — Tracking GPS for active Workout"
- Live updates with elapsed time, distance, and pace (min/km)
- Request POST_NOTIFICATIONS permission at runtime (Android 13+)
- Page titles: "- Fitness" → "- Bocken" (missed in prior commit)
2026-03-24 18:29:38 +01:00
Alexander d9f89239b7 rebrand app from Bocken Fitness to Bocken, track Android project
- Manifest: name/short_name → "Bocken", start_url → "/"
- Tauri: productName → "Bocken", identifier → org.bocken.app, url → "/"
- Cargo: package → bocken, lib → bocken_lib
- Page titles: "- Fitness" → "- Bocken" across all fitness routes
- Build script: auto-regenerate android project on identifier change
- Regenerate app icon from website favicon
- Track Android project source in git (ignore only build output/caches)
- Add native GPS foreground service and AndroidBridge for background
  location tracking (LocationForegroundService, AndroidBridge.kt)
- Add ACCESS_BACKGROUND_LOCATION permission for screen-off GPS
2026-03-24 18:29:38 +01:00
Alexander 68e3a3e1e9 fix: precache __data.json for offline client-side navigation
The fitness pages were only precaching HTML shells, but SvelteKit
client-side navigation fetches __data.json instead. Without these
cached, navigating to workout/training while offline would fail.
2026-03-23 22:28:39 +01:00
Alexander 1c8bdb5f30 fix: sync rest timer exercise/set indices across sessions
restExerciseIdx and restSetIdx were sent by the client but never
persisted server-side, so other sessions couldn't display which
exercise/set the rest timer belonged to.
2026-03-23 22:22:32 +01:00
Alexander 2ac7cdc9f7 fitness: match WorkoutFab rest timer style to active page RestTimer 2026-03-23 22:18:22 +01:00
Alexander 19ac60c6f2 fitness: add offline support with session queue and shell caching
Cache fitness page shells and data routes in the service worker so
pages load offline. Queue finished workouts in IndexedDB when the
POST fails and auto-flush them on reconnect. Show an offline banner
on the completion screen so the user knows their workout will sync.
2026-03-23 22:15:42 +01:00
Alexander 90d38d806d homepage: move docs to its previous place 2026-03-23 21:27:10 +01:00
Alexander 82b6d7c15f faith: fix typos in confiteor 2026-03-23 19:55:39 +01:00
Alexander fa8a0ccec4 homepage: move fitness page up on the page 2026-03-23 19:52:57 +01:00
Alexander 4579d5f76e fix: resolve Svelte a11y and reactivity build warnings 2026-03-23 17:45:27 +01:00
Alexander 81a1d25e5f android: enable offline sync and hide theme toggle in Tauri app
Detect Tauri via __TAURI__ in pwaStore so the offline recipe sync,
image caching, and auto-sync activate in the Android shell.
2026-03-23 17:38:29 +01:00
Alexander fa6e7c8d1f app: follow system theme, remove toggle 2026-03-23 17:37:04 +01:00
Alexander 927061d17d android: use bocken.org for production builds instead of local IP 2026-03-23 17:28:07 +01:00
Alexander 217ae764d9 android: fix duplicate plus icon and button contrast in dark mode
Remove Plus icon from Add Exercise button (translation already includes +).
Use --primary-contrast instead of hardcoded white for button text so it's
legible in dark mode (nord0 on dark, white on light).
2026-03-23 17:13:49 +01:00
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