Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/workbench/extensions/agent/AgentPanelRoot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,31 @@ describe('AgentPanelRoot onboarding', () => {
localStorage.removeItem(SCOPED_KEY)
})

it('shows the scoped coach after first consent despite a legacy seen flag', async () => {
localStorage.setItem('Comfy.AgentPanel.onboarded', 'true')
const consentStore = useAgentConsentStore()
Object.assign(consentStore, { accepted: false })

render(AgentPanelRoot, { global: { plugins: [i18n] } })
expect(localStorage.getItem(SCOPED_KEY)).toBeNull()

Object.assign(consentStore, { accepted: true })

expect(
await screen.findByRole('dialog', { name: 'Meet your Comfy Agent' })
).toBeInTheDocument()
expect(localStorage.getItem(SCOPED_KEY)).not.toBe('true')
})

it('still carries the legacy seen flag for an already-consented scope', () => {
localStorage.setItem('Comfy.AgentPanel.onboarded', 'true')

render(AgentPanelRoot, { global: { plugins: [i18n] } })

expect(localStorage.getItem(SCOPED_KEY)).toBe('true')
expect(localStorage.getItem('Comfy.AgentPanel.onboarded')).toBeNull()
})

it('defers the tour in App Mode without completing it or blocking the composer', async () => {
canvasStore.linearMode = true
render(AgentPanelRoot, { global: { plugins: [i18n] } })
Expand Down
5 changes: 4 additions & 1 deletion src/workbench/extensions/agent/AgentPanelRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ const onboardingKey = computed(() =>
watch(
onboardingKey,
(key) => {
if (key) adoptSharedOnboardingFlag(key)
// Only carry the pre-consent, device-wide flag into a scope that had
// already accepted consent when it loaded. A newly consenting scope has
// not seen this scoped tour yet and should receive it once.
if (key && consentAccepted.value) adoptSharedOnboardingFlag(key)
},
{ immediate: true }
)
Expand Down
Loading