Skip to content

Open relative browser files from the caller directory - #19011

Open
YashasVM wants to merge 2 commits into
omacom:quattrofrom
YashasVM:fix/browser-relative-files
Open

YashasVM wants to merge 2 commits into
omacom:quattrofrom
YashasVM:fix/browser-relative-files

Conversation

@YashasVM

@YashasVM YashasVM commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What changes

omarchy-launch-browser page.html can open a website instead of the local file when browser handoff declines. The fallback systemd user service starts in home, so a file relative to the caller's directory is no longer found.

Pass --same-dir to systemd-run. The caller's directory survives uwsm-app too, so the browser can open the file without rewriting its arguments.

Fixes #19004.

Verification

  • Ran the launcher through the real systemd user manager and uwsm-app with an isolated desktop entry whose browser command records its directory and reads page #1.html. The base starts in home and cannot read it; this branch starts in the caller's directory and reads the HTML.
  • Headless Chromium with an isolated profile renders <h1>relative file reached</h1> when launched through the fixed chain with page.html.
  • The new relative-file case in test/shell.d/launch-browser-test.sh fails on the base and passes with the fix. The whole file and test/shell.d/browser-link-handoff-test.sh pass, including xdg-open and portal routing.
  • The structural i18n check, extraction scan, Bash syntax and whitespace checks pass locally.
  • After rebasing onto quattro at 4bf10ed28, ./test/all completed successfully: the CLI suite passed and all 427 shell test files completed without failures; 40 files had skipped checks. This was a headless run with the inherited GTK platform theme removed. Desktop-dependent and unavailable-environment checks were skipped, not verified. Upstream CI still needs approval to run this fork's workflows.

Resume verification on 2026-11-16 at unchanged head 7f0f296a2caafb08abe1b6779e5a4489b1799213:

  • Both focused files passed again with disk-backed TMPDIR: launch-browser-test.sh and browser-link-handoff-test.sh. The initial runs with /tmp failed later checks, with an explicit Disk quota exceeded error in the handoff run. Those initial failures are recorded here; changing the temporary-file location resolved them without source changes.
  • A fresh isolated desktop entry launched headless Chromium through this checkout's launcher, the real systemd user manager and real uwsm-app. Chromium's working directory was the caller's directory, it received page.html unchanged, and it exited 0 after rendering <h1>relative script reached</h1> from the page's relative marker.js file. No user browser profile or settings were changed.
  • Rechecked the retained full-suite records reported above: 427 shell file exit records, all 0; 40 output files contain skipped checks. The full suite was not rerun during this resume.
  • Bash syntax and git diff --check pass. No further source changes were needed.
  • GitHub Tests run 43794897024 and Check translation structure run 43794897032 both remain action_required, awaiting maintainer approval. Greptile Review succeeded. These blocked workflows have not passed, and no maintainer review is present.

Before and after from the real launch chain:

Before:
browser cwd: <home>
argument: page #1.html
FAIL: local file missing in browser working directory

After:
browser cwd: /tmp/omarchy-19004/work
argument: page #1.html
<h1>relative file reached</h1>

Not tested: interactive browser windows, Brave Origin or Firefox. Chromium was checked headlessly; no user browser settings changed.

Screenshots

No visible change to the browser UI: launch directory handling. Terminal evidence is above.

Reviewed with sol-loop: 1 round with gpt-6.1-sol on high reasoning effort. Sol verdict: approved.

Created with GPT-6.1 Sol in Codex through T3 Code.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes appear safe to merge.

Summary

The browser launcher keeps the caller’s directory and falls back to home when that directory has been deleted.

  • Fallback browsers now open relative files from the caller's folder.

No actionable new issues found. Tests were not run during this review.

Reviews (3) · Last reviewed commit: "Keep browser fallback working from a del..." · Reviewed by Greptile

@YashasVM YashasVM changed the title Keep relative browser files in the caller directory Open relative browser files from the caller directory Nov 16, 2026
systemd-run --same-dir cannot resolve a directory that has been removed, so return to home before launching from that state. Keep directory propagation for ordinary launches. Replace the test that reimplemented systemd directory handling with a regression that checks the launcher itself changes to home when its working directory is gone; the real systemd and uwsm path was exercised on a disposable worker.

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
Co-Authored-By: muse-wonder via pi, thinking high <noreply@omarchy.org>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reproduced #19004 on an ISO worker through the real systemd user manager, uwsm-app and interactive Chromium. The base and reverted fix opened http://page.html/; head 31f0282bd1f99ba291bc1fb8b7c6cdbfd9e2dcd7 opened the caller's local page and its relative JavaScript. A filename containing a space and # also opened correctly.

Pushed 31f0282bd to keep URL launches working when the caller's directory has been deleted: the launcher returns to home before using --same-dir. Replaced the test that simulated systemd's directory behavior with a test of that launcher fallback. The CLI suite passed 134 checks, and the launcher and link-handoff tests passed 14 checks on the worker. Restoring the original launcher made the new regression test fail at the intended assertion.

Reviewed by GPT-6 in Codex (reasoning effort not exposed), Opus 5.5 High and muse-wonder via pi, thinking high. The panel raised the deleted-directory regression and test issue; its final review found no blocking findings. Reviewer independence is not guaranteed. Waiting on maintainer approval and successful runs of Tests and Check translation structure; both currently report action_required.

Before: the base opens page.html as a hostname and displays a DNS error.

After: the final head opens the local page and loads its relative JavaScript in Chromium on the worker.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-launch-browser opens a relative file path as a web address when it falls back to systemd-run

2 participants