Repository navigation
feat(app): sidebar account entry with login avatar and logout - #341
Merged
Merged
Conversation
Add an account entry to the sidebar right under Settings: a Log in row (opening the existing configure dialog) while signed out, and an initials avatar while signed in whose menu holds Help (moved out of the sidebar rows) and a new Log out. Log out mirrors codevhub logout: @codev/gateway gains logout() — drop the SSO block from the shared auth file (keeping the gateway api-key and config blocks), leave the force-login sentinel, best-effort revoke both tokens — plus loadAccount(), clearSkillhubCookie() and markForceLogin(). The desktop controller exposes getAccount/logout over new gateway-sso IPC channels, cancelling any in-flight login on logout so every window's account UI resets. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BcADw33oD8qs5jvn5NWMJx
loadAccount showed the avatar for a file whose access token had expired with no refresh token to revive it — a session no silent refresh can bring back. Require the session to be live or refresh-revivable; a present refresh token stays optimistic since its server-side validity is unknowable from disk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BcADw33oD8qs5jvn5NWMJx
The initials avatar grows from 24px to 32px. The persistent "Session upload is paused" toast now dismisses itself when a login completes (phase "ready"), from whichever entry point — its own action, the sidebar's Log in, or the menu item — instead of waiting for its close button. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BcADw33oD8qs5jvn5NWMJx
First-two-words initials read family + middle name for a
family-name-first name ("Nguyễn Hoàng Minh" showed NH); first + last
word yields NM there and is unchanged for two-word Western names. The
avatar menu now leads with the signed-in email as a group label above
Help and Log out.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BcADw33oD8qs5jvn5NWMJx
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.
Summary
Adds an account entry to the sidebar, right under Settings:
gateway.apiKey.newcommand.codevhub logout: it clears only the SSO token block from the shared auth file (the gateway API key and config blocks survive, so chat keeps working), writes theforce-loginsentinel so the next sign-in re-prompts for credentials, best-effort revokes both tokens against the SSO wrapper (3s cap, errors swallowed), and drops the hub admin cookie.Implementation
@codev/gateway: newlogout(),loadAccount()(identity on disk independent of access-token expiry — a refresh-revivable session still counts),clearSkillhubCookie(),markForceLogin(); revocation accepts afetchImplso the desktop passes Electron'snet.fetch.packages/desktop: controller gainsgetAccount()/logout()(logout cancels an in-flight login and resets state so every window's account UI refetches); newgateway-sso-get-account/gateway-sso-logoutIPC channels; preload bridge extended.packages/app: fork-onlyAccountNavcomponent;app-sidebar.tsxnow renders its own Settings row instead ofHomeUtilityNav(Help lives only in the account menu; no upstreamhome.tsxedit needed; the e2eSettingshandle is unchanged). i18n keyssidebar.login/sidebar.logout/sidebar.accountin en/es/vi.DIVERGENCES.mdrows (persistent app sidebar, gateway key recovery) amended;CHANGELOG.mdUnreleased entry added.Testing
bun typecheckclean incodev-gateway,desktop,app.bun test: gateway 60 pass (new logout/loadAccount/clearSsoSession suites), desktop 17 pass (new controller logout/getAccount tests), app 814 unit tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01BcADw33oD8qs5jvn5NWMJx