From 96a1f3d1287de38f63e2c9b440805f33173333ad Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sun, 4 Oct 2026 17:26:29 -0700 Subject: [PATCH 1/3] fix(onboarding): keep the first-run nudge clear of the docked Agent panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Explore templates" nudge is `fixed bottom-0 right-0`, so it does not see the layout width a docked Agent panel takes. On signup it landed fully on top of the panel, hiding the starter prompts and the composer (PM-1872). Anchor it to `--workspace-inset-right` instead — the variable the docked panel already publishes and body-portaled overlays already read. With no docked surface the inset is 0 and the position is unchanged. Unlike a dialog, the nudge is 320px wide and always fits beside the panel, so it steps aside rather than covering it. That is the opposite policy to #20002, deliberately: that PR could not keep a large dialog both at full size and clear of the panel, and this one has no such conflict. Fixes PM-1872 Co-Authored-By: Claude Opus 5 (1M context) --- .../firstRunNudgeAgentPanel.spec.ts | 123 ++++++++++++++++++ .../firstRunTour/nudge/FirstRunTourNudge.vue | 9 +- 2 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 browser_tests/tests/onboarding/firstRunNudgeAgentPanel.spec.ts diff --git a/browser_tests/tests/onboarding/firstRunNudgeAgentPanel.spec.ts b/browser_tests/tests/onboarding/firstRunNudgeAgentPanel.spec.ts new file mode 100644 index 00000000000..e7e7b130583 --- /dev/null +++ b/browser_tests/tests/onboarding/firstRunNudgeAgentPanel.spec.ts @@ -0,0 +1,123 @@ +import { expect } from '@playwright/test' +import type { Locator, Page } from '@playwright/test' + +import enMessages from '@/locales/en/main.json' with { type: 'json' } + +import { + agentTest as test, + bootAgentApp +} from '@e2e/fixtures/agentPanelFixture' +import { AgentPanel } from '@e2e/fixtures/components/AgentPanel' + +const GETTING_STARTED_TITLE = enMessages.gettingStarted.title +const CARD_TESTID_PREFIX = 'getting-started-card-' + +/** + * The viewport PM-1872 was reported at: the attached staging-cloud screenshot + * is a 2904x1828 2x capture, less the browser chrome above the app. + */ +const SIGNUP_VIEWPORT = { width: 1452, height: 828 } + +interface Box { + x: number + y: number + width: number + height: number +} + +function overlap(a: Box, b: Box): { x: number; y: number } { + return { + x: Math.min(a.x + a.width, b.x + b.width) - Math.max(a.x, b.x), + y: Math.min(a.y + a.height, b.y + b.height) - Math.max(a.y, b.y) + } +} + +async function boxOf(element: Locator): Promise { + const box = await element.boundingBox() + if (!box) throw new Error('element is not laid out') + return box +} + +/** + * Arms the nudge the way the reporter did: a first-run user picks a template, + * is offered the tour, and leaves it. Every ending arms the nudge, and an + * ending that is not a completed walk is the "Hundreds more where that came + * from" copy the screenshot shows. + */ +async function skipTheFirstRunTour(page: Page): Promise { + const gettingStarted = page.getByRole('dialog', { + name: GETTING_STARTED_TITLE + }) + await expect(gettingStarted).toBeVisible() + + const cards = page.locator(`[data-testid^="${CARD_TESTID_PREFIX}"]`) + await expect(cards.first()).toBeVisible() + await cards.first().click() + await expect(gettingStarted).toBeHidden() + + const card = page.getByRole('dialog').filter({ hasText: /Step \d+ of \d+/ }) + await expect(card).toBeVisible() + await card.getByRole('button', { name: 'Skip', exact: true }).click() + await expect(card).toBeHidden() +} + +test.describe( + 'First-run nudge beside the Agent panel', + { tag: ['@cloud', '@agent', '@ui'] }, + () => { + test.use({ viewport: SIGNUP_VIEWPORT }) + + test( + 'does not cover the open Agent panel on signup', + { + annotation: { + type: 'regression', + description: + 'https://linear.app/comfyorg/issue/PM-1872/test-signup-templates-pop-up-covers-part-of-the-agent-panel' + } + }, + async ({ page }) => { + test.slow() + await bootAgentApp(page, true, { + objectInfo: 'server', + settings: { 'Comfy.TutorialCompleted': false }, + features: { + onboarding_tour_enabled: true, + subscription_required: true + } + }) + + const agentPanel = new AgentPanel(page) + await agentPanel.open() + await skipTheFirstRunTour(page) + + const nudge = page.getByTestId('first-run-nudge') + await expect(nudge).toBeVisible({ timeout: 15_000 }) + // The entrance animation translates the box it is measured against. + await expect + .poll(() => nudge.evaluate((node) => node.getAnimations().length)) + .toBe(0) + + const [nudgeBox, panelBox] = await Promise.all([ + boxOf(nudge), + boxOf(agentPanel.dockedPanel) + ]) + + expect( + panelBox.width, + 'the panel has to be docked and taking layout width, or this is not the reported case' + ).toBeGreaterThan(0) + + const covered = overlap(nudgeBox, panelBox) + expect( + Math.min(covered.x, covered.y), + `the nudge covered the Agent panel by ${covered.x}x${covered.y}px, hiding its starter prompts and composer (PM-1872)` + ).toBeLessThanOrEqual(0) + expect( + nudgeBox.x, + 'stepping aside must not push the nudge off the left edge' + ).toBeGreaterThanOrEqual(0) + } + ) + } +) diff --git a/src/renderer/extensions/firstRunTour/nudge/FirstRunTourNudge.vue b/src/renderer/extensions/firstRunTour/nudge/FirstRunTourNudge.vue index e4cfd927a47..9bc511d4102 100644 --- a/src/renderer/extensions/firstRunTour/nudge/FirstRunTourNudge.vue +++ b/src/renderer/extensions/firstRunTour/nudge/FirstRunTourNudge.vue @@ -1,10 +1,17 @@