Repository navigation
fix(ui): open browser for alphaXiv sign-in on remote sessions - #884
Conversation
When orx is running on a remote host (e.g. workstation connected from laptop), the backend orx login process cannot launch a browser on the client machine via host-side open_browser. LoginSession received the authorization URL from the PTY stdout but only set component URL state without invoking window.open, leaving the dialog stuck on "Finish signing in in your browser…". Prompt window.open with the authorization URL once received. Closes alphaXiv#883 Assisted-by: claude-opus-5.5
[Medium impact] The change reaches the sign-in and account-linking flows in the UI. The PR appears safe to merge, with non-blocking issues around blocked popups and duplicate local sign-in tabs. FindingsFix with agent prompt### Issue 1
ui/src/components/AccountChip.tsx:112-114
`window.open` runs from a WebSocket callback, after the click's browser permission can expire. If the browser blocks this delayed popup, remote sign-in still opens no tab. The user must click the existing URL link.
Open a placeholder tab during the sign-in click and navigate it when the URL arrives, as `RemoteHostDialog` already does.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
### Issue 2
ui/src/components/AccountChip.tsx:114
Local desktop sign-in now opens the same authorization URL twice. Both login endpoints run `login`, which already calls `open_browser` unconditionally. The desktop app sends this new `window.open` request to the system browser too. The `opened` ref only prevents repeated frontend calls, so users get two account prompts for one action.
Coordinate the two launch paths so each sign-in opens one tab.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Summary
|
… sessions Avoid opening duplicate browser tabs on local sign-in by deferring to backend login's open_browser when not in a remote session. On remote sessions in web browsers, open a placeholder tab during user gesture and navigate it once the authorization URL arrives to prevent popup blocking. In remote desktop app sessions, prompt window.open directly without pre-opening. Assisted-by: claude-opus-5.5
|
Addressed in commit 1c0c7be: • Issue 1 (Delayed popup blocking in browsers): • Issue 2 (Duplicate browser tabs on local sign-in): |
Closes #883
Summary
When
orxis running on a remote host (e.g. workstation connected from a laptop), the backendorx loginprocess attempts to launch a browser locally on the host viaopen_browser, which cannot open a browser window on the client machine.In
LoginSession(ui/src/components/AccountChip.tsx), the authorization URL was captured from the PTY stdout and stored in local state, butwindow.openwas never called on the client side. The dialog rendered "Finish signing in in your browser…" while no browser tab was ever prompted or opened on the user's laptop.This change invokes
window?.open?.(match[0], "_blank")when the authorization URL arrives from the login session stream, using a ref guard so it opens only once.Test plan
LoginSession prompts browser window when authorization URL arrivesinui/tests/accountChip.test.mjs.node --test --experimental-strip-types ui/tests/accountChip.test.mjs: all 10 tests pass.pnpm -C ui test: all 578 unit tests pass.pnpm -C ui typecheck: typecheck passes without errors.pnpm -C ui build: Paraglide compile, typecheck, and Vite production build pass without errors.cargo fmt --check: passes without formatting differences.cargo check --bin orx: passes without errors.Assisted-by: claude-opus-5.5