From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Modrinth Enhanced Date: Tue, 15 Sep 2026 15:14:28 +0200 Subject: [PATCH] Show the account in the title bar when the sidebar is folded The Minecraft account lives in the right sidebar, so folding the sidebar away took with it any way to see which account is selected or to switch to another. While the sidebar is folded, the account now sits in the title bar next to the window buttons: its head and name, opening a menu to switch accounts, add one or remove one. The menu stands in for the sidebar's account card rather than being a second one. That card stays mounted while the sidebar is hidden, so the selection, the avatar and the sign-in dialogs are the card's own and stay in step with it, and a dialog opened from the menu outlives the menu closing. --- apps/app-frontend/src/App.vue | 8 + .../src/components/ui/AccountsCard.vue | 32 ++-- .../components/ui/TitleBarAccountSwitcher.vue | 163 ++++++++++++++++++ 3 files changed, 191 insertions(+), 12 deletions(-) create mode 100644 apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index 0ffddff..5cbe7d8 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -79,6 +79,7 @@ import { computed, nextTick, onMounted, onUnmounted, provide, ref, watch } from import { RouterView, useRoute, useRouter } from 'vue-router' import AccountsCard from '@/components/ui/AccountsCard.vue' +import TitleBarAccountSwitcher from '@/components/ui/TitleBarAccountSwitcher.vue' import AppActionBar from '@/components/ui/AppActionBar.vue' import Breadcrumbs from '@/components/ui/Breadcrumbs.vue' import ErrorModal from '@/components/ui/ErrorModal.vue' @@ -2509,6 +2510,13 @@ provideAppUpdateDownloadProgress(appUpdateDownload) + + + diff --git a/apps/app-frontend/src/components/ui/AccountsCard.vue b/apps/app-frontend/src/components/ui/AccountsCard.vue index 224d776..632483e 100644 --- a/apps/app-frontend/src/components/ui/AccountsCard.vue +++ b/apps/app-frontend/src/components/ui/AccountsCard.vue @@ -226,18 +226,6 @@ function showElyAccountModal(event?: MouseEvent) { elyAccountModal.value?.show(event) } -defineExpose({ - refreshValues, - showOfflineAccountModal, - showElyAccountModal, - setEquippedSkin, - setLoginDisabled, - login, - loginDisabled, -}) - -await refreshValues() - const selectedAccount = computed(() => accounts.value.find((account) => account.profile.id === defaultUser.value), ) @@ -256,6 +244,26 @@ const avatarUrl = computed(() => { return 'https://launcher-files.modrinth.com/assets/steve_head.png' }) +defineExpose({ + refreshValues, + showOfflineAccountModal, + showElyAccountModal, + setEquippedSkin, + setLoginDisabled, + login, + loginDisabled, + // For the title bar's account switcher, which stands in for this card while + // the sidebar is folded away. + accounts, + selectedAccount, + avatarUrl, + getAccountAvatarUrl, + setAccount, + logout, +}) + +await refreshValues() + function getAccountAvatarUrl(account: MinecraftCredential) { if ( account.profile.id === selectedAccount.value?.profile?.id && diff --git a/apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue b/apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue new file mode 100644 index 0000000..70ab9e9 --- /dev/null +++ b/apps/app-frontend/src/components/ui/TitleBarAccountSwitcher.vue @@ -0,0 +1,163 @@ + + + +