Repository navigation
feat: open the menu with a swipe from the left - #775
arthur-lzrs wants to merge 1 commit into
Conversation
On a phone the menu opens only from its button in the top bar, which is a stretch for a thumb on a large screen. A new device setting, Settings > General > This device > "Swipe from the edge for the menu", lets a swipe to the right that starts a little in from the left edge open the menu, and a swipe to the left on the menu or its backdrop close it. It is off by default, kept per device like keeping the screen on, and offered on a phone-sized screen with a touchscreen. The swipe starts 30 to 84 px in from the edge and never at it: a phone's own back gesture takes the very edge and a page cannot stop it, so starting clear of it means the two are never started by the same touch. It is not started on the map pages (a map pans on any touch), over a dialog, or on a map, a chart or anything that scrolls sideways. A finger that moves up or down first is a scroll and is left alone. The gesture listens on the window (pointer events, with touch events to follow the drag where a browser cancels the pointer to pan the page), so nothing sits over the page to catch taps. useDrawerSwipe holds it, App.vue wires it to the menu, and DeviceSettings has the toggle. The new edgeSwipeMenu setting is local to the device, so it is not synced to the account. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks a lot for this, and for all the PRs you've opened! I'm going through them one by one, and I started with the ones that, as a web developer, I had the most doubts about. This is one of them, so I'm closing it. Here's why:
Native Android moved away from edge-swipe drawers once gesture navigation came in, for these same reasons, so I'd rather not go there. The problem you're solving is real though: the menu button in the top left is hard to reach with a thumb. If you'd like to have a go at that, I'd welcome a fix that needs no gestures, for example a bottom navigation bar on phones with a "More" item that opens the full menu, or a menu button at the bottom of the screen. Happy to talk it through in an issue first. Your other PRs look a lot more promising, and I'll get to them next. Thanks again for putting the time in! |
Summary
On a phone the menu opens only from its button in the top bar, which is a stretch for a thumb on a large screen.
A new device setting, Settings > General > This device > Swipe from the edge for the menu, lets a swipe to the right that starts a little in from the left edge open the menu, and a swipe to the left on the menu or its backdrop close it.
How it works
useDrawerSwipe(new composable) listens on the window, so nothing sits over the page to catch taps meant for it. It is a decision, not a drag: once the finger has gone 56 px sideways, and not mostly up or down, the menu opens as it does for its button.App.vuewires it to the existing menu state.DeviceSettings.vuehas the toggle.edgeSwipeMenuis in the UI settings and listed inlocalKeys, so it stays on the device and is not synced to the account.Type of Change
Related Issues
None.
How it was tested
App.vue, for the toggle, and for the setting staying on the device (parse and sync).Notes for review
useDrawerSwipe.ts,EDGE_START_MIN_PXandEDGE_START_MAX_PX. Some Android gesture-navigation settings widen the system back zone; the floor is a default that is easy to move.nl,esandpt-PTare my own drafts, so a native check is welcome.settingsUi.ts,settingsStores.spec.tsandsettingsSync.spec.tsnext to the same lines. Whichever lands second needs a trivial rebase.Checklist
pnpm checkinfrontend/(frontend only: the .NET side is untouched, sodotnet testanddotnet formatwere not run)feat: ...,fix(frontend): ...)ITripRepository): done in the demo too, with a step inTripRepositoryContractTests(not applicable)documentation/openapi.jsonis committed (not applicable, the API did not change)src/GarageStack.Data/Demo/(not applicable, nothing here needs data)frontend/src/locales/unraid/garagestack.xmlchanged: synced tojoszz/unraid-community-appsafter merge (not applicable, it did not change)🤖 Generated with Claude Code