feat: --page launch argument to open the app on a given page (e.g. --page quota) - #209
Open
ahmed-khaire wants to merge 1 commit into
Open
feat: --page launch argument to open the app on a given page (e.g. --page quota)#209ahmed-khaire wants to merge 1 commit into
ahmed-khaire wants to merge 1 commit into
Conversation
Lets launchers, tray helpers and scripts open EasyCLIProxyAPI directly on a page (for example `--page quota` for OAuth > Quota Lookup) instead of always landing on Home. - Rust: parse `--page <id>` / `--page=<id>`; keep it in managed state and expose `take_launch_page` for the first render. If another instance already holds the instance lock, write the request next to the lock and exit, and let the running instance pick it up (500 ms poll), reveal its window and emit `navigate-page`. Values are restricted to `[A-Za-z0-9/-]` and 64 chars; the frontend validates the actual target. - Frontend: `parseLaunchTarget` accepts page ids plus `oauth/<subpage>` and the bare OAuth subpage aliases (`quota`, `authFiles`, `login`). The target is held until `canOpenAppPage` allows it, since non-Home pages unlock only once the core runs; the OAuth page accepts a requested subpage. - README: document the argument. Tested on Linux: `--page usage-records` on first launch, `--page home` forwarded to a running instance (single window, request consumed), and `--page quota` landing on Quota Lookup once the core was running.
ahmed-khaire
force-pushed
the
feat/launch-page
branch
from
September 5, 2026 11:25
9e9a417 to
6afa6a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
--page <id>launch argument so EasyCLIProxyAPI can be opened directly on a page instead of Home, e.g.EasyCLIProxyAPI --page quotafor OAuth → Quota Lookup. When an instance is already running, the running window is raised and switched to that page; no second window.Motivation: tray helpers / launchers that want to jump straight to quota details. Today there is no deep link, and driving the page through the accessibility layer crashes the WebKit view on Linux.
How
Rust (
src-tauri/src/launch_navigation.rs,main.rs)--page <id>and--page=<id>are parsed before the instance guard.LaunchPageState; the frontend reads it once via thetake_launch_pagecommand.<tmp>/EasyCLIProxyAPI-navigate-<instance key>.txtand the process exits. The running instance polls that file (500 ms), consumes it, reveals the main window (tray helper on macOS/Windows,show/unminimize/set_focuselsewhere) and emitsnavigate-page.[A-Za-z0-9/-], max 64 chars; anything unknown is ignored by the frontend.Frontend (
src/launchNavigation.ts,App.tsx,ManagementPages.tsx)parseLaunchTargetaccepts sidebar page ids,oauth/<subpage>, and the bare OAuth subpage aliasesquota/authFiles/login.canOpenAppPage(page, coreRunning)is true, because pages other than Home/Usage/… unlock when the core is running and the existing reset-to-home effect would otherwise win.OAuthManagementPageaccepts arequestedSubpageand switches its tab.Docs: README "Launch arguments" section.
Tests
tests/launchNavigation.test.ts(parser) andsrc-tauri/src/tests/launch_navigation.rs(argument parsing, sanitising, request file round-trip): all pass.bun run checkclean.bun test: 148 pass, 1 pre-existing failure (i18n > keeps both locale dictionaries structurally aligned) that also fails onmain.cargo test: 329 pass;agent_probe_command_stops_at_timeoutfails on my Ubuntu 24.04 host onmainas well (timing), unrelated.--page usage-recordson first launch → Usage;--page homefrom a second launch → forwarded, one window, request file consumed;--page quota→ held while the core was starting, then OAuth / Quota Lookup selected.Not tested on macOS/Windows; the reveal path there reuses the existing
tray::show_main_window.