"No se están moviendo los datos de la tarjeta, se quedan igual." En esta pantalla, un teléfono que
está enviando cada cinco minutos y uno que dejó de enviar se ven idénticos: los mismos números, la
misma hora de la última lectura. Necesitan arreglos opuestos — uno se mira en el reloj, el otro en el
celular — y hasta ahora la pantalla no daba con qué distinguirlos: decía "actualizado hace X", que es
cuando llegó el último envío, y nada sobre lo que ese envío traía.
El endpoint ya devolvía el recibo (`last: {ts, points, duplicates, workouts}`) y se quedaba en la
respuesta. Ahora se muestra:
· "El último envío trajo 6 datos nuevos; 282 ya estaban guardados." → el teléfono trabaja y los
números se mueven cuando Apple Health tiene algo nuevo.
· "El último envío no trajo nada nuevo: todos los datos ya estaban guardados. El teléfono está
enviando; Apple Health no tiene nada más reciente que lo que ya está acá." → el problema está en
el reloj o en su sincronización con Salud, no en la app ni en el servidor.
· "Todavía no llegó ningún envío." → la automatización no corrió nunca.
Tres frases que llevan a tres lugares distintos, en una línea bajo el rango. Antes de sospechar del
merge, esto dice si hay algo que mergear.
El test usa el propio botón de actualizar para forzar la segunda lectura, así que también comprueba
que ese botón vuelve a preguntarle al servidor. Mutation-check: si el recibo pierde el caso "nada
nuevo", falla.
Preguntaste si se podía implementar Jev, y con qué API. Resulta que Jev se sirve por OpenCode Zen,
así que una sola cuenta cubre esto y cualquier otra cosa apuntada a ese gateway:
POST https://opencode.ai/zen/v1/systemone Bearer <clave> model: jev-1.13
Y ahí está la razón de que valga la pena: Jev no es un modelo de chat. Le mandás un *estado* y
preguntas tipadas — sí/no (`noul`), opción (`choice`), rúbrica (`score`) — y contesta todas en una
sola petición con el valor **y la probabilidad que le puso**. "62% probable" se puede discutir;
"tomate una semana de descarga" no. Así que no entra por el Coach (que necesita *escribir*) y no se
fuerza dentro de su lista de proveedores: tiene su módulo, sus dos rutas y su tarjeta.
Qué hace. En Salud, arriba de la grilla, una tarjeta con cuatro respuestas: qué tan listo estás para
entrenar fuerte (nivel 1-5, con el número al lado), si la semana pide bajar carga (62% probable), qué
parte del cuerpo parece menos recuperada, y qué métrica de salud merece atención — esa última con la
última lectura de la métrica que nombró, para que "vigilá tu frecuencia en reposo" venga con el 62
que lo motivó. La hoja detrás del ⓘ dice a dónde va y exactamente qué se envía, con el mismo resumen
que devuelve el servidor.
Lo que sale, y lo que no. Se decide en `api/jev.js` y son agregados: una semana de cada métrica por
campo como la escribió el teléfono, series por parte del cuerpo de 4 semanas y de la última, sesiones,
días desde la última, RPE medio, estancamientos *por nombre de ejercicio*, el último pesaje y su
cambio. Ningún identificador: ni perfil, ni nombre, ni títulos de entrenamientos, ni ids de
ejercicios, ni chat — hay un test que lo afirma sobre el JSON, porque es una promesa que hacen los
docs y nada más la miraba. La única excepción es deliberada y está documentada: la nota de
*limitaciones* del cuestionario del Coach, porque "hombro malo" cambia la respuesta. (Los títulos sí
estuvieron un rato ahí: los saqué al escribir ese test, y el test se quedó.)
Un juicio no es una instrucción, y el código lo trata así. Cada respuesta se muestra con su
probabilidad; una pregunta que el modelo no contestó se muestra como no contestada, nunca como un
cero; un nivel que no habíamos ofrecido se marca en vez de disfrazarse de propio; y si los datos
cambiaron desde que se pidió (una sesión registrada, una noche que llegó) la tarjeta lo dice en lugar
de seguir pareciendo actual. Tampoco corre por temporizador: cuesta una petición, así que pasa cuando
alguien aprieta *Preguntar*, con cupo por perfil y por día y un piso de diez minutos aplicados en el
servidor, no en la pantalla.
El Coach, además, lo recibe como `secondOpinion` en su payload **solo si tiene menos de seis horas**,
como evidencia con confianza adjunta para citar en `why`, nunca como una orden ni como un cambio de
plan. Es la mitad que faltaba de "y el Coach escribe con eso".
El lector de respuestas es tolerante a propósito: el contrato de la petición está documentado, la
respuesta no la vimos nunca del servicio real, así que acepta las formas plausibles
(`answers`/`results`, `option`/`answer`/`choice`, `probability` o una distribución sobre los niveles),
normaliza lo que encuentra y devuelve `null` por lo que no puede leer. El cuerpo crudo queda guardado
al lado del parseado (y sale con `?raw=1`): la primera llamada real se puede mirar, y una forma mal
adivinada es un arreglo, no un misterio.
Dos cosas que encontré escribiendo esto y que quedan arregladas: una variable de entorno vacía se
leía como **cero** (`Number('')` pasa un chequeo ingenuo), así que un cupo sin configurar era "cero
peticiones" — un feature que parece configurado y no funciona nunca; y agregar la palabra *Back*
para la espalda redefinió el botón *Atrás* de la app a "Espalda", porque en un objeto literal la
última clave gana y nada lo dice. El catálogo de español tiene ahora un test que falla si una clave
se escribe dos veces, mutación comprobada.
Cobertura: 11 tests del módulo (el estado, las preguntas, cada forma de respuesta, la promesa de
privacidad, el cupo), 5 de las rutas contra un gateway de mentira y el servidor real, 6 del modelo de
vista en el frontend y 5 de render por la tarjeta real. API 259 en verde, frontend 1696, build OK.
"Pasos, energía activa, horas de pie, tiempo de ejercicio se ven una sola tarjeta por fila y se ven
grande; debe ser igual que las demás." That was the "Trends" section: the first four metrics in
catalogue order drawn as full-width panels with a big chart and the window's own min/avg/high,
with those four taken out of the grid below so nothing was drawn twice.
It was a bad idea for two reasons. Four huge cards, one per row, above a tidy grid of small ones
read as two screens stapled together — which is exactly what was reported. And the four it picked
are the four most people open this screen for, so the grid looked like it was missing its own
headline metrics: Steps was a panel *instead of* a card.
Every metric is now one card in one grid, two to a row, with its sparkline; the chart worth reading
is one tap away in the detail sheet, where it also has the hours and the day-by-day numbers around
it. That makes `trendCards` and `seriesStats` unused, so they and their tests are gone with the
section, along with the `.vh-charts` / `.vh-tchart*` rules that only it used.
The render test now asserts the grid holds *every* metric (5 of 5 in the fixture, labels included),
that no `.vh-tchart` is rendered anywhere, and that no "Trends" heading is left behind. Checked
against the old behaviour by holding one metric back out of the grid: four tests fail.
Asked for as "filas de 2 tarjetas para que se vea bien". The grid used the shared `.tiles`, which
is two columns on a phone and **four** at ≥1000px, so on a desktop the health cards were ~240px
wide — narrow enough that the unit wrapped off the number and the sparkline flattened into a
squiggle with no shape, which is the one thing it is there to show.
The grid now carries `vh-tiles` and the stylesheet gives that pairing two columns, on any screen.
It is a scoped rule rather than a change to `.tiles` because every other grid in the app — Home's
quick tiles, Stats, the admin cards, the sheets — wants the four-column version; a health card is
the only tile carrying a unit, a trend arrow and a chart.
The test asserts both halves, because either one alone does nothing: the class on the grid, and
the rule it applies. Checked against both bugs — removing the class fails it, and so does putting
the rule back to four columns.
The idea was "each person types their Apple Music username and their public playlists
appear". Apple does not allow that, and it is worth writing down rather than discovering
later: there is no API for another person's public playlists — their own developer forums
answer that request with "you can't" (threads 692941 and 123894) — and a profile page is
rendered by JavaScript with nothing behind it to call. MusicKit offers the catalog and the
*signed-in* user's own library, and the second needs an Apple Developer Program membership
for a developer token plus a Music-User-Token per person: a private key and a third-party
secret in an app that holds none, to fetch something other than what was asked for.
What a self-hosted app can do is the share link, which every playlist has: Music → Share →
Copy Link. So the Música screen (next to Salud in Home's header, plus a section in Settings)
keeps a list of them per profile, in the profile document like the routines — so they sync to
the other devices and travel in a backup — and tapping one opens it in Apple Music on the
iPhone. The username is a link to the person's public profile.
The list is nicer than a column of URLs because the API reads each link's public page for a
title, artwork and track count. That is scraping, so it is built to lose: a page that says
nothing leaves the card showing the name its owner typed, and nothing on the screen depends
on it. `POST /api/music/lookup` is host-allowlisted to Apple's music hosts — https only,
checked again on the URL a redirect lands on — because the api container sits on the same
network as everything else the owner runs, and a route that fetches whatever it is handed is
a request-forgery lever. That boundary has its own tests, including the LAN addresses it
must refuse.
The parsing lives in api/music.js rather than in both halves: two copies of a parser kept in
step by hand is a bomb, and this is the same shape as vitals.js. It is in the Dockerfile's
COPY for the same reason vitals.js had to be.
Two things about the launch screen on the phone.
**No mark on it.** The photograph is the screen now — the logo that sat in the middle is
gone, and so is the vignette that existed to keep that logo readable. Nothing to read, just
the picture, which is what was asked for.
**It no longer waits for React.** Until now the splash was a React element, so it could not
appear until the bundle had downloaded, parsed and mounted — on a phone that is the long
blank stretch between opening the app and seeing anything, and it is why the splash seemed
to arrive late and then flash past: by the time it rendered, the app was nearly ready.
index.html now paints the same photograph from inline styles, so it is on screen as soon as
the HTML is parsed, with the bundle still downloading behind it. React replaces the
container's contents when it mounts, and the two screens are identical — same image, same
object-fit, same base colour behind it while the picture decodes — so the handover cannot be
seen as anything but the app arriving.
The blank before even that is iOS's own launch screen, which is what apple-touch-startup-image
covers: production already serves all fourteen, so a PWA that still opens white is one that
was installed before those existed. Removing the icon from the home screen and adding it
again is what makes iOS pick them up — its launch images are read at install time, not on
every launch.
Two things the Salud screen had and the rest of the app did not.
**The panels.** Every card, tile, grouped list and list row is translucent now, because the
aura is behind all of them: with a solid fill the background we added to every screen was
only visible in the gaps between cards, which is not what a background is for. The tab bar
and the sheets are translucent too, at a heavier weight — they float over content and have
to stay readable, which is what the second token (`--glass-strong`) is for. The blur comes
from one shared rule instead of each class carrying its own pair, and the per-view panels
that paint their own surface (the effort table, the superset card, the check-in card, a
note, a calendar cell) joined the list rather than being left behind.
No opaque fallback for the panels, deliberately, where the tab bar keeps one: the bar
scrolls over text, a card sits in the page flow with nothing behind it but the aura.
**The colours.** They came from the group — every Activity metric the same green, every
Heart metric the same pink — which is exactly the "all the same" that was wrong: resting
heart rate and VO₂ max are both heart, and telling them apart by colour is the whole point.
Each of the 50 metrics in the catalogue now carries its own, following the Health app's own
logic: red for heart rate and blood pressure, indigo and violet for sleep, blue for body
composition, teal for oxygen and breathing, oranges for movement and temperature. The label
takes the colour too, as asked; the group tint stays as the fallback so a metric nobody has
written a line for still gets one.
Two bugs of my own on the way, both caught by tests rather than by looking: the spec()
builder is an allow-list and was dropping the `color` it was handed, so every card fell
straight back to its family colour; and the test that now asserts "within a family the
colours are not all identical" is what would have kept that from shipping unnoticed.
**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.
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.
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.
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.
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.
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.
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).
Three pieces of collateral from d7bb67a, which fixed C8/C23 and C25 with two blunter
rules than those findings needed. Both of its fixes stay fixed; what they cost the
rows and titles around them does not.
.lrow-m, the title column. The 104px floor was the width of one long word, but every
row pays it, and a row whose only flexible part is the title has nothing else to give.
In the backfill sheet's Date and Start-time rows the floor came straight out of the
<input type=date>: at 320px it ended 23px off the right of the screen with its calendar
picker entirely off-screen, so on a small phone there was no way to open the picker at
all. The floor also took space from values that used to fit — "Freies Training" became
"Freies …", and the Rule row's value dropped from 141px to 113px. min-width:auto, the
flex default this rule had switched off, is the floor the Progression row was actually
asking for: its own longest word, which for "Routine" is 63px and for "Progression"
96px. Every row now asks for exactly what its title needs and no more. It also closes a
row the floor never reached: German "Intensivierungstechnik" ran 18px over the value
beside it on v1.3.7 and on the branch, and now it does not.
The two rows with a date or time field. Even at its own longest word a title can leave
that field nothing: Polish "Godzina rozpoczęcia" plus the clock is 17px more than a
320px row holds, and the same is true of the Settings reminder row, whose field hung
3px off the screen in every language. Those rows now wrap the field onto a line of its
own under the title, still flush right — the same shape a row with an inline segmented
control already uses when its control and title cannot share a line.
.hdr h1, the page title. min-width:0 on the title block and flex:none on the button are
what keep the header button reachable, and they stay. What came apart was the title left
in the 95 to 125px the Library's "By muscle" button leaves it: hyphens:auto spends a
character's worth of width on the hyphen itself, and in a box that tight that was the
difference between two lines and three — "Упражнения" rendered as "Упра / жнен / ия" in
a 170px header, "Ćwiczenia" and "Gyakorlatok" the same. Below 420px, every phone width
we test, the title now drops a step to 30px, at which all 14 packs take two lines at
most with a character of slack; hyphens:auto is gone, and a word that still does not fit
is broken with overflow-wrap:break-word rather than :anywhere, which moves the whole word
to the next line before breaking it — :anywhere broke "Bartholomew_Jones" mid-word even
at 412px, where a line of its own was waiting for it.
Measured on the QA rig (scripts/opengym-qa/run/r3-layout-collateral/, en/de/ru at
320/368/412 plus all 14 packs at 320/368, the header set also with Roboto injected):
backfill <input type=date> / <input type=time> right edge at 320px, de: 343 / 325
(23px and 5px off a 320px screen) -> 288 / 288, both inside the card, both
picker icons visible. pl "Godzina rozpoczęcia" 325 (5px off) -> wraps, 288.
en and ru 288 / 288 on one line. 360, 368 and 412 clean in every pack.
Routine value box at 320px, de: 72px ("Freies …") -> 113px ("Freies Train…"). The
German string wants 119px and the row has 176px for title plus value, so
v1.3.7's 119px was bought by letting "Routine" spill 6px into the value's
box. en 72px (clipped) -> 75px, not clipped, as on v1.3.7.
Rule value box at 320 / 368 / 412: 113 / 161 / 191 -> 141 / 167 / 191, which is
v1.3.7's 141 / 167 / 191 exactly.
C8/C23 "Progression" title box / how far the title runs onto the value, 320px:
v1.3.7 37px / +47, branch 104 / -20, now 96 / -12 (ru 102 / -12). 368px:
v1.3.7 65-74 / +10..+19, now 96 / -12. ru 412: v1.3.7 80 / +10, now 102 / -12.
C25 Library button right edge, ru at 320 / 368: v1.3.7 388 / 388 (off both
screens) -> 304 / 352, button reachable. Title lines at 320: branch
Упра/жнен/ия, header 170px -> Упраж/нения, 126px; hu Gyak/orlat/ok, 151px ->
two lines; pl Ćwic/zeni/a -> Ćwicz/enia. ru at 412 is back to one line.
headers 15 packs x /library /settings /home x 320/368/412 with Roboto: 135 headers,
none over two lines, every button on screen. The one title that still takes
three lines is "Hi Bartholomew_Jones" at 320 and 368 — a 17-character token
with no break in it; at 412 it is two lines, where the branch had three.
sweep Every .lrow of Settings, the routine editor, the exercise config sheet and
the backfill sheet in all 14 packs at 320 and 368: 1170 rows, 30 of them
poking out of their row on the branch, 0 now.
Known trade: German "Intensivierungstechnik" and "Keine" cannot both fit a 320px row.
The title now has its word and the value ellipsises to "K…" (46px -> 28px) where before
the title ran 18px over it. Thai wraps "การเพิ่มระดับ" onto two lines at 320 rather than
holding a 104px column open for it.
Vitest: 117 files, 1535 tests green (1533 plus the two added here); locales in sync; the
source-string baseline stays at 33. No new user-facing strings.
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
0b1072d, 108 combinations of width, view, effort, steppers and superset — prints byte-identical
output on this build and on fixes-0917, 0 with problems (QA C2, C3, C4, C5, C21, C22, C24).
The weight/reps steppers gave their two 32 px buttons priority over the number between them, so
on narrow phones the field shrank to nothing: at 320 px a fresh profile (no effort column,
buttons on) showed an empty reps field and "102" for 102.5; per-side rows lost the reps number at
368 px, and inside a superset at 412; the cardio row's 10.5 km/h read "10"; a per-side drop set's
two fields collapsed to 0 px; with an effort column the decimal weights lost their last digit at
320 px; a weighted timed hold showed "102.!" for its load at every phone width; the logged
effort's value shrank to 4 px under its own digits so a tap on it stepped the rating instead of
opening the picker; and the column header over per-side rows stood 17-23 px left of the cells
because it never accounted for the L/R badge. Only the #235 mitigations existed, scoped to rows
with an effort column.
Every number field now reserves the widest value it shows at its own font (`--num`, plus the
field's padding and 2 px against font rounding), the cell is never narrower than that plus two
button floors (18 px, 16 px on the tightest rows), and the buttons shrink first. The weight and
reps buttons, that is: the effort cell is a `.stp` too and its value is a `<button>`, so that
rule stays off it and the value keeps filling its cell instead of sitting in a 32 px box with
dead space beside it. The effort column keeps a 28 px value with 16 px floors; where a row cannot
hold three numbers and six buttons — every row below 360 px, and an L/R row inside a superset in
the list view below 430 px, where three insets leave it 260 px of a 412 px screen for the 277 its
cells want — the effort's −/+ give way and the value alone stays, still opening the picker; from
430 px up that row keeps its −/+ like the plain row above it. A timed hold logs the seconds first
and the load second, so those two columns swap their reserve and their share at every width, not
only below 360. The header carries `per-side`, `timed` and `plain` from Workout.jsx so its columns
freeze exactly where the cells do; per-side drop rows no longer pay the straight row's 32 px
indent twice; a weighted timed hold (one control more than a straight row) gets the effort-row
sizing below 360 px. The list view's grid gets minmax(0,1fr): with floors on the cells the default
`auto` track grew a unit past the screen and carried the ticks off it, which is also why an
earlier draft's list numbers looked fine. The sets card nested in a list unit or superset card
gives up 8 px of side padding at <=400 px so every row has the same 256 px at 320 as in a plain
card.
Measured with scripts/opengym-qa/run/fix-setrow-layout-2/measure.mjs on the QA rig (slot 70), one
fresh guest per combination, 320/368/412 px x cards/list/compact x effort none/RIR/RPE x buttons
on/off x plain/superset (108 combinations), values 102.5 / 227.5 kg, 12 / 100 reps, 22 min @
10.5 km/h, timed holds of 120 s @ 32.5 kg, 90 s @ 102.5 kg and 600 s @ 227.5 kg, per-side
22.5 x 12 and 102.5 x 100 with drops, RIR 2.5 / RPE 8.5, Liberation Sans as the Roboto-metric
proxy: before (fixes-0917) 0 of 108 clean, 698 clipped fields and the list unit 23 px wider than
a 320 px screen; after 108 of 108 clean, no row or unit overflow, header drift 0 px on plain and
per-side rows, the tightest field ("227.5" in a drop row) 2.1 px of slack. The same matrix at 768
and 1280 px (48 combinations): clean. The timed load — the field the earlier run only ever put
32.5 kg in — has 37 px for "102.5" and "227.5" at 320 px, 44 at 368 and 51-67 at 412, with
scrollWidth == clientWidth everywhere (before 17-29 px for a 41.7 px value, i.e. "102.!").
Effort cell (tap-effort.mjs, RPE 8.5, taps at the value's centre +-6 px, 320/368/412, cards and
list): 30 of 30 open the picker (before: 2-3 of 5 stepped the rating at 320/368); its value is
28 px next to 24.4 px of text on a phone and 71.5 px in a 115 px cell at 1280 px, centred between
the −/+ (before 32 px in a 105 px cell, bunched left). L/R rows in a superset in the list view
(budget.mjs, ss-eff.mjs): the effort −/+ are gone at 320-429 px and back from 430 px, where the
row is 278 px wide and nothing overflows — 1 px short at 428 — and at 768 and 1280 px both
buttons and a 28-35 px value are there, as on the plain row beside them. Per-side drop inputs
(drop-rows.mjs): 34/24 px for "22"/"5" at 320 cards, 368 list+superset and 412 list+superset
(before 0/0, 5/5, 13/13). Cardio speed "10.5" (cardio-speed.mjs): 35-45 px for a 32.5 px value at
every width and view (before 0-33 px). Header vs cell centres (header-drift.mjs): 0 px in all 12
configurations (before w -18..-23, r -6..-14).
Four fixes to layouts that only fall apart on narrow phones, all pre-existing:
Exercise config sheet (C6). Double progression on a weighted exercise puts four
steppers in one .cfgrow (Step, Reps from, Reps up to, Deload 1RM). Each spends 64 px
on its buttons, so four abreast left the input 1 px at 320 and 13 px at 368 — "1.25"
read "1.2", "90" read "9(". The row now carries `cfgrow-4` when it holds the four,
and below 480 px it wraps into two pairs (basis half the row minus half the gap).
From 480 up four abreast still leaves 41 px, enough for "1.25".
Routine editor, "Progression" row (C8, same as C23). .lrow-m had a basis of 0 and got
only what the capped value left over: a 37 px box for a 96 px title at 320, so
"Progression" was painted over by "Linear progression". The title column now keeps
104 px, the width of one long word; the value shrinks and ellipsises as before. This
is the same floor the segmented-control rows already use (150 px), which the more
specific rule keeps. All 60 title+value rows in the 15 packs fit at 320 px.
Page header (.hdr) (C25 plus the two reported header cases). The title block could
not shrink below its longest word, so "Упражнения" at 34 px, "Izom szerint" next to
it, or a profile name like "Hi Bartholomew_Jones" pushed the Settings gear or the
"By muscle" button off the right edge, and before that the button's own label wrapped
into two lines. The title block gets min-width:0, a word that does not fit is
hyphenated (hyphens:auto — <html lang> follows the app language) and broken anywhere
only as a last resort, and the header button is flex:none so it keeps its width.
Body-weight card header, Home and Stats. In German the title plus "Ziel" and
"+ Eintragen" outgrow a 320 px card by ~55 px and the last button poked past the
card; the header (`bw-head`) may now wrap the button pair onto a second line, still
flush right.
Measured on the QA rig (scripts/opengym-qa/run/fix-layout-misc/measure.mjs, en/de/ru;
after in DejaVu and with Roboto injected, before in DejaVu):
C6 input clientWidth for "1.25" (needs 37): before 1 / 13 / 24 at 320 / 368 / 412
→ 74 / 98 / 120, two lines; 480: 41, 600: 71, one line (c6-wide.mjs)
C8 title box / paint-over onto the value, 320 en: before 37 px / 47 px over
→ 104 / −20 (Roboto −27); 368 de before 65 / 19 → 104 / −20; 412 ru before 80 / 10
→ 104 / −14; no title clipped in any of the 9 cases
C25 Library button right edge, viewport 320 / 368: ru before 388 / 388 → 304 / 352;
Roboto 304 / 352 / 396 (412), title hyphenated "Упраж-нения" at 320 and 368
hdr Home gear right edge with "Hi Bartholomew_Jones": before 423 at every width
→ 304 / 352 / 396
bw last button past the card's padding, 320 de: before 53 px → 0 (second line);
368 de before 5 → 0
Regression sweep (sweep.mjs: /home /settings /plan /plan/r /stats /library /muscles
/history at 320 and 368 in en/de/ru/hu): no page overflow, nothing off-screen, no row
wider than its card. Vitest: 115 files, 1520 tests green; locales in sync; the
source-string baseline stays at 33.
The scroll margin that keeps the current unit out from under the pinned header was a
fixed 96 px, the height of a one-line header. The header renders the session name
without truncation, so a descriptive routine name or a two-routine "A + B" session
makes it two to five lines tall and the unit's label, Current badge and menu ended up
underneath it.
Workout.jsx measures the header right before it scrolls and hands the height to the
list as --whdr-h; .wl-unit's scroll-margin-top uses it (safe area included, since the
header's padding carries it) and keeps the one-line height as the fallback.
Measured on the QA rig (scripts/opengym-qa/run/fix-list-scroll/measure.mjs, gap from
header bottom to the current unit's top, tab-bar return with "Set current" on the 4th
exercise; before: negative = covered):
320 px 8ch 12 | 42ch (143 px header) 12, before −51 | 62ch (165) 12, before −73
368 px 8ch 11 | 42ch (121) 12, before −29 | 62ch (143) 12, before −51
412 px 8ch 11 | 42ch (99) 12, before −7 | 62ch (121) 12, before −29
backfilled session, 42ch name, via ⋯ → Layout → List at 368 px: 16
- useRevealActiveChip sets the strip's own scrollLeft instead of scrollIntoView, which
walked every scrollable ancestor and jumped the page when the strip sat above the fold;
.chips contain overscroll on both axes.
- Every .sheet cap (and .center) carries env(safe-area-inset-top); the dead
-webkit-overflow-scrolling is gone.
- viewport-guard: with the keyboard down and the page displaced, a text field that kept
focus (WebKit does not blur on button taps) is blurred and the correction runs; while
Modals has the body pinned it unpins for one scroll and pins back where it was.
Modals blurs a page field when a sheet opens; ticking a set blurs the row's input.
- Android: shortEdges cutout mode so --sat is real, adjustResize for the keyboard.
The body-part and equipment filters in the Library (and the exercise
picker, the muscle explorer) are `.chips` rows that overflow sideways.
On a phone you swipe them; index.css hides the scrollbar. On a desktop
browser there was no way to reach the chips past the right edge — a
mouse wheel scrolls the page, and there's no visible handle.
lib/hchips.js adds a click-drag: press anywhere on a strip and pull it
along, the way a swipe does on a phone. One delegated pointerdown
listener on the document.
- 6px slop before a press becomes a drag, so a click still selects a chip
- the click the browser fires after a drag is swallowed, so releasing
over a chip doesn't toggle that filter
- mouse only (pointerType 'touch'/'pen' already scroll natively);
primary button only; non-overflowing rows are left alone
- grab / grabbing cursor as the hint, on rows that actually overflow
(data-xscroll, set on hover), gated to (hover:hover) and (pointer:fine)
Closes#68
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DBkhHLqWtSYrPdsNE11PiP
One-sided (reps-per-side) exercises now log weight, reps, RIR/RPE and done individually per side, shown as two L/R rows per set. The per-side data rides on the set row while its scalar w/r/done/effort stay a correct aggregate, so volume, 1RM, PRs, progression, recovery, history and the coach read it unchanged. Side badges localised for all languages. Closes#60.
- removed ability to manually enter code to be displayed as QR code. Codes can only be scanned via camera or imported from an image on the device
- Cards can be edited once they are created. E.g. changing the description, re-scanning the code
- You can change the order of code-cards via long-press
- Last selected code-card will be shown when selecting "check in" on home screen
- Optics: Correctly centered titles of code-cards
Wer eine Routine plant, scrollt sonst jedes Mal durch 1300 Uebungen zu denselben zehn.
Ein Stern im Kopf des Uebungs-Detail-Sheets (aria-label + Toast) merkt sich eine Uebung in
S.favEx — Katalog- oder eigene Ids. Das Feld reist mit dem Profil (Sync/Export), bleibt aber
bewusst aus dem geteilten Plan-Bundle draussen (lib/plan-share.js baut das Bundle nur aus
Routinen/Woche/customEx, dort war nichts zu aendern).
- lib/favourites.js: favIds/isFav/toggleFav/sortFavouritesFirst; alte Profile ohne Feld lesen
als leer. Die Sortierung ist in beiden Haelften stabil, damit eine nach Name oder Nutzung
sortierte Liste ihre Ordnung behaelt.
- Picker, Library, MuscleExplorer sortieren erst NACH Suche/Koerperteil/Equipment, also innerhalb
der aktuellen Trefferliste; Favoriten tragen einen kleinen gelben Stern vor dem Namen. Der
Akzent-Tag am Zeilenende ("Gewaehlt" = schon in Routine/Log) bleibt unveraendert und ist
durch Position und Farbe davon unterscheidbar.
- Picker: zusaetzlicher Chip "Favoriten (n)" vor "Gewaehlt", nur sichtbar wenn es welche gibt,
mit eigenem Leer-Hinweis; die Scope-Abfrage ist jetzt eine kleine inScope-Funktion.
- Eine geloeschte eigene Uebung faellt auch aus favEx.
- ko/ru nannten den alten "Chosen"-Filter bereits "Favoriten" — umbenannt (선택됨 / Выбранные),
damit die zwei Chips nicht gleich heissen.
- 6 neue Strings in 14 Packs, pt-BR nur der Leer-Hinweis (toque/adicioná-lo); Fingerprint
in pt-br-locale.test.js nachgezogen.
- Tests: lib/favourites.test.js, sheets.favourites.test.jsx (Stern + Picker-Reihenfolge +
Chip mit echtem Store), views/Library.test.jsx (Reihenfolge + Koerperteil-Filter).
Vorher standen pro Uebung Notiz/Details, zwei Superset-Tasten, ein Stangen-Chip, unter den
Saetzen drei Tasten und unter der Karte Prev/Next, Hinzufuegen, Hoch/Runter, Tauschen, Entfernen;
pro Satz dazu +Drop/+Burst und bei Warm-ups ein X. Jetzt:
- Uebungskopf: nur noch "⋯" (Notiz, Details, Progression, Stangengewicht, Aufwaermsatz,
Superset mit vorheriger/naechster, Tauschen, Hoch, Runter, Entfernen). Der Notiz-Stift bleibt
sichtbar, sobald eine Notiz existiert. Die Aktionen zielen auf GENAU diese Uebung, auch als
Superset-Mitglied (blockProps traegt idx, moveUnitAt(at, dir) statt moveCurrentUnit).
- Satznummer ist ein Button: Drop-Satz, Rest-Pause-Burst, diesen Satz entfernen (ersetzt die Chips
und das Warm-up-X). Unter der Karte nur noch "Satz hinzufuegen".
- Stangen-Chip wird eine Textzeile (Bearbeiten ueber das Menue).
- Settings → Waehrend eines Trainings → "Bedienelemente im Training": Plus/Minus-Tasten (aus =
Zahl antippen und eintippen, .stp.plain), Drop/Burst-Kuerzel an jedem Satz, Superset-Tasten im
Kopf, Verschieben/Tauschen/Entfernen unter der Uebung. S.wc ueberlagert WC_DEFAULT
(lib/workout-controls.js), alte Profile lesen als schlankes Layout.
- menuSheet() in sheets.jsx als generisches Aktionsmenue, Icon "more".
- 14 neue Strings in allen 14 Packs (pt-BR mit voce-Formen), pt-BR-Guard 617/592/088bb72a.
- Tests: Menue-Pfade + Schalter neu; Move/Swap/Remove-Tests laufen mit exerciseButtons an.