Commit graph

7 commits

Author SHA1 Message Date
Danny
8e9a2b7208 ui(webapp): split current exercise and next-exercise input into separate cards
The two concerns sharing one gray block felt crowded. Giving the
next-exercise input its own card creates clear visual separation
and a natural "what comes next" feel.

Drop the now-redundant top-border/padding on .sets-section since
it's its own card now.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 18:52:26 +02:00
Danny
512c565f54 ui(webapp): move next-exercise input to bottom of add-exercise card
The empty "Exercise name" field above the current exercise's sets
felt counter-intuitive. Putting it below the sets reads naturally:
current exercise on top, prompt to start the next one at the bottom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 18:46:24 +02:00
Danny
b4d76b0eca feat(webapp): show running version in Mini App footer
Compute `git describe --tags --always --dirty` at server startup
and expose via unauthenticated /api/version. Render as small muted
text at the bottom of the Mini App so the running version can be
confirmed at a glance.

Once tags exist, the badge will show e.g. v0.1.0 or v0.1.0-3-gSHA.
Until then it shows the short SHA.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 17:38:52 +02:00
Danny
4d6c4b1151 fix(webapp): hide next-exercise input until current has >=1 set
Typing in the exercise-name input while an exercise was in progress
but had no sets would silently replace it. Hide the name row in that
state so the user commits to adding a set (or explicitly removes the
exercise) before starting another.

Because the name row was the only way to abandon a 0-set exercise,
always show the "Remove exercise" escape hatch whenever a current
exercise exists.

Consolidate the save/name-row/delete visibility logic in syncEditorUI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 17:14:56 +02:00
Danny
60171d9b1c fix(webapp): show save button while first exercise is in progress
Save button was gated on workout.length, which stays 0 until a
second exercise is started (the transition that flushes the current
exercise into workout[]). Single-exercise workouts had no reachable
save path.

Gate on workout.length OR currentExercise sets, and recompute
visibility when sets are added/removed and on draft restore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 16:53:42 +02:00
Danny
a529416599 feat(tg-fitness-bot): structured mini-app, edit workouts, draft persistence
Rebuilt Log view: exercise name input with autocomplete, per-set
entry (reps x weight), exercise cards with edit/remove. Comma and
dot both work as decimal separators. Notes field. Collapsible raw
text input as fallback.

Edit saved workouts from History (pencil icon). Loads exercises
into editor, Save becomes Update, Cancel returns to History.

localStorage draft persistence: auto-saves on every state change,
restores on reopen (24h expiry), clears on save.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:41:47 +02:00
Danny
f025e5fd19 Add Telegram Mini App (web UI + API server + localtunnel)
- server.py: aiohttp API serving webapp/ and REST endpoints using existing db.py
- start.py: orchestrator that loads token, starts server + localtunnel + bot
- webapp/: Mini App frontend (Log, History, Stats) with Telegram-native theming
- bot.py: added Mini App menu button and inline button on /start
- flake.nix: added aiohttp + localtunnel, nix run now uses start.py
2026-03-24 20:17:36 +01:00