9e580c4794605a5b709b6cc4cbcb1f3d1958af68
796
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9e580c4794 |
Cards you can see through, a splash that waits, and iOS launch screens
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
**The transparency was there and invisible.** `--glass` was a near-black at 55% alpha, and a dark film over a dark background reads as solid no matter what the alpha says — so the cards looked exactly as opaque as before. It is 34% now, the family tint weighs a little more (14%) and the blur is 10px instead of 16: heavy blur flattens the backdrop into one colour, which hides the very thing that is supposed to show through. The opaque `@supports` fallback is gone as well. It was copied from the tab bar, where it is right — the bar floats over scrolling text — and it is wrong here: a card sits in the page flow and the only thing behind it is the aura. On any device that took that branch, the cards were solid by construction. **The splash now waits, which is what a launch screen does.** It stays until the boot is finished, with a floor of 1.1s so it can actually be read (a warm boot takes milliseconds, and a splash that lasts that long is a flicker) and a ceiling of 6s so a request that never answers cannot hold anybody behind a photograph — their workouts are already local. The mark pulses slowly while it waits, so it looks like a screen that is loading rather than a photograph that is stuck. **The long white is iOS, before any of our code runs.** The deployed HTML already carries the aura's base colour inline, so what is left is the installed web app's own launch screen: iOS paints it before the page exists, and without an `apple-touch-startup-image` that matches the device it paints nothing. Fourteen entries now cover the phone and tablet sizes the app is opened on, cropped from the same photograph (each device fetches only its own). build-app-icons.mjs fails when the sizes it generates and the sizes index.html links disagree, because a missing entry is the blank screen this exists to remove. |
||
|
|
3908dc524a |
Fix the shell: useState was used and never imported, so the app never mounted
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
The launch-screen work added a useState to App.jsx without adding it to the React import line, and the only symptom in production was a background: React threw while rendering the shell, so neither the app nor the splash ever mounted. "Uncaught ReferenceError: useState is not defined" at the top of the bundle is as fatal as a build error and much quieter — the page loads, the CSS applies, the aura paints, and nothing else happens. It shipped because no test rendered App. The whole point of a shell is that it can fail everything by failing once, so there is now a smoke test that mounts it against a mocked network: it checks the app renders at all, that the launch screen comes first with the photo and the mark on it, that the shell gets past it to a real screen, and that a signed-in device whose boot never finishes still gets its own data rather than being held on the splash. Checked against the bug itself — with useState removed from the import all three fail with that exact ReferenceError. Also swept every file in src/ for the same class of mistake (a hook called, its name not in the React import): App.jsx was the only one. |
||
|
|
a0f1f388bc |
The splash nobody could see, the white flash, and cards that let the aura through
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Three things, and the first two were bugs rather than taste. **The launch screen never appeared.** Its condition was `!ready && !authed`, and `authed` is true from the saved profile — so a signed-in person (everybody who has ever opened the app) went straight past it and only a brand-new device ever saw the photo. It now shows for the first half second on every launch, and beyond that only while there is genuinely nothing to show yet (no profile and boot still running, the original behaviour, which stops the login screen flashing before the server config lands). Deliberately not "until ready": boot pulls from the server, and waiting for it would hide the local copy exactly when the network is bad — working from that copy is what the offline mode is for. **The white screen.** Until the app's stylesheet arrives the browser paints its own default, and the aura's dark base only existed in that stylesheet — so a cold load, or a service worker swapping in a new bundle, started white. index.html now carries the base colour inline, and, next to it, a few lines that apply the saved theme and accent before the first paint: the app reads those after boot, which meant everybody who had chosen anything saw the defaults flash first. Same storage key the store writes, same resolution of 'system'. **The cards.** They were solid --surface, which sat on top of the aura and hid it. Salud's tiles and chart panels are glass now — the family tint over a translucent fill, a hairline border in the same tint, and a 16px blur with a saturation lift so what shows through stays readable. The fill is a warm near-black rather than the neutral grey: a cool card over a warm gradient reads as a dirty edge. The token (`--glass`) is defined per theme, and where backdrop-filter is unsupported the cards go back to solid, which is the trade the tab bar already documents — the fallback block sits AFTER the glass rules, or the cascade would have handed it the blur it cannot render. Only Salud's cards are glass so far; the rest of the app is still opaque, which is a bigger decision than this change should make on its own. |
||
|
|
c3c1c2836c |
Salud: Today by default, chart panels, and an aura behind the whole app
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Three things the screen was missing, plus the launch photo.
**Today.** The period filter started at 30 days, which buried the question a five-minute
cadence exists to answer: what do the numbers say right now? "Today" is now first and the
default, and it means today — the grid drops metrics nobody has measured today (the scale
is not stepped on every morning), and if nothing has come in yet the grid falls back to
everything and says so rather than showing an empty screen. The number on every card was
always the newest reading; what is new is that the card says which day it is and when it
landed ("hoy · hace 12 min"), so the claim can be checked instead of trusted. The screen
also refreshes itself every minute while it is open, which is what makes a five-minute
cadence visible.
The filter and the charts want different windows, and the view keeps them apart: a
sparkline or a trend needs history, so the fetch never asks for less than a week even in
"Today", and anything labelled with a window says which one it is. (The alternative —
fetching one day and drawing nothing — would have made Today the one mode with no charts.)
**Chart panels.** Every tile carries a 52px sparkline, which shows a shape and cannot be
read. The first few metrics in the catalogue's own order now get a full-width panel each:
axes, the window's min / avg / max, and the card's own colour, so a panel and its tile are
recognisably the same metric.
**The aura.** index.html carries the three "Diamond Weave" layers and index.css puts the
base colour on `body` where the blend modes composite against it, with `#app` lifted to
z-index 1 so the absolutely-positioned layers cannot paint over the page (everything modal
was already higher). Dark keeps `screen`; the light theme switches the same layers to
`multiply`, because screened amber over white is amber that has been washed away. The blur
radii follow the spec per breakpoint, and the layers are fixed rather than absolute so
scrolling never repaints two 200px blurs.
**The launch screen.** assets/splash.jpg is a 3862×5786 photograph from a camera, so
nothing ships it raw: build-app-icons.mjs now derives public/splash.webp (1170px wide, 62 KB
— WebP because it is a photo) for the boot screen and resources/splash.jpg (2732×2732,
fitted on the aura's base colour rather than cropped, so a portrait composition survives)
for @capacitor/assets. The 12 MB original is gitignored: the derived files are committed,
so a clone still builds, and the script says what is missing when regeneration is asked for
without it.
|
||
|
|
3b7c9011c4 |
Salud: one colour per family of metric, so the grid reads at a glance
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Every card carried the same white number, which meant reading fourteen labels to find the one you came for. Each family now has a colour — activity green, heart pink, body blue, sleep indigo, vitals teal, everything unrecognised grey — and the card's number, its icon, its sparkline and a low wash behind it all read from a single `--tint` property set by lib/vitals-view.js. The detail sheet follows the same tint, so opening a card keeps its colour. The tints are the app's own palette variables, not hex values: the light theme redefines every one of them, so a card stays legible in both. They are deliberately not `var(--acc)` — the accent is whatever the person chose in Settings, and a dashboard whose "steps" colour changes with the theme accent is one nobody can learn. Grey for the unknown group is the honest choice: an unrecognised metric has no family to colour. The wash is 8% on purpose. The colour is there to sort the grid, not to shout, and a saturated tile behind a 26px number fights the number it is meant to highlight; the value itself carries the colour at full strength. Guarded twice: vitals-view.test.js checks every group resolves to a tint and that no two groups share one (sharing would defeat the point), and the render test checks the cards actually carry `--tint` — the wiring, not the shades, which is the part that can silently break. |
||
|
|
4222e8d86b |
Deploy path: X-Forwarded-For is the append form here, not $remote_addr
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
I changed this to $remote_addr when the resolver fix went in, on the reasoning that appending lets a client put its own address in front of the real one. That reasoning is right for web/nginx.conf.template and wrong here, and the deployment's own access log shows why: this nginx is NOT the edge. Traefik terminates TLS in front of it, logs the web container's peer as 10.0.1.182, and carries the real client (66.98.33.30) in the header it sends. $remote_addr therefore records Traefik's own address, and $proxy_add_x_forwarded_for — which puts the incoming header first — is what preserves the person's. The API reads the first entry, so the append form is the correct one in this shape. Comment 4 now spells out both directions: append here because a trusted proxy is in front, $remote_addr in the registry template because there the container answers the internet directly, where an incoming header is exactly what cannot be trusted. Nothing recorded was wrong in the meantime — AUDIT_IP is off unless an operator asks for it — but this is the setting to get right before anybody turns it on. |
||
|
|
41b004fea7 |
Salud: the ingest key shows up the moment it exists
Tests / test (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Clicking "Create an ingest key" said "Ingest key created" and then showed nothing to copy — no key, just the button again. The key was being created correctly the whole time (it is in the profile, and the phone could have used it); the sheet handing it over was what was broken. A sheet is rendered from the JSX captured when it was opened (useUI.openSheet keeps the element), so anything it reads off the screen's state is frozen at that moment. The header block keyed off the screen's `key`, which was null when the element was created and never re-rendered — the screen's state updated, the element did not, and the toast came from the store rather than from that tree, which is why the confirmation appeared and the key did not. The sheet now holds the key in its own state, seeded from the profile's existing one, and the two handlers resolve with the new key so the sheet can show it the instant it is created. Both blocks that were `data?.key` follow the same local state, so Replace the key updates what is on screen too. Two things came with it, because "where do I copy it from" was the actual complaint: the endpoint and the key each get a labelled button (Copy the URL / Copy the key) instead of a bare clipboard glyph next to a code box, and a line under the key says what to do with it. Guarded by two tests that need the real Modals host to be rendered at all: one creates the key through the sheet and asserts it appears in full, the other opens the sheet on a profile that already has one. The first was checked against the old behaviour — it fails when the sheet reads the frozen prop — so it is a regression guard and not a description. |
||
|
|
002e5e6bbb |
Deploy path: the header counts the traps it documents (there are four now)
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
|
||
|
|
7271dadbee |
The deploy path's nginx: re-resolve the api on every request
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
A plain `proxy_pass http://api:3000` is resolved once, when nginx starts, and the address stays pinned for the life of the container. Recreate the api — a deploy that changes its configuration, a --force-recreate, any restart that hands it a new IP — and the web container keeps talking to a dead address: every /api call answers 502, including /api/config, so the app cannot even boot. That is not hypothetical: it is what happened on gym.dploy.lol, where restarting the api to pick up new code produced 502 on every endpoint until the web container was restarted too. The generated config now asks Docker's embedded DNS again on every request instead: `resolver 127.0.0.11` plus `set $api_upstream http://api:3000` and `proxy_pass $api_upstream`. This is the same fix web/nginx.conf.template has carried for the registry-image shape (with a comment explaining issue #16), and comment 4 at the top of this file now records why the deploy path needs it too. Verified by rendering the command exactly as the container runs it and passing the result through an nginx config parser: both body limits in place, both locations on the variable, and the upstream still resolved through the embedded resolver. |
||
|
|
5eb0a5298a |
The deploy path's api container now keeps itself on the clone's revision
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
gym.dploy.lol runs deploy/compose-build-at-deploy.yml, and that stack has an asymmetry that has now cost two deploys: `web` serves the frontend build out of a shared volume, so every deploy refreshes the app by itself, while `api` copies the clone INTO its container at start-up. Compose recreates a service only when its configuration or image changed, and the clone is a volume, so neither does — the api kept running the previous revision while the frontend moved on. That is invisible from the outside except as a route that answers 404 although the screen that calls it is already deployed and visibly new, which is exactly what "Crear clave de ingesta → not found" was: POST /api/vitals/key hitting last week's server. The api's command is now a small loop instead of a one-liner: it syncs /app from the clone whenever the clone's revision changes, restarts the server on it, and starts it again if it ever exits (the old one-liner left that to the container restart policy, which also meant a full re-copy every time). Dependencies are reinstalled only when package.json itself changed, so a deploy costs a couple of seconds of downtime rather than a minute of npm install. It is careful about the window a deploy opens: `source` does `rm -rf /work/repo` before it re-clones, and the loop tests for api/server.js — a file a fresh clone writes and that rm removes — so a deploy caught mid-clone is waited out instead of half-copied. Two things this file has to get right, both verified rather than assumed. Every `$` in the container's script is written `$$`, because compose interpolates `$VAR` in block scalars too and an unescaped `$src` would have arrived empty (this is the same reason the web service writes `$$host`). And the loop's control flow was simulated before pushing: first start, a new clone, a package.json change, a server that dies, and a clone that disappears mid-deploy and comes back — five paths, all as intended. |
||
|
|
c150101232 |
The app's own mark: assets/logoym.png becomes the icon, the brand, and the Start button
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Every icon the app ships now comes from one source image, generated rather than drawn: frontend/scripts/build-app-icons.mjs writes public/icon-512.png (declared "any maskable" in the manifest, hence an opaque square), public/icon-180.png (iOS home screen and favicon), public/logo.png (transparent, for the UI) and resources/icon.png (the @capacitor/assets source for the native shells). The file was a PNG despite its .jpeg name — it has a real alpha channel — so it is assets/logoym.png now. It is the file the owner dropped in, and the icons are derived from it, which is what keeps the PWA icon, the home-screen icon, the in-app mark and the native icon from ever drifting apart. The emblem is dark green (its most common colour is #031808, its accents are greens too) with transparent corners, which decides two things. The icon squares are filled with that same dark green and the mark is centred at 88% of the canvas: the corners blend into it, the maskable safe circle stays clean, and a transparent icon can't disappear on a dark home screen. And the tab bar's Start button keeps the accent as a RING instead of a fill — on the old lime disc the emblem would have read as a dark blob. The ring still marks the primary action, and it still turns orange with the pulse while a session is running, with the label underneath saying Start / Resume / Workout, so nothing that button communicated was lost by swapping its glyph for the mark. Login, the mobile onboarding and the boot placeholder in App.jsx showed the dumbbell glyph as a stand-in for the brand; they all show the mark now, so the app cannot flash a different logo on its way in. Three now-unused Icon imports go with it. Icons are written as 256-colour palettes: measured against the full RGBA versions the mean per-channel error is 1.5/255, invisible, and the files are ~2.5× smaller (161 KB for everything the browser downloads, against 532 KB of source). Transparency survives it as the palette's own alpha entries — verified, not assumed. docs/MOBILE.md says how to regenerate and why resources/icon.svg is now inert (@capacitor/assets tries .png before .svg, so the new icon.png wins), and that comment is repeated in the SVG itself so nobody edits the file that no longer decides anything. |
||
|
|
ba37ef8a44 |
Deploy path: give the health ingest 32 MB, and stop appending to X-Forwarded-For
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
gym.dploy.lol does not run docker-compose.yml. It runs deploy/compose-build-at-deploy.yml, where nginx is generated inline by the web service from a printf in its command, with a single global `client_max_body_size 5m`. The per-route 32 MB added for the Apple Health ingest lives in web/nginx.conf.template, which belongs to the registry-image path and is never read here — so a first export of more than 5 MB came back as nginx's own 413 HTML before the API saw a byte of it. That path now has a second location for /api/vitals/ingest with 32m; nginx picks the longest matching prefix, so that one route takes the bigger body and everything else keeps matching the API's MAX_BODY. Both limits are spelled out in comment 3 at the top, with a note that the two deployment shapes have to be changed together. Also fixes a smaller thing found while reading it: X-Forwarded-For was $proxy_add_x_forwarded_for, which APPENDS to whatever the client sent, and the API reads the first entry — so a caller could choose the address recorded about it. It is now $remote_addr, which is what web/nginx.conf.template already does and for the same reason documented there. Audit IPs are off by default, so nothing was being recorded; this matters the day somebody sets AUDIT_IP=net. Comment 3 also now records the two things that make a deploy confusing rather than broken: the api service copies the clone into /app at container start, so an api that was not recreated keeps serving the previous revision while web-build serves the new frontend (exactly the 404-on-a-new-route symptom), and web resolves api's IP once at start-up, so recreating api without web leaves nginx pointing at a dead address and every /api call answering 502. |
||
|
|
8d190bb591 |
Salud moves to Home's header: a sixth tab pushed Start off centre
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
The tab bar is a flex row of equal columns with the Start button raised in the middle, so the tab count has to stay odd. Adding Salud as a sixth pushed that disc half a column to the right, and it read immediately as "the button moved" — the app's primary action is the one thing in the bar that must not drift. Salud is now the heart button in Home's header, next to the gear, with the same destination and the same route (/health). It is reachable from Settings → Data as well, which was already there. The tab bar is back to five: Home, Plan, Start, Stats, Exercises. Two tests, because this is the kind of change that regresses silently: TabBar.test.jsx asserts the odd count and that the raised button is the middle child (plus that no tab points at /health), and Home.health-door.test.jsx asserts the heart sits in the same non-shrinking container as the gear and navigates to /health — if that breaks, the screen is only reachable from Settings, where nobody looks for it. Also: the Comments in Home, TabBar, README, CHANGELOG and docs/HEALTH.md now say where Salud is, and one test assertion checks flexGrow/flexShrink rather than the `flex: none` shorthand — the CSSOM rewrites that to `0 0 auto`, which is what the first version of the test tripped over. |
||
|
|
691e664d3f |
Apple Health (Salud): a per-profile ingest endpoint, and a tab that draws it
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
An iOS automation in Health Auto Export POSTs Apple Health to /api/vitals/ingest, and the new Salud tab (next to Plan) draws whatever arrived: steps, heart rate, sleep, weight, oxygen, workouts and every other metric HAE can export, grouped into cards with a trend, a sparkline and a 7/30/90/365-day range. Nothing on that screen is an input, and the watch's workouts stay out of the history on purpose — they carry no sets and no weights, so folding them into progression, PRs and the recovery model would be inventing data. The interesting part is duplicates. A five-minute automation re-sends overlapping windows: with Date Range "Today", appending would count a day of steps again on every run, and with "Since Last Sync", replacing would throw away everything but the last five minutes. So the endpoint decides per payload instead. Datapoints that sit on midnight are HAE's own day grouping, i.e. a *total*, and a day total replaces the day it names — re-sending the same day all afternoon converges on that day's total. Anything else is a real sample, identified by its instant plus its numbers and stored once, which is right for overlapping and disjoint windows alike. Every sync answers with a receipt (received / duplicates / stored), so a misconfigured automation is visible rather than silent, and day keys come from the date the phone wrote — never the server's clock, or every evening's steps would land on tomorrow. Per profile and private by construction. Each profile mints its own ingest key (Salud → ⚙), which is write-only: it can add to that one profile's health file and cannot read a single number back, so a key leaking out of a phone is a nuisance rather than a disclosure. It is its own credential, so rotating it disconnects a phone without signing anybody out anywhere. The data lives in data/vitals-<uid>.json, outside the synced state document, so a year of heart rate never round-trips through localStorage on every device, and it is bounded on write: 400 days per metric, a 72 h dedupe ledger, the newest 300 workouts. Two traps that only exist in production, both fixed here and both of which would have shipped broken. api/Dockerfile copies the modules server.js imports by name, and vitals.js was not on that list — a container that boots straight into ERR_MODULE_NOT_FOUND. And the web container's nginx capped every /api body at 5 MB, which a health export with Summarize Data off exceeds; that one route now gets the API's own 32 MB while every other path keeps 5 MB, with the shared proxy settings hoisted to server level so the two locations cannot drift apart. Coverage: vitals.js (13 tests — overlapping, disjoint, day-grouped, raw, heart rate, sleep, blood pressure, pruning, timezones), the routes against a real server (4 — isolation between profiles, a key that cannot read, ten re-sends changing nothing), the card model (18) and the screen (4). docs/HEALTH.md has the Health Auto Export settings and the merge table; the five endpoints are in api/openapi.yaml under the health tag, and website/api.html is rebuilt from it. |
||
|
|
0819d03efb |
Measure the iOS touch offset on the device that has it
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
Tests / test (push) Canceled after 0s
Press a row on an iPhone and the one above it reacts — but only sometimes, and only after typing. That is the shape of the keyboard displacement the app already fights in lib/viewport-guard.js: iOS slides the *visual* viewport inside the layout one, everything `position:fixed` is painted against the layout viewport, and the app and the finger disagree until something scrolls. The guard stands down while a text field has focus on purpose (touching the page there threw the keyboard back out — issue #242), and that is precisely the window this falls into. Which correction is right depends on numbers that only exist on the phone: visualViewport.offsetTop, innerHeight, the scale, whether the body is pinned. So this adds a readout instead of a guess. Open the app with `vvdebug` anywhere in the URL, type in a field, tap the row that misbehaves, and read what the viewports were at the moment of that tap — plus which element the browser believed was under the finger, which is the other half of the question ("did it hit the row above, or the row it hit is not where it is drawn?"). It renders nothing without the parameter, and removing it is this file plus one line in App.jsx. |
||
|
|
903a435af3 |
Build a routine with AI: the screen the builder was missing
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
"Add exercise" now has a sibling: it asks which muscles, whether the session
starts with cardio, and how hard — then the Coach fills the routine in. Three
taps instead of picking ten exercises one at a time, and it is the only place in
the app that asks what you want to train today.
Why it exists in this shape:
- The Coach's own intake asks about the *person* — goal, days, equipment, limits
— and is answered once. Nothing in it asks which muscles, so a three-day plan
reasonably came back full body; that is what prompted this. The builder asks
only what changes between sessions and reads the rest from the saved profile,
so a second routine costs three taps and not a questionnaire.
- It adds a NEW routine rather than filling the one you opened. The questions are
about a session you are about to build, and replacing the routine somebody
opened would be the wrong guess. It does not touch the week either: nobody was
asked about days.
- The muscle buttons are the catalogue's own body-part words ("back", "waist"),
which the Library and the body map already translate, so a button and the list
behind it cannot drift apart. "Light" and "Hard" are NOT reused for the effort
chips: those keys already mean the light theme and hard sets, and a chip reading
"Claro" for an easy session would be nonsense in Spanish.
The async half: requestPlan only *starts* a job (the server runs it in the
background and the result arrives on a status poll), so `awaitCoachJob` waits for
that job by the id of the last finished one — a proposal left over from an
earlier question can never be mistaken for this answer — and throws with the
job's own error class for jobErrorText to phrase.
Five tests drive the whole thing: the three steps, the exact questions sent (the
muscles as bp/tg selectors with cardio in the library, not only in the sentence),
that what comes back lands as a new routine with the cardios and the modes the app
owns normalised, that a failure is shown in the app's words and can be retried,
and that an answer with no routine is refused rather than added empty.
The 22 new strings exist in Spanish only, by decision. Rather than leave
check-locales.mjs permanently red — a guard nobody reads is not a guard — the
pending set is written down in src/locales/PENDING.md: the check still fails on
anything NEW, and the debt is a list somebody can work through.
|
||
|
|
996797bf00 |
Spanish exercise names for the whole catalogue
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
A Spanish profile now reads the catalogue in Spanish. Only pt-BR and hu had a
name pack, so every other language — Spanish included, which is this fork's
default — showed 1,324 English titles.
The pack is generated the way the pt-BR and hu ones were, with two differences
that matter to a self-hosted instance:
- `scripts/translate-es-exercise-names.mjs` talks to an OpenAI-compatible
endpoint instead of the `claude` CLI, because that is what the instance
already has: the same router the Coach runs on. Point it at one with
COACH_BASE_URL / COACH_MODEL / COACH_API_KEY.
- It is resumable. Ids already in the source file are skipped, so a run that
stops half way continues where it left off and a review only re-translates
what it deletes. With 1,324 rows, a pass that had to start over would never be
repeated.
Three rounds of review went into the file, each one caught by reading the output
rather than by the script succeeding:
1. "chin-up" and "pull-up" came back as English loanwords — the terms the
catalogue itself uses — so the core vocabulary is now pinned in the prompt and
asserted by the test (dominada, sentadilla, peso muerto, zancada, plancha…).
2. 142 rows led with the equipment ("Banda sentadilla", "Mancuerna press"), which
is the English word order. Spanish names the movement first: "Sentadilla con
banda". Those rows were re-translated, and the test now refuses a title that
starts with a piece of equipment — "Peso muerto" is why "Peso" is not on that
list.
3. Four rows dropped their (male) qualifier and four named variations kept an
English head noun ("Hack squat con barra"); both were fixed, the first by hand
since the review is allowed to edit the source.
The pack is honest about its provenance, like the pt-BR one: model-produced,
not reviewed by a native speaker, and the README says so.
|
||
|
|
40959de0a2 |
Forward the COACH_* variables to the api container in the deploy compose
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
The api service lists its environment explicitly, and that list is an allowlist:
a variable set in the host's .env reaches the container only when it is named
there. Everything else in the panel is used solely to substitute ${…} in the
compose file — which is how COACH_PROVIDER can sit in Dokploy looking applied
while the api never sees it, the Coach stays off, and no screen anywhere shows a
button. That is exactly what happened on this instance.
The `:-` defaults keep an instance that sets none of them byte-for-byte as it
was: an empty value reads as unset in coach/config.js.
|
||
|
|
238eb635c5 |
Configure the Coach from the environment
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
An instance can now be pointed at a model entirely from its environment — so a
container is redeployed with the Coach already working, and nobody has to open
an admin screen:
COACH_PROVIDER=compatible
COACH_BASE_URL=https://ai.example.com # WITHOUT /v1 — the adapter adds it
COACH_MODEL=vendor/model-name
COACH_API_KEY=sk-... # or the provider's own variable
Naming a provider is the whole configuration, so it also turns the Coach on: an
instance started this way that then reported itself "off" would be a puzzle with
no clue in it.
Three decisions worth stating:
- The environment is the *base*, the way DEFAULTS is, and the saved file is
layered on top: an admin who picked a provider in the app meant it, and this
only fills what is absent.
- The key is deliberately NOT a field of the config. That object is cached,
written to data/coach.json by any admin action, and included in the backup the
docs tell people to make. envCredentialFor reads it from the process
environment instead, so it is written nowhere and never surfaced by any route
that reports configuration. A pasted credential still outranks it, and a filed
one that fails to decrypt stays a failure rather than quietly falling back to
a key nobody knows is being spent.
- What the environment supplies is stripped before the file is written. A saved
config used to be written back whole, which would have frozen this start-up's
values on disk — and since the file outranks the environment, a later change
to COACH_MODEL would have been silently ignored.
Verified through the server's own path (config → credentialFor → jobEnv →
adapter) against the OpenAI-compatible router this fork runs on: a chest+triceps
request came back as a six-exercise routine with the cardio row first and
correctly marked `mode: cardio`.
|
||
|
|
327aa5211b |
The core of "build a routine with AI": muscles, cardio, intensity
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
The screen that will drive this needs three things underneath it, and all three
are here, tested, with no UI yet.
1. `librarySlice` can be narrowed to the muscles someone picked. A selector is
`{ bp }` or `{ tg }` — the target muscle matters because "biceps" and "triceps"
are both `upper arms`, and asking for one must not hand back the other — and an
exercise is kept when it matches any of them, so "back and biceps" is one list.
`catalogueOnly` drops the person's own exercises, which are the only rows in
the app with no animation; the builder promises every pick can be watched.
Both answers ride in the existing `intake` object rather than a second channel:
the intake is already how "which muscles" reaches the payload, and it travels
the whole way (route → job → build, and local → build) untouched. `cleanGroups`
sanitises it, since it is the one intake field that reaches a filter rather than
the model's reading.
2. `lib/ai-routine.js` — the three questions and what to do with the answer: the
intake the model is asked with, and the routine it hands back, normalised for
this app. Cardio lands in the library and not only in the sentence (a model told
to start with cardio but handed no cardio exercise can only improvise, which is
what it did the first time this was tried), a cardio row becomes one bout
whatever set count came back, and a missing mode is read from the exercise the
same way `modeOf` reads it everywhere else.
3. A validator fix found on the way: the cardio branch set `min` and `speed` but
never `clean.mode = 'cardio'`, unlike the time and reps branches. The app
recovered it from the catalogue, so nothing was visibly broken — but the bundle
did not describe its own prescription, and a model that omitted `mode` (which is
what a model prescribing "8 minutes of cardio" usually does) got "3 × 10 reps"
with a stray `min` nothing reads. Now the mode is stated, and inferred from the
catalogue when it is missing. `time` is deliberately not inferred: nothing in the
catalogue says an exercise is held for seconds.
Verified against the real router behind gym.dploy.lol with the real pipeline: a
back+biceps request produced a 6-exercise routine from an 80/80/22 library slice.
|
||
|
|
ea1af681c2 |
Read an answer that arrives with an SSE terminator glued to it
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
A gateway may answer a request that did not ask for streaming with SSE framing anyway: the whole chat.completion object followed by "\ndata: [DONE]". That body is not JSON, so readJson's strict parse rejected it, `data` came back null, and the job failed with "unexpected response shape: Cannot read properties of null (reading 'choices')" — while the answer it wanted sat in the first few kilobytes. Not hypothetical: the OpenAI-compatible router behind this fork's own instance answers exactly that way, which made every coach job fail against it with a message that says nothing about the real problem. The lenient read takes the first complete JSON value and ignores what follows, counting braces outside of strings so a "}" inside a rationale cannot end the scan early. It cannot paper over a truncated answer — an object that never closes still returns null, which is what the token-limit path depends on — and there are three tests for that: the terminator case, trailing junk after a complete object, and an object that never closes. |
||
|
|
1c201ab6f9 |
Merge #1: rebrand to KuentaGYM, pounds/Spanish defaults, build-at-deploy stack
Tests / test (push) Canceled after 0s
Publish Docker images / build (., ./web/Dockerfile, web) (push) Canceled after 0s
Publish Docker images / build (./api, ./api/Dockerfile, api) (push) Canceled after 0s
|
||
|
|
1a48efdbcc |
Add deploy/compose-build-at-deploy.yml for hosts that build at deploy time
Tests / test (pull_request) Canceled after 0s
The instance at gym.dploy.lol runs a five-service stack that clones the source and builds it on every deploy, rather than pulling the images docker-compose.yml names. That shape has three requirements nothing in the repository stated, and getting any of them wrong costs a deploy: - web-build has to copy the whole repository and build from frontend/. The frontend imports the Coach's core from ../../../api/coach/core/, so a build stage holding only frontend/ fails with nine UNRESOLVED_IMPORT errors — the reason web/Dockerfile copies api/coach/core/ into its build stage. - The volume names have to be pinned with `name:`. Unpinned, a restyled stack silently creates empty volumes and the profiles and training history look gone. - nginx needs client_max_body_size. Its default request limit is 1 MB while the app PUTs the whole profile to /api/data and the API accepts 5 MB — the sync starts failing with a 413 the UI cannot explain once a history grows past 1 MB. web/nginx.conf.template already sets 5m; this matches it. The file is the shape that instance runs, with its volume names filled in. |
||
|
|
affac4a2a0 |
Add scripts/build-images.sh: build the two images and publish them
The images docker-compose.yml pulls are normally built by
.gitea/workflows/docker-publish.yml, which needs a registered Actions runner
and a PACKAGES_TOKEN secret. Neither exists on this instance's forge yet, so a
host that pulls rather than builds has nothing to pull — and the two builds are
easy to get wrong by hand: api builds from ./api, web from the repository root,
because the web image compiles frontend/ inside its first stage. A wrong context
produces an image that builds fine and then fails at runtime.
One command now does both and pushes them:
GITEA_TOKEN=<token with write:package> ./scripts/build-images.sh
TAG, REGISTRY, OWNER, PLATFORM, PUSH and API_TARGET (default vs coach) are all
overridable, and the tags default to exactly what docker-compose.yml asks for.
|
||
|
|
87bfd6d4c4 |
Rebrand to KuentaGYM, and start a new profile in pounds and Spanish
The app is now KuentaGYM everywhere a user can see it, and a fresh profile no longer starts on upstream's English/kg defaults. Both are this fork's decisions, so both are pinned by tests rather than left to a find-and-replace. Rename (1,270 references, 149 files) - Visible surfaces: the Login/Home/mobile-onboarding wordmark, the Settings version line, the printed plan, the PWA title + manifest, and the 17 branded strings across all 14 locale packs. - Infrastructure: repo links, the container images and the release endpoints now name git.dploy.lol/dsantillan/kuentagym; .gitea/workflows/docker-publish.yml publishes to this forge's registry instead of gitea.com. - The Android/iOS application id stays ch.duartesantos.opengym on purpose: changing it would make the mobile app a different app that could never update an installed copy. Three things the mechanical pass would have broken, fixed here - The update check asked gitlab.com for upstream's releases and would have installed upstream's APK, putting the old name back on the phone. It now reads this fork's Gitea releases API (the assets shape differs), with the tests rewritten to the payload Gitea actually returns. - Renaming the mobile state/pairing files (opengym-state.json, opengym-remote.json) would lose the on-device copy of a history whose WebView storage may have been evicted, and silently unpair the device. Both are read under their old names and written forward under the new ones. - Renaming the exported plan-file marker (openGym_plan) rejected every plan shared before the rename as "not a plan file". Both markers are accepted. Defaults: pounds and Spanish - DEF.unit = 'lb', DEF.lang = 'es', plus every fallback that independently assumed en/kg (the <html lang> attribute, the Settings pickers, the Store, the MCP, the Coach payload). - Server-generated push copy existed only in English and pt-BR, so a Spanish profile would have been notified in English; Spanish added. - The demo seed states unit: 'kg' — its seeded numbers are kilograms, and inheriting the new default would have introduced an 82.4 lb lifter benching 60. - The module-level language in i18n-core stays English: it is the only language whose strings need no pack, so `t()`, dates, numbers and lists agree before a pack loads. Starting there on 'es' formats a Spanish-shaped UI with English strings. Also - api/package.json's test glob missed push-messages.test.js and verify-error.test.js, which sat beside the modules they cover and never ran. - README, docs/, website/ and the issue templates no longer describe upstream's GitLab/GitHub pipeline, Discord, sponsorship or public demo as if they were this fork's; upstream history and attribution are preserved (NOTICE.md). |
||
|
|
f91cde15a1 |
v1.3.8: twenty-four reports, the four promised items, and eleven community pull requests
versionCode 22. The milestone was due on the 27th; it ships a week early because the QA round that followed the bug fixes found — and closed — enough to be worth releasing on its own.v1.3.8 |
||
|
|
90a1e8956a |
Admin: delete an account, not just disable it (#107)
Disabling locks someone out but deliberately leaves their state file and credential on disk, so 'no data remains' was not reachable from the dashboard — which is what the request asked for. POST /api/admin/user/delete removes the user, their passkeys, their push subscriptions, their presence entry, their training history and any Coach credential of theirs. Two refusals, because nothing in the UI could undo either: an admin cannot delete their own account, and the last remaining admin cannot be removed. The invite code they joined with stays burned — it was used, and freeing it would quietly widen an invite-only instance. In the dashboard it asks twice, naming the account both times, and offers their data as a download first: the training history is theirs. Five tests drive the real server. |
||
|
|
ae1c8fe8b2 |
Weights can show two decimals, for quarter plates and microplates (#139)
A per-side figure off kg plates lands on .25 and .75, and one decimal reported those as .3 and .8 — close enough to be wrong, and no use at all to anyone loading microplates. Settings carries the choice and lib/format.js reads it the way it already reads the date locale, so all sixty-odd places that print a weight follow without being touched. It only ever shows precision that is already in the number: a whole number still prints whole, 62.5 is 62.5 either way, and nothing about what is stored or how it rounds changes. |
||
|
|
22c2ff9d2c |
Bar weight: 'No bar' for a Smith machine that carries its own carriage (#138)
Typing 0 in the bar field meant 'clear the override', so it snapped straight back to the 9 kg default and the plate math, the drop-set steps and the warm-up ramp all counted a bar that is not in your hands. A stored 0 is now a value of its own — no bar — and the key being absent is what means 'use the default for this bar type'. A switch in the bar-weight editor sets it; turning it off gives the default back. The chip in a session drops the bar half and shows the plate math alone, which with no bar is simply half of what you logged. Two existing tests asserted the old meaning of 0 and are updated: that is the behaviour change. |
||
|
|
82646843c6 |
Plan: move a routine up or down, and every screen follows (#142)
Routines sat in the order they were created, so a plan added in the wrong order stayed that way — the reporter's PushA PullA LegsB PushB PullB LegsB could not be straightened out. Arrows on each row in Plan, the same pair the routine editor uses for exercises. `S.routines` is the one order the whole app reads, so moving a routine here moves it in the Start screen, the day-assignment sheets and every routine picker at once, which is what the request asked for. They are left out entirely when there is only one routine to order. |
||
|
|
0345abc925 | No one-rep-max calculator on an assistance machine — it was offering a max of the help you were given (#232) | ||
|
|
6aa43e7a06 |
Assistance machines: a sync no longer hands the help back, and Stats reads the best the same way (#232)
Two readers were still folding the kept load upwards, so on a signed-in profile the lighter setting was saved and then overwritten on the next sync — the symptom the fix was supposed to remove, one layer down. `sync-merge` kept the larger `w` per exercise, on the stated grounds that the app only ever raises it. That is no longer true: on an assistance machine it lowers it, so merging with a device that still held 30 kg handed back the help the other one had just dropped. Both sides now go through `beatsWeight`, which knows which way each exercise runs. Stats tracked its per-exercise best with a plain maximum, so the curve's "best" line disagreed with the exercise's own record. Weighted reps work now folds by the exercise; reps, duration and speed are unchanged, since more is better in all three. Also makes the list-view scroll test deterministic. It waited on the component's 0 ms fallback and raced under a loaded full-suite run; the test DOM now carries a frame queue the test drains itself, which is the requestAnimationFrame path a browser actually takes. |
||
|
|
542c3f493a |
Serving openGym under a subpath works, with or without the prefix reaching the container (#238)
The app's assets were already relative — the shell loads fine from any directory, which is how
the demo lives under /demo/. What assumed the site root was the API call: `fetch('/api/...')`
went to the proxy's own root, where there is nothing to answer it, so behind
`https://example.com/gym/` the app booted and then could not talk to its server.
It now asks its own address instead: `appBase()` reads the directory the app is being served
from, which the router never leaves — every screen is a hash, and a path that is not a file is
sent back to the app's root before React boots. A proxy that strips its prefix (Caddy's
`handle_path`, Traefik's StripPrefix) therefore needs no configuration at all.
For a proxy that passes the prefix through, the web container takes `BASE_PATH=/gym`, rendered
into its nginx config at start-up like the other settings, so it applies to a prebuilt image.
Wired through docker-compose.yml as well — a documented setting the compose file does not pass
on is no setting at all.
Both shapes were checked in containers rather than read: with BASE_PATH empty the shell, the
assets, /api and the deep-path redirect behave exactly as before; with BASE_PATH=/gym all four
work under the prefix and the redirect stays inside it. The first attempt passed at /gym/ and
404'd /gym/assets/app.js, because a regex location outranks the prefix block and never saw its
rewrite — the cache-control blocks carry it too now. The built app was then loaded in a browser
under /gym/ and its own requests go to /gym/api/config and /gym/api/me.
Reported by leon332157.
|
||
|
|
f7b9a80a93 |
Assistance machines run the other way round: less help is the record, and the plan takes help away (#232)
On an assisted pull-up or dip the stack carries part of your body weight, so 20 kg of help is a harder set than 30. The app read it like every other lift: 30 kg stayed the best, dropping to 20 was not a record, and progression answered a clean session by asking for even more help. Which exercises these are is deliberately narrow. Twenty-nine entries in the catalogue have "assisted" in the name, but only eight are the machine: the rest are partner-assisted stretches, a medicine-ball twist, band and bodyweight leg curls, where the weight is ordinary load and inverting it would be the same bug pointed the other way. The rule is therefore the leverage machine whose name says assisted — and `assisted: true` (or false) on a custom exercise or on a routine's config overrides it in either direction. What changes for those eight: the best load folds to the smallest, in a session and across history; a lighter set is the PR and what the app offers next time; progression takes a step of help away after a clean session and gives one back on a stall, with wording that says so instead of "2.5 kg more"; and they are out of the estimated one-rep max entirely, because Epley on the help you were given rises as you get weaker. A logged 0 counts as "no load entered" rather than a set done with no help at all, so it cannot invent a perfect record and ask for negative assistance afterwards. The progression tests picked their plain lift as "the first catalogue entry that is not cardio, legs, back or bodyweight" — which is `assisted chest dip`. They now exclude assistance machines explicitly, since they are about the ordinary direction. Reported by dpatrongomez. PR #231 fixes the same issue by matching the name alone. |
||
|
|
b5d55467d0 |
Progression reads the sets the plan asked for, not the extra ones logged on top (#233)
An extra set — the one you add because you felt strong, or to chase a heavy single — was read as part of the prescription. A heavier bonus set pulled the weight for the next session up with it, and a bonus set taken short of the target reps reported the whole session as missed and started counting stalls toward a deload. `readSession` now stops at the planned number of work sets. A set past that is still logged, still counts in the volume, the PRs and the history; it just has no say in what the plan does next. A session with fewer sets than planned is short exactly as before. |
||
|
|
a7d710902c |
iOS: the keyboard stays open — the viewport guard no longer blurs the field you are typing in (#242)
Tapping the name or invite-code field on the login sheet threw the keyboard straight back out, about four times in five, and the same happened in every other sheet on iPad and iPhone. `realign()` corrects a page iOS left displaced after the keyboard closed, and it used to let go of a text field that still held focus, because WebKit does not blur an input when a button is tapped and iOS only puts the viewports back once focus has left. The guard around it is `keyboardOpen()`, which compares `innerHeight` with the visual viewport — and both of those move while the keyboard animates in, because the browser chrome collapses at the same time. Measured on iOS 26.6: `innerHeight` fell 684 → 374 while the visual viewport sat at 158, so the difference dipped back under the threshold and the keyboard read as closed roughly 100 ms after every tap. The guard then blurred the field the person had just tapped. The detector cannot be made reliable, so nothing acts on it while somebody is typing: with a text field focused, `realign()` now does nothing at all — no blur, no scroll, and no unpin of a body that a sheet has pinned. The correction still runs from `focusout`, which is when iOS actually needs it, and the two cases the blur was written for already let go of the field themselves: Workout.jsx blurs when a set is ticked, Modals.jsx when a sheet opens. Reported by FabianReitz with a screen recording, and diagnosed by hectorroaz, who instrumented a build on a real device and posted the timings that show the mid-animation misfire. |
||
|
|
c04fd512d4 | Rename workout: the two strings #228 brought in are translated in all fourteen packs, and pt-BR inherits them from pt-PT | ||
|
|
4f003073d0 | Merge #190: i18n(de): use standard ß, not Swiss ss (mkoester) | ||
|
|
9dcda4bfc2 | Merge #234: accessibility: typable weight input (Strazdonis) | ||
|
|
1bb0806436 | Merge #237: fix(home): a door to the Start screen — freestyle and Other routines are unreachable on a planned day (kurktchiev) | ||
|
|
b9079c98db | Merge #228: workout: allow renaming workout title from header menu (ncbachh) | ||
|
|
069cb6d9f9 | Merge r3/custom-tg-edit: QA round 3 2026-09-20 (dev team) | ||
|
|
1ee9970c71 | Merge r3/admin-null-routine: QA round 3 2026-09-20 (dev team) | ||
|
|
6859624e0f | Merge r3/setrow-band: QA round 3 2026-09-20 (dev team) | ||
|
|
d35ba5643b | Merge r3/layout-collateral: QA round 3 2026-09-20 (dev team) | ||
|
|
a0a44cb6c0 |
Phone-width layout: a list row's title asks only for its own longest word, a date or time field drops a line rather than the screen edge, and the page title steps down instead of shredding
Three pieces of collateral from
|
||
|
|
d302088c11 |
Set rows: every give-way now lasts until the full-size row fits — the L/R effort −/+ shrink once more at 360–365 px and the list view's cards keep their extra width to 404 px (QA re-test of 0b1072d)
Two narrow bands were left where a set row was wider than the content box of the card it sits in,
so its done tick reached into the card's side padding: 360–365 px on an L/R row with an effort
column (over by 6, 5, 4, 3, 2 and 1 px, in a sets card inside a superset card or a list unit,
cards, list and compact alike, with a rating logged or not), and 401–404 px on a plain row with
an effort column in a superset in the list and compact view (over by 4, 3, 2 and 1 px). Nothing
was clipped and nothing left the screen — the page never overflowed and every number field still
had scrollWidth == clientWidth — but a row may not stand in its card's padding.
Both are the same shape: a give-way that ends one pixel before the layout it hands back to fits.
At 401 px the nested cards' padding snapped back to 16 + 14 + 14 per side and took 48 px off the
row in the one pixel the screen had gained, leaving 281 px for cells that want 285; at 360 px the
effort −/+ returned and asked for 35 px more than the row had. So each give-way now ends where
its full-size counterpart fits. The padding give-back for the list view's units, superset cards
and sets cards runs to 404 px instead of 400, because 405 px is the width where the three full
insets and the row's 285 px of cells first add up to the screen. And the effort column, which had
one step (nothing below 360 px, 64 px from 360), gets the intermediate one it was missing: from
360 to 365 px an L/R row's pill is 56 px, its −/+ shrinking to a 12 px floor. They are what that
cell sheds first — a pixel lower they go altogether — and the rating keeps its 28 px tap target.
The weight and reps columns were deliberately left alone: they have the 41 px numbers and the
18 px button floors of every other row, and "WEIGHT (KG)" needs 75.5 px of the weight column's
77, so taking the six pixels there would have wrapped the header onto a second line at the most
common phone width there is.
Measured with scripts/opengym-qa/run/r3-setrow-band/sweep.mjs on the QA rig (slot 31, slot 71 for
fixes-0917), a 1 px sweep from 320 to 440 px across cards / list / compact x effort none / RIR /
RPE x steppers on / off x a plain and an L/R row inside a superset and outside one (3630
measurements per build, values 102.5 / 227.5 kg, 12 / 100 reps per side, RIR 2.5 / RPE 8.5,
Liberation Sans as the Roboto-metric proxy): before, 64 measurements had a row past its card's
content box — exactly 360–365 and 401–404 px — and after, none, with no clipped number field, no
card or unit past its parent or the screen and no page overflow anywhere in the sweep. The empty
effort cell (empty-eff.mjs) was over by the same 6 / 3 / 1 px at 360 / 363 / 365 and is now 0.
The effort cell is 56 px wide at 360–365 px and 64 px again at 366; the weight column stays 77 px
and its header label one line (before: one line at 77 px, two at 73). The picker still opens:
tap-effort.mjs at 360, 363 and 365 px in cards and list, taps at the value's centre ±6 px, 30 of
30 opened it. 320, 368 and 412 px lie outside both edges, and fix-setrow-layout/measure.mjs — the harness of
|
||
|
|
36123c0d19 |
Admin: a stored state written before the entry filter opens the drill-down instead of 500ing it (QA C16 follow-up)
GET /api/admin/user mapped S.routines straight off disk — `r.id` on every entry — so a single
null routine threw, the route answered 500 {"error":"server error"} with a stack trace in the
log, and the sheet never left "Loading…". The Disable button lives inside that sheet, so the
one account an operator opened the dashboard to stop was the one they could not: exactly the
end state C16 described, reached through routines instead of workouts. C16 hardened the sheet
and taught PUT /api/data to drop such entries, but a document v1.3.7 accepted still sits on
disk and answers to nobody.
A `records(list)` helper next to readState now hands every reader the entries of a stored list
and nothing else, and both admin routes go through it: the routine map, the body-weight log,
the workout history (whose `.slice()` threw in its own right when `workouts` was an object
rather than an array) and the user list's workout count, which counted entries the drill-down
then dropped and read `null` for a non-array list. A routine's exercise count counts entries
too, rather than the length of whatever `ex` happens to be. PUT /api/data reuses the helper
for the filter it already had, unchanged in behaviour.
The reminder tick walks the same two lists outside any route: a null entry threw there, was
logged and skipped, and cost that profile every reminder from then on, day after day. It
skips the entry now, not the profile.
Measured on QA slot 32 with each shape planted directly in the slot's data dir
(scripts/opengym-qa/run/r3-admin-null-routine/plant.mjs, shots alongside it):
routines [null, r] before GET /api/admin/user 500, sheet "Loading…", 0 Disable
buttons, 16 stack frames in api.log
after 200, sheet shows Workouts 1 · Weigh-ins 1 · Routines 1,
disable and re-enable both land in the audit log,
0 stack frames, no console or HTTP errors
workouts/routines as before 500, same dead sheet, 12 stack frames
objects, not arrays after 200 with empty lists
bodyweight [null, b] before 200 but "Weigh-ins 2" for one weigh-in (4 for one plus
three junk entries)
after 1, the number of weigh-ins there are
null and shapeless workout entries, a null customEx, absent lists and an ordinary
profile all open, disable and enable, before and after.
api/test/server-admin-state.test.js covers both admin routes against ten stored shapes, and
server-reminder.test.js gains the null-entry case: 188 api tests (was 185). Frontend
untouched — the sheet's own guard from C16 still does the work the server cannot: 1533 vitest
green, 14 locales in sync, 33 demo-only source strings.
|
||
|
|
668002b066 |
Custom exercises: un-ticking the target hands it to a muscle you tapped, not to the topmost one (QA C10 follow-up)
|
||
|
|
0fa35030ee | Merge fix/layout-misc: QA round 2026-09-19 (dev team) |