Back gestures must match closing one layer at a time
Aliases: back dismisses overlay · system back · pop one layer
What it is
The system Back key, an edge swipe, and browser Back are read, when overlays are up, as “close the top layer I can see.” Back as single-layer pop lines the gesture up with the layer stack: one press closes the top, the next closes the next, and only an empty stack leaves the page. One Back that tears the whole stack down, or that exits the page, fights the structure in view — the eye is still on the top layer, the gesture has already taken the page underneath.
Why it happens
Back, in the OS, pops the top of a navigation stack. If a floating layer claims to be a layer, it should enter that stack, at least in the user’s model. If the implementation is absolute positioning on the page and never registers with history, Back skips the layers and hits the real previous page, leaving the top layer hanging on a new page, or replacing the page while the layer stays. Conversely, if every popover is pushed into history, Back becomes close-layer, which is correct, but shared links and refresh carry history entries that should not exist. Consistency means: in one session’s operation, as many layers as the user sees, that many Back pops; whether they are written into browser history is a separate choice that must be uniform. Layers that sometimes enter history and sometimes do not will not train. An edge swipe bound only to the page, not to layers, will slide the next page out from under a layer and uproot the top.
Studying it
With two overlay layers open, fire system Back, an edge swipe, and browser Back. Record whether each action closes the top, the whole stack, or the whole page. Independent variables: whether layers write history, whether the swipe recognises layers. Dependent variables: mismatches with the “close top only” expectation, layers left on the wrong page. Fix the expected model in a pre-brief: “when you press Back, what should happen.”
Where it stops holding
Desktop browser users who treat Back as site navigation may refuse to let Back close a menu; then Escape closes layers and Back moves pages, and the two channels must be distinguishable in the UI. In a single-page WebView with no history stack, Back is often stolen by the host app; agree layer priority with the host or the app Back will exit the WebView first. Games and canvases that bind Back to an in-game action should rebind it to close-layer while an overlay is up, and restore it after.
Applying it
- Make the current temporary layer the first receiver of Back: one Back closes the top only.
- Edge-swipe Back and button Back should share one layer stack; do not let one close a layer and the other turn the page.
- Decide whether layers enter browser history, and apply that choice to every layer.
- How to check: open two layers and press system Back once. Closing only the top is consistent. The page leaving, or both layers remaining, means the semantics are still misaligned.