slides: an overlay on a phone can be dismissed by tapping away from it - #273
Open
iamgeo92 wants to merge 2 commits into
Open
slides: an overlay on a phone can be dismissed by tapping away from it#273iamgeo92 wants to merge 2 commits into
iamgeo92 wants to merge 2 commits into
Conversation
iamgeo92
force-pushed
the
phone-drawer-dismiss
branch
2 times, most recently
from
August 10, 2026 02:28
ef80014 to
b832901
Compare
Below 700px the side panels are not columns — styles.css makes them overlay drawers laid across the canvas, because a 188px column beside a 402px screen leaves the thing being edited as the smallest thing on it. Tapping a thumbnail navigated correctly and then left the drawer covering the slide it had just navigated to, so every slide change cost a second trip to the toggle in the topbar to actually see the result. Closing is scoped to the drawer width and to the thumbnail itself: on a wide screen the list is a real column and stays put, and the Duplicate and Delete buttons on a thumbnail already stop propagation, so editing the list never dismisses it.
The slide list, the properties panel and the two phone-only bar menus all open across the canvas, and every one of them had a single way out: press the button that opened it. On a drawer wide enough to cover that button, that is a hunt rather than a gesture. Tapping the slide beside an overlay now closes it. Two conditions keep this from reaching anywhere it should not: the drawer rule runs only while the panels ARE drawers (on a wide screen they are columns, where a click on the canvas is just a click on the canvas), and a press inside the topbar is exempt so the toggles keep toggling — closing on their pointerdown would let the click that follows reopen what it just closed. The + and ... menus turn out to be the only dropdowns in the bar without an outside-press dismissal, and they are the two that exist only on a phone: the menus hardest to escape were the ones a thumb could not escape at all. They now use the same helper.
iamgeo92
force-pushed
the
phone-drawer-dismiss
branch
from
August 10, 2026 23:51
b832901 to
848c46d
Compare
Author
|
@nyblnet — this one when you get a chance. Four things open over the canvas on a phone and none of them could be dismissed by tapping away: both drawers and the +/⋯ menus. The last two turn out to be the only dropdowns in the bar without an outside-press dismissal, and they're the two that exist only on a phone — so the menus hardest to escape were the ones a thumb couldn't escape at all. The interesting bit is the trap it had to avoid: ☰ is outside the drawer, so a naive handler closes on its Stacked on #272 — merge that first and this reduces to one commit. |
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.
The problem
Four things open over the canvas on a phone, and every one of them had exactly
one way out — press the button that opened it again:
The last two are the interesting ones. Every other dropdown in the bar — Save
as, Share, Language, Shape, Media, the present pill — already wires up the same
three lines:
+ and ⋯ do not. And they are the only two dropdowns that exist exclusively on
a phone (
.ed-phone-only). So the menus that were hardest to escape were theones a thumb could not escape at all.
Measured on the dev server under an iPhone profile, tapping the canvas with each
overlay open:
The fix
Tapping the slide beside an overlay closes it.
Two conditions keep this from reaching anywhere it shouldn't:
≤700px— the threshold the CSS andapplyPhoneChromealready share). On a wide screen the panels are columnsbeside the canvas, and a click on the canvas is just a click on the canvas.
falls into: ☰ is outside the drawer, so a naive handler closes the drawer on
its
pointerdownand theclickthat follows immediately reopens it — thebutton would never shut anything again. There is a regression test for exactly
this (open → close → open).
The two phone menus get the same helper the rest of the bar open-codes. I left
the other five call sites alone deliberately: converting them is pure churn on a
file several branches touch, and it belongs in its own cleanup.
Before / after
Same gestures both sides: open +, tap the slide; open ☰, tap the slide.
How this was verified
iPhone emulation (390×664, DPR 3,
hasTouch) with real touch dispatch, plus a1280×800 mouse context:
Gates:
No new user-facing strings, so no i18n catalog changes. No format or kernel
change; nothing under
sync/.Deliberately not in scope: dismissing with
Escape. A phone has no Esc key,and
Escapealready carries meaning on the canvas — bundling it in would makethis change harder to reason about, not easier.
Caveat: verified under Chromium's iPhone emulation, not on physical iOS
hardware. The logic is pointer-target and viewport-width based with no
WebKit-specific behaviour involved.
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.