Skip to content

feat(desktop): sign-in toast for stalled session uploads - #320

Merged
quickbeard merged 2 commits into
mainfrom
upload-signin-toast
Aug 25, 2026
Merged

quickbeard merged 2 commits into
mainfrom
upload-signin-toast

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Issue for this PR

Closes #

Type of change

  • New feature
  • Bug fix

What does this PR do?

Two changes to the same flow — getting back into the CoDev sign-in.

1. The menu item is now "Log in/Configure" (was "Get a new API Key..."). It sits in the CoDev menu on macOS and the File menu on Windows/Linux, and appears in the command palette on every platform via command.gateway.apiKey.new (en/es/vi updated). The label names what the item is actually reached for — re-authenticating — with minting a key as the side effect. The command id is deliberately unchanged: it is the wire name desktop-menu.ts dispatches through sendMenuCommand.

2. The "Session upload is paused" warning is now an in-app toast with a Log in button.

The background session upload needs a live CoDev SSO session, but the app itself runs on the gateway API key alone — so when the session dies, uploads stop silently while everything else keeps working. @codev/upload's daemon records that stall in ~/.codev-hub/last-upload.json, and the desktop surfaced it as an Electron Notification. That notification had nothing to click, and Electron only renders notification action buttons on macOS — on Linux it depends on a notification daemon that may drop the whole thing. So the one surface telling you uploads had stopped could neither fix it nor reliably appear.

It is now a toast inside the app, with a Log in button that calls the same openConfigure the menu command does, so both entry points open the same dismissable DialogConfigure. persistent: true — a warning that fades while you are reading code is the same silence the nudge exists to break.

Wiring, main → renderer:

  • main/index.ts reads shouldNudgeSignIn() once at startup into a one-shot let and hands it to registerGatewaySsoIpcHandlers' new second argument. Read once rather than per request so a sign-in mid-session cannot flip the answer between windows; consumed so a second window does not repeat a toast the user is already looking at (the old notification fired once per launch, and a per-request read would have fired once per window).
  • New gateway-sso-consume-upload-nudge channel, on the gatewaySso namespace because signing back in is the nudge's entire remedy — and because GatewaySsoPlatform lives in the fork-only packages/app/src/gateway/types.ts, which types it without touching upstream's platform.tsx.
  • gateway-configure-gate.tsx (fork-only) consumes it onMount and raises the toast.

DIVERGENCES.md rows for the desktop session upload and gateway key recovery are updated; CHANGELOG.md gets an entry, and the two unreleased entries that described the old notification and the old menu label are corrected in place rather than left contradicting it.

How did you verify your code works?

  • bun typecheck in packages/app and packages/desktop — clean.
  • bun test in packages/app (700 pass) and packages/desktop (155 pass).
  • prettier --check on every changed file.

Not verified by running the app: reproducing the toast needs a real stalled state — an SSO-origin gateway key plus ~/.codev-hub/last-upload.json carrying {"skipped":"not-logged-in"} — which I did not manufacture on this machine. The toast call itself mirrors the existing update toast in pages/layout.tsx (same showToast options shape, same actions contract).

Screenshots / recordings

None — see the note above.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

Quickbeard and others added 2 commits August 25, 2026 09:24
The "Session upload is paused" warning was an OS notification with nothing
to click: the user had to find the sign-in themselves, and Electron only
renders notification action buttons on macOS — on Linux the notification
can be dropped by the daemon entirely.

Main now reads shouldNudgeSignIn() once at startup into a one-shot flag
handed out over gateway-sso-consume-upload-nudge, and the configure gate
raises a persistent in-app toast whose Log in action opens the same
DialogConfigure the menu item does. Consuming the flag keeps the toast to
one window instead of one per window.

The menu item it points at is renamed "Get a new API Key..." ->
"Log in/Configure" (macOS app menu, Windows/Linux File menu, and the
command palette via command.gateway.apiKey.new in en/es/vi). The command
id is unchanged — it is the wire name the desktop menus dispatch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 3f011ba into main Aug 25, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the upload-signin-toast branch August 25, 2026 02:29
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.

1 participant