fix: 修复新手导览自动跳过、卡住与步骤不跳转
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled

This commit is contained in:
AxTps committed 2026-10-01 11:27:27 +08:00
1 parent 6912e0aeb1
commit 6b1d2e1943
3 files changed
+32 -9

No files matched your search

+20 -1
View File
@@ -313,6 +313,22 @@ const showOnboarding = ref(false)
const onboardingMode = ref('main') const onboardingMode = ref('main')
const onboardingSettings = ref(null) const onboardingSettings = ref(null)
const onboardingReplay = ref(false) const onboardingReplay = ref(false)
// Expand the sidebar while the onboarding tour is visible so steps that point
// at sidebar entries (account card, announcement, create instance) can find
// their targets. The previous state is restored when the tour ends.
let sidebarStateBeforeOnboarding: boolean | undefined
watch(showOnboarding, (visible) => {
if (visible) {
sidebarStateBeforeOnboarding = sidebarToggled.value
sidebarToggled.value = true
setSidebarExpanded(true)
} else if (sidebarStateBeforeOnboarding !== undefined) {
sidebarToggled.value = sidebarStateBeforeOnboarding
setSidebarExpanded(sidebarStateBeforeOnboarding)
sidebarStateBeforeOnboarding = undefined
}
})
const nativeDecorations = ref(false) const nativeDecorations = ref(false)
const os = ref('') const os = ref('')
@@ -2509,7 +2525,10 @@ provideAppUpdateDownloadProgress(appUpdateDownload)
> >
<div id="sidebar-teleport-target" class="sidebar-teleport-content contents"></div> <div id="sidebar-teleport-target" class="sidebar-teleport-content contents"></div>
<div class="sidebar-default-content hidden" :class="{ 'sidebar-enabled': sidebarVisible }"> <div class="sidebar-default-content hidden" :class="{ 'sidebar-enabled': sidebarVisible }">
<div class="p-4 border-0 border-b-[1px] border-[--brand-gradient-border] border-solid"> <div
data-onboarding-id="sidebar-accounts"
class="p-4 border-0 border-b-[1px] border-[--brand-gradient-border] border-solid"
>
<h3 class="text-base text-primary font-medium m-0"> <h3 class="text-base text-primary font-medium m-0">
{{ formatMessage(messages.userInformation) }} {{ formatMessage(messages.userInformation) }}
</h3> </h3>
@@ -381,7 +381,7 @@ export const onboardingTours: Record<OnboardingMode, OnboardingStep[]> = {
), ),
inspect( inspect(
'account-login', 'account-login',
'account-entry', 'sidebar-accounts',
onboardingMessages.accountLoginTitle, onboardingMessages.accountLoginTitle,
onboardingMessages.accountLoginDescription, onboardingMessages.accountLoginDescription,
), ),
@@ -391,11 +391,15 @@ export const onboardingTours: Record<OnboardingMode, OnboardingStep[]> = {
onboardingMessages.announcementTitle, onboardingMessages.announcementTitle,
onboardingMessages.announcementDescription, onboardingMessages.announcementDescription,
), ),
inspect( step(
'create-starlight', 'create-starlight',
'create-instance', 'navigate',
onboardingMessages.createStarlightTitle, copy(
onboardingMessages.createStarlightDescription, onboardingMessages.createStarlightTitle,
onboardingMessages.createStarlightDescription,
onboardingMessages.clickCreate,
),
control('create-instance', '/create'),
), ),
step( step(
'discover-navigation', 'discover-navigation',
@@ -405,7 +409,7 @@ export const onboardingTours: Record<OnboardingMode, OnboardingStep[]> = {
onboardingMessages.discoverDescription, onboardingMessages.discoverDescription,
onboardingMessages.clickDiscover, onboardingMessages.clickDiscover,
), ),
control('nav-discover', '/browse/modpack'), control('nav-discover', '/browse'),
), ),
inspect( inspect(
'discover-content', 'discover-content',
@@ -284,7 +284,7 @@ export function useOnboardingTour(
if (clickedElement && handleBranchClick(clickedElement)) return if (clickedElement && handleBranchClick(clickedElement)) return
if (!targetElement.value?.contains(event.target as Node)) return if (!targetElement.value?.contains(event.target as Node)) return
if (step.value.expectedPath && route.path !== step.value.expectedPath) { if (step.value.expectedPath && !route.path.startsWith(step.value.expectedPath)) {
waitingForRoute.value = true waitingForRoute.value = true
return return
} }
@@ -301,7 +301,7 @@ export function useOnboardingTour(
() => route.path, () => route.path,
(path) => { (path) => {
if (!waitingForRoute.value || !step.value.expectedPath) return if (!waitingForRoute.value || !step.value.expectedPath) return
if (path !== step.value.expectedPath) return if (!path.startsWith(step.value.expectedPath)) return
waitingForRoute.value = false waitingForRoute.value = false
void advance() void advance()
}, },