Skip to content

omamobile-shell: route edge Back inside the shell - #582

Draft
latentoperator wants to merge 4 commits into
derekross:mainfrom
latentoperator:ux/edge-navigation-20261109
Draft

latentoperator wants to merge 4 commits into
derekross:mainfrom
latentoperator:ux/edge-navigation-20261109

Conversation

@latentoperator

@latentoperator latentoperator commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Add browser history after main's native BackLink handling. Keyboard dismissal and the topmost registered shell surface run first. If neither consumes Back, a coherent activated non-modal Chrome/Chromium window gets Alt+Left through wtype; the ordered Hyprland dispatch pair remains the fallback. Unknown, changed or modal focus keeps main's Escape/terminal-Home behavior.

Quick settings (including nested Wi-Fi/Bluetooth/Record panels), the app drawer and recents register their existing navigation callbacks with BackLink. Both edges remain Back. Back.qml imports BackLink.js directly. A browser at its first history entry stays there; the home pill remains Home.

November 19 review changes

Head b9edfe0908 includes upstream 17f9a3cd. Back always asks the native registry before sending a key. The clone loader, extra reader methods and clone-only test are gone. TOUCH-PLAN and the Bluejay note record the gestures, keyboard dismissal and Qt dialog result from the November 11 combined build at 83326ed6.

tools/pr-check, tests/all, the shell suite and the offline package build passed. The QML tests exercise both browser edges, changed or modal focus, keyboard precedence and nested shell surfaces. One local full-package run hit the intermittent modem NV overlay test failure. The shell package built as 0.2.135-1, the upstream version, and the maintainer assigns its release version at merge.

This draft still needs the current package installed on the Pixel 6a, the requested gesture checks and a fresh tools/phone-smoke report. Derek will then run his Pixel 7 Pro check.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @latentoperator. Back that actually goes back in a browser is a real gap, and the care about the lock and about not sending browser keys to a prompt is what I'd want. Before you take it further, I'd like to change how it's built:

  1. Decide in the plugin, not in a helper. As it stands, every Back swipe, in every app, starts Python and then runs eight commands (two rounds of the lock, the active window, the layers and the launcher's state) before it sends anything: 247 ms by your own measurement on the 6a, where today it's one dispatch. Back.qml already runs inside the shell. The focused app is ToplevelManager.activeToplevel.appId (the voice plugin uses it the same way), and the panels are plugins in the same process, so the choice can be made with no subprocess, followed by one dispatch as now. That also narrows the window in which focus can change under the key.
  2. Never do nothing. If any query fails or times out, the helper sends nothing. For dialogs and popovers this gesture is the only way out on a touch screen, so when in doubt it should send Escape, as it does today.
  3. Why wtype? Our test says "back uses Hyprland's dispatcher" on purpose, and it's what every phone has run since the gesture landed. Could you post the failing dispatch and its output from the 6a, with the on-screen keyboard up and down? If the keymap there is missing Escape, I'd rather fix that than route around it. If a key really must go through wtype, I'd want to see it with squeekboard up.
  4. Forward on the right edge. Both edges are Back today, as on Android, and a right-handed swipe in a browser would now go Forward. I'd keep Back on both edges and make browser Back the new part. If you've used left and right for a while and prefer it, tell me why.

Practical notes: #521 landed today in the same handler of Back.qml, so this needs a rebase; 0.2.110 is taken (main is at 0.2.113, and I set versions at merge); and this and #581 both append to docs/TOUCH-PLAN.md. The screen-record fix in quick settings is fine as its own small PR if you want it in sooner. Since this changes Back for every app, I'll run it on my Pixel 7 Pro before it merges, once the package installs as a whole on your phone.

@den-kloot

Copy link
Copy Markdown
Contributor

A data point from a Pixel 9a for the "no named Escape" case. The packaged back gesture does nothing on the phone with Hyprland 0.57.0 and omamobile-shell 0.2.100 plugins. Sending its Escape by hand:

$ hyprctl dispatch 'hl.dsp.send_key_state({ mods = "", key = "Escape", state = "down" })'
error: =[C]:-1: send_key_state: key not found

Esc, esc, 9 and code:9 are accepted (ok). With Esc, though, the Wi-Fi page still stayed open: its layer is keyboard focus OnDemand, and the focus was on the window below. So closing the shell's pages directly, as this PR does, is what I'd need. With omarchy-shell shell call omamobile.back back '', none of the Wi-Fi, Bluetooth or Hotspot (#539) pages closed. I haven't run this PR's branch on the 9a.

@derekross

Copy link
Copy Markdown
Owner

@den-kloot, thank you, that's the data point I was asking for, and from a second phone. Two separate things in it, as I read it:

  1. key = "Escape" answers "key not found" on your 9a, while code:9 is accepted. Main still sends the name, so I'll run the same line on my Pixel 7 Pro. If it fails there too, the back gesture is broken for everyone on Hyprland 0.57 and I'll fix the key on its own, ahead of this PR. If it works on mine, it depends on the keymap, and I'll ask you and @latentoperator for hyprctl devices with the on-screen keyboard up and down.
  2. Escape doesn't close the Wi-Fi, Bluetooth or Hotspot pages when the focus is on the window below. That one is ours whatever the key is called, and I'll open an issue for it. When you're on a current omamobile-shell (main is at 0.2.114), could you confirm it still happens?

@latentoperator, this changes my third point a little: you don't need to reproduce the failing dispatch, it's here now. It doesn't make the case for wtype, though, since the dispatcher takes the key by code. It does support the part of your PR that closes the shell's own pages directly rather than hoping a key reaches them, and that fits what I asked for in point 1: those pages are plugins in the same process as Back.qml, so it can close them itself with no helper. The other points stand as I wrote them (decide in the plugin, send Escape when in doubt, Back on both edges), and the branch needs a rebase over #521; main's shell is at 0.2.114 now, and I'll set the number at merge.

latentoperator added a commit to latentoperator/omarchy-mobile that referenced this pull request Nov 10, 2026
Dismiss phone panels through in-process callbacks before choosing browser Back from current Wayland/Hyprland focus. Both edges remain Back by default, with Escape for uncertain focus, shell windows and dialogs. Preserve threshold haptics from derekross#521 and retain optional personal right-edge Forward.

Use Hyprland keycodes with the existing ordered down/up path instead of a Python state-query helper or wtype. Exact candidate routing tests cover panel subpages, focus changes, Escape fallback, publisher reloads and both edges. Full-package 6a and reference-phone qualification remain required. The maintainer assigns the package version at merge as requested on derekross#582.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator
latentoperator force-pushed the ux/edge-navigation-20261109 branch from e66f4d1 to d230d9f Compare November 10, 2026 19:12
@latentoperator latentoperator changed the title omamobile-shell 0.2.110: route browser edge gestures and dismiss panels omamobile-shell: route edge Back inside the shell Nov 10, 2026
@derekross

Copy link
Copy Markdown
Owner

I checked main's Back on my Pixel 7 Pro today (Hyprland 0.57.0, omamobile-shell 0.2.114): the edge swipe goes back in an app. So main's Escape dispatch works here, and what @den-kloot saw ("key not found" for key = "Escape") isn't Back being broken on main for everyone. @den-kloot, could you paste the exact hyprctl dispatch line that failed and hyprctl version? Then we can see whether it's the 9a's keyboard layout or the way the line was typed.

@derekross

Copy link
Copy Markdown
Owner

Correction to my last comment: I was wrong, and @den-kloot was right. I ran the dispatch by hand on my Pixel 7 Pro (hyprland 0.57.0-3.2): key = "Escape" answers send_key_state: key not found, and so do escape and ESCAPE; Esc and code:9 are accepted. So Back on main arms, ticks and sends nothing, on every phone with Hyprland 0.57. My "it works" was a swipe that I took for a back and that never tested the key.

The fix is its own small PR, as I said it should be if this turned out to be real: the gesture sends code:9. @den-kloot, thank you for the exact report; no need for the command line I asked for.

@latentoperator, when you pick this draft up again, please build on that: the Escape path is code:9 from then on.

derekross added a commit that referenced this pull request Nov 10, 2026
#637)

The gesture sent Escape through Hyprland's send_key_state by name. Hyprland 0.57.0 answers key = "Escape" with "send_key_state: key not found" ("Esc" and "code:9" are accepted), so the swipe armed, ticked and sent nothing: Back did nothing anywhere. The dispatch's answer goes to /dev/null, which is why nothing showed it.

It now sends code:9 (Escape: evdev's KEY_ESC + 8), which doesn't depend on the key's name or the keyboard layout.

Reported by den-kloot on a Pixel 9a (#582). Confirmed and tested on a Pixel 7 Pro on 2026-11-10 (hyprland 0.57.0-3.2): by name "key not found", by code "ok"; with 0.2.116 installed the swipe closes dialogs and sheets again. Apps that don't treat Escape as back are a separate piece of work.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
latentoperator added a commit to latentoperator/omarchy-mobile that referenced this pull request Nov 10, 2026
Dismiss phone panels through in-process callbacks before choosing browser Back from current Wayland/Hyprland focus. Both edges remain Back by default, with Escape for uncertain focus, shell windows and dialogs. Preserve threshold haptics from derekross#521 and retain optional personal right-edge Forward.

Use Hyprland keycodes with the existing ordered down/up path instead of a Python state-query helper or wtype. Exact candidate routing tests cover panel subpages, focus changes, Escape fallback, publisher reloads and both edges. Full-package 6a and reference-phone qualification remain required. The maintainer assigns the package version at merge as requested on derekross#582.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator
latentoperator force-pushed the ux/edge-navigation-20261109 branch from 637952e to c9296bc Compare November 10, 2026 21:23
@derekross

Copy link
Copy Markdown
Owner

Thank you, @latentoperator, and thank you for taking all four points: the helper is gone, an uncertain focus ends in Escape, both edges are Back, and the haptic from #521 survived the rebase. The care in the focus check shows.

Main moved under you twice more today, though, and I have to ask you to rebuild this on top of it rather than rebase. After the code:9 fix I found on my Pixel 7 Pro that Hyprland answers the key dispatch with "ok" and the focused app never sees the key: Settings stayed put for send_key_state by code and by name, and went back at once for a virtual keyboard's Escape. Your own notes say the same from the other side: foot and Chrome got the key, your Qt fixture didn't. So #637 and #643 changed Back like this, and it's the design I want to keep:

  1. the on-screen keyboard is put away first, and nothing else is sent;
  2. the topmost shell surface on Back's list closes or goes back a level (plugins/omamobile.back/BackLink.js, joined through BackLinkClient.qml);
  3. otherwise Escape goes to the focused window through wtype, with the dispatch as the fallback. A terminal gets no key and goes home, and an app at its top level asks for home itself (omamobile-home).

Against that, here is what I think your PR still adds, and I'd like both parts:

  • Browser Back. Main sends a browser Escape, which goes nowhere. Main's ESCAPE_ARGV already reads the focused window's class for the terminal rule, so this is one more rule beside it: your isBrowser() list and pattern in BackModel.js with their tests, and for a browser Alt+Left through the same virtual keyboard (wtype -M alt -k Left -m alt), with ALT + code:113 as the dispatch fallback.
  • Quick settings, its Wi-Fi, Bluetooth and Record panels, the drawer and recent apps closed directly. Your navigationBack() functions are what I want. Please register them with BackLinkClient.qml (a handler that calls navigationBack(), active bound to the panel being open) and drop PanelLink.js and PanelLinkClient.qml: they're the same idea as BackLink, and one list is enough. "Last opened asks first" gives you the nesting.

And what I'd leave out: the dispatcher as the main path, rightEdgeForward and the README line about personal clones, the manifest.json reformatting, and replacing test/back-model.js (please extend main's). The README and TOUCH-PLAN text will need rewriting to match.

One thing to settle between us: with Alt+Left a browser on its first page just stays there on Back, and home is the pill. I think that's fine; say so if you see it differently.

Please keep it a draft until it's rebuilt. I'll run it on my Pixel 7 Pro before it merges, since it changes Back for every app, and I set the version at merge. If you'd rather split it, browser Back alone is the smaller and quicker of the two.

@latentoperator
latentoperator force-pushed the ux/edge-navigation-20261109 branch 2 times, most recently from 7bf031c to f17fb0e Compare November 11, 2026 18:19
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
derekross#637)

The gesture sent Escape through Hyprland's send_key_state by name. Hyprland 0.57.0 answers key = "Escape" with "send_key_state: key not found" ("Esc" and "code:9" are accepted), so the swipe armed, ticked and sent nothing: Back did nothing anywhere. The dispatch's answer goes to /dev/null, which is why nothing showed it.

It now sends code:9 (Escape: evdev's KEY_ESC + 8), which doesn't depend on the key's name or the keyboard layout.

Reported by den-kloot on a Pixel 9a (derekross#582). Confirmed and tested on a Pixel 7 Pro on 2026-11-10 (hyprland 0.57.0-3.2): by name "key not found", by code "ok"; with 0.2.116 installed the swipe closes dialogs and sheets again. Apps that don't treat Escape as back are a separate piece of work.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
latentoperator and others added 3 commits November 14, 2026 17:00
Build browser Back on current main BackLink handling. Preserve keyboard-first, terminal Home and Escape keymap behavior. Register quick settings, drawer and recents in the existing active registry so browser navigation cannot pass underneath them.

Choose history from coherent activated browser handles captured at gesture start. Share the packaged reader URL from personal clones. Exercise actual routing/native callbacks and keep the existing surface, haptic and model fixtures current. Full current-main package and attended qualification remain pending.

Co-Authored-By: Codex <noreply@openai.com>
Separate physical browser/keyboard-first/Qt results from direct native-surface and permission checks. Name the exact installed artifact and retain latency and reference-phone gates.

Co-Authored-By: Codex <noreply@openai.com>
Link the precise combined-package results and distinguish physical browser and Qt checks from handler checks and untested revised kernels.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator
latentoperator force-pushed the ux/edge-navigation-20261109 branch from f17fb0e to 1aee2fe Compare November 14, 2026 23:16
@derekross

Copy link
Copy Markdown
Owner

Thank you, @latentoperator. This is the rebuild I asked for, and it reads well: the keyboard and the registered surfaces still go first, quick settings with its panels, the drawer and recent apps are on BackLink with your navigationBack() functions, PanelLink is gone, and a browser gets Alt+Left through wtype with the dispatch pair only as the fallback. Deciding the browser case in QML from the window the gesture started on, and falling back to main's Escape on any doubt, is fine by me.

Before it leaves draft:

  1. Please put import "BackLink.js" as BackLink back in Back.qml and call it directly, and drop the Loader, the back()/names() additions to BackLinkClient.qml, the README sentence about cloned plugins and test/back-clone.py. On main Back always asks the registry; with the Loader it asks only once the Loader's item exists, and otherwise skips the keyboard and the surfaces and sends Escape. On a packaged phone both paths already reach the same BackLink.js, so the Loader only serves a copy of the plugin kept outside the package, which is the part I'd asked to leave out.
  2. It conflicts with main now, in packages/omamobile-shell/test/all and device/bluejay/NOTES.md; a rebase please, or CI won't run on your next push.
  3. The TOUCH-PLAN section and the bluejay note describe the combined 0.2.119-1 package of 11-11, not this head, as your description says. For the record on main I'd like it short: what the phone showed (both edges go back a page in Chromium, the first Back only hides the keyboard, the Qt dialog closes on the wtype Escape), the package and commit it came from, and that this head hasn't run yet. The bluejay note's kernel and lock parts belong with your bluejay PR rather than here.
  4. One run of this head installed as a package on your 6a, with a tools/phone-smoke report: browser Back from both edges, a dialog over the browser (it should get Escape, not history), quick settings with a Wi-Fi sheet open, the drawer with a search typed, and recent apps with its menu open.

Then I'll run it on my Pixel 7 Pro as agreed, and set the version when I merge. I didn't resolve the conflict or run the suite on a merge this round.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants