diff --git a/src/workbench/extensions/agent/components/agent/OnboardingCoach.test.ts b/src/workbench/extensions/agent/components/agent/OnboardingCoach.test.ts index b67105aab28..76319f0da22 100644 --- a/src/workbench/extensions/agent/components/agent/OnboardingCoach.test.ts +++ b/src/workbench/extensions/agent/components/agent/OnboardingCoach.test.ts @@ -216,7 +216,8 @@ describe('OnboardingCoach', () => { }) }) - it('does not mark the tour complete when its target is absent', async () => { + it('neither completes the tour nor signals the overlay while its target is absent', async () => { + const overlay = useOnboardingOverlayStore() render(OnboardingCoach, { props: { steps: STEPS, storageKey: KEY }, global: { plugins: [i18n] } @@ -225,6 +226,7 @@ describe('OnboardingCoach', () => { await nextTick() expect(screen.queryByRole('dialog')).toBeNull() expect(localStorage.getItem(KEY)).toBe('false') + expect(overlay.active).toBe(false) }) it('signals the onboarding overlay while running and clears it when dismissed', async () => { @@ -270,5 +272,6 @@ describe('OnboardingCoach', () => { name: lateSteps[0].title }) await waitFor(() => expect(dialog).toBeVisible()) + expect(useOnboardingOverlayStore().active).toBe(true) }) }) diff --git a/src/workbench/extensions/agent/components/agent/OnboardingCoach.vue b/src/workbench/extensions/agent/components/agent/OnboardingCoach.vue index c35657ce734..d7ad4d2902b 100644 --- a/src/workbench/extensions/agent/components/agent/OnboardingCoach.vue +++ b/src/workbench/extensions/agent/components/agent/OnboardingCoach.vue @@ -27,12 +27,13 @@ const { active, index, step, isLast, next, finish } = useOnboarding( storageKey ) -// Let surfaces like the What's New popup defer while these coach marks run. -// The store drops the source with this component's scope on unmount. -useOnboardingOverlayStore().registerSource(() => active.value) const titleId = useId() const bodyId = useId() const target = ref(null) +const visible = computed(() => active.value && target.value !== null) +// Let surfaces like the What's New popup defer while a coach card is on +// screen. The store drops the source with this component's scope on unmount. +useOnboardingOverlayStore().registerSource(() => visible.value) const toolbar = ref(null) const card = ref(null) const bounds = useElementBounding(target) @@ -149,11 +150,7 @@ useEventListener(