From c039ac97070e664656dcd55f33a26039cbf7591e Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Wed, 23 Sep 2026 02:04:10 +0000 Subject: [PATCH] fix(agent): signal the onboarding overlay only while a coach card is on screen (#18439) ## Summary The Agent coach told the What's New popup to stay away from the moment it mounted, even when its own card was not on screen yet. If a coach step's target never mounts, that held the popup back for the whole session with nothing visible to dismiss. The signal now follows the card itself. Follow-up to #18287. ## Changes - `OnboardingCoach.vue` registers its overlay source as `active && target !== null`, the same condition the template renders on, through one `visible` computed used by both. - `OnboardingCoach.test.ts` pins that the overlay stays clear while the target is absent and turns on once a late target mounts. ## Review Focus The popup hides a tick later than before: after the target resolves rather than at mount. `WhatsNewPopup.vue` gates on a reactive `v-if` and showing it writes no seen flag, so nothing is burned in that window. ## QA - [x] Unit: 71 passing across `OnboardingCoach`, `releaseStore` and `onboardingOverlayStore` - [x] Revert-red: the tightened target-absent test fails on the previous source and passes on this one - [x] Manual: open the Agent panel with the chat history view showing (no `#agent-composer` on screen), confirm the What's New popup is not withheld --- .../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(