feat: switch between multiple Google accounts without re-signing in - #118
Merged
Merged
Conversation
Backend now stores every signed-in Google account (JSON store, same encrypted-file/keyring transport as before) instead of one, each with its own isolated login webview partition so accounts can never cross-contaminate. Sign-in stays one additive operation; new switch/remove/list commands handle the rest. Legacy single-account installs migrate transparently and keep their original webview partition. Frontend gets listGoogleAccounts/switchGoogleAccount/removeGoogleAccount on top of the existing (unrelated) channel switcher, plus a GoogleAccountSwitcher in the title bar and Settings. 16 new Rust tests on the store logic, 1 new TS check on the switch/remove outcome branch. Closes #94
Both switchers rendered as one undifferentiated list in the title bar popover. Each now carries its own optional section label, rendered only alongside its own rows so a hidden single-option section never leaves an orphaned header. Settings' switchers use the same prop instead of duplicating the header markup.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What and why
Closes #94. Today, using two YouTube Music accounts means a full sign-out/sign-in each time. This adds real multi-account storage and a switcher, so switching is instant.
How
YoutubeAccountStore(per-account slot id, cookie, cached name/avatar) replaces the single bare cookie, through the exact same encrypted-file (macOS) / OS-keyring (Windows/Linux) transport — the orphan-recovery fix from Unable to login to youtube on mac os #116 covers it unchanged. An existing install's bare cookie migrates into one pinned slot automatically.sign_in_youtube_musickeeps its signature (now inherently additive); newlist/switch/remove_youtube_music_accountcommands handle the rest.listGoogleAccounts/switchGoogleAccount/removeGoogleAccount, separate from the existing channel-level switcher (brand channels within one login — untouched). AGoogleAccountSwitchersits in the title bar (switch only) and Settings (switch + remove + add).Scope
Switching still does a full library resync rather than an instant cached view per account — the issue asked to avoid re-login, not for per-account caching, and namespacing the whole offline cache is a separable, larger change.
How it was checked
cargo check/cargo test— 44/44 pass (16 new, covering the store's upsert/remove/switch/migration logic directly — it's pure, no AppHandle needed)npm run verify— typecheck clean, 32/32 self-checks pass (1 new)