diff --git a/e2e/chooser.test.ts b/e2e/chooser.test.ts index 468f9567b..f018c825e 100644 --- a/e2e/chooser.test.ts +++ b/e2e/chooser.test.ts @@ -4,7 +4,9 @@ import { clickNewInstallTile, openTitleMenu, expectChooserVisible, - expectTakeoverOpen + expectTakeoverOpen, + pickFromTitleMenu, + showBuildsPage } from './support/chooserHelpers' import { findWebContentsId, @@ -74,12 +76,7 @@ test('Builds dropdown opens both import flows and restores focus on Escape @wind }) test('activate hook focuses the existing chooser host instead of spawning a duplicate @windows @macos @linux', async () => { - const before = await evalWithRetry(() => - ctx.app.evaluate( - ({ BrowserWindow }) => BrowserWindow.getAllWindows().filter((w) => !w.isDestroyed()).length - ) - ) - expect(before).toBe(1) + expect(await openWindowCount()).toBe(1) await evalWithRetry(() => ctx.app.evaluate(({ app }) => { @@ -88,12 +85,7 @@ test('activate hook focuses the existing chooser host instead of spawning a dupl ) await new Promise((r) => setTimeout(r, 200)) - const after = await evalWithRetry(() => - ctx.app.evaluate( - ({ BrowserWindow }) => BrowserWindow.getAllWindows().filter((w) => !w.isDestroyed()).length - ) - ) - expect(after).toBe(1) + expect(await openWindowCount()).toBe(1) }) test('title popup + system modal webContents are pre-warmed on the chooser host @windows @macos @linux', async () => { @@ -112,7 +104,13 @@ test('title popup opens, renders menu items, and closes via bridge @windows @mac .toBe(true) const popupItems = await readPopupMenuItems(ctx.app, 'comfyTitlePopup.html') - expect(popupItems).toEqual(['Open Dashboard', 'Desktop Settings', 'Close Window', 'Quit Desktop']) + expect(popupItems).toEqual([ + 'Performance Tests', + 'Benchmarks', + 'Desktop Settings', + 'Close Window', + 'Quit Desktop' + ]) await evalWithRetry(() => ctx.app.evaluate(({ webContents }) => { @@ -131,6 +129,20 @@ test('title popup opens, renders menu items, and closes via bridge @windows @mac .toBe(false) }) +test('the ☰ menu opens Performance Tests and Benchmarks in the dashboard window itself @windows @macos @linux', async () => { + for (const [label, page] of [ + ['Performance Tests', '[data-testid="performance-test"]'], + ['Benchmarks', '[data-testid="benchmarks"]'] + ] as const) { + await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) + await pickFromTitleMenu(ctx.app, ctx.titleBar, label) + await ctx.panel.waitForVisible(page) + expect(await openWindowCount(), `${label} opened without a second window`).toBe(1) + } + + await showBuildsPage(ctx.panel) +}) + test('title popup reopens after a blur dismiss (menu-closed IPC clears the reopen guard) @windows @macos @linux', async () => { await new Promise((resolve) => setTimeout(resolve, TITLE_REOPEN_SUPPRESSION_MS)) @@ -210,6 +222,14 @@ test('title-bar tooltip popup is created on demand and hides cleanly @windows @m .toBe(false) }) +async function openWindowCount(): Promise { + return evalWithRetry(() => + ctx.app.evaluate( + ({ BrowserWindow }) => BrowserWindow.getAllWindows().filter((w) => !w.isDestroyed()).length + ) + ) +} + async function readPopupMenuItems(app: ElectronApplication, marker: string): Promise { return evalWithRetry(() => app.evaluate(({ webContents }, m) => { diff --git a/e2e/lifecycle-first-use-skip.test.ts b/e2e/lifecycle-first-use-skip.test.ts index 04841e94b..21ef38da0 100644 --- a/e2e/lifecycle-first-use-skip.test.ts +++ b/e2e/lifecycle-first-use-skip.test.ts @@ -19,7 +19,7 @@ test('cold start lands on first-use start screen with the waffle menu hidden @li await ctx.panel.waitForVisible('.start-hero', { timeout: 15_000 }) await ctx.panel.waitForVisible('[data-testid="first-use-continue"]') - expect(await ctx.titleBar.exists('.title-menu-button')).toBe(false) + expect(await ctx.titleBar.exists('.title-menu-button[aria-haspopup="menu"]')).toBe(false) }) test('ToS + Local + Continue surfaces the waffle menu; Skip Onboarding reveals the chooser @lifecycle', async () => { @@ -45,10 +45,10 @@ test('ToS + Local + Continue surfaces the waffle menu; Skip Onboarding reveals t expect(await ctx.panel.click('[data-testid="first-use-continue"]')).toBe(true) - await ctx.titleBar.waitForVisible('.title-menu-button', { timeout: 15_000 }) + await ctx.titleBar.waitForVisible('.title-menu-button[aria-haspopup="menu"]', { timeout: 15_000 }) await resetIpcInvocations(ctx.app, 'comfy-window:set-first-use-mode') - expect(await ctx.titleBar.click('.title-menu-button')).toBe(true) + expect(await ctx.titleBar.click('.title-menu-button[aria-haspopup="menu"]')).toBe(true) await waitForWebContents(ctx.app, 'comfyTitlePopup.html') const popup = titlePopupPage(ctx.app) await popup.waitForVisible('li.item', { timeout: 10_000 }) diff --git a/e2e/support/chooserHelpers.ts b/e2e/support/chooserHelpers.ts index d7302812a..cb620cbe6 100644 --- a/e2e/support/chooserHelpers.ts +++ b/e2e/support/chooserHelpers.ts @@ -60,11 +60,28 @@ export async function clickInstallTile( } export async function openTitleMenu(titleBar: WebContentsPage): Promise { - await titleBar.waitForVisible('.title-menu-button--icon') - const ok = await titleBar.click('.title-menu-button--icon') + await titleBar.waitForVisible('.title-menu-button--icon[aria-haspopup="menu"]') + const ok = await titleBar.click('.title-menu-button--icon[aria-haspopup="menu"]') expect(ok, 'Title menu button click dispatched').toBe(true) } +export async function pickFromTitleMenu( + app: ElectronApplication, + titleBar: WebContentsPage, + label: string +): Promise { + await waitForWebContents(app, 'comfyTitlePopup.html', 10_000) + await openTitleMenu(titleBar) + await expect + .poll(() => isPopupVisible(app, 'comfyTitlePopup.html'), { + timeout: 5_000, + intervals: [100, 200] + }) + .toBe(true) + const picked = await titlePopupPage(app).clickByText('li.item', label) + expect(picked, `${label} picked from the title menu`).toBe(true) +} + export async function openDownloadsTray(titleBar: WebContentsPage): Promise { await titleBar.waitForVisible('.title-downloads-tray') const ok = await titleBar.click('.title-downloads-tray') diff --git a/e2e/whats-new-keeps-page.test.ts b/e2e/whats-new-keeps-page.test.ts index 97801cdd1..8f545ef69 100644 --- a/e2e/whats-new-keeps-page.test.ts +++ b/e2e/whats-new-keeps-page.test.ts @@ -1,6 +1,6 @@ import { test, expect } from '@playwright/test' import { launchApp, type AppContext } from './launchApp' -import { expectChooserVisible } from './support/chooserHelpers' +import { expectChooserVisible, pickFromTitleMenu } from './support/chooserHelpers' const BELL = '.title-announcement-button' const WHATS_NEW_CLOSE = '[data-testid="announcement-close"]' @@ -30,7 +30,7 @@ async function settleClose(): Promise { } test("closing What's New stays on the Performance Tests page @windows @macos @linux", async () => { - expect(await ctx.panel.click('[data-testid="app-sidebar-performance-test"]')).toBe(true) + await pickFromTitleMenu(ctx.app, ctx.titleBar, 'Performance Tests') await ctx.panel.waitForVisible(PERFORMANCE_TEST) await openWhatsNew() diff --git a/locales/en.json b/locales/en.json index eb46da807..6f5a0883c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -19,7 +19,6 @@ "builds": "Builds", "navigation": "Navigation", "home": "Home", - "tools": "Tools", "collapse": "Collapse sidebar", "expand": "Expand sidebar", "signInTitle": "Log in to Comfy", @@ -1527,7 +1526,6 @@ "lineage": "Lineage" }, "fileMenu": { - "newWindow": "Open Dashboard", "newInstall": "Install a New Build", "addExistingInstall": "Add Existing Build", "loadSnapshot": "Load Snapshot", diff --git a/locales/zh.json b/locales/zh.json index f17ba0975..5ac3b62c3 100644 --- a/locales/zh.json +++ b/locales/zh.json @@ -19,7 +19,6 @@ "builds": "构建", "navigation": "导航", "home": "主页", - "tools": "工具", "collapse": "收起侧边栏", "expand": "展开侧边栏", "signInTitle": "登录 Comfy", @@ -1527,7 +1526,6 @@ "lineage": "来源" }, "fileMenu": { - "newWindow": "打开仪表板", "newInstall": "安装新构建", "addExistingInstall": "添加现有构建", "loadSnapshot": "加载快照", diff --git a/src/main/popups/titlePopup.test.ts b/src/main/popups/titlePopup.test.ts index 0f9af4db1..d5057efb8 100644 --- a/src/main/popups/titlePopup.test.ts +++ b/src/main/popups/titlePopup.test.ts @@ -32,13 +32,10 @@ import { scopeInstancePicker, buildTitlePopupMenuItems, computePopupHeight, - decideFlowMenuItemTarget, - isFlowMenuItemId, parseGlobalSettingsTarget, registerTitlePopupIpc, requiresPerOpenConfigSync, syncTitlePopupConfig, - type FlowMenuItemId, type InstancePickerInstall, type TitlePopupEntry, type TitlePopupHostBindings @@ -135,11 +132,12 @@ describe('buildTitlePopupMenuItems', () => { }) it.each([null, 'inst-1'] as const)( - 'keeps settings and window actions without duplicate dashboard shortcuts on host %s', + 'lists the tools, settings and window actions on host %s', (installationId) => { const items = buildTitlePopupMenuItems(makeEntry({ installationId })) expect(items.map((item) => item.id ?? 'separator')).toEqual([ - 'new-window', + 'performance-test', + 'benchmarks', 'separator', 'settings', 'separator', @@ -153,7 +151,8 @@ describe('buildTitlePopupMenuItems', () => { const items = buildTitlePopupMenuItems(makeEntry({ installationId: 'inst-1', zoomLevel: 2 })) const ids = items.map((i) => i.id ?? null).filter((id) => id !== null) expect(ids).toEqual([ - 'new-window', + 'performance-test', + 'benchmarks', 'settings', 'reset-zoom', 'exit-window', @@ -191,10 +190,11 @@ describe('buildTitlePopupMenuItems', () => { expect(items.find((i) => i.id === 'reset-zoom')).toBeUndefined() }) - it('places New Window first and Quit Desktop last on a chooser host', () => { + it('places Performance Tests first and Quit Desktop last on a chooser host', () => { const items = buildTitlePopupMenuItems(makeEntry({ installationId: null })) const ids = items.map((i) => i.id ?? null) - expect(ids[0]).toBe('new-window') + expect(ids[0]).toBe('performance-test') + expect(ids).not.toContain('new-window') expect(ids[ids.length - 1]).toBe('close-all-windows') }) @@ -218,36 +218,36 @@ describe('activateTitlePopupMenuItem', () => { } as unknown as Parameters[0] } - it.each([null, 'inst-1'] as const)( - 'opens Performance Test in a new host when installationId is %s', - (installationId) => { - const host = makeEntry({ installationId }) + it.each(['performance-test', 'benchmarks'] as const)( + 'switches the dashboard window to %s in place', + (tool) => { + const host = makeEntry({ installationId: null }) comfyWindows.set(host.windowKey, host) const bindings = { openChooserHostWindow: vi.fn(), setActivePanel: vi.fn() } as unknown as TitlePopupHostBindings - activateTitlePopupMenuItem(makePopupEntry(host.windowKey), 'performance-test', bindings) + activateTitlePopupMenuItem(makePopupEntry(host.windowKey), tool, bindings) - expect(bindings.openChooserHostWindow).toHaveBeenCalledExactlyOnceWith('performance-test') - expect(bindings.setActivePanel).not.toHaveBeenCalled() + expect(bindings.setActivePanel).toHaveBeenCalledExactlyOnceWith(host.windowKey, tool) + expect(bindings.openChooserHostWindow).not.toHaveBeenCalled() } ) - it.each([null, 'inst-1'] as const)( - 'opens Benchmarks in a new host when installationId is %s', - (installationId) => { - const host = makeEntry({ installationId }) + it.each(['performance-test', 'benchmarks'] as const)( + 'opens %s in a dashboard window from a build window', + (tool) => { + const host = makeEntry({ installationId: 'inst-1' }) comfyWindows.set(host.windowKey, host) const bindings = { openChooserHostWindow: vi.fn(), setActivePanel: vi.fn() } as unknown as TitlePopupHostBindings - activateTitlePopupMenuItem(makePopupEntry(host.windowKey), 'benchmarks', bindings) + activateTitlePopupMenuItem(makePopupEntry(host.windowKey), tool, bindings) - expect(bindings.openChooserHostWindow).toHaveBeenCalledExactlyOnceWith('benchmarks') + expect(bindings.openChooserHostWindow).toHaveBeenCalledExactlyOnceWith(tool) expect(bindings.setActivePanel).not.toHaveBeenCalled() } ) @@ -273,33 +273,6 @@ describe('activateTitlePopupMenuItem', () => { }) }) -describe('decideFlowMenuItemTarget', () => { - const flowIds: FlowMenuItemId[] = ['new-install', 'track', 'load-snapshot', 'quick-install'] - - it.each(flowIds)('dashboard host routes %s to in-place takeover', (id) => { - const target = decideFlowMenuItemTarget(makeEntry({ installationId: null }), id) - expect(target).toEqual({ kind: 'set-active-panel', panel: id }) - }) - - it.each(flowIds)('install host routes %s to a fresh chooser window', (id) => { - const target = decideFlowMenuItemTarget(makeEntry({ installationId: 'inst-1' }), id) - expect(target).toEqual({ kind: 'open-chooser-host', panel: id }) - }) -}) - -describe('isFlowMenuItemId', () => { - it('accepts the four flow ids and rejects everything else', () => { - expect(isFlowMenuItemId('new-install')).toBe(true) - expect(isFlowMenuItemId('track')).toBe(true) - expect(isFlowMenuItemId('load-snapshot')).toBe(true) - expect(isFlowMenuItemId('quick-install')).toBe(true) - expect(isFlowMenuItemId('new-window')).toBe(false) - expect(isFlowMenuItemId('settings')).toBe(false) - expect(isFlowMenuItemId('feedback')).toBe(false) - expect(isFlowMenuItemId('')).toBe(false) - }) -}) - describe('requiresPerOpenConfigSync', () => { it('forces a config re-send for a global-settings open with a requested tab', () => { expect( diff --git a/src/main/popups/titlePopup.ts b/src/main/popups/titlePopup.ts index 7cd02f321..5bb9e2893 100644 --- a/src/main/popups/titlePopup.ts +++ b/src/main/popups/titlePopup.ts @@ -475,7 +475,12 @@ export function buildTitlePopupMenuItems(entry: ComfyWindowEntry): TitlePopupMen ] } const items: TitlePopupMenuItem[] = [ - { id: 'new-window', label: 'Open Dashboard', labelKey: 'fileMenu.newWindow' }, + { + id: 'performance-test', + label: 'Performance Tests', + labelKey: 'fileMenu.performanceTest' + }, + { id: 'benchmarks', label: 'Benchmarks', labelKey: 'fileMenu.benchmarks' }, { kind: 'separator' }, { id: 'settings', @@ -1191,28 +1196,6 @@ function showInstancePickerForHost( })() } -export type FlowMenuItemId = 'new-install' | 'track' | 'load-snapshot' | 'quick-install' - -const FLOW_MENU_ITEM_IDS: ReadonlySet = new Set([ - 'new-install', - 'track', - 'load-snapshot', - 'quick-install' -]) - -export function isFlowMenuItemId(id: string): id is FlowMenuItemId { - return FLOW_MENU_ITEM_IDS.has(id) -} - -export function decideFlowMenuItemTarget( - entry: ComfyWindowEntry, - id: FlowMenuItemId -): { kind: 'set-active-panel' | 'open-chooser-host'; panel: ComfyPanelKey } { - return isChooserHost(entry) - ? { kind: 'set-active-panel', panel: id } - : { kind: 'open-chooser-host', panel: id } -} - export function activateTitlePopupMenuItem( entry: TitlePopupEntry, id: string, @@ -1229,8 +1212,12 @@ export function activateTitlePopupMenuItem( bindings.openChooserHostWindow() releaseFocusToParent = false } else if (id === 'performance-test' || id === 'benchmarks') { - bindings.openChooserHostWindow(id) - releaseFocusToParent = false + if (parentEntry && isChooserHost(parentEntry)) { + bindings.setActivePanel(entry.parentEntryId, id) + } else { + bindings.openChooserHostWindow(id) + releaseFocusToParent = false + } } else if (id === 'return-to-dashboard') { void bindings.returnToDashboard(entry.parentEntryId) } else if (id === 'exit-window') { @@ -1261,16 +1248,6 @@ export function activateTitlePopupMenuItem( if (parentEntry != null && parentEntry.installationId !== null) { bindings.resetComfyZoom(parentEntry.installationId) } - } else if (isFlowMenuItemId(id)) { - if (parentEntry) { - const target = decideFlowMenuItemTarget(parentEntry, id) - if (target.kind === 'set-active-panel') { - bindings.setActivePanel(entry.parentEntryId, target.panel) - } else { - bindings.openChooserHostWindow(target.panel) - releaseFocusToParent = false - } - } } hideTitlePopup(entry, { releaseFocusToParent }) } diff --git a/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts b/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts index c256af797..cd90aa7ee 100644 --- a/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts +++ b/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts @@ -270,7 +270,7 @@ describe('TitleBarApp', () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp) await flushPromises() - const fileBtn = wrapper.find('.title-menu-button') + const fileBtn = wrapper.find('.title-menu-button[aria-haspopup="menu"]') expect(fileBtn.exists()).toBe(true) expect(fileBtn.attributes('aria-label')).toBe('Menu') expect(fileBtn.classes()).toContain('title-menu-button--icon') @@ -307,7 +307,7 @@ describe('TitleBarApp', () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp, { attachTo: document.body }) await flushPromises() - await wrapper.find('.title-menu-button').trigger('click') + await wrapper.find('.title-menu-button[aria-haspopup="menu"]').trigger('click') expect(bridgeState.fileMenuAnchors.length).toBe(1) const anchor = bridgeState.fileMenuAnchors[0]! expect(typeof anchor.x).toBe('number') @@ -393,13 +393,13 @@ describe('TitleBarApp', () => { const wrapper = mount(TitleBarApp, { attachTo: document.body }) await flushPromises() - await wrapper.find('.title-menu-button').trigger('click') + await wrapper.find('.title-menu-button[aria-haspopup="menu"]').trigger('click') expect(bridgeState.fileMenuAnchors.length).toBe(1) bridgeState.menuClosedCallbacks.forEach((cb) => cb({ menu: 'menu' })) await flushPromises() - await wrapper.find('.title-menu-button').trigger('click') + await wrapper.find('.title-menu-button[aria-haspopup="menu"]').trigger('click') expect(bridgeState.fileMenuAnchors.length).toBe(1) wrapper.unmount() @@ -1005,7 +1005,7 @@ describe('TitleBarApp', () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp, { attachTo: document.body }) await flushPromises() - const btn = wrapper.find('.title-menu-button').element as HTMLElement + const btn = wrapper.find('.title-menu-button[aria-haspopup="menu"]').element as HTMLElement btn.dispatchEvent(new PointerEvent('pointermove', { bubbles: true })) vi.advanceTimersByTime(1000) await flushPromises() @@ -1023,7 +1023,7 @@ describe('TitleBarApp', () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp) await flushPromises() - const btn = wrapper.find('.title-menu-button') + const btn = wrapper.find('.title-menu-button[aria-haspopup="menu"]') expect(btn.attributes('aria-label')).toBe('Menu') expect(btn.attributes('data-title-tooltip')).toBe('Menu') expect(btn.attributes('title')).toBeUndefined() @@ -1035,7 +1035,7 @@ describe('TitleBarApp', () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp) await flushPromises() - const btn = wrapper.find('.title-menu-button') + const btn = wrapper.find('.title-menu-button[aria-haspopup="menu"]') expect(btn.attributes('aria-label')).toBe('Menu') expect(btn.attributes('title')).toBe('Menu') expect(btn.attributes('data-title-tooltip')).toBeUndefined() @@ -1051,7 +1051,7 @@ describe('TitleBarApp', () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp, { attachTo: document.body }) await flushPromises() - const btn = wrapper.find('.title-menu-button').element as HTMLElement + const btn = wrapper.find('.title-menu-button[aria-haspopup="menu"]').element as HTMLElement btn.getBoundingClientRect = () => ({ left: 20, top: 6, right: 50, bottom: 30, width: 30, height: 24, x: 20, y: 6 }) as DOMRect btn.dispatchEvent(new PointerEvent('pointermove', { bubbles: true })) diff --git a/src/renderer/src/comfyTitleBar/TitleBarApp.vue b/src/renderer/src/comfyTitleBar/TitleBarApp.vue index 2deec2a31..847f11b8f 100644 --- a/src/renderer/src/comfyTitleBar/TitleBarApp.vue +++ b/src/renderer/src/comfyTitleBar/TitleBarApp.vue @@ -558,7 +558,7 @@ onUnmounted(() => { diff --git a/src/renderer/src/panel/AppSidebar.test.ts b/src/renderer/src/panel/AppSidebar.test.ts index a93bf1057..4e386dd8b 100644 --- a/src/renderer/src/panel/AppSidebar.test.ts +++ b/src/renderer/src/panel/AppSidebar.test.ts @@ -32,30 +32,27 @@ async function mountSidebar(activePage: DashboardPage = 'chooser') { } describe('AppSidebar', () => { - it('lists Home, Builds, Performance Tests, then Benchmarks', async () => { + it('lists Home then Builds, with the tools left to the menu', async () => { const wrapper = await mountSidebar() - expect(wrapper.findAll('nav button').map((row) => row.text())).toEqual([ - 'Home', - 'Builds', - 'Performance Tests', - 'Benchmarks' - ]) + expect(wrapper.findAll('nav button').map((row) => row.text())).toEqual(['Home', 'Builds']) }) it('marks only the current page', async () => { + const wrapper = await mountSidebar('chooser') + + expect(wrapper.findAll('[aria-current="page"]').map((row) => row.text())).toEqual(['Builds']) + }) + + it('marks no row while a tool page from the menu is open', async () => { const wrapper = await mountSidebar('benchmarks') - expect(wrapper.findAll('[aria-current="page"]').map((row) => row.text())).toEqual([ - 'Benchmarks' - ]) + expect(wrapper.findAll('[aria-current="page"]')).toHaveLength(0) }) it.each<[string, DashboardPage]>([ ['app-sidebar-home', 'home'], - ['app-sidebar-chooser', 'chooser'], - ['app-sidebar-benchmarks', 'benchmarks'], - ['app-sidebar-performance-test', 'performance-test'] + ['app-sidebar-chooser', 'chooser'] ])('navigates from %s', async (testId, page) => { const wrapper = await mountSidebar() @@ -74,15 +71,15 @@ describe('AppSidebar', () => { it('collapses to icons with tooltips and stays collapsed when reopened', async () => { const wrapper = await mountSidebar() - const benchmarks = wrapper.get('[data-testid="app-sidebar-benchmarks"]') - expect(benchmarks.text()).toBe('Benchmarks') - expect(benchmarks.attributes('title')).toBeUndefined() + const builds = wrapper.get('[data-testid="app-sidebar-chooser"]') + expect(builds.text()).toBe('Builds') + expect(builds.attributes('title')).toBeUndefined() await wrapper.get('[data-testid="app-sidebar-toggle"]').trigger('click') await flushPromises() - expect(benchmarks.text()).toBe('') - expect(benchmarks.attributes('title')).toBe('Benchmarks') + expect(builds.text()).toBe('') + expect(builds.attributes('title')).toBe('Builds') expect(wrapper.get('[data-testid="app-sidebar-toggle"]').attributes('aria-expanded')).toBe( 'false' ) diff --git a/src/renderer/src/panel/AppSidebar.vue b/src/renderer/src/panel/AppSidebar.vue index ce039d4f9..eef929093 100644 --- a/src/renderer/src/panel/AppSidebar.vue +++ b/src/renderer/src/panel/AppSidebar.vue @@ -2,7 +2,7 @@ import { computed } from 'vue' import { useI18n } from 'vue-i18n' import { useLocalStorage } from '@vueuse/core' -import { ChartColumn, Gauge, House, Server } from 'lucide-vue-next' +import { House, Server } from 'lucide-vue-next' import type { Component } from 'vue' import Button from '@comfyorg/design-system/button/Button' import ComfyCLogo from '../components/icons/ComfyCLogo.vue' @@ -34,13 +34,8 @@ const mainRows = computed(() => [ { page: 'home', label: t('sidebar.home'), icon: House }, { page: 'chooser', label: t('sidebar.builds'), icon: Server } ]) -const toolRows = computed(() => [ - { page: 'performance-test', label: t('fileMenu.performanceTest'), icon: Gauge }, - { page: 'benchmarks', label: t('fileMenu.benchmarks'), icon: ChartColumn } -]) -const groups = computed(() => [ - { key: 'main', rows: mainRows.value }, - { key: 'tools', title: t('sidebar.tools'), rows: toolRows.value } +const groups = computed<{ key: string; title?: string; rows: SidebarRow[] }[]>(() => [ + { key: 'main', rows: mainRows.value } ]) function navigate(page: DashboardPage): void {