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 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.
This commit is contained in:
Duarte Santos committed 2026-09-20 17:46:09 +02:00
1 parent 0fa35030ee
commit a0a44cb6c0
3 files changed
+70 -12

No files matched your search

+29 -12
View File
@@ -184,13 +184,19 @@ body.resting #app{padding-bottom:calc(206px + var(--sab))}
.hdr{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:8px 0 18px}
/* The title block gives way, the button on the right never does: a flex item will not shrink
below its longest word, so "Упражнения" at 34px or "Hi Bartholomew_Jones" used to push the
gear / "By muscle" past the screen edge. A word that does not fit is hyphenated ("Упраж-
нения"; <html lang> follows the app language, so the right dictionary applies) and, for one
no dictionary knows, broken anywhere as the last resort. Ordinary titles still wrap at
spaces, and the button keeps its width instead of squeezing. */
gear / "By muscle" past the screen edge. Two things follow from letting it shrink. Below 420px
— every phone width we test — the title drops a step to 30px, because the 95 to 125px the
Library button leaves the Polish and Russian titles is less than half of "Ćwiczenia" or
"Упражнения" at 34px and they came apart into three lines; at 30px all 14 packs take two at
most. And a word that still does not fit is broken with overflow-wrap:break-word, which moves
the whole word to the next line first and breaks it only if it does not fit there either —
`anywhere` broke "Bartholomew_Jones" mid-word even at 412px, where a line of its own was
waiting for it. hyphens:auto goes with them: the hyphen costs a character's worth of width in
a box this tight, and that is what turned "Упражнения" into "Упра / жнен / ия". */
.hdr>div{min-width:0}
.hdr>.btn{flex:none}
.hdr h1{font-size:34px;line-height:1.06;font-weight:700;letter-spacing:-.028em;hyphens:auto;overflow-wrap:anywhere}
.hdr h1{font-size:34px;line-height:1.06;font-weight:700;letter-spacing:-.028em;overflow-wrap:break-word}
@media (max-width:420px){.hdr h1{font-size:30px}}
.hdr .sub{color:var(--label-2);font-size:15px;letter-spacing:-.006em;margin-top:4px}
.iconbtn{
@@ -260,16 +266,20 @@ h4.sec{
display:flex;align-items:center;justify-content:center;
background:var(--tint,var(--acc));color:#fff;
}
/* The title column keeps at least 104px: with a basis of 0 it only got what a capped value left
over, and on a 320px phone "Progression" (96px) was painted over by "Linear progression" in a
37px box. .lrow-t does not ellipsise on purpose — long settings titles wrap onto a second line,
and a floor the width of one long word is what keeps a single word from spilling. The value
next to it shrinks and ellipsises instead (below). */
.lrow-m{flex:1;min-width:104px;display:flex;flex-direction:column;gap:1px}
/* The title column never shrinks below its own longest word. With a basis of 0 and min-width:0 it
only got what a capped value left over, and on a 320px phone "Progression" (96px) was painted over
by "Linear progression" in a 37px box; min-width:auto — the flex default — is exactly the floor
that case wants. A fixed 104px floor fixed that row and starved the rest: the backfill sheet's Date
and Start-time rows have nothing but the title to give, so the floor shoved their fixed-width
.timef off a 320px screen, and a short title like "Routine" (63px) took 104px away from the value
beside it until "Freies Training" ellipsised. Asking only for the longest word takes nothing a row
did not already owe the title. .lrow-t does not ellipsise on purpose — long settings titles wrap
onto a second line — and the value next to it shrinks and ellipsises instead (below). */
.lrow-m{flex:1;min-width:auto;display:flex;flex-direction:column;gap:1px}
.lrow-t{font-size:17px;letter-spacing:-.012em;line-height:1.25}
.lrow-s{font-size:13px;color:var(--label-2);line-height:1.3}
/* flex:none would let a long value ("Follow the routine (Linear progression)") run straight
through the title next to it, since the title's column is free to shrink down to its floor.
through the title next to it, since the title's column only holds out for its longest word.
Letting the value shrink and ellipsise instead keeps the two out of each other's way.
The cap is max-width, not flex-basis: .lrow-m is flex:1, so its basis is 0 and it absorbs
none of the shrink — a long value would otherwise take the whole row and squeeze the title
@@ -587,6 +597,13 @@ body.chips-dragging *{cursor:inherit}
background:var(--surface-2);border:none;border-radius:8px;padding:6px 10px;
font-size:16px;color:var(--label);outline:none;font-variant-numeric:tabular-nums;
}
/* A date or time field is as wide as the browser draws it and will not give way, and neither will
the title beside it once that is down to its longest word: the Polish "Godzina rozpoczęcia" plus
the clock leaves a 320px row 17px short, and the field then hangs over the edge of the card with
its picker icon. Such a row wraps the field onto a line of its own under the title instead, still
flush right — the same way a row carrying an inline segmented control does. */
.lrow:has(.timef){flex-wrap:wrap}
.lrow>.timef{margin-left:auto}
.timef::-webkit-calendar-picker-indicator{filter:invert(.5)}
:root[data-theme="light"] .timef::-webkit-calendar-picker-indicator{filter:none}