slides: the toolbar scrolls instead of being cut off on a 320px phone - #274
slides: the toolbar scrolls instead of being cut off on a 320px phone#274iamgeo92 wants to merge 1 commit into
Conversation
4eb0d5a to
ae80c21
Compare
Folding is not enough at the narrow end. Even fully folded the bar needs ~356px — six 44px targets plus the mark and the title — and an iPhone SE, or any iPhone with Display Zoom on, is 320px wide. .ed-root sets overflow:hidden so an over-wide bar can never turn into document scroll, which is right; the consequence was that the surplus was simply clipped. The ... button hung 36px past the edge, taking Redo, Comment, Export PDF, Share, Language, Help and the whole save-as list with it — none of which have another route on a phone. The bar now scrolls itself, so the clipped button becomes a partly-visible one, which is its own affordance, and the fix keeps working if the bar ever gains another control. A scroll container clips in both axes, so the menus hanging off + and ... would have been cut off by the bar itself. They are positioned against the viewport instead, which costs nothing extra to anchor because the phone rules already pin them to the end of the screen rather than to their trigger. The one thing CSS cannot know is where the bar ends — its height moves with the safe-area insets, per device and on rotation — so editor.ts publishes it as --ed-bar-bottom.
ae80c21 to
bbdf86c
Compare
|
@nyblnet — could you cast an eye over this one? At 320px (an iPhone SE, or any iPhone with Display Zoom on) the bar needs ~356px even fully folded, and The part worth your judgement is the second half: a scroll container clips in both axes, so the two menus hanging off the bar would have been cut off by it. They're anchored to the viewport instead, which costs nothing sideways because your existing phone rule already pins them to the screen's end — but it does mean Two files, +42. |
The problem
Below 700px
applyPhoneChromefolds most of the bar into the + and ⋯ menus.That works down to about 360px. It does not work at 320px — an iPhone SE, or
any iPhone with Display Zoom turned on, which turns a 375/390pt phone into a
320pt one.
Even fully folded the bar needs ~356px: six 44px touch targets plus the mark and
the title. And the editor column is explicitly clipped:
That rule is right — but with nothing else in place, the surplus is simply cut
off. Measured at 320×568:
⋯ is not a nice-to-have on a phone. It is where
applyPhoneChromeputs Redo,Comment, Export PDF, Share, Language, Help and the entire save-as list — 23
rows. On a 320px screen none of them had any route at all.
The fix
The bar scrolls sideways instead of being clipped.
affordance for "there is more this way".
overscroll-behavior-x: containkeeps a sideways flick on the bar fromrubber-banding the page behind it.
.ed-root'soverflow: hiddenstill doesits job: the bar scrolls itself, never the document.
targets below the 44px the codebase deliberately chose ("a 36px icon is a
mis-tap on glass").
The part worth reviewing: a scroll container clips in both axes, so the
menus hanging off + and ⋯ would now be cut off by the bar itself. They are
positioned against the viewport (
position: fixed) instead. That costsnothing extra to anchor sideways, because the existing phone rule already pins
these menus to the end of the screen rather than to their trigger:
The one thing CSS cannot work out is where the bar ends — its height moves
with the safe-area insets, which differ per device and change on rotation — so
editor.tspublishes it as--ed-bar-bottomfrom aResizeObserver.All of this is inside the existing
@media (max-width: 700px)block. Above700px the bar is not a scroller and the menus are still absolutely positioned
under their trigger.
Before / after — 320×568
Same gesture both sides: swipe the toolbar, then tap where ⋯ is.
How this was verified
Chrome DevTools iPhone emulation with real touch dispatch — including a genuine
14-step swipe on the bar, not a synthetic scroll assignment:
--ed-bar-bottomis published as a px valueposition: fixed)Desktop regression at 1280×800: bar
overflow-xis stillvisibleand the bardoes not overflow — pass.
Gates:
No new user-facing strings, so no i18n catalog changes. No format or kernel
change; nothing under
sync/.Caveat: verified under Chromium's iPhone emulation, not on physical iOS
hardware. The one place real Safari could differ is momentum scrolling on the
bar (
-webkit-overflow-scrolling: touchis set) — worth a glance on a device,though the reachability fix does not depend on it.
Changelog entry — not in the diff, on purpose
CHANGELOG.mdis this repo's named conflict magnet (docs/PARALLEL-WORK.md§3). With several of these open at once, and[Unreleased]being emptied every time a release is cut, a changelog hunk made every one of them conflict on that file and nothing else — twice over. They carry noCHANGELOG.mdchange so they stay mergeable; here is the entry to drop in at release time, or I'll add it back in whatever form you prefer.