Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions device/bluejay/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ keeps manual GS101 success marking on hold and requires a known-good image
flash before the boot that would spend B's final try. This note changes no
tool, guard, package or runbook and performs no phone operation.

## 2026-11-11: physical Back gestures

On November 11, both edges went back one page in Chromium on the Pixel 6a.
With the keyboard open, the first Back hid it and left the page in place.
A Qt dialog closed on Escape delivered through `wtype`. The phone ran
`omamobile-shell 0.2.119-1` from the combined build at `83326ed6`.
The revised package still needs its own handset run.

## 2026-11-09: review split and slot-success audit (offline)

The development source remains inspectable in [#543](https://github.com/derekross/omarchy-mobile/pull/543).
Expand Down
8 changes: 8 additions & 0 deletions docs/TOUCH-PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ Hyprland transform 1 or 3 gives a 1040x480 logical px output (portrait is 480x10

**What remains after batch 4:** 1.11 (gum prompts as sheets: onboarding, PIN setup), 1.12's Nightlight and Reminder tiles, 2.1's per-token font seeds (the 12 px floor is in; the overrides need a theme-change check), 2.7 contrast (4.5:1 for placeholder and secondary text), 3.1 per-site web-app flags, 3.3's upstreamable `menu.d` patch (the rows are hidden by `omamobile-setup-user` for now), 3.6 haptics, 3.7 polish, and the Omarchy patches 3-6 below.

## Browser history after native Back (1.2)

On November 11, both edges went back one page in Chromium on the Pixel 6a.
With the keyboard open, the first Back hid it and left the page in place.
A Qt dialog closed on Escape delivered through `wtype`. The phone ran
`omamobile-shell 0.2.119-1` from the combined build at `83326ed6`.
The revised package still needs its own handset run.

## Suggested order

1. Phase 0 (one `omamobile-omarchy` and firstboot release, plus a `phone-smoke` lock check).
Expand Down
7 changes: 7 additions & 0 deletions packages/omamobile-shell/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1205,3 +1205,10 @@ What upstream needs instead, smallest first:
`omarchy.notifications` only to full bars. Quick settings calls the
`notifications` IPC target on its own shell instance (`qs ipc -p
Quickshell.shellDir`) instead.

Browser history follows the native Back handlers. Both edges use Alt+Left for
an activated Chrome/Chromium window whose current Wayland and Hyprland handles
agree with the window captured at gesture start. Modal, changed or uncertain
focus uses the existing Escape/Home path. Quick settings, drawer and recents
register active handlers with BackLink so navigation stays in their topmost
surface.
23 changes: 16 additions & 7 deletions packages/omamobile-shell/plugins/omamobile.back/Back.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import Quickshell.Hyprland
import Quickshell.Wayland
import qs.Commons
import qs.Commons as Commons
import "BackModel.js" as BackModel
import "BackLink.js" as BackLink
import "BackModel.js" as BackModel

// The back gesture, as on Android (TOUCH-PLAN 1.2): swipe in from the left
// or right edge of the screen and let go to go back. "Back" is Escape, sent
// to whatever has the keyboard focus (BackModel.js has how): it closes app
// dialogs, menus and popovers that have no other way out on a touch screen,
// and the shell's own sheets and drawer, which all close on Escape. An app
// and the shell's own sheets and drawer. After native handling, an activated
// Chrome/Chromium window goes back in browser history from either edge. An app
// goes back one level on it, and at its top level asks for the home screen
// (omamobile-home), as Back at an app's first screen does on Android.
//
Expand Down Expand Up @@ -42,14 +43,21 @@ Item {
// `shell call omamobile.back back ''`: the same as the gesture. One Back
// does one thing (BackLink.js): the on-screen keyboard is put away, or
// else the topmost shell surface that registered closes, or else Escape
// goes to the focused window. Returns what used it.
function back() {
// goes to the focused window, with history Back for a coherent browser.
// Returns what used it.
function back(payloadJson, startedToplevel) {
var used = BackLink.back()
if (used !== "") {
console.log("omamobile-back:", used)
return used
}
Quickshell.execDetached(BackModel.ESCAPE_ARGV)
var active = ToplevelManager.activeToplevel
var started = startedToplevel === undefined ? active : startedToplevel
var hypr = Hyprland.activeToplevel
var browser = !!active && active === started
&& active.activated === true && !active.parent
&& !!hypr && hypr.wayland === active && BackModel.isBrowser(active.appId)
Quickshell.execDetached(browser ? BackModel.BROWSER_BACK_ARGV : BackModel.ESCAPE_ARGV)
return "ok"
}

Expand Down Expand Up @@ -170,6 +178,7 @@ Item {
readonly property bool armed: BackModel.fires(inward, across, BackModel.THRESHOLD)
property real atY: 0
property bool wasArmed: false
property var startedToplevel: null
onCentroidChanged: if (active) atY = centroid.position.y
// One threshold tick per gesture, even if the finger crosses back.
property bool feedbackSent: false
Expand All @@ -182,9 +191,9 @@ Item {
}
}
onActiveChanged: {
if (active) { atY = centroid.position.y; wasArmed = false; feedbackSent = false; return }
if (active) { startedToplevel = ToplevelManager.activeToplevel; atY = centroid.position.y; wasArmed = false; feedbackSent = false; return }
console.log("omamobile-back: swipe", win.rightEdge ? "right" : "left", wasArmed ? "back" : "")
if (wasArmed) root.back()
if (wasArmed) root.back("", startedToplevel)
}
}
}
Expand Down
16 changes: 15 additions & 1 deletion packages/omamobile-shell/plugins/omamobile.back/BackModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ var ESCAPE_ARGV = ["sh", "-c",
// asks. `shell call omamobile.back home ''` runs it too.
var HOME_ARGV = ["omamobile-home"]

// Browser history is chosen in QML after native Back handlers. Use the same
// virtual keyboard as Escape; retain the ordered dispatch pair as fallback.
var BROWSER_BACK_ARGV = ["sh", "-c",
'if command -v wtype >/dev/null 2>&1; then exec wtype -M alt -k Left -m alt; fi; ' +
'hyprctl dispatch "$1" >/dev/null; sleep 0.05; hyprctl dispatch "$2" >/dev/null', "sh",
'hl.dsp.send_key_state({ mods = "ALT", key = "code:113", state = "down" })',
'hl.dsp.send_key_state({ mods = "ALT", key = "code:113", state = "up" })']

function isBrowser(appId) {
var id = String(appId || "")
return ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser", "org.chromium.Chromium", "com.google.Chrome"].indexOf(id) !== -1
|| /^chrome-.+-(?:Default|Profile(?:_\d+)?)$/.test(id)
}

// How far the finger has to come in from the edge (logical px), and how far
// a swipe may wander along the edge for each pixel it comes in: a mostly
// vertical drag that starts on the strip is not a back.
Expand All @@ -73,7 +87,7 @@ function inwardFor(rightEdge, translationX) {
}

if (typeof module !== "undefined") {
module.exports = { TERMINALS: TERMINALS, isTerminal: isTerminal,
module.exports = { BROWSER_BACK_ARGV: BROWSER_BACK_ARGV, isBrowser: isBrowser, TERMINALS: TERMINALS, isTerminal: isTerminal,
ESCAPE_DOWN: ESCAPE_DOWN, ESCAPE_UP: ESCAPE_UP, ESCAPE_ARGV: ESCAPE_ARGV, HOME_ARGV: HOME_ARGV, THRESHOLD: THRESHOLD,
progress: progress, fires: fires, inwardFor: inwardFor
}
Expand Down
17 changes: 17 additions & 0 deletions packages/omamobile-shell/plugins/omamobile.launcher/Launcher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ Item {

// `opened` is the drawer; the dock is always on screen.
property bool opened: false

Loader {
source: Qt.resolvedUrl("../omamobile.back/BackLinkClient.qml")
onLoaded: {
item.name = "app drawer"
item.handler = function() { return root.navigationBack() }
item.active = Qt.binding(function() { return root.opened })
}
}

function navigationBack() {
if (!opened) return false
if (input.activeFocus && query) query = ""
else dismiss(0)
return true
}

property string query: ""
property var apps: []
property int appsRevision: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,36 @@ Item {
property var manifest: null

property bool opened: false

Loader {
source: Qt.resolvedUrl("../omamobile.back/BackLinkClient.qml")
onLoaded: {
item.name = "quick settings"
item.handler = function() { return root.navigationBack() }
item.active = Qt.binding(function() { return root.navigationOpen })
}
}

readonly property bool navigationOpen: opened || wifiPicker.opened || bluetoothPanelItem.opened || recordPanelItem.opened

function navigationBack() {
if (wifiPicker.opened) {
if (wifiPicker.sheet) wifiPicker.cancelSheet()
else wifiPicker.backRequested()
return true
}
if (bluetoothPanelItem.opened) {
if (bluetoothPanelItem.activeSheet) bluetoothPanelItem.cancelSheet()
else bluetoothPanelItem.backRequested()
return true
}
if (recordPanelItem.opened) { recordPanelItem.backRequested(); return true }
if (!opened) return false
if (editing) finishEditing()
else dismiss()
return true
}

readonly property string pluginId: (manifest && manifest.id) || "omamobile.quicksettings"

// ---------------------------------------------------------------- lifecycle
Expand Down
18 changes: 18 additions & 0 deletions packages/omamobile-shell/plugins/omamobile.switcher/Switcher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ Item {

property bool opened: false

Loader {
source: Qt.resolvedUrl("../omamobile.back/BackLinkClient.qml")
onLoaded: {
item.name = "recent apps"
item.handler = function() { return root.navigationBack() }
item.active = Qt.binding(function() { return root.opened })
}
}

function navigationBack() {
if (!opened) return false
if (actionsOpen && actionPage === "pick") actionPage = "menu"
else if (actionsOpen) closeActions()
else dismiss()
return true
}


// Newest first, like Android's recents.
readonly property var windows: {
var list = ToplevelManager.toplevels.values.slice()
Expand Down
10 changes: 9 additions & 1 deletion packages/omamobile-shell/test/all
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ for sc in 3 '8 \/ 3'; do
t=$(printf 'local omarchy_monitor_scale = 2\n' | sed "s/^local omarchy_monitor_scale = .*/local omarchy_monitor_scale = $sc/")
[[ $t == 'local omarchy_monitor_scale = 3' || $t == 'local omarchy_monitor_scale = 8 / 3' ]] || fail "the seeded scale line ($t)"
done
grep -c 'Quickshell.execDetached(BackModel.ESCAPE_ARGV)' "$b" >/dev/null || fail "back sends Escape through BackModel"
grep -c 'Quickshell.execDetached(browser ? BackModel.BROWSER_BACK_ARGV : BackModel.ESCAPE_ARGV)' "$b" >/dev/null || fail "back sends Escape through BackModel"
grep -c 'WlrLayershell.namespace: "omamobile-back"' "$b" >/dev/null || fail "back strips' namespace"
grep -c 'mask: Region { item: strip }' "$b" >/dev/null || fail "only the edge strip takes touches"
grep -c 'exclusionMode: ExclusionMode.Normal' "$b" >/dev/null || fail "back strips stay clear of the bar and the keyboard"
Expand Down Expand Up @@ -1262,3 +1262,11 @@ else
pass "Back threshold feedback: once per gesture, both edges and retreat"
fi
env -u OMAMOBILE_POWER_KEY_ANDROID bash test/power-overlap.sh || fail "overlapping power-key presses"
rc=0; out=$(python3 -B test/back-navigation.py 2>&1) || rc=$?
if [[ $rc == 77 ]]; then
pass "Back navigation # SKIP no qmltestrunner"
elif [[ $rc != 0 ]]; then
printf '%s\n' "$out" >&2; fail "Back navigation"
else
pass "Back navigation"
fi
4 changes: 3 additions & 1 deletion packages/omamobile-shell/test/back-haptic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def handler(name):
raise AssertionError("unterminated handler")


h = {"armed": handler("onArmedChanged"), "active": handler("onActiveChanged")}
h = {"armed": handler("onArmedChanged"), "active": handler("onActiveChanged").replace("ToplevelManager.activeToplevel", "manager.activeToplevel")}
if args.negative:
h["armed"] = h["armed"].replace("armed && !feedbackSent", "armed")

Expand All @@ -40,6 +40,7 @@ def handler(name):
property int backs:0
function haptic(){ticks++}
function back(){backs++}
QtObject {id:manager;property var activeToplevel:null}
QtObject {id:win;property bool rightEdge:false}
QtObject {id:centroid;property point position:Qt.point(0,20)}
QtObject {
Expand All @@ -48,6 +49,7 @@ def handler(name):
property bool armed:false
property bool wasArmed:false
property bool feedbackSent:false
property var startedToplevel:null
property real atY:0
onArmedChanged: ARMED
onActiveChanged: ACTIVE
Expand Down
38 changes: 38 additions & 0 deletions packages/omamobile-shell/test/back-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,44 @@ test("a terminal gets no Escape: Back goes home; every other window gets the vir
assert.ok(M.isTerminal("foot") && M.isTerminal("org.omarchy.terminal") && !M.isTerminal("") && !M.isTerminal("Foot"))
})

test("browser history uses the virtual keyboard with the ordered Alt+Left dispatch fallback", () => {
const [sh, c, script, name, down, up] = M.BROWSER_BACK_ARGV
assert.deepStrictEqual([sh, c, name], ["sh", "-c", "sh"])
assert.strictEqual(down, 'hl.dsp.send_key_state({ mods = "ALT", key = "code:113", state = "down" })')
assert.strictEqual(up, down.replace('"down"', '"up"'))
assert.ok(script.indexOf("exec wtype -M alt -k Left -m alt") < script.indexOf('hyprctl dispatch "$1"'))
assert.ok(script.indexOf('hyprctl dispatch "$1"') < script.indexOf("sleep 0.05"))
assert.ok(script.indexOf("sleep 0.05") < script.indexOf('hyprctl dispatch "$2"'))
})

test("browser Back releases Alt and runs only the selected key path", () => {
const fs = require("fs"), os = require("os"), cp = require("child_process")
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "back-browser-"))
const log = path.join(dir, "log")
const stub = (name, body) => fs.writeFileSync(path.join(dir, name), "#!/bin/sh\n" + body + "\n", { mode: 0o755 })
try {
const sleep = cp.execSync("command -v sleep", { shell: "/bin/sh" }).toString().trim()
fs.symlinkSync(sleep, path.join(dir, "sleep"))
stub("hyprctl", 'echo "hyprctl $*" >> "$LOG"')
stub("wtype", 'echo "wtype $*" >> "$LOG"')
const run = () => {
fs.writeFileSync(log, "")
cp.execFileSync("/bin/sh", M.BROWSER_BACK_ARGV.slice(1), { env: { PATH: dir, LOG: log } })
return fs.readFileSync(log, "utf8").trim().split("\n")
}
assert.deepStrictEqual(run(), ["wtype -M alt -k Left -m alt"])
fs.rmSync(path.join(dir, "wtype"))
assert.deepStrictEqual(run(), ["hyprctl dispatch " + M.BROWSER_BACK_ARGV[4], "hyprctl dispatch " + M.BROWSER_BACK_ARGV[5]])
} finally { fs.rmSync(dir, { recursive: true, force: true }) }
})

test("browser matching includes installed apps without matching helpers or prompts", () => {
for (const id of ["google-chrome", "chromium", "chromium-browser", "chrome-mail.google.com__-Default", "chrome-abcdef-Profile_1"])
assert.ok(M.isBrowser(id), id)
for (const id of [null, "", "foot", "polkit", "chrome-password-dialog", "chromium-prompt", "google-chrome-helper"])
assert.ok(!M.isBrowser(id), id)
})

test("home is the shell's one command, with nothing of Hyprland in it", () => {
assert.deepStrictEqual(M.HOME_ARGV, ["omamobile-home"])
})
Expand Down
Loading