fix: route the onboarding checklist at the account chooser

This commit is contained in:
Felitendo committed 2026-09-14 14:48:32 +02:00
1 parent 9f8f11f424
commit 0a71af9b94
6 files changed
+50 -16

No files matched your search

+3 -2
View File
@@ -31,8 +31,9 @@ The player UUID is derived exactly the way Minecraft itself derives it — an MD
launcher. Offline accounts can play singleplayer and join servers running in offline mode. Servers launcher. Offline accounts can play singleplayer and join servers running in offline mode. Servers
in online mode reject them, as they do in every other launcher. in online mode reject them, as they do in every other launcher.
Both sit next to "Sign in to Microsoft" in the account card, and in the "Minecraft required" modal Both sit next to "Sign in to Microsoft" everywhere an account can be added: the account card, the
you get when pressing Play with no account. modal you get when pressing Play with no account, and "Sign in to Minecraft" in the getting started
checklist. Upstream offered Microsoft and nothing else at all three.
### Microsoft sign-in ### Microsoft sign-in
+42 -11
View File
@@ -22,24 +22,31 @@ data when they are opened elsewhere.
Usernames are validated the way Mojang validates them: 3 to 16 Usernames are validated the way Mojang validates them: 3 to 16
characters of letters, numbers and underscores. characters of letters, numbers and underscores.
Two places had to be opened up for any of this to be reachable. The Three places had to be opened up for any of this to be reachable, all of
account card was hidden until a Microsoft account had been added, which which offered Microsoft and nothing else:
left offline sign-in unreachable for exactly the people who want it, and
the "Minecraft required" modal - what you actually hit on pressing Play * The account card was hidden until a Microsoft account had been added,
with no account - offered Microsoft and nothing else. which left offline sign-in unreachable for exactly the people who want
it.
* The "Minecraft required" modal - what you hit on pressing Play with no
account - now lists the alternatives too. It is no longer only about
something being required, so it is titled "Sign in to Minecraft".
* "Sign in to Minecraft" in the getting started checklist went straight
to Microsoft. It opens that same modal now, so every way in offers the
same choice.
--- ---
Cargo.lock | 1 + Cargo.lock | 1 +
Cargo.toml | 1 + Cargo.toml | 1 +
apps/app-frontend/src/App.vue | 10 +- apps/app-frontend/src/App.vue | 12 +-
.../src/components/ui/AccountsCard.vue | 30 ++++ .../src/components/ui/AccountsCard.vue | 30 ++++
.../src/components/ui/OfflineAccountModal.vue | 136 ++++++++++++++++++ .../src/components/ui/OfflineAccountModal.vue | 136 ++++++++++++++++++
.../MinecraftRequiredModal.vue | 26 +++- .../MinecraftRequiredModal.vue | 30 +++-
apps/app-frontend/src/helpers/auth.js | 13 ++ apps/app-frontend/src/helpers/auth.js | 13 ++
apps/app/src/api/auth.rs | 7 + apps/app/src/api/auth.rs | 7 +
packages/app-lib/Cargo.toml | 1 + packages/app-lib/Cargo.toml | 1 +
packages/app-lib/src/api/minecraft_auth.rs | 39 +++++ packages/app-lib/src/api/minecraft_auth.rs | 39 +++++
packages/app-lib/src/state/minecraft_auth.rs | 68 +++++++++ packages/app-lib/src/state/minecraft_auth.rs | 68 +++++++++
11 files changed, 327 insertions(+), 5 deletions(-) 11 files changed, 330 insertions(+), 8 deletions(-)
create mode 100644 apps/app-frontend/src/components/ui/OfflineAccountModal.vue create mode 100644 apps/app-frontend/src/components/ui/OfflineAccountModal.vue
diff --git a/Cargo.lock b/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock
@@ -67,10 +74,16 @@ index a4a779c..a85f576 100644
modrinth-log = { path = "packages/modrinth-log" } modrinth-log = { path = "packages/modrinth-log" }
modrinth-util = { path = "packages/modrinth-util" } modrinth-util = { path = "packages/modrinth-util" }
diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue
index 6e7b27d..532f104 100644 index 6e7b27d..e5c6fd4 100644
--- a/apps/app-frontend/src/App.vue --- a/apps/app-frontend/src/App.vue
+++ b/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue
@@ -2472,10 +2472,12 @@ provideAppUpdateDownloadProgress(appUpdateDownload) @@ -2467,15 +2467,17 @@ provideAppUpdateDownloadProgress(appUpdateDownload)
>
<OnboardingChecklist
@create-instance="installationModal?.show()"
- @login-minecraft="accounts?.login()"
+ @login-minecraft="minecraftRequiredModal?.show()"
@login-modrinth="signIn"
/> />
<div id="sidebar-teleport-target" class="sidebar-teleport-content"></div> <div id="sidebar-teleport-target" class="sidebar-teleport-content"></div>
<div class="sidebar-default-content" :class="{ 'sidebar-enabled': sidebarVisible }"> <div class="sidebar-default-content" :class="{ 'sidebar-enabled': sidebarVisible }">
@@ -325,7 +338,7 @@ index 0000000..8300e28
+}) +})
+</script> +</script>
diff --git a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue diff --git a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
index 73293f5..bbdc517 100644 index 73293f5..8e6b275 100644
--- a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue --- a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
+++ b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue +++ b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
@@ -43,6 +43,16 @@ @@ -43,6 +43,16 @@
@@ -354,6 +367,24 @@ index 73293f5..bbdc517 100644
import { Button, ButtonLink, defineMessages, NewModal, useVIntl } from '@modrinth/ui' import { Button, ButtonLink, defineMessages, NewModal, useVIntl } from '@modrinth/ui'
import { inject, type Ref, ref } from 'vue' import { inject, type Ref, ref } from 'vue'
@@ -73,7 +83,7 @@ const accountsCard = inject('accountsCard') as Ref<InstanceType<typeof AccountsC
const messages = defineMessages({
header: {
id: 'minecraft-required.header',
- defaultMessage: 'Minecraft required',
+ defaultMessage: 'Sign in to Minecraft',
},
descriptionHeader: {
id: 'minecraft-required.description-header',
@@ -82,7 +92,7 @@ const messages = defineMessages({
description: {
id: 'minecraft-required.description',
defaultMessage:
- 'You need a Microsoft account that owns Minecraft before you can launch and play.',
+ 'A Microsoft account that owns Minecraft is what lets you play online and keep your skin.',
},
getSupport: {
id: 'minecraft-required.get-support',
@@ -100,6 +110,15 @@ const messages = defineMessages({ @@ -100,6 +110,15 @@ const messages = defineMessages({
id: 'minecraft-required.get-minecraft', id: 'minecraft-required.get-minecraft',
defaultMessage: 'Get Minecraft', defaultMessage: 'Get Minecraft',
@@ -32,7 +32,7 @@ bar button - so nothing there promises anything.
4 files changed, 92 insertions(+), 9 deletions(-) 4 files changed, 92 insertions(+), 9 deletions(-)
diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue
index 532f104..54e3912 100644 index e5c6fd4..a9e3945 100644
--- a/apps/app-frontend/src/App.vue --- a/apps/app-frontend/src/App.vue
+++ b/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue
@@ -10,6 +10,7 @@ import { @@ -10,6 +10,7 @@ import {
+1 -1
View File
@@ -311,7 +311,7 @@ index 0000000..d909ec3
+}) +})
+</script> +</script>
diff --git a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue diff --git a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
index bbdc517..ec939d7 100644 index 8e6b275..7781cee 100644
--- a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue --- a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
+++ b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue +++ b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
@@ -47,10 +47,16 @@ @@ -47,10 +47,16 @@
@@ -303,7 +303,7 @@ index 0000000..283b89c
+}) +})
+</script> +</script>
diff --git a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue diff --git a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
index ec939d7..b1e5358 100644 index 7781cee..341ccdc 100644
--- a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue --- a/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
+++ b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue +++ b/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue
@@ -25,10 +25,8 @@ @@ -25,10 +25,8 @@
+2
View File
@@ -49,6 +49,8 @@ check "the frontend can reach it" \
contains "$WORKTREE/apps/app-frontend/src/helpers/auth.js" "plugin:auth|login_offline" contains "$WORKTREE/apps/app-frontend/src/helpers/auth.js" "plugin:auth|login_offline"
check "it is reachable with no account yet" \ check "it is reachable with no account yet" \
contains "$WORKTREE/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue" 'showOfflineAccountModal' contains "$WORKTREE/apps/app-frontend/src/components/ui/minecraft-required-modal/MinecraftRequiredModal.vue" 'showOfflineAccountModal'
check "the checklist offers the same choice" \
contains "$WORKTREE/apps/app-frontend/src/App.vue" '@login-minecraft="minecraftRequiredModal?.show()"'
log "Microsoft sign-in" log "Microsoft sign-in"
check "the browser flow is registered" \ check "the browser flow is registered" \