Skip to content

omamobile-shell: share once-only Chromium and Grok fitting - #581

Open
latentoperator wants to merge 6 commits into
derekross:mainfrom
latentoperator:ux/browser-launch-20261109
Open

latentoperator wants to merge 6 commits into
derekross:mainfrom
latentoperator:ux/browser-launch-20261109

Conversation

@latentoperator

@latentoperator latentoperator commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Share Chromium and Grok Bot's browser fitting through one geometry path and the established 578 px layout target: reference 480 logical px retains 0.83, Pixel 9a's 405 gets 0.70, and Pixel 6a's 360 gets 0.62 for a fresh default. Preserve custom flags, deliberately removed defaults and historical setup markers; migrate only the exact generated 0.83 line once. Chrome defaults remain deferred until launcher #2388 is released.

Chromium's UA/IME/first-run defaults do not wait for panel geometry. Only scale waits; the phone bar retries at shell start with live monitor geometry. A helper failure cannot abort later user setup. Fresh defaults intentionally use a generic Android mobile UA without a device model; existing UA choices stay intact.

November 19 update

Merged upstream 17f9a3cd into the topic at 419df7bf59. Kept both README sections. The browser helper and the package version are unchanged by this refresh. All 15 helper tests, tools/pr-check, tests/all, and all 33 package suites passed on the host. Derek has the version and TOUCH-PLAN edits at merge. Hosted policy, repository tests and all packages passed on this revision.

November 14 source refresh

Rebased onto current main 54a6565, preserving the new auto-sleep setup block and its fixtures. Review found an additional preservation edge case: an unquoted URL fragment could make comment parsing hide later custom scale/UA flags. Comments now start only at unquoted token boundaries. The new regression fails on the prior helper and passes with the correction; direct helper tests avoid writing bytecode into the packaged bin directory.

Policy, all 15 focused helper tests and the complete omamobile-shell package suite pass. Independent review found no remaining source blocker. Fresh hosted CI run 43652939578 passes policy, tests/all and every package suite on d45d79e145829517b91aaa38a2ba0d7c1fa9b530. The maintainer assigns the package version at merge.

Dated runtime evidence and remaining gate

The November 11 combined Pixel 6a package was omamobile-shell 0.2.119-1, integration 83326ed6d09684ae80f38c9360e8c4e864d32614, now published unchanged on bringup/bluejay-userspace-tested-20261111, kernel 7.3.0-rc6-omamobile-bluejay-input-gated0. Its exact package SHA and observations remain in TOUCH-PLAN: six required smoke checks passed, 370 package files verified unchanged, geometry-free defaults followed by live 0.62 fitting, intentional UA/IME removals preserved, and the owner's custom 0.70/site zoom/personal plugins preserved.

The maintainer's November 12 existing/fresh-user Pixel 7 Pro run passed on the earlier head, including a complete UA arriving as one Chromium argument. Those dated runs do not qualify the new parser edge-case correction or later unrelated main changes; no new phone operation is claimed here.

The Pixel 9a live-helper result is recorded below. Current PR #582's Back routing remains separate.

Pixel 9a live-helper result — November 15, 2026

The owner ran this head's helper directly in the live 9a session, without replacing the installed shell package. Chromium's generated 0.83 scale became 0.70 once; the second invocation left both files byte-identical. The Grok file also migrated 0.83 to 0.70 because it contained the exact unquoted generated default and the historical fit marker. The earlier expectation that Grok would always remain unchanged was too broad: the helper preserves custom values, quoted overrides and deliberately removed scale lines, while migrating that historical generated fallback. The 7 Pro's unchanged 0.83 case and this 9a migration case are distinct.

This supplies live helper migration/repeat evidence, not a new full package-install/login run. The follow-up records that scope and the intended narrow migration for maintainer review. No source change or new version bump was made for this update.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @latentoperator. Taking the browser's scale from the panel instead of the 7 Pro's 0.83 is the right fix, and the Pixel 9a needs it as much as your 6a (405 px at 0.83 is a 488 px layout). The description is also exactly as candid as I'd like about what has and hasn't run. Some direction while it's a draft:

  1. Keep the defaults once-only. The helper adds any missing flag at every login; only the migration is behind a marker. I ran it in a scratch home: after I deleted the --user-agent and --enable-wayland-ime lines, the next run put both back. Today those steps run once, so someone who removes the mobile user agent to get desktop sites keeps that choice. Could the defaults be written only when the browser's marker is absent, with later logins doing the migration alone?
  2. One fitting rule. The Grok Bot step just below fits the same panel to a 578 px layout and reads only card*-DSI-*; yours fits to 512 px and also accepts eDP and Unknown. So the 9a would get 0.79 for Chromium and 0.70 for Grok, and on your 6a (Unknown-1) the Grok step finds no panel and falls back to 0.83. I'd like one geometry function for both, and a line on why 512 is enough for Chromium when the 7 Pro's own layout is 578.
  3. Other phones. With the 9a's geometry and an existing file, the old 0.83 line becomes 0.79 at the next login. That's intended, and I'd want a 9a owner to see it before merge. I'll check the 7 Pro myself: an existing file there isn't touched, and a new user gets the new user-agent line.
  4. The quoting test. test/setup-user.sh now only greps for Mobile Safari/537.36 while its message still says the line stays quoted. Single quotes are fine for Chromium (Arch Linux ARM's launcher applies shell quoting; I checked the package), so please assert that the line parses to one argument.
  5. Login cost. The unit runs before the compositor, so the hyprctl branch never runs at login, and chromium --version now runs at every login with a 2 s timeout. Reading the version only when a user-agent line is about to be written would keep logins as they are.
  6. Chrome can follow once the launcher change is released; the Chromium half doesn't depend on it, if you'd like to split.

On numbers: 0.2.109 is taken (main is at 0.2.113), and this and #582 both append to docs/TOUCH-PLAN.md at the same place. I set the version at merge, so don't chase it.

@latentoperator
latentoperator force-pushed the ux/browser-launch-20261109 branch from 20c5baf to b928834 Compare November 10, 2026 19:12
latentoperator added a commit to latentoperator/omarchy-mobile that referenced this pull request Nov 10, 2026
Use one internal-output geometry path and the established 578 px layout target. Preserve historical setup markers, custom flags and intentional removals; migrate only the generated 0.83 line once. Query Chromium version only when writing a missing UA. Defer Chrome until its quote-aware launcher is released.

Focused tests and scratch-home login checks cover migration, quoting, geometry, deliberately removed flags and divergent XDG variables. Full-package phone and reference-device checks remain gates. Package version is assigned by the maintainer at merge as requested on derekross#581.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator latentoperator changed the title omamobile-shell 0.2.109: fit browsers to the phone output geometry omamobile-shell: share once-only Chromium and Grok fitting Nov 10, 2026
@derekross

Copy link
Copy Markdown
Owner

Thank you, @latentoperator. I went through my six points against the new head and they're all answered. I repeated my scratch-home test: a new user gets the five lines, and after I delete the user agent and the input-method flags the next login leaves them deleted. A home shaped like my 7 Pro's (the old markers and the old file) comes out byte for byte the same and never starts Chromium, a 9a-shaped one moves Chromium from 0.83 to 0.70 once and leaves Grok alone, and later logins start no process at all. The tests pass here on today's main.

Two things I'd like changed, both small:

  1. omamobile-setup-user runs under set -e, and the helper is called bare in the middle of it. Please make that call unable to stop the rest of user setup (omamobile-browser-setup || echo "…failed" >&2).
  2. When the geometry can't be read, nothing is written at all, and today the no-first-run flag, the mobile user agent and the input-method flags don't depend on geometry. That matters more than it looks: my open omamobile-shell 0.2.116: every phone's UI at the 7 Pro's physical size #635 turns the omarchy_monitor_scale line in monitors.lua into a computed value, and since the helper runs before the compositor, it would then find no number at any login and a new user would get no Chromium flags. Could the helper write the geometry-free defaults regardless and defer only the scale factor, and could it get a second run where hyprctl monitors -j answers (from the shell's start, behind the same markers)? Then it doesn't matter which of the two PRs lands first. omamobile-shell 0.2.116: every phone's UI at the 7 Pro's physical size #635 also edits the Grok step you remove, so one of us will rebase; I'll say which once I know the order.

With those in, please take it out of draft. What's left before merge is on phones, not in the code: I'll run it on my Pixel 7 Pro (an existing user and a fresh one, to see the new user-agent line reach Chromium as one argument), and I'd like a Pixel 9a owner to see the one-time 0.83 to 0.70 change. @den-kloot, if you have a moment once it's rebased, that would be you.

I'll set the version when I merge.

latentoperator added a commit to latentoperator/omarchy-mobile that referenced this pull request Nov 11, 2026
Use one internal-output geometry path and the established 578 px layout target. Preserve historical setup markers, custom flags and intentional removals; migrate only the generated 0.83 line once. Query Chromium version only when writing a missing UA. Defer Chrome until its quote-aware launcher is released.

Focused tests and scratch-home login checks cover migration, quoting, geometry, deliberately removed flags and divergent XDG variables. Full-package phone and reference-device checks remain gates. Package version is assigned by the maintainer at merge as requested on derekross#581.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator
latentoperator force-pushed the ux/browser-launch-20261109 branch from b928834 to c53a888 Compare November 11, 2026 16:52
latentoperator added a commit to latentoperator/omarchy-mobile that referenced this pull request Nov 11, 2026
Use one internal-output geometry path and the established 578 px layout target. Preserve historical setup markers, custom flags and intentional removals; migrate only the generated 0.83 line once. Query Chromium version only when writing a missing UA. Defer Chrome until its quote-aware launcher is released.

Focused tests and scratch-home login checks cover migration, quoting, geometry, deliberately removed flags and divergent XDG variables. Full-package phone and reference-device checks remain gates. Package version is assigned by the maintainer at merge as requested on derekross#581.

Co-Authored-By: Codex <noreply@openai.com>
@latentoperator
latentoperator force-pushed the ux/browser-launch-20261109 branch from c53a888 to 8a16a92 Compare November 11, 2026 18:19
@latentoperator
latentoperator marked this pull request as ready for review November 11, 2026 18:32
@derekross

Copy link
Copy Markdown
Owner

Thank you, @latentoperator. Both things from last time are in:

  • The call in omamobile-setup-user can no longer stop the rest of user setup, and your new test shows a later step still running after the helper fails.
  • The first-run, input-method and user-agent defaults are written whether or not the panel can be read, only the scale waits, and the bar gives the helper a second run at shell start where hyprctl answers. That covers a computed scale line, so it no longer matters whether this or omamobile-shell 0.2.116: every phone's UI at the 7 Pro's physical size #635 lands first (one of us still rebases over the Grok step).

I ran it merged onto today's main: tools/pr-check, your 14 helper tests and the scratch-home test all pass, and a home shaped like my 7 Pro's still comes out unchanged apart from the new markers.

What's left is on phones, as we said. I'll run it on my Pixel 7 Pro with an existing user and a fresh one, and check that the new user-agent line reaches Chromium as one argument. @den-kloot, when you have a moment, could you install this on the Pixel 9a and confirm that Chromium's --force-device-scale-factor=0.83 line becomes 0.70 once, and that the Grok Bot file stays as it is?

Two small notes, nothing to change now: #582 appends to docs/TOUCH-PLAN.md at the same place, so the second of the two to merge will need a rebase there; and in the plan it would help to name the fork branch that holds the tested 83326ed. I'll set the version when I merge (0.2.126 as things stand).

@derekross

Copy link
Copy Markdown
Owner

The Pixel 7 Pro run is done, and it passes. The phone: Omarchy 4.5.0-3, uname -r 7.3.0-rc6-omamobile-g1a9d1d4e9289, this head merged onto today's main (e6bc8e3d) and built on the phone with tools/phone-install-package.

An existing user. After the install and one shell restart:

  • ~/.config/chromium-flags.conf and ~/.config/grok-bot-flags.conf are byte for byte what they were before (the user agent line, --force-device-scale-factor=0.83 in both, the Wayland input-method flags);
  • the old markers are all still there, and three new ones appeared at the shell's start: omamobile-browser-defaults-chromium, omamobile-browser-fit-chromium, omamobile-browser-fit-grok-bot.

A fresh user (the helper run for an empty home under the live session, so hyprctl answered):

  • Chromium's file gets --force-device-scale-factor=0.83, --no-first-run, the two input-method flags and the single-quoted user agent; Grok Bot's gets 0.83; the same three markers;
  • a second run changes nothing;
  • chromium --help, which prints the flags the launcher parsed, lists the user agent as one argument, spaces and all. The launcher says it applies shell quoting rules, so single quotes are fine.

One thing I noticed, not blocking: the fresh user's user agent is Mozilla/5.0 (Linux; Android 14) …, while my existing file's has a device name after Android 14;. If that's intended (no device name for a new user), a line in the plan saying so would save the next reader the question.

So from my side this is ready. What's left is the Pixel 9a check I asked @den-kloot for (Chromium's 0.83 becoming 0.70 once, Grok Bot's file left alone). I'll merge after that, as 0.2.126 unless something takes the number first.

latentoperator and others added 5 commits November 14, 2026 17:01
Use one internal-output geometry path and the established 578 px layout target. Preserve historical setup markers, custom flags and intentional removals; migrate only the generated 0.83 line once. Query Chromium version only when writing a missing UA. Defer Chrome until its quote-aware launcher is released.

Focused tests and scratch-home login checks cover migration, quoting, geometry, deliberately removed flags and divergent XDG variables. Full-package phone and reference-device checks remain gates. Package version is assigned by the maintainer at merge as requested on derekross#581.

Co-Authored-By: Codex <noreply@openai.com>
Document the exact combined userspace artifact, deferred-geometry and intentional-removal checks, preserved personal settings and remaining reference-phone gates.

Co-Authored-By: Codex <noreply@openai.com>
Record the generic UA choice and completed Pixel 7 Pro check. Name the immutable integration branch so the earlier combined 6a test can be matched to source; the Pixel 9a migration remains a separate gate.

Assisted-by: OpenAI Codex
shlex comment mode discards an unquoted URL fragment and every following flag. That made browser setup overlook an existing custom scale and UA, then append generated replacements. Recognize comments only at unquoted token boundaries, matching the launcher parsing behavior, and keep malformed-input refusal.

A regression fails with the prior parser and verifies that an app URL followed by custom scale and UA remains unchanged. Direct helper tests also suppress bytecode writes into the packaged bin directory.

Assisted-by: OpenAI Codex
…e evidence

The exact November 11 package remains the historical phone checkpoint. Record the new URL-fragment preservation fix as an offline-validated follow-up so its coverage is not inferred from that earlier boot.

Assisted-by: OpenAI Codex
@latentoperator
latentoperator force-pushed the ux/browser-launch-20261109 branch from 8a16a92 to d45d79e Compare November 14, 2026 23:22
@derekross

Copy link
Copy Markdown
Owner

Thank you, @latentoperator. I went through the rebase and the three new commits:

  • The URL-fragment fix is right. The old shlex.split(…, comments=True) ended a token at any #, so a custom scale after an app URL with a fragment was missed; starting a comment only at a token boundary is what the launcher's shell rules do. Your new test fails with the old call and passes with the new one; I checked both.
  • My Pixel 7 Pro run still stands. I gave the old and the new parser the flags file my phone has, and one with comment lines: they read them identically, so the existing-user result from the 12th (both files unchanged, three new markers) holds for this head.
  • The plan names the branch with 83326ed and explains the user agent without a model. Thank you for both.

Merged onto today's main it's clean, and your 15 helper tests and the scratch-home test pass here.

So the one thing left is the Pixel 9a look. @den-kloot, when you have a few minutes with the 9a: could you install this branch's shell and check that Chromium's --force-device-scale-factor=0.83 line becomes 0.70 once, and that ~/.config/grok-bot-flags.conf stays as it is? After that I'll merge, with the version set on the branch just before.

@derekross

Copy link
Copy Markdown
Owner

@den-kloot, could you do one quick check of this on your 9a? With this branch installed, Chromium's --force-device-scale-factor should go from 0.83 to 0.70 once at login and then stay there, and ~/.config/grok-bot-flags.conf should be unchanged. A grep scale ~/.config/chromium-flags.conf before and after is all I need.

If nobody with a 9a can try it in the next few days, I'll merge on my 7 Pro run and the 9a-shaped scratch home from 11-11.

@den-kloot

Copy link
Copy Markdown
Contributor

Done on the Pixel 9a (7.3.0-rc6-omamobile-push1-gcbb1a7eb0a78, monitor scale 8/3, 405 px logical). The installed shell is 0.2.127 with a few local patches, so I didn't replace the package. Instead I ran this head's omamobile-browser-setup (d45d79e) directly in the live session, the same call the bar makes at shell start. Before running it I copied both flags files and the list of markers.

$ grep scale ~/.config/chromium-flags.conf ~/.config/grok-bot-flags.conf   # before
grok-bot-flags.conf:--force-device-scale-factor=0.83
chromium-flags.conf:--force-device-scale-factor=0.83
$ omamobile-browser-setup   # run 1
chromium-flags.conf:--force-device-scale-factor=0.70
grok-bot-flags.conf:--force-device-scale-factor=0.70
new markers: omamobile-browser-defaults-chromium, omamobile-browser-fit-chromium, omamobile-browser-fit-grok-bot
$ omamobile-browser-setup   # run 2
chromium-flags.conf:--force-device-scale-factor=0.70
grok-bot-flags.conf:--force-device-scale-factor=0.70   (byte-identical to after run 1)
  • Chromium: 0.83 became 0.70 once and stayed. Nothing else in the file changed: the UA line with "Pixel 7 Pro", the extensions list with my own Bitwarden extension, the IME flags and --no-first-run.
  • Grok Bot: this is the part that doesn't match what you expected. Its file did change, 0.83 → 0.70. On this phone it held the exact generated --force-device-scale-factor=0.83, and its omamobile-grok-bot-fit marker has the same timestamp as the file (2026-11-11 15:28:47). So setup-user wrote 0.83 there, not 0.70, probably because it couldn't read the panel mode at that moment, and nothing on this phone is a value I chose. With that marker and that exact line, the helper treats it as the historical default and migrates it, as the code says. I think that's the right result for a 9a, see below. But if the 9a's Grok file is meant to stay as it is in every case, the Grok branch needs a different rule.

Screenshots: Chromium and Grok Bot 1.0.1 (from the omarchy repo, started from an extracted copy with a throwaway profile), each with the factor given on the command line:

0.83 0.70
Chromium (page with a red bar on its right edge) window 500 CSS px on a 405 px screen: the red bar and part of the ⋮ menu are off-screen 579 CSS px, the red bar and ⋮ are visible
Grok Bot the window's close button is cut off at the right minimize, maximize and close are all visible
Chromium 0.83 Chromium 0.70 Grok Bot 0.83 Grok Bot 0.70

(Measured on my phone with Claude.)

@latentoperator

Copy link
Copy Markdown
Contributor Author

Thanks, @den-kloot. The Chromium result and the second-run byte comparison answer the one-time migration question. Your Grok result also matches this head's rule: an existing omamobile-grok-bot-fit marker plus the exact unquoted generated --force-device-scale-factor=0.83 line lets the helper replace that historical default with the panel-derived factor. Custom values, quoted overrides and a deliberately removed scale line are preserved.

My description that the Grok file would stay unchanged was too broad. It stays unchanged when its existing value is already right for the panel, as on Derek's 7 Pro; the generated 0.83 fallback on this 9a is a migration case. I would retain that narrow migration rather than leave Grok clipped at the historical fallback. The screenshots support the 0.70 fit on this phone.

Keeping the scope of the evidence precise: you ran omamobile-browser-setup from d45d79e1 directly in the live session, without replacing the installed shell package. This qualifies that helper's live migration and repeat behavior, not a package-install/login test. The Pixel 7 Pro package/session result remains the separate evidence for those paths. No source change is included in this reply.

@derekross

Copy link
Copy Markdown
Owner

Thank you both. @den-kloot, that was exactly the check I needed, and done the careful way: both files copied first, the helper run twice, and screenshots of each app at both factors.

You were right to flag Grok Bot, and so is the code. I went back to main: the Grok step in omamobile-setup-user writes 0.83 when it can't read a panel mode, and your file held exactly that line, written at the same second as its marker. So it was our fallback, not a value you chose, and migrating that one exact line to the panel's factor is what the helper is written to do, the same rule as Chromium's. On my 7 Pro the panel's factor is 0.83 anyway, which is why I saw no change there and wrongly expected none on yours. Your screenshots, with Grok's close button back on screen at 0.70, show it's the right result. @latentoperator, thank you for the clear write-up of the rule in the description.

So this is ready. When I merge I'll push two small things to your branch first: the shell version (0.2.133, after #425 takes 0.2.132), and one line in TOUCH-PLAN, which still says the 9a check "remains before merge", recording den-kloot's result. Then I'll merge once CI has run on that push.

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