Let a phone held upright reach the fold that already exists - #1037
Merged
Conversation
The fold from #1023 declares both the button and the collapsed state inside @media (max-height: 720px). A phone in portrait is 844-932px tall, so it clears that threshold and reads as a roomy viewport -- but the panel is a fixed 373px, which is 46.6% of a 360x800 screen and 44.2% of a 390x844 one, and the centre of the view hit-tests the legend rather than the globe. The form factor with the worst ratio was the only one that could not fold: the button was display:none there and .controls.is-collapsed was inert. Move the fold rules into @media (max-height: 720px), (max-width: 540px), and give the coarse-pointer sizing the matching arm so the 44px target holds at both orientations. 540px is the breakpoint the stylesheet already uses for phones in eight other places. The spacing trim stays height-only, so the expanded panel measures exactly what it did before and nothing folds on its own -- this makes the gesture reachable, it does not change a default. Keeping the button and the collapsed state in one query preserves the invariant the stylesheet promises: a viewport that grows out of the query restores every row and removes the control together, so no reader is left with rows hidden and nothing to undo them. What the fold keeps is unchanged, so the product ID and the month stay rendered in both states; the new spec reads the citation before folding and asserts it survived verbatim. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Local verification (Chromium,
Gates: The soak and visual jobs are gated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Visible: On a phone held upright, a fold control now appears in the top-left
corner of the bottom panel. Tapping it puts the colour ramp and the timeline
away, and the middle of the screen becomes the globe instead of the legend.
Tapping again brings both rows back. Nothing folds on its own — the panel still
opens at exactly the height it does today.
The defect
The fold shipped in #1023 and was extended to landscape phones in #1027. Both
the button and the collapsed state were declared inside
@media (max-height: 720px), which is the right scope for the case they were written for — a shortwindow — but it means a phone held upright never reaches either one. A
portrait phone is 844–932px tall, so it clears the threshold and reads as a
roomy viewport.
The panel's height does not care about that. Measured on the live site today:
DIV.legend__barSPAN.legend__measuresSo the ratio is worst on the smallest phones, and on all of them the aim point
lands inside the panel rather than on the globe — at 390x844 you have to go 80px
above centre to reach the canvas.
The control that answers this already existed and was simply out of reach:
.controls__collapsewasdisplay: noneat these widths, and clicking itprogrammatically changed nothing, because the
.controls.is-collapsedrule wasinside the height query too. The one form factor with the worst ratio was the
only one that could not fold.
The change
src/style.css— the fold rules move out of the height-only query into@media (max-height: 720px), (max-width: 540px), and the coarse-pointer sizinggains the matching arm. 540px is the breakpoint the stylesheet already uses for
phones in eight other places; no new breakpoint is introduced.
Deliberately not in scope:
gap/paddingreduction isstill
@media (max-height: 720px)alone, so the panel's expanded height isunchanged at every viewport. This is a reachability fix, not a height fix.
Whether it should open folded on a tall narrow screen is a separate and
larger question — it is the one
docs/BACKLOG.mdframes around shortviewports and has never asked about narrow-tall ones. This PR does not answer
it; it only makes the gesture available.
stylesheet's own comment promises still holds: a viewport that grows out of
the query restores every row and removes the control in the same breath. A
reader cannot end up with rows hidden and nothing to bring them back.
Provenance is untouched: what the fold keeps is the layer selector and the
provenance line, so the product ID and the month stay rendered in both states.
The new spec reads the citation before folding and asserts it survived.
Verification
e2e/hud-collapse.spec.tsgains atest.describe("on a phone held upright")block at 390x844 with
hasTouch, asserting:aria-expanded="true"(default unchanged);provenance text verbatim, and
document.elementFromPoint(centre)becomesglobe; unfolding restores both rows;restores the rows.
Full local e2e suite run (
CI=1, Chromium) — the HUD trap makes anything nearthis panel layout-affecting, so the whole suite ran, not just the new spec.
a11y.spec.tsmatters here in particular: it runs at 390x844 withhasTouch,which is exactly the viewport where this button now renders for the first time,
and its 24px AA floor and 44px coarse-pointer checks both cover it.
Also updated the stale comment in
hud-collapse.spec.tsthat explained the 44pxguarantee could not live in
a11y.spec.ts"because the button is not renderedat 390x844" — that reason no longer holds after this change.
CSS-only on the runtime side; entry chunk unchanged at 52.4 kB gzip (budget 60),
no chunk reports FAIL.
🤖 Generated with Claude Code