From 007a06cb72ab0562e155a8a2de2dc8f99e044117 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 22 Sep 2026 20:04:43 +0530 Subject: [PATCH] fix(agent): signal the onboarding overlay only while a coach card is on screen The coach registered its overlay source as active, which is true from mount, while the card itself renders only once its target has mounted. A target that never mounts left the What's New popup withheld for the whole session with nothing on screen to dismiss. The source now follows the same condition the template renders on. --- .../agent/components/agent/OnboardingCoach.test.ts | 5 ++++- .../agent/components/agent/OnboardingCoach.vue | 13 +++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) 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(