From 989773995a184c6efa7d87f8e11614781da9fa83 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Tue, 23 Jun 2026 09:33:29 -0700 Subject: [PATCH 01/59] feat: add product coachmark onboarding tours - add blank canvas (demo) and app mode (wip) tours - overlay with target highlight, landing card, step state handling, step card - v-coachmark directive updating registry for mount/unmount - frame settling watcher for animated targets (dialogs) - focus trap for the target plus the coachmark element - add telemetry for each step --- browser_tests/fixtures/ComfyPage.ts | 3 + browser_tests/fixtures/components/Tour.ts | 117 ++++++ browser_tests/fixtures/tourFixture.ts | 11 + browser_tests/tests/tour.spec.ts | 388 ++++++++++++++++++ .../LiteGraphCanvasSplitterOverlay.vue | 6 +- .../ComfyRunButton/ComfyQueueButton.vue | 2 + .../widget/WorkflowTemplateSelectorDialog.vue | 2 + src/components/dialog/vRekaZIndex.ts | 6 +- .../sidebar/SidebarTemplatesButton.vue | 2 + src/locales/en/main.json | 50 +++ src/platform/onboarding/CoachmarkCard.vue | 48 +++ src/platform/onboarding/CoachmarkLanding.vue | 84 ++++ src/platform/onboarding/TourOverlay.vue | 281 +++++++++++++ .../onboarding/coachmarkController.ts | 17 + .../onboarding/coachmarkGates.test.ts | 46 +++ src/platform/onboarding/coachmarkGates.ts | 12 + .../onboarding/coachmarkRegistry.test.ts | 36 ++ src/platform/onboarding/coachmarkRegistry.ts | 28 ++ .../onboarding/onboardingTours.test.ts | 119 ++++++ src/platform/onboarding/onboardingTours.ts | 208 ++++++++++ .../onboarding/useCoachmarkTarget.test.ts | 158 +++++++ src/platform/onboarding/useCoachmarkTarget.ts | 175 ++++++++ .../onboarding/useCoachmarkTour.test.ts | 149 +++++++ src/platform/onboarding/useCoachmarkTour.ts | 376 +++++++++++++++++ src/platform/onboarding/useFocusTrap.test.ts | 104 +++++ src/platform/onboarding/useFocusTrap.ts | 87 ++++ src/platform/onboarding/vCoachmark.ts | 34 ++ .../settings/constants/coreSettings.ts | 7 + src/platform/telemetry/TelemetryRegistry.ts | 9 + .../cloud/MixpanelTelemetryProvider.ts | 12 +- .../cloud/PostHogTelemetryProvider.ts | 13 +- src/platform/telemetry/types.ts | 37 ++ .../extensions/linearMode/LinearControls.vue | 4 + .../extensions/linearMode/LinearWelcome.vue | 23 +- src/schemas/apiSchema.ts | 1 + src/views/GraphView.vue | 4 + src/views/LinearView.vue | 2 + 37 files changed, 2652 insertions(+), 9 deletions(-) create mode 100644 browser_tests/fixtures/components/Tour.ts create mode 100644 browser_tests/fixtures/tourFixture.ts create mode 100644 browser_tests/tests/tour.spec.ts create mode 100644 src/platform/onboarding/CoachmarkCard.vue create mode 100644 src/platform/onboarding/CoachmarkLanding.vue create mode 100644 src/platform/onboarding/TourOverlay.vue create mode 100644 src/platform/onboarding/coachmarkController.ts create mode 100644 src/platform/onboarding/coachmarkGates.test.ts create mode 100644 src/platform/onboarding/coachmarkGates.ts create mode 100644 src/platform/onboarding/coachmarkRegistry.test.ts create mode 100644 src/platform/onboarding/coachmarkRegistry.ts create mode 100644 src/platform/onboarding/onboardingTours.test.ts create mode 100644 src/platform/onboarding/onboardingTours.ts create mode 100644 src/platform/onboarding/useCoachmarkTarget.test.ts create mode 100644 src/platform/onboarding/useCoachmarkTarget.ts create mode 100644 src/platform/onboarding/useCoachmarkTour.test.ts create mode 100644 src/platform/onboarding/useCoachmarkTour.ts create mode 100644 src/platform/onboarding/useFocusTrap.test.ts create mode 100644 src/platform/onboarding/useFocusTrap.ts create mode 100644 src/platform/onboarding/vCoachmark.ts diff --git a/browser_tests/fixtures/ComfyPage.ts b/browser_tests/fixtures/ComfyPage.ts index 84934c1999a..b0034cc93b8 100644 --- a/browser_tests/fixtures/ComfyPage.ts +++ b/browser_tests/fixtures/ComfyPage.ts @@ -535,6 +535,9 @@ export const comfyPageFixture = base.extend<{ 'Comfy.userId': userId, // Set tutorial completed to true to avoid loading the tutorial workflow. 'Comfy.TutorialCompleted': true, + // Mark every coachmark tour as seen — detection or app-mode entry would + // otherwise start one whose blocker breaks unrelated tests. + 'Comfy.OnboardingCoachmarks.Seen': ['blankCanvas', 'appMode'], 'Comfy.Queue.MaxHistoryItems': 64, 'Comfy.SnapToGrid.GridSize': testComfySnapToGridGridSize, 'Comfy.VueNodes.AutoScaleLayout': false, diff --git a/browser_tests/fixtures/components/Tour.ts b/browser_tests/fixtures/components/Tour.ts new file mode 100644 index 00000000000..b1c31301c41 --- /dev/null +++ b/browser_tests/fixtures/components/Tour.ts @@ -0,0 +1,117 @@ +import type { Locator, Page } from '@playwright/test' + +import { nextFrame } from '@e2e/fixtures/utils/timing' + +export type CoachTour = 'blankCanvas' | 'appMode' + +const SEEN_SETTING = 'Comfy.OnboardingCoachmarks.Seen' + +/** + * Coach-mark overlay (src/platform/onboarding/TourOverlay.vue). + * The card is a `role="dialog"` distinguished from app dialogs by its + * "Step x of y" label; the spotlight is decorative and located by test id. + */ +export class OnboardingCoachmarks { + public readonly card: Locator + public readonly stepLabel: Locator + public readonly title: Locator + public readonly skipButton: Locator + public readonly nextButton: Locator + public readonly doneButton: Locator + public readonly spotlight: Locator + public readonly spotlightRing: Locator + public readonly landing: Locator + public readonly landingStartButton: Locator + public readonly landingSkipButton: Locator + + constructor(public readonly page: Page) { + this.card = page.getByRole('dialog').filter({ hasText: /Step \d+ of \d+/ }) + this.stepLabel = this.card.getByText(/Step \d+ of \d+/) + this.title = this.card.getByRole('heading') + this.skipButton = this.card.getByRole('button', { name: 'Skip' }) + this.nextButton = this.card.getByRole('button', { + name: 'Next', + exact: true + }) + this.doneButton = this.card.getByRole('button', { + name: 'Done', + exact: true + }) + this.spotlight = page.getByTestId('coach-spotlight') + this.spotlightRing = page.getByTestId('coach-spotlight-ring') + this.landing = page.getByTestId('coach-landing') + this.landingStartButton = this.landing.getByRole('button', { + name: 'Start tutorial' + }) + this.landingSkipButton = this.landing.getByRole('button', { + name: 'Skip for now' + }) + } + + /** + * Re-navigate with a forced tour (`?coach=` bypasses detection, gates and + * the seen-flag). Clears the pre-seeded seen-flag afterward so completion + * assertions observe it being set. + */ + async startTour(tour: CoachTour) { + await this.page.goto(new URL(`/?coach=${tour}`, this.page.url()).toString()) + await this.page.waitForFunction(() => window.app?.extensionManager) + await this.page.locator('.p-blockui-mask').waitFor({ state: 'hidden' }) + await this.page.evaluate( + async (key) => window.app!.extensionManager.setting.set(key, []), + SEEN_SETTING + ) + await nextFrame(this.page) + } + + /** An element a tour points at, by its `data-coach-id` anchor. */ + coachAnchor(id: string): Locator { + return this.page.locator(`[data-coach-id="${id}"]`) + } + + /** + * Largest px difference between the spotlight box and `target` grown by `pad` + * on every side. ~0 means the spotlight precisely wraps the target. Poll this + * to wait out the open-animation settle. + */ + async spotlightGap(target: Locator, pad = 8): Promise { + const spot = await this.spotlight.boundingBox() + const box = await target.boundingBox() + if (!spot || !box) return Number.POSITIVE_INFINITY + return Math.max( + Math.abs(spot.x - (box.x - pad)), + Math.abs(spot.y - (box.y - pad)), + Math.abs(spot.width - (box.width + pad * 2)), + Math.abs(spot.height - (box.height + pad * 2)) + ) + } + + /** + * Whether the spotlight box encloses `target` (the target is fully spotlit). + * Unlike {@link spotlightGap} this tolerates the viewport-edge clamp that + * trims the spotlight's padding when the target hugs a screen edge, so it + * stays meaningful for edge-anchored targets like the app-mode run button. + */ + async spotlightCovers(target: Locator, tolerance = 3): Promise { + const spot = await this.spotlight.boundingBox() + const box = await target.boundingBox() + if (!spot || !box) return false + return ( + box.x >= spot.x - tolerance && + box.y >= spot.y - tolerance && + box.x + box.width <= spot.x + spot.width + tolerance && + box.y + box.height <= spot.y + spot.height + tolerance + ) + } + + async seen(tour: CoachTour): Promise { + const seen = await this.page.evaluate( + async (key) => + (await window.app!.extensionManager.setting.get(key)) as + | string[] + | undefined, + SEEN_SETTING + ) + return !!seen?.includes(tour) + } +} diff --git a/browser_tests/fixtures/tourFixture.ts b/browser_tests/fixtures/tourFixture.ts new file mode 100644 index 00000000000..7ab4cb0ba64 --- /dev/null +++ b/browser_tests/fixtures/tourFixture.ts @@ -0,0 +1,11 @@ +import { test as base } from '@playwright/test' + +import { OnboardingCoachmarks } from '@e2e/fixtures/components/Tour' + +export const onboardingFixture = base.extend<{ + onboarding: OnboardingCoachmarks +}>({ + onboarding: async ({ page }, use) => { + await use(new OnboardingCoachmarks(page)) + } +}) diff --git a/browser_tests/tests/tour.spec.ts b/browser_tests/tests/tour.spec.ts new file mode 100644 index 00000000000..93149315233 --- /dev/null +++ b/browser_tests/tests/tour.spec.ts @@ -0,0 +1,388 @@ +import { expect, mergeTests } from '@playwright/test' + +import { comfyPageFixture } from '@e2e/fixtures/ComfyPage' +import { makeTemplate } from '@e2e/fixtures/data/templateFixtures' +import { + createTemplateHelper, + withTemplates +} from '@e2e/fixtures/helpers/TemplateHelper' +import { onboardingFixture } from '@e2e/fixtures/tourFixture' + +const test = mergeTests(comfyPageFixture, onboardingFixture) + +/** + * Tours are forced via `?coach=` — it bypasses detection, the seen-flag + * and the per-step gates, which depend on backend state the fixture can't + * control (detection logic is unit-tested in onboardingTours.test.ts). + * + * Not covered: detection-driven starts (need a brand-new user and controlled + * backend assets) and the deferTarget timeout (needs the templates dialog to + * fail to mount after the click). + */ +test.describe('Onboarding coachmarks', { tag: '@ui' }, () => { + // The production templates index ships ~400 entries and the dialog + // lazy-paginates, so the real `default` card never renders into the DOM for + // the "Select a template" step. Pin the index to a single known `default` + // card; the workflow JSON itself still loads from the server. + test.beforeEach(async ({ comfyPage }) => { + await createTemplateHelper( + comfyPage.page, + withTemplates([makeTemplate({ name: 'default', title: 'Default' })]) + ).mock() + }) + + test.describe('blank-canvas tour', () => { + test.use({ initialSettings: { 'Comfy.VueNodes.Enabled': true } }) + + test('walks the forced tour end to end', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + + // No Nodes 2.0 gate step when the setting is already on. + await expect(coach.title).toHaveText('This is your canvas') + await expect(coach.stepLabel).toHaveText('Step 1 of 4') + await expect(coach.spotlight).toBeVisible() + + await coach.nextButton.click() + await expect(coach.title).toHaveText('Start from a template') + + // Click-to-advance step: the blocker hole is the target's exact bounds, + // so a click in the spotlight pad just outside must not advance. + const templatesButton = coach.coachAnchor('templates-button') + const box = await templatesButton.boundingBox() + if (!box) throw new Error('templates button has no bounding box') + await comfyPage.page.mouse.click( + box.x + box.width + 4, + box.y + box.height / 2 + ) + await comfyPage.nextFrame() + await expect(coach.title).toHaveText('Start from a template') + + await templatesButton.click() + const dialog = coach.coachAnchor('templates-dialog') + await expect(dialog).toBeVisible() + await expect(coach.title).toHaveText('Select a template') + + // Selecting a template closes the dialog and advances to the Run step. + await comfyPage.templates.loadTemplate('default') + await expect(dialog).toBeHidden() + await expect(coach.title).toHaveText('Now run it') + + // A workflow template stays in the graph, so the multi-target run step + // resolves to the graph run button. + await expect + .poll(() => coach.spotlightGap(coach.coachAnchor('run-button')), { + timeout: 3000 + }) + .toBeLessThanOrEqual(2) + + // The final step offers Done only — Skip would be redundant. + await expect(coach.skipButton).toBeHidden() + await coach.doneButton.click() + await expect(coach.card).toBeHidden() + expect(await coach.seen('blankCanvas')).toBe(true) + }) + + test('spotlight tracks the templates dialog to its final size', async ({ + comfyPage: _comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('This is your canvas') + + await coach.nextButton.click() + await expect(coach.title).toHaveText('Start from a template') + + await coach.coachAnchor('templates-button').click() + const dialog = coach.coachAnchor('templates-dialog') + await expect(dialog).toBeVisible() + await expect(coach.title).toHaveText('Select a template') + + // The spotlight is the target rect plus an 8px pad on every side; it must + // match the fully-opened dialog, not the mid-scale-in size it had while + // the open animation was still running. + await expect + .poll(() => coach.spotlightGap(dialog), { timeout: 3000 }) + .toBeLessThanOrEqual(2) + }) + + test('run step retargets the app run button when the loaded template enters app mode', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('This is your canvas') + + await coach.nextButton.click() + await expect(coach.title).toHaveText('Start from a template') + await coach.coachAnchor('templates-button').click() + await expect(coach.coachAnchor('templates-dialog')).toBeVisible() + + // Reach the run step via a workflow (graph-mode) template. + await comfyPage.templates.loadTemplate('default') + await expect(coach.title).toHaveText('Now run it') + await expect + .poll(() => comfyPage.nodeOps.getGraphNodesCount()) + .toBeGreaterThan(0) + + // An app template switches to app mode, which hides the graph run button + // and mounts the app run button; the spotlight must follow the visible one. + await comfyPage.appMode.enterAppModeWithInputs([]) + const appRun = coach.coachAnchor('app-run-button') + await expect(appRun).toBeVisible() + await expect(coach.coachAnchor('run-button')).toBeHidden() + // The app run button anchors the bottom of the viewport, so the spotlight + // clamps its padding to keep the ring on screen — assert it still encloses + // the button rather than wrapping it to the pixel. + await expect + .poll(() => coach.spotlightCovers(appRun), { timeout: 3000 }) + .toBe(true) + }) + + test('marches an outline around the target on a click step when the user stalls', async ({ + comfyPage: _comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('This is your canvas') + + await coach.nextButton.click() + await expect(coach.title).toHaveText('Start from a template') + + // The spotlight outline only marches once the user has stalled. + await expect(coach.spotlightRing).not.toHaveClass(/coach-march/) + await expect(coach.spotlightRing).toHaveClass(/coach-march/, { + timeout: 10000 + }) + + // Clicking the target advances the tour and stops the marching. + await coach.coachAnchor('templates-button').click() + await expect(coach.coachAnchor('templates-dialog')).toBeVisible() + await expect(coach.spotlightRing).not.toHaveClass(/coach-march/) + }) + + test('blocks clicks outside the spotlight on informational steps', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('This is your canvas') + + const box = await coach.coachAnchor('templates-button').boundingBox() + if (!box) throw new Error('templates button has no bounding box') + await comfyPage.page.mouse.click( + box.x + box.width / 2, + box.y + box.height / 2 + ) + await comfyPage.nextFrame() + await expect(coach.coachAnchor('templates-dialog')).toHaveCount(0) + await expect(coach.title).toHaveText('This is your canvas') + }) + + test('Escape dismisses the tour and marks it seen', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.card).toBeVisible() + + await comfyPage.page.keyboard.press('Escape') + await expect(coach.card).toBeHidden() + expect(await coach.seen('blankCanvas')).toBe(true) + }) + + test('Skip dismisses the tour and marks it seen', async ({ + comfyPage: _comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.card).toBeVisible() + + await coach.skipButton.click() + await expect(coach.card).toBeHidden() + expect(await coach.seen('blankCanvas')).toBe(true) + }) + + test('traps focus: starts on the primary action and Tab stays in the coach cycle', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('This is your canvas') + await expect(coach.nextButton).toBeFocused() + + // Skip immediately precedes the primary button in the cycle. + await comfyPage.page.keyboard.press('Shift+Tab') + await expect(coach.skipButton).toBeFocused() + + // Focus must never escape the card + spotlighted target. + for (let i = 0; i < 5; i++) { + await comfyPage.page.keyboard.press('Tab') + const inCycle = await comfyPage.page.evaluate(() => { + const active = document.activeElement + const overlay = document.querySelector( + '[data-testid="coach-spotlight"]' + )?.parentElement + const target = document.querySelector('[data-coach-id="canvas"]') + return Boolean( + active && (overlay?.contains(active) || target?.contains(active)) + ) + }) + expect(inCycle).toBe(true) + } + }) + + test('pulls stray focus back into the card', async ({ + comfyPage: _comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('This is your canvas') + + // The run button is outside both the card and the spotlighted target. + await coach + .coachAnchor('run-button') + .evaluate((el) => (el as HTMLElement).focus()) + await expect(coach.nextButton).toBeFocused() + }) + + test('canvas spotlight starts below the tab bar and stays inside the viewport', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('This is your canvas') + await comfyPage.nextFrame() + + const spotlight = await coach.spotlight.boundingBox() + const tabs = await comfyPage.page + .getByTestId('topbar-workflow-tabs') + .boundingBox() + const viewport = comfyPage.page.viewportSize() + if (!spotlight || !tabs || !viewport) + throw new Error('missing geometry for spotlight assertion') + + expect(spotlight.y).toBeGreaterThanOrEqual(tabs.y + tabs.height - 1) + expect(spotlight.x).toBeGreaterThanOrEqual(0) + expect(spotlight.x + spotlight.width).toBeLessThanOrEqual(viewport.width) + expect(spotlight.y + spotlight.height).toBeLessThanOrEqual( + viewport.height + ) + }) + }) + + test.describe('Nodes 2.0 gate', () => { + test.use({ initialSettings: { 'Comfy.VueNodes.Enabled': false } }) + + test('leads with the enable step, flips the setting and advances', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + + await expect(coach.title).toHaveText('Turn on Nodes 2.0') + await expect(coach.stepLabel).toHaveText('Step 1 of 5') + await expect(coach.spotlight).toBeHidden() + + await coach.card.getByRole('button', { name: 'Enable Nodes 2.0' }).click() + await expect(coach.title).toHaveText('This is your canvas') + expect( + await comfyPage.settings.getSetting('Comfy.VueNodes.Enabled') + ).toBe(true) + }) + + test('Skip on the gate ends the whole tour', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('blankCanvas') + const coach = onboarding + await expect(coach.title).toHaveText('Turn on Nodes 2.0') + + await coach.skipButton.click() + await expect(coach.card).toBeHidden() + expect(await coach.seen('blankCanvas')).toBe(true) + expect( + await comfyPage.settings.getSetting('Comfy.VueNodes.Enabled') + ).toBe(false) + }) + }) + + test.describe('app-mode tour', () => { + test('opens on the welcome landing, focuses Start, and Skip dismisses it', async ({ + comfyPage: _comfyPage, + onboarding + }) => { + await onboarding.startTour('appMode') + const coach = onboarding + + await expect(coach.landing).toBeVisible() + await expect(coach.landing.getByRole('heading')).toHaveText( + 'Welcome to Apps' + ) + // The focus trap lands on the primary action. + await expect(coach.landingStartButton).toBeFocused() + + await coach.landingSkipButton.click() + await expect(coach.landing).toBeHidden() + expect(await coach.seen('appMode')).toBe(true) + }) + + test('Escape dismisses the welcome landing and marks it seen', async ({ + comfyPage, + onboarding + }) => { + await onboarding.startTour('appMode') + const coach = onboarding + await expect(coach.landing).toBeVisible() + + await comfyPage.page.keyboard.press('Escape') + await expect(coach.landing).toBeHidden() + expect(await coach.seen('appMode')).toBe(true) + }) + }) + + test.describe('coach anchors', () => { + // comfyPage is requested (unused) so its fixture performs the app setup. + test('every registry id resolves to an element (drift guard)', async ({ + comfyPage, + onboarding + }) => { + // Keep in sync with COACH_IDS in src/platform/onboarding/onboardingTours.ts + // (importing it would execute app modules outside the browser). + const coach = onboarding + // Graph-mode anchors. + for (const id of ['canvas', 'run-button', 'templates-button']) { + await expect(coach.coachAnchor(id)).toBeVisible() + } + // The dialog anchor only mounts with the templates dialog open. + await coach.coachAnchor('templates-button').click() + await expect(coach.coachAnchor('templates-dialog')).toBeVisible() + + // App-mode anchors only mount once a workflow is running in app mode. + // Wait for the template to populate the graph first — entering app mode + // with an empty graph shows the welcome screen, not the controls. + await comfyPage.templates.loadTemplate('default') + await expect + .poll(() => comfyPage.nodeOps.getGraphNodesCount()) + .toBeGreaterThan(0) + await comfyPage.appMode.enterAppModeWithInputs([]) + for (const id of ['app-run-button', 'inputs-list', 'outputs']) { + await expect(coach.coachAnchor(id)).toBeVisible() + } + }) + }) +}) diff --git a/src/components/LiteGraphCanvasSplitterOverlay.vue b/src/components/LiteGraphCanvasSplitterOverlay.vue index 4e6655bf07b..233f2bc4d07 100644 --- a/src/components/LiteGraphCanvasSplitterOverlay.vue +++ b/src/components/LiteGraphCanvasSplitterOverlay.vue @@ -77,7 +77,10 @@ state-storage="local" @resizestart="onResizestart" > - + @@ -420,6 +421,7 @@ import CompareSliderThumbnail from '@/components/templates/thumbnails/CompareSli import DefaultThumbnail from '@/components/templates/thumbnails/DefaultThumbnail.vue' import HoverDissolveThumbnail from '@/components/templates/thumbnails/HoverDissolveThumbnail.vue' import LogoOverlay from '@/components/templates/thumbnails/LogoOverlay.vue' +import { vCoachmark } from '@/platform/onboarding/vCoachmark' import Button from '@/components/ui/button/Button.vue' import BaseModalLayout from '@/components/widget/layout/BaseModalLayout.vue' import LeftSidePanel from '@/components/widget/panel/LeftSidePanel.vue' diff --git a/src/components/dialog/vRekaZIndex.ts b/src/components/dialog/vRekaZIndex.ts index 3e4540119e7..d6c5d290fd2 100644 --- a/src/components/dialog/vRekaZIndex.ts +++ b/src/components/dialog/vRekaZIndex.ts @@ -1,6 +1,10 @@ import { ZIndex } from '@primeuix/utils/zindex' import type { Directive } from 'vue' +/** Shared PrimeVue/Reka modal stacking sequence; later registrations cover earlier ones. */ +export const MODAL_Z_KEY = 'modal' +export const MODAL_Z_BASE = 1700 + // Both Reka and PrimeVue dialogs can appear at any depth in dialogStack, in // any order. PrimeVue auto-increments a per-key z-index counter so later // dialogs always cover earlier ones; Reka uses a static z-1700 class which @@ -9,7 +13,7 @@ import type { Directive } from 'vue' // renderers share one stacking sequence: whichever dialog opens last wins. export const vRekaZIndex: Directive = { mounted(el) { - ZIndex.set('modal', el, 1700) + ZIndex.set(MODAL_Z_KEY, el, MODAL_Z_BASE) }, beforeUnmount(el) { ZIndex.clear(el) diff --git a/src/components/sidebar/SidebarTemplatesButton.vue b/src/components/sidebar/SidebarTemplatesButton.vue index 232e8c1b601..a71e4237b98 100644 --- a/src/components/sidebar/SidebarTemplatesButton.vue +++ b/src/components/sidebar/SidebarTemplatesButton.vue @@ -1,5 +1,6 @@