review: the 375px phone this fix had not been measured on (#662)

* review: the 375px phone this fix had not been measured on

Answers the five findings on #660.

  * Recurring's four fixed columns wanted 416px between them, so at 375px the URL
    column got exactly 0 and the table overflowed again -- the same bug as before,
    moved down from 540px.  Widths are phone-first now, in col-* classes, widening
    at the tablet breakpoint.
  * The in-progress button in Completed At carried "5 MBps / 3m44s" -- 169-188px
    measured, against 124px of column.  It shows the percent; the modal it opens
    already lists speed, ETA and bytes, and the full text is on the button's title.
  * The select column was 2.5em: 16.5px of content for a 22px checkbox, which hung
    into the URL column.  3em holds the checkbox and its padding.
  * The Cypress fixtures were a raw <table>, so tableLayout would read 'fixed' even
    with the selector that loses to Mantine -- the test could not fail for the reason
    it claimed.  They mount SortableTable, Table.HeaderCell onSort and a real
    Checkbox now, and the header check measures the text rather than skipping cells
    with no element child.
  * Comments trimmed to what cannot be recovered from the code.

Fixing the first surfaced one more: once URL became the small column, its own header
overran -- "URL" and its arrow need 72px against 58 -- and a single word cannot wrap.
A header is clipped by its column as a last resort.

Measured at 375px: once 46/58/123/146, recurring 44/100/104/57/69, nothing
overflowing.  69 suites / 1214 jest tests pass.

The Cypress tests here are NOT verified: the component runner does not start in this
repo (see the separate cypress investigation), so every layout claim above rests on
direct measurement in Chrome, not on that suite.

* review: the 375px phone this fix had not been measured on

Answers the five findings on #660, and now runs against a component suite that can
actually execute (#661).

  * Recurring's four fixed columns wanted 416px between them, so at 375px the URL got
    exactly 0 and the table overflowed -- the same bug as before, moved down from 540px.
    Widths are phone-first now, in col-* classes, widening at the tablet breakpoint.
  * The in-progress button in Completed At carried "5 MBps / 3m44s", 169-188px against
    124px of column.  It shows the percent; the modal it opens already lists speed, ETA
    and bytes, and the full text is on the button's title.
  * The select column was 2.5em: 16.5px of content for a 22px checkbox, which hung into
    the URL column.  3em holds the checkbox and its padding.
  * The fixtures were a raw <table>, so tableLayout read 'fixed' even with the selector
    that loses to Mantine -- the test could not fail for the reason it claimed.  They
    mount SortableTable, Table.HeaderCell onSort and a real Checkbox now.
  * Comments trimmed to what cannot be recovered from the code.

Two defects the restored suite caught, neither of them findable before it ran:

  * The elastic URL column ends up narrower than its own header -- "URL" and its arrow
    need 72px against 58 -- and one word cannot wrap, so the column clips.  A sized column
    must fit its label; only the elastic one may clip.  That is what the header test
    asserts, per kind of column, rather than measuring text and calling it the label: the
    first version measured the text alone, missed the sort arrow, and passed while the
    button overran by 14px.
  * Recurring's Control column was 4.5em, 70px of content for a 78px "Control".  Sized
    for the word rather than the button it holds: 5.2em.

At 375px: once 46/58/123/146, recurring 33/100/104/57/80, nothing overflowing and no
sized header clipped.  The URL column there is 33px -- the accepted trade for keeping
every column on a phone.

336 component tests pass, 69 suites / 1214 jest tests pass, npm run build is clean.

* review: a header assertion that stopped at the padding box

Three findings on #662.

  * The sized-header check compared scrollWidth to clientWidth, which is the padding box,
    so a label could overflow its content box into the padding and pass -- the same class
    of miss the 4.5em Control failure was meant to close.  It measures the label's longest
    word (plus the sort arrow, where there is one) against the content box now.

    That found two more columns tuned to their exact limit and clipping by a pixel:
    Download Frequency wanted 79.4px of a 78.1px box, Completed At 82.3 of 81.9.  Every
    sized column now has margin over its own label.

  * SortableTable stopped applying `width`, leaving dead keys at the Tags and Zim call
    sites.  Removed, so a column is sized one way.  CollectionTable's `width` is NOT dead
    -- it converts sixteenths to percentages -- so Channels, Docs, Playlists and Archive
    keep theirs.

  * Comments trimmed again: the percent button, the header clip, the ButtonGroup rule and
    the Cypress helper.

336 component tests pass, 69 suites / 1214 jest tests pass.

* ui: a phone header short enough to leave room for the URL

Five full-length headers do not fit a phone.  Sized so each held its own label, the
recurring URL column came out 20px -- narrower than one character and its ellipsis, a
column present but carrying nothing.

A long header carries both forms and `.label-*` shows one: Freq and Done below the tablet
breakpoint, Download Frequency and Completed At above it, where there is room.  The mobile
widths are sized for the short word.

At 375px the URL column goes from 20px to 105px on the recurring table and 54px to 97px on
the once table.  Nothing overflows, nothing clips, and every column stays.

336 component tests pass, 69 suites / 1214 jest tests pass, npm run build is clean.
This commit is contained in:
lrnselfreliance 2026-08-13 11:38:49 -06:00 • committed by GitHub
parent 1867382d7b
commit 67c3afbec9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 360 additions and 248 deletions

View file

@ -337,30 +337,13 @@ textarea.otp {
}
/*
* A table that truncates to the width it has, rather than growing past it.
* A table that truncates to the width it has rather than growing past it: the columns divide
* the table's width, and `column-ellipsis` gives up what it cannot show. A column that must
* fit something exact states a width on its header cell; the rest is the ellipsis column's.
*
* `table-layout: fixed` is what makes the truncation possible at all. Under the default
* `auto` layout a table is as wide as its columns want to be and the container simply
* overflows -- on a 540px phone the downloads tables came out 676px and 727px, so Completed
* At and Control sat off the right edge and the buttons could not be reached without
* scrolling sideways. Fixed layout inverts that: the columns get the table's width divided
* between them, and the one marked `column-ellipsis` gives up what it cannot show.
*
* The old rule tried to do this with `max-width: 0` and `min-width: 25em`. The max-width was
* the usual trick for forcing an ellipsis under `auto` layout; the min-width was there so the
* text column stayed readable -- but 25em is 385px, and a floor wider than the screen is what
* made the overflow certain. Under fixed layout neither is needed: the column width comes
* from the header, and every other column is sized to its content so the ellipsis column
* keeps the remainder.
*
* Columns that must fit something exact -- a checkbox, a group of buttons -- state a width on
* their header cell. Any column that does not is sized by what is left over.
*/
/*
* `table.` rather than the class alone: Mantine sets `table-layout` on its own
* `.mantine-Table-table`, which is the same specificity and comes later in the cascade, so
* the bare class silently lost and the table stayed `auto` -- with every other property here
* applying, which made it look like the rule had worked.
* `table.`, not the bare class: Mantine sets `table-layout` on its own `.mantine-Table-table`
* at the same specificity and later in the cascade, so the bare class loses -- silently, with
* every other property here still applying.
*/
table.table-ellipsis {
width: 100%;
@ -374,38 +357,94 @@ table.table-ellipsis {
}
/*
* The one column width that has to change with the screen.
* Column widths for the downloads tables. Phone first, and the phone is 375px: below the
* breakpoint each column is cut to what it must hold -- its header's longest word, the label
* wrapping, or its buttons -- and the URL takes what is left, which is little. Above it the
* labels get their own line back and the URL gets the rest.
*
* Most headers here are sized to hold their own label on one line at any width -- a wrapped
* label is a fallback, not a layout. "Download Frequency" is the exception: 11.7em on one
* line, which a phone cannot spare when four other columns need room, and it is one of five
* columns rather than one of four. So it wraps below the tablet breakpoint and gets its line
* back above it, where the width costs nothing.
*
* 700px is the app's `tablet` breakpoint (see `AppMedia` in contexts.js).
* 700px is the app's `tablet` breakpoint (`AppMedia` in contexts.js). `em` here is the
* table's own font (~15.4px), not the root's.
*/
/*
* A header too long for a phone carries both forms and shows one. The short word is what the
* mobile column widths below are sized for; the full words return at the breakpoint.
*/
.table-ellipsis th .label-long {
display: none;
}
@media (min-width: 700px) {
.table-ellipsis th .label-long {
display: inline;
}
.table-ellipsis th .label-short {
display: none;
}
}
.table-ellipsis th.col-select {
/* 22px of checkbox plus 11px of cell padding either side. */
width: 3em;
}
.table-ellipsis th.col-frequency {
width: 7em;
width: 4.2em;
}
.table-ellipsis th.col-completed {
width: 5.5em;
}
.table-ellipsis th.col-completed-plain {
width: 4.2em;
}
.table-ellipsis th.col-next {
width: 3.9em;
}
/* A `ButtonGroup` cannot wrap -- its buttons are joined -- so this holds all three of them
(delete, edit, retry on a failed download) at every width. */
.table-ellipsis th.col-control-group {
width: 9.5em;
}
/* A `.wrolpi-button-row` wraps, so on a phone this holds one button and the second drops
beneath it. It is sized by the word "Control" rather than by the button, which is wider. */
.table-ellipsis th.col-control-row {
width: 5.2em;
}
@media (min-width: 700px) {
.table-ellipsis th.col-frequency {
width: 12em;
}
.table-ellipsis th.col-completed {
width: 9.5em;
}
.table-ellipsis th.col-completed-plain {
width: 8.5em;
}
.table-ellipsis th.col-next {
width: 4em;
}
.table-ellipsis th.col-control-row {
width: 7.5em;
}
}
/*
* A header wraps instead of running into the next column.
* A header wraps instead of running into the next column: `.wrolpi-th-sort` is nowrap, which a
* fixed column cannot widen for, so a long label printed over its neighbour.
*
* `.wrolpi-th-sort` is `white-space: nowrap` so a sortable label never splits from its arrow.
* That is right under `auto` layout, where the column widens to fit; under fixed layout the
* column does not widen, so "Completed At" overran its cell and printed on top of "Control".
* Wrapping to two lines is the only thing a fixed column can do with a label too long for it.
*
* `min-width: 0` as well as the wrap: the button is a flex container, and its text is an
* anonymous flex item whose automatic minimum is its longest word. Without this the label
* still refuses to go below "Completed" and still overruns. A column narrower than its
* longest word is a width to fix at the call site, not something CSS can hide.
* `min-width: 0` as well as the wrap -- the label is an anonymous flex item whose automatic
* minimum is its longest word, and without this it still refuses to go below that word. A
* column narrower than its longest word is a width to fix at the call site.
*/
.table-ellipsis th .wrolpi-th-sort {
display: flex;
@ -415,13 +454,15 @@ table.table-ellipsis {
}
/*
* Grouped buttons keep their size in a fixed column.
*
* `ButtonGroup` is a nowrap flex row whose children may shrink, and in a column too narrow
* for them they did: the Stop button on a pending download was squeezed to 23px against its
* neighbour's 40px, a target too small to hit and visibly clipped. The column is sized for
* the widest group it has to hold (three buttons), so the buttons themselves should not give.
* A header is clipped rather than painted over its neighbour. Wrapping cannot save a
* single-word label in the elastic column, which may be narrower than the word itself.
*/
.table-ellipsis th {
overflow: hidden;
}
/* `ButtonGroup` is a nowrap flex row whose children shrink; `col-control-group` is sized for
the whole group, so the buttons in it must not. */
.table-ellipsis td .mantine-ButtonGroup-group > * {
flex-shrink: 0;
}