From e791a0d48091662206904610de69c0f40ff48f03 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Thu, 9 Apr 2026 23:52:04 +0100 Subject: [PATCH] fix(onboarding): fix widget links, isComplete logic, and event slugs Use dynamic href for external links, check completedAt for graduation, link events by slug instead of _id, and remove stale click handler. --- app/components/OnboardingWidget.vue | 3 +-- app/composables/useOnboarding.js | 11 ++++++----- tests/client/composables/useOnboarding.test.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/components/OnboardingWidget.vue b/app/components/OnboardingWidget.vue index 5d6c710..4d73b61 100644 --- a/app/components/OnboardingWidget.vue +++ b/app/components/OnboardingWidget.vue @@ -19,7 +19,7 @@ {{ currentSuggestion.actionText }} → diff --git a/app/composables/useOnboarding.js b/app/composables/useOnboarding.js index 6dfcbf7..78a6353 100644 --- a/app/composables/useOnboarding.js +++ b/app/composables/useOnboarding.js @@ -22,10 +22,11 @@ export function useOnboarding(options = {}) { const _fetched = useState('onboarding._fetched', () => false) const isComplete = computed(() => - goals.value.hasProfileTags && + !!completedAt.value || + (goals.value.hasProfileTags && goals.value.hasVisitedEvent && goals.value.hasEngagedEcology && - goals.value.hasClickedWiki + goals.value.hasClickedWiki) ) const pickCategory = options.pickCategory || ((categories) => { @@ -63,7 +64,7 @@ export function useOnboarding(options = {}) { return { key: 'wiki', text: 'Browse the wiki for resources and guides', - action: null, + action: 'https://wiki.ghostguild.org', actionText: 'Browse wiki', isExternal: true, } @@ -101,7 +102,7 @@ export function useOnboarding(options = {}) { return { key: 'event', text: `Upcoming event: ${item.title}`, - action: `/events/${item._id}`, + action: `/events/${item.slug}`, actionText: 'View event', } } @@ -139,7 +140,7 @@ export function useOnboarding(options = {}) { _fetched.value = true // If graduated, fetch recommendations - if (isComplete.value) { + if (completedAt.value) { await fetchRecommendations() } } catch { diff --git a/tests/client/composables/useOnboarding.test.js b/tests/client/composables/useOnboarding.test.js index 322b2c1..b80610a 100644 --- a/tests/client/composables/useOnboarding.test.js +++ b/tests/client/composables/useOnboarding.test.js @@ -233,7 +233,7 @@ describe('useOnboarding', () => { }) expect(currentSuggestion.value.key).toBe('wiki') - expect(currentSuggestion.value.action).toBeNull() + expect(currentSuggestion.value.action).toBe('https://wiki.ghostguild.org') expect(currentSuggestion.value.isExternal).toBe(true) })