The card-deck options clear the print row instead of covering its label

On mobile the size options sat on top of the words they belong to, so the
Card deck label disappeared behind its own menu.

The row hangs at top:100% and is then pulled back up by half the print
row's height. The reasoning was sound and the arithmetic is right at
exactly one line: the footer sticker half-overhangs the banner edge, so
half a row is the correct clearance. It stops being true the moment the
row wraps -- on mobile it takes two lines, and half of a doubled height is
no longer half a row, it is the labels.

A FRACTION OF A VARIABLE HEIGHT IS THE BUG. The sticker's overhang is a
constant, so the offset is now the full row height minus that constant,
which is correct at any number of lines. Measured at one, two and three
lines: the old rule overlapped by 10, 20 and 30px, covering labels from
two lines on; the new one overlaps by a constant 11px -- the sticker
alone -- every time.

Same shape as the box-sizing error on the packet's table rows: a value
that happens to be right at one size and is silently wrong at every other,
which is why it only showed up on a phone.
This commit is contained in:
Doxa Maps 2026-09-28 18:35:56 +00:00
parent 12d8c7a8d5
commit 59d83ba6b3

View file

@ -787,9 +787,17 @@ useShadowStyles(
// the row wraps to a second line in long-label locales (ro/ru measured at 2 lines).
// A hard-coded 20px would tuck the size row under the print row in exactly those
// locales. toggleDeck() reads the live offsetHeight and writes it to --pstocks-gap.
// Hangs below the footer sticker, which is itself half-overhanging the banner edge — so the
// offset starts at HALF the print row's height, not all of it.
'.pstocks{top:100%;margin-top:calc(var(--pstocks-gap,20px) / 2);width:92%;max-width:92%;' +
// ⚠ THE OFFSET IS THE FULL ROW HEIGHT MINUS A FIXED STICKER OVERHANG, NOT HALF THE ROW.
// It used to be `calc(var(--pstocks-gap) / 2)`, reasoning that the footer sticker half-overhangs
// the banner edge so half the row's height is the right clearance. That holds ONLY while the row
// is ONE LINE. On mobile it wraps to two, and half of a doubled height is no longer half a row —
// it lands squarely on the labels, so the size options covered the words "Card deck" themselves.
// Reported from mobile 2026-09-28.
// A FRACTION OF A VARIABLE HEIGHT IS THE BUG: the sticker's overhang is a CONSTANT (~11px), so
// subtracting a constant is correct at any number of lines, while halving is correct at exactly
// one. Same shape as the box-sizing error on the packet's table rows — a value that happens to be
// right at one size and is silently wrong at every other.
'.pstocks{top:100%;margin-top:calc(var(--pstocks-gap,20px) - 11px);width:92%;max-width:92%;' +
'box-sizing:border-box;padding:3px;border-radius:2px;background:#fff;' +
'display:flex;flex-wrap:wrap;gap:3px;justify-content:center;' +
'box-shadow:0 1px 4px rgba(0,0,0,.10);cursor:default}' +