Commit Graph

716 Commits

Author SHA1 Message Date
d462a6ae1b fix: nutrition coverage double-counting excluded ingredients
Excluded (manually disregarded) ingredients were incrementing the total
count twice — once in the loop body and again in the exclusion check —
deflating the displayed coverage percentage.
2026-04-03 09:00:27 +02:00
88f3909634 chore: Svelte 5 syntax updates, a11y fixes, and dead CSS removal
All checks were successful
CI / update (push) Successful in 4m29s
Replace deprecated svelte:component with direct component invocation,
use span instead of label for non-input controls with role="group",
remove unused imports and dead CSS rules.
2026-04-03 08:44:36 +02:00
8a14230d00 nutrition: use SvelteKit read() for embedding files instead of fs
Some checks failed
CI / update (push) Has been cancelled
Replace fragile CWD-based readFileSync path resolution with SvelteKit's
read() + Vite ?url asset imports. This lets the build system manage the
embedding files as hashed immutable assets, fixing ENOENT errors in
production where the working directory didn't match expectations.
2026-04-03 08:43:12 +02:00
f386032716 fitness: use server-computed PRs on workout summary screen
All checks were successful
CI / update (push) Successful in 3m36s
The summary screen was comparing against only the last session
(limit=1), showing false PRs when you beat last time but not your
all-time best. Now uses the server-computed PRs and kcal from the
save response, which compare against the best from 50 sessions.
2026-04-03 08:31:45 +02:00
eda8502568 fitness: compute kcal server-side and store in session document
All checks were successful
CI / update (push) Successful in 3m43s
Previously kcal was computed on-the-fly in 3 places with inconsistent
inputs (hardcoded 80kg, missing GPS data, no demographics). Now a
shared computeSessionKcal() helper runs server-side using the best
available method (GPS + real demographics) and stores the result in
a new kcalEstimate field on WorkoutSession.

Kcal is recomputed on save, recalculate, GPX upload, and GPX delete.
The stats overview uses stored values with a legacy fallback for
sessions saved before this change.
2026-04-03 08:24:45 +02:00
cee20f6bb3 fitness: improve weight SMA with lookback and partial-window scaling
All checks were successful
CI / update (push) Successful in 3m54s
Fetch up to 6 extra measurements beyond the display limit so the SMA
window is fully populated from the first displayed point. For users
with fewer total measurements, use a reduced window with Bessel's
correction and sqrt(w/k) sigma scaling to reflect increased uncertainty.
2026-04-02 22:24:28 +02:00
eda87a8231 chore: remove dead migration and one-off scripts 2026-04-02 21:11:36 +02:00
433477e2c6 nutrition: fix embedding file paths for production and copy to dist
All checks were successful
CI / update (push) Successful in 4m42s
resolve() uses CWD which in production (adapter-node) is dist/, not the
project root. Detect the correct data directory at startup and add a
postbuild step to copy the embedding JSON files into dist/data/.
2026-04-02 21:08:54 +02:00
61336823b3 nutrition: pre-download HuggingFace models at build time
All checks were successful
CI / update (push) Successful in 4m26s
The deployment server couldn't fetch transformer models at runtime due to
restricted network access and permission errors writing to node_modules.
Add a prebuild script to download models during build and document
TRANSFORMERS_CACHE env var for configuring a shared writable cache path.
2026-04-02 20:47:10 +02:00
7935ac6b75 theming: migrate cospend to semantic CSS variables, extract SaveFab, refactor measure page
All checks were successful
CI / update (push) Successful in 4m21s
Replace hardcoded Nord colors with semantic CSS variables across all cospend
pages and shared components (FormSection, ImageUpload, SplitMethodSelector,
UsersList, PaymentModal, BarChart). Remove all dark mode override blocks.
Make BarChart font colors theme-reactive via isDark() + MutationObserver.

Extract reusable SaveFab component and use it on recipe edit and all cospend
edit/add pages. Remove Cancel buttons and back links in favor of browser
navigation. Replace raw checkboxes with Toggle component.

Move fitness measurement add/edit forms to separate routes with SaveFab.
Collapse profile section (sex/height) by default on the measure page.

Document theming rules in CLAUDE.md for future reference.
2026-04-02 20:38:33 +02:00
4f77f29a27 Merge branch 'recipes-calories'
All checks were successful
CI / update (push) Successful in 4m37s
recipes: nutrition calculator with BLS/USDA matching, manual overwrites, and skip

Dual-source nutrition system using BLS (German, primary) and USDA (English, fallback)
with ML embedding matching (multilingual-e5-small / all-MiniLM-L6-v2), hybrid
substring-first search, and position-aware scoring heuristics.

Includes per-recipe and global manual ingredient overwrites, ingredient skip/exclude,
referenced recipe nutrition (base refs + anchor tags), section-name dedup,
amino acid tracking, and reactive client-side calculator with NutritionSummary component.

recipes: overhaul nutrition editor UI and defer saves to form submission

- Nutrition mappings and global overwrites are now local-only until
  the recipe is saved, preventing premature DB writes on generate/edit
- Generate endpoint supports ?preview=true for non-persisting previews
- Show existing nutrition data immediately instead of requiring generate
- Replace raw checkboxes with Toggle component for global overwrites,
  initialized from existing NutritionOverwrite records
- Fix search dropdown readability (solid backgrounds, proper theming)
- Use fuzzy search (fzf-style) for manual nutrition ingredient lookup
- Swap ingredient display: German primary, English in brackets
- Allow editing g/u on manually mapped ingredients
- Make translation optional: separate save (FAB) and translate buttons
- "Vollständig neu übersetzen" now triggers actual full retranslation
- Show existing translation inline instead of behind a button
- Replace nord0 dark backgrounds with semantic theme variables
2026-04-02 19:47:12 +02:00
705a10bb3a recipes: overhaul nutrition editor UI and defer saves to form submission
- Nutrition mappings and global overwrites are now local-only until
  the recipe is saved, preventing premature DB writes on generate/edit
- Generate endpoint supports ?preview=true for non-persisting previews
- Show existing nutrition data immediately instead of requiring generate
- Replace raw checkboxes with Toggle component for global overwrites,
  initialized from existing NutritionOverwrite records
- Fix search dropdown readability (solid backgrounds, proper theming)
- Use fuzzy search (fzf-style) for manual nutrition ingredient lookup
- Swap ingredient display: German primary, English in brackets
- Allow editing g/u on manually mapped ingredients
- Make translation optional: separate save (FAB) and translate buttons
- "Vollständig neu übersetzen" now triggers actual full retranslation
- Show existing translation inline instead of behind a button
- Replace nord0 dark backgrounds with semantic theme variables
2026-04-02 19:46:03 +02:00
866d2e9fff tasks: use Toggle component for recurring task switch
All checks were successful
CI / update (push) Successful in 5m12s
2026-04-02 17:29:35 +02:00
381012db98 tasks: add refresh mode toggle (completion date vs planned date)
Recurring tasks can now calculate next due date from either the
completion time (default) or the planned due date, catching up
if overdue.
2026-04-02 17:29:08 +02:00
7ebebe5d11 tasks: complete tasks on behalf of another user via long-press
All checks were successful
CI / update (push) Successful in 2m22s
Long-press the check button to open a popover with user selection.
Normal click still completes for yourself.
2026-04-02 08:13:50 +02:00
4f17ad56fa tasks: add individual completion deletion API and UI
All checks were successful
CI / update (push) Successful in 2m23s
2026-04-02 07:47:58 +02:00
a588b8ee84 tasks: add clear completion history button on rewards page
Some checks failed
CI / update (push) Has been cancelled
2026-04-02 07:46:11 +02:00
21a1f9b976 tasks: remove debug toggle from rewards page
All checks were successful
CI / update (push) Successful in 3m39s
2026-04-02 07:34:02 +02:00
9027dd9881 tasks: shared task board with sticker rewards, difficulty levels, and calendar
Some checks failed
CI / update (push) Has been cancelled
Complete household task management system behind task_users auth group:
- Task CRUD with recurring schedules, assignees, tags, and optional difficulty
- Blobcat SVG sticker rewards on completion, rarity weighted by difficulty
- Sticker collection page with calendar view and progress tracking
- Redesigned cards with left accent urgency strip, assignee PFP, round check button
- Weekday-based due date labels for tasks within 7 days
- Tasks link added to homepage LinksGrid
2026-04-02 07:32:55 +02:00
7e1181461e recipes: nutrition calculator with BLS/USDA matching, manual overwrites, and skip
Dual-source nutrition system using BLS (German, primary) and USDA (English, fallback)
with ML embedding matching (multilingual-e5-small / all-MiniLM-L6-v2), hybrid
substring-first search, and position-aware scoring heuristics.

Includes per-recipe and global manual ingredient overwrites, ingredient skip/exclude,
referenced recipe nutrition (base refs + anchor tags), section-name dedup,
amino acid tracking, and reactive client-side calculator with NutritionSummary component.
2026-04-01 13:00:55 +02:00
3cafe8955a recipes: revert to substring search, keep fuzzy for prayers/exercises
All checks were successful
CI / update (push) Successful in 2m20s
2026-03-30 13:29:45 +02:00
29763ffaa9 fitness: GPS workout templates with interval pre-selection
All checks were successful
CI / update (push) Successful in 2m17s
Enable creating templates for GPS-tracked workouts with activity type
and optional interval training. GPS templates show activity/interval
info instead of exercise lists in cards, modals, and schedule. Starting
a GPS template pre-selects the interval and jumps to the map screen.
2026-03-30 13:24:58 +02:00
27a29b6f69 fitness: use time-scale x-axis for weight chart to handle date gaps
All checks were successful
CI / update (push) Successful in 2m23s
Weight chart now spaces data points proportionally to actual dates
instead of evenly. Days without a weight log no longer compress adjacent
points together. Uses Chart.js time scale with chartjs-adapter-date-fns.
2026-03-30 09:00:17 +02:00
5bed3f3781 fitness: TTS volume control, audio ducking, and workout start/finish announcements
All checks were successful
CI / update (push) Successful in 2m37s
Add TTS volume slider (default 80%) and audio duck toggle to voice
guidance settings. Announce "Workout started" when TTS initializes and
speak a full workout summary (time, distance, avg pace) on finish.
The finish summary reuses the existing TTS instance via handoff so it
plays fully without blocking the completion screen.
2026-03-30 08:49:14 +02:00
660fec44c2 fix: scrollbars are minimal and out of the way
All checks were successful
CI / update (push) Successful in 2m32s
2026-03-27 09:06:51 +01:00
5b3b2e5e80 fitness: shorter strings for main activity buttons, add missing pages
All checks were successful
CI / update (push) Successful in 2m12s
2026-03-26 15:04:42 +01:00
7f6dcd83a8 fitness: more nord blue as accent color for both light and dark
All checks were successful
CI / update (push) Successful in 2m14s
2026-03-26 14:57:31 +01:00
91582d6009 fitness: GPS Start Button nord blue in all themes
All checks were successful
CI / update (push) Successful in 2m26s
2026-03-26 14:29:41 +01:00
c41a916947 fintess: WIP: interval setup and TTS
All checks were successful
CI / update (push) Successful in 2m17s
2026-03-26 14:11:07 +01:00
3349187ebf feat: GPS workout UI polish and voice guidance improvements
All checks were successful
CI / update (push) Successful in 2m27s
- Start native GPS service in paused state during pre-start (notification
  shows "Waiting to start..." instead of running timer)
- Bump notification importance to IMPORTANCE_DEFAULT for lock screen
- Theme-aware glass blur overlay matching header style (dark/light mode)
- Dark Nord blue background for activity picker, audio stats panel
- Transparent overlay in pre-start, gradient fade for cancel button
- Use Toggle component for voice announcements checkbox
- Persist voice guidance settings to localStorage
- Derive voice language from page language, remove language selector
2026-03-26 10:45:42 +01:00
9e95179175 fix: auto-zoom to street level when first GPS point arrives
All checks were successful
CI / update (push) Successful in 2m19s
When the map starts zoomed out (level 5), snap to zoom 16 on the first
real GPS position instead of keeping the overview level.
2026-03-26 10:08:28 +01:00
c997e74806 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
c8dafa7c8a 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
8b63812734 feat: redesign GPS workout UI with Runkeeper-style map overlay
All checks were successful
CI / update (push) Successful in 2m32s
- 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
d75e2354f6 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
a5f2a1d6de fix: resolve all 58 TypeScript errors across codebase
All checks were successful
CI / update (push) Successful in 2m10s
- 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
3b805861cf 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
0263a18c5f fix: preserve GPS data when saving session edits
All checks were successful
CI / update (push) Successful in 2m18s
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
1e0dd27fa3 fix: shorten dashboard labels to "Burned" and "Covered"
All checks were successful
CI / update (push) Successful in 2m22s
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
9caa0fbc24 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
f3a89d2590 feat: add cardio PRs for longest distance and fastest pace by range
All checks were successful
CI / update (push) Successful in 2m14s
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
81bb3a2428 fix: persist and display Volume PRs in workout history
All checks were successful
CI / update (push) Successful in 2m13s
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
f9f8761c7b remove Android CI workflow and Dockerfile
All checks were successful
CI / update (push) Successful in 2m18s
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
10233a3804 fix: track Gradle wrapper in git so Docker build finds gradlew
Some checks failed
CI / update (push) Successful in 3m22s
Android APK / build (push) Failing after 18m10s
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
d1fbb1c826 fix: use rust:slim-trixie for JDK 21 and latest Rust, trim CI paths
Some checks failed
Android APK / build (push) Failing after 14m16s
CI / update (push) Successful in 2m23s
- 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
e9de9a35c8 fix: use Adoptium APT repo for JDK 21 in Android Dockerfile
Some checks failed
Android APK / build (push) Failing after 8m26s
CI / update (push) Has been cancelled
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
6685e5731c fix: stop GPS tracking on workout cancellation
Some checks failed
Android APK / build (push) Failing after 4m48s
CI / update (push) Has been cancelled
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
fe49c5b997 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
8fff5f14b5 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
28b2494a08 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