feat(ui): a shell a phone can be held in
Plan 016 B2, phase 1. Below 600px the grid drops its sidebar column, `bottom-nav` becomes the primary navigation, and the shell fits the viewport instead of scrolling sideways out of it. 600 rather than the sidebar's own 900, because 900 is a laptop and the answer there is a narrower sidebar, which is still a sidebar. Under 600 there is no room for one at all: 360px of viewport over a 200px nav is not a layout. **The tab bar is four destinations and a way to everything else.** Three to five is where touch targets stop being thumb-sized -- eleven over 360px is 32px each -- so the four are the ones plan 016's subset says a phone is for, and "More" opens the *existing* `app-sidebar` in a drawer rather than listing the destinations a second time. Two lists is two places to add the next view to. That reuse has a cost this found the hard way: a shared component brings its `data-testid`s with it, so rendering the drawer's sidebar unconditionally put a second `nav-home` (and ten siblings) in the DOM and **failed 30 existing specs** with "resolved to 2 elements" -- on a desktop viewport, where this element is `display: none` and the drawer can never open. It renders only while the drawer is open, and the component test asserts the absence, because the failure is invisible from inside the component and lands in files nobody touched. **What made the shell overflow was minimums, not padding.** Measured at 360px: the body was 652px wide, because a `min-width` in a flex row is a hard floor and a grid item's implicit minimum is its content. So `min-width: 0` on the boxes between the viewport and the content, and each component stands its own non-essential parts down in its *own* stylesheet -- search-bar's 200px floor, job-indicator's label (the visible one; the live region that announces it is untouched), audio-player's seek bar and volume. A media query inside a shadow root is answered by the viewport, so this is the component saying what it drops rather than the shell reaching in. Volume goes because the hardware keys own it on a phone, which is the same reason mediacontrols' Android handler implements no volume callback. Seeking goes because 4px is not a thumb target; it belongs to the full-screen now-playing view, which is the next phase. An existing spec therefore asserts the opposite of what it did: layout-overflow's 320px case used to require that the 464px behind `overflow: hidden` could be *scrolled to*, which was the remedy available while the shell had one layout. It reflows now -- 320px in a 320px viewport, exactly -- and reflow is what WCAG 1.4.10 asked for.
This commit is contained in:
@@ -2828,3 +2828,77 @@ for boot ok". `pick_device` now resolves `ANDROID_SERIAL` from
|
||||
`ro.boot.qemu.avd_name`, since serials are assigned in boot order and
|
||||
the AVD name is the stable identity. Verified with both emulators
|
||||
running: it selects `yj-test` and installs.
|
||||
|
||||
## The phone shell fits, and what it cost to make it fit (2026-08-16)
|
||||
|
||||
Plan 016 B2, phase 1: the shell below 600px. Measured at 360×780 and
|
||||
390×844 against the real app (`make dev-headless` + Playwright, which
|
||||
is the tier that can answer this — server mode serves the same document
|
||||
an Android WebView renders).
|
||||
|
||||
**What overflowed, and by how much.** The body was 652px wide in a
|
||||
360px viewport before any of this. Walking every element and its shadow
|
||||
roots for a `right` past the viewport named the causes in order:
|
||||
|
||||
| element | width | why |
|
||||
|---|---|---|
|
||||
| `header.top-bar` | 580 | its children's minimums, summed |
|
||||
| `search-bar` | 320 | `.search-container { min-width: 200px }` |
|
||||
| `job-indicator` | 157 | the label, "3 background jobs" |
|
||||
|
||||
A `min-width` in a flex row is a *hard* floor — it does not shrink — and
|
||||
a grid item's implicit minimum is `auto`, i.e. its content. So the
|
||||
header could not get smaller than the sum of what it held, the body grew
|
||||
to the header, and `overflow-x: hidden` would then have hidden a third
|
||||
of the app rather than fitting it. `min-width: 0` on the boxes between
|
||||
the viewport and the content, plus each component standing its own
|
||||
non-essential parts down in its own stylesheet, takes 360 → 360 exactly.
|
||||
At 320px (400% zoom, the width WCAG 1.4.10 names) it is also exact.
|
||||
|
||||
**So an existing spec now asserts the opposite of what it did**, and
|
||||
that is the fix landing rather than the test being weakened.
|
||||
`layout-overflow.spec.ts` used to assert that the 464px of app behind
|
||||
`overflow: hidden` *could be scrolled to* with a wheel gesture, which
|
||||
was the remedy available when the shell had one layout. It reflows now,
|
||||
which is what 1.4.10 asks for; scrolling to the overflow was the
|
||||
concession.
|
||||
|
||||
**And a shared component brings its test handles with it.**
|
||||
`bottom-nav`'s "More" opens the *existing* `<app-sidebar>` in a drawer —
|
||||
the whole point being not to write a second list of destinations — but
|
||||
rendering it unconditionally put a second `data-testid="nav-home"` (and
|
||||
ten siblings) in the DOM. **30 existing specs failed** with "strict mode
|
||||
violation: resolved to 2 elements", on a *desktop* viewport where
|
||||
`bottom-nav` is `display: none` and the drawer can never open. Lazy
|
||||
rendering fixes it; the component test asserts the absence, because the
|
||||
failure is invisible from inside the component and appears in files
|
||||
nobody touched.
|
||||
|
||||
Three smaller things worth keeping:
|
||||
|
||||
- **A new icon name is a runtime failure, not a build one.** `bars` was
|
||||
not in `src/icons/names.txt`, so `offline-icons.spec.ts` caught it —
|
||||
the sweep asserts `window.__yjIconMisses` is empty. `node
|
||||
frontend/scripts/fetch-icons.mjs` re-vendors after adding a line.
|
||||
- **A `wa-drawer` animates, so a test asserts its events**, not its
|
||||
`open` property: setting `open = false` starts a hide that has not
|
||||
finished on the next microtask, and a test reading the property in
|
||||
between sees the state it is leaving.
|
||||
- **`update(el)` in the component tier takes two arguments**
|
||||
(`update(el, {})`), which is only visible from `tsc`, not from a
|
||||
failing test.
|
||||
|
||||
### A pre-existing failure this uncovered but did not cause
|
||||
|
||||
`requested-badge.spec.ts` fails two of its three tests, **on clean
|
||||
`main` as well** (verified by stashing every change and re-running).
|
||||
The symptom is `download.Service.AddRequest` not settling in 10s.
|
||||
|
||||
What is now known, and narrows it for whoever picks it up: the same
|
||||
method with the same arguments, called straight at the runtime endpoint
|
||||
with `curl`, **returns in 4ms** (it inserted, and answered `2`). So it
|
||||
is not the backend and not the documented read-pool trap — `Queries` is
|
||||
built over the writer, and `Reconciler.Trigger` is a non-blocking
|
||||
select. It is the page-side path: `__yjEvents.call` → the `fetch` hook
|
||||
→ `/wails/runtime`. A third test in that file fails only *after* those
|
||||
two, so it is state, not a third bug.
|
||||
|
||||
Reference in New Issue
Block a user