Repository navigation
Switcher revamp - #210
Switcher revamp#210Tektonikal wants to merge 3 commits into
Conversation
PR's account switcher files were migrated from OneConfig's internal theme API to the public OneConfigTheme API that main switched to.
| Row( | ||
| horizontalArrangement = Arrangement.Center, | ||
| modifier = Modifier.fillMaxWidth(), | ||
| ) { |
There was a problem hiding this comment.
🟡 [P2] Adapt the account layout to smaller windows
At the default 854×480 window size, reproduced on Minecraft 26.3, the fixed-width preview leaves too little room for these side-by-side buttons. The Microsoft button consumes the available width, the offline button disappears, and the resulting row height collapses the weighted account list. Users cannot add offline accounts or manage existing accounts without enlarging the window. Scale the preview and stack or wrap the buttons when space is limited.
| ) { | ||
| SocialText(text = "Accounts", fontSize = 24.sp, fontWeight = FontWeight.SemiBold) | ||
| Spacer(Modifier.weight(1f)) | ||
| SocialIconButton(SOCIAL_ASSETS + "x-close.svg", tooltip = "Close", onClick = onClose) |
There was a problem hiding this comment.
🟡 [P2] Prevent dismissal while an account switch is still running
During a slow account switch, this close button and the screen's Escape handler bypass the backdrop's idle check. Disposing the composition cancels its coroutine scope, but the synchronous OneLauncherAccounts.switchTo call on Dispatchers.IO continues through its blocking profile lookup and subsequent session mutation. Users can return to the menu and start another switch, only for the earlier operation to finish later and overwrite their selection. Apply the busy guard to every dismissal path, or ensure cancellation prevents the pending session mutation.
| if (account.microsoft) { | ||
| RefreshAccountButton( | ||
| color = if (account.expired) SocialDangerColor else SocialTextSecondary, | ||
| enabled = enabled, | ||
| spinning = refreshing, | ||
| onClick = onRefresh, |
There was a problem hiding this comment.
🟡 [P2] Hide refresh for transient launch accounts
When a Microsoft launch account is absent from auth.json, OneLauncherAccounts.list() includes it as a transient account without a refresh token. This condition nevertheless gives it an enabled refresh button, whose call to OneLauncherAccounts.refresh() always fails with “Account not found” because that method only searches persisted accounts. Expose and check refreshability rather than treating every Microsoft account as refreshable.
| import org.lwjgl.input.Keyboard | ||
| *///?} | ||
|
|
||
| class AccountSwitcherScreen(internal val previousScreen: Screen?) : ComposeScreen(RenderMode.CONTINUOUS) { |
There was a problem hiding this comment.
🔵 [P3] Reuse the existing overlay screen implementation
This class duplicates SocialOverlayScreen's Escape restoration, blur animation, panorama rendering, and version-specific rendering branches, changing essentially only the content and close target. Future rendering or lifecycle fixes must now be maintained in both copies. Share the existing overlay implementation and supply the account content and dismissal callback.
Changes the drop-down account switcher on the title screen to be its own menu, loosely based on the one in the launcher.