Repository navigation
feat(desktop): sign-in toast for stalled session uploads - #320
Merged
Merged
Conversation
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>
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.
Issue for this PR
Closes #
Type of change
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 namedesktop-menu.tsdispatches throughsendMenuCommand.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 ElectronNotification. 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
openConfigurethe menu command does, so both entry points open the same dismissableDialogConfigure.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.tsreadsshouldNudgeSignIn()once at startup into a one-shotletand hands it toregisterGatewaySsoIpcHandlers' 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).gateway-sso-consume-upload-nudgechannel, on thegatewaySsonamespace because signing back in is the nudge's entire remedy — and becauseGatewaySsoPlatformlives in the fork-onlypackages/app/src/gateway/types.ts, which types it without touching upstream'splatform.tsx.gateway-configure-gate.tsx(fork-only) consumes itonMountand raises the toast.DIVERGENCES.mdrows for the desktop session upload and gateway key recovery are updated;CHANGELOG.mdgets 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 typecheckinpackages/appandpackages/desktop— clean.bun testinpackages/app(700 pass) andpackages/desktop(155 pass).prettier --checkon 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.jsoncarrying{"skipped":"not-logged-in"}— which I did not manufacture on this machine. The toast call itself mirrors the existing update toast inpages/layout.tsx(sameshowToastoptions shape, sameactionscontract).Screenshots / recordings
None — see the note above.
Checklist
🤖 Generated with Claude Code