Repository navigation
feat(web): Pandar Cloud sign-in and Devices tab - #22
Conversation
Port GUI_App::request_login / request_user_logout and MainFrame's Device tab (MainFrame.cpp:1606-1608, show_device) over the Pandar Hub web login ticket: a Cloud menu next to File signs in through a PKCE popup, the web:session token is kept in ares.config, and a Devices tab shows the tenant's printers live from the printer-event socket. Print plate now sends through the Cloud session; the manual print host is removed.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e20649bf37
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const response = await fetch(`${hub}/api/v1/web/login-tickets/exchange`, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ ticket: await ticket, code_verifier: verifier }), | ||
| }); |
There was a problem hiding this comment.
Abort the exchange request when sign-in is cancelled
If the popup has already delivered its ticket and the exchange request is still in flight, clicking Cancel only aborts the ticket wait; this fetch has no abort signal and will still save the session and update app state after the dialog was cancelled. Pass the controller signal to the exchange request (and ignore its result after cancellation) so cancelling cannot unexpectedly sign the user in.
Useful? React with 👍 / 👎.
Summary
Adds a Cloud menu next to File that signs in to a Pandar Hub. While signed in, a Devices tab shows the tenant's printers with live status. Print plate now sends through the Cloud session, and the manual Physical Printer settings are removed.
This ports the following upstream OrcaSlicer behaviour (v2.5.0,
40ecc66f):GUI_App::request_login/ShowUserLogin(GUI_App.cpp:5135,:5363) andGUI_App::request_user_logout(:5448).MainFrame'sm_monitor_page/MonitorPanel(MainFrame.cpp:1606-1608), whichMainFrame::show_device(:1661-1745) inserts after Preview.The architecture doc
docs/architecture/web-pandar-print-host.mdis updated.Sign-in
{hub}/web-sign-inwithredirect_url, a PKCE S256code_challengeand a randomstate.public/cloud-callback.htmlwith a one-use ticket. That page posts{ ticket, state }on theares.cloudBroadcastChannel. The app'sCross-Origin-Opener-Policy: same-originheader severswindow.opener, so the popup cannot report back directly.POST /api/v1/web/login-tickets/exchangefor a 30-dayweb:sessiontenant token.Session storage
cloudfield ofares.configand mirrored in the store.printHostfield is dropped on load, not migrated.Devices tab (
#/devices)GET /printers, then opens the printer-event WebSocket. Eachprinter_snapshotreplaces its printer. A closed socket reconnects after 5 s.Print plate
Depends on
The Pandar Hub web sign-in endpoints (
/web-sign-in,web/login-tickets,web:sessionscope) come from ProjectPandar/pandar#18.Testing
New
web/e2e/pandarCloud.spec.ts. The fake Hub inweb/e2e/pandarHub.tsredirects the popup and accepts the exchange only whenSHA-256(verifier)equals the challenge it issued. The spec checks:printer_snapshotupdate;Screenshots and
session.jsonare written totarget/web-e2e/pandar-cloud/.web/e2e/pandarSend.spec.tsnow signs in through Cloud before sending.Local results:
bun run fmt:check,lint,typecheckandtest:unitpass. The pandar, persistence, fileMenu and about E2E specs pass on desktop. The iPhone/iPad mobile specs were not run locally because WebKit is not installed.🤖 Generated with Claude Code