Repository navigation
fix(onboarding): keep the first-run nudge clear of the docked Agent panel #20146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
96a1f3d
fix(onboarding): keep the first-run nudge clear of the docked Agent p…
christian-byrne 2fff661
fix(onboarding): clamp the nudge inset so it cannot leave the viewport
christian-byrne 1bd01ff
Merge origin/main into fix/pm-1872-nudge-clears-agent-panel
DrJKL 915a029
test: simplify the first-run nudge Agent panel spec
DrJKL df5f9f9
Merge remote-tracking branch 'origin/main' into takeover/pr20146
DrJKL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
browser_tests/tests/onboarding/firstRunNudgeAgentPanel.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| 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' | ||
| import { OnboardingCoachmarks } from '@e2e/fixtures/components/Tour' | ||
|
|
||
| const GETTING_STARTED_TITLE = enMessages.gettingStarted.title | ||
|
|
||
| const SIGNUP_VIEWPORT = { width: 1452, height: 828 } | ||
|
|
||
| async function settledBox(element: Locator) { | ||
| await expect | ||
| .poll(() => element.evaluate((node) => node.getAnimations().length)) | ||
| .toBe(0) | ||
| const box = await element.boundingBox() | ||
| if (!box) throw new Error('element is not laid out') | ||
| return box | ||
| } | ||
|
|
||
| async function skipTheFirstRunTour(page: Page): Promise<void> { | ||
| const gettingStarted = page.getByRole('dialog', { | ||
| name: GETTING_STARTED_TITLE | ||
| }) | ||
| await expect(gettingStarted).toBeVisible() | ||
|
|
||
| const cards = page.locator( | ||
| '[data-testid^="getting-started-card-"]:not([data-testid*="-skeleton-"])' | ||
| ) | ||
| await expect(cards.first()).toBeVisible() | ||
| await cards.first().click() | ||
| await expect(gettingStarted).toBeHidden() | ||
|
|
||
| const { card } = new OnboardingCoachmarks(page) | ||
| 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( | ||
| 'stays clear of the open Agent panel', | ||
| { | ||
| annotation: { | ||
| type: 'regression', | ||
| description: | ||
| 'https://linear.app/comfyorg/issue/PM-1872/test-signup-templates-pop-up-covers-part-of-the-agent-panel' | ||
| } | ||
| }, | ||
| async ({ page }) => { | ||
| await bootAgentApp(page, true, { | ||
| objectInfo: 'server', | ||
| settings: { 'Comfy.TutorialCompleted': false }, | ||
| features: { | ||
| onboarding_tour_enabled: true, | ||
| subscription_required: true | ||
| } | ||
| }) | ||
|
|
||
| await skipTheFirstRunTour(page) | ||
|
christian-byrne marked this conversation as resolved.
Resolved
|
||
|
|
||
| const agentPanel = new AgentPanel(page) | ||
| await agentPanel.open() | ||
|
christian-byrne marked this conversation as resolved.
Resolved
|
||
| await expect( | ||
| page.getByTestId('agent-panel-resize-handle'), | ||
| 'the reported case requires a docked, non-overlay Agent panel' | ||
| ).toBeVisible() | ||
|
|
||
| const nudge = page.getByTestId('first-run-nudge') | ||
| await expect(nudge).toBeVisible() | ||
|
|
||
| const nudgeBox = await settledBox(nudge) | ||
| const panelBox = await settledBox(agentPanel.dockedPanel) | ||
|
|
||
| expect( | ||
| nudgeBox.x + nudgeBox.width, | ||
| 'the nudge must sit left of the docked Agent panel, not over its starter prompts and composer (PM-1872)' | ||
| ).toBeLessThanOrEqual(panelBox.x) | ||
| } | ||
| ) | ||
| } | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.