Skip to content
Open
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
4 changes: 2 additions & 2 deletions e2e/beta-activation-notice-lockdown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ async function popupVisible(app: ElectronApplication): Promise<boolean | 'detach

async function lockdownEngaged(titleBar: WebContentsPage): Promise<boolean> {
const bell = await titleBar.exists('.title-announcement-button')
const pill = await titleBar.exists('.title-install-pill.is-interactive')
return !bell && !pill
const firstUseLabel = await titleBar.exists('.title-install-pill')
return !bell && firstUseLabel
}

const UNREACHABLE_POSTHOG_HOST = 'http://127.0.0.1:1'
Expand Down
7 changes: 4 additions & 3 deletions e2e/chooser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ test('chooser body renders on cold start @windows @macos @linux', async () => {
expect(await ctx.panel.exists('[data-testid="devplatform-account-signin"]')).toBe(true)
})

test('title bar shows install-less pill on chooser host @windows @macos @linux', async () => {
expect(await ctx.titleBar.exists('.title-install-pill.is-install-less')).toBe(true)
expect(await ctx.titleBar.textOf('.title-install-name')).toMatch(/Comfy Desktop/i)
test('title bar leaves the middle empty on the chooser host @windows @macos @linux', async () => {
expect(await ctx.titleBar.exists('.title-center')).toBe(true)
expect(await ctx.titleBar.exists('.title-center > *')).toBe(false)
expect(await ctx.titleBar.exists('.title-install-pill')).toBe(false)
})

test('Desktop Settings opens from the sidebar footer when expanded and collapsed @windows @macos @linux', async () => {
Expand Down
4 changes: 2 additions & 2 deletions e2e/core-beta-args-pill-restart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { launchApp, type AppContext } from './launchApp'
import {
clickInstallTile,
expectChooserVisible,
openPickerViaTitlePill
openPickerInWindow
} from './support/chooserHelpers'
import { closeTitlePopupIfOpen, isPopupVisible, type WebContentsPage } from './support/cdpPages'
import { getRunningSessionSnapshot } from './support/devHooks'
Expand Down Expand Up @@ -84,7 +84,7 @@ test.afterAll(async () => {

async function openStartupArgs(): Promise<WebContentsPage> {
await closeTitlePopupIfOpen(ctx.app)
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'config')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'config')
await popup.waitForVisible(`${ARGS_FIELD} .ui-input`, { timeout: 15_000 })
return popup
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/launch-own-window.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { test, expect } from '@playwright/test'
import { launchApp, type AppContext } from './launchApp'
import { reserveFreePort, writeFakeComfyInstall } from './support/fakeComfyInstall'
import { evalWithRetry } from './support/evalRetry'
import { openPickerViaTitlePill } from './support/chooserHelpers'
import { openPickerInWindow } from './support/chooserHelpers'
import { WebContentsPage } from './support/cdpPages'
import { byTestId, TID } from './support/testIds'

Expand Down Expand Up @@ -154,7 +154,7 @@ test('Start on another build from a build window opens it in its own window and
ctx.app,
`comfyTitleBar.html?installationId=${INSTALL_ID}`
)
const popup = await openPickerViaTitlePill(ctx.app, firstBuildTitleBar)
const popup = await openPickerInWindow(ctx.app, firstBuildTitleBar)
const secondRow = byTestId(TID.pickerRow(SECOND_INSTALL_ID))
await popup.waitForVisible(secondRow, { timeout: 15_000 })
expect(await popup.click(secondRow), 'second build selected').toBe(true)
Expand Down
38 changes: 18 additions & 20 deletions e2e/real-comfy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
expectNewBuildModalOpen,
openManageViaDashboard,
openNewBuildChangeSetup,
openPickerViaTitlePill
openPickerInWindow
} from './support/chooserHelpers'
import {
armLaunchReadyHold,
Expand Down Expand Up @@ -509,9 +509,7 @@ test('picker Dashboard opens a chooser without stopping the running install @sec
})
)

expect(await ctx.titleBar.click('.title-install-pill.is-interactive')).toBe(true)
await waitForWebContents(ctx.app, 'comfyTitlePopup.html')
const popup = titlePopupPage(ctx.app)
const popup = await openPickerInWindow(ctx.app, ctx.titleBar)
await popup.waitForVisible('.picker-home', { timeout: 10_000 })
expect(await popup.click('.picker-home')).toBe(true)

Expand Down Expand Up @@ -658,7 +656,7 @@ async function stopAndReturnToDashboardViaUI(): Promise<void> {
return
}
}
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar)
const popup = await openPickerInWindow(ctx.app, ctx.titleBar)
await popup.waitForVisible(byTestId(TID.pickerMoreTrigger), { timeout: 15_000 })
await popup.clickUntilVisible(
byTestId(TID.pickerMoreTrigger),
Expand Down Expand Up @@ -878,7 +876,7 @@ async function selectPytorchOption(

async function changePytorchStack(option: PytorchPickerOption): Promise<void> {
const beforeSession = await getRunningSessionSnapshot(ctx.app, _updateInstallId)
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'update')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'update')
await selectPytorchOption(popup, option)
const action = byTestId(TID.updateActionButton('change-pytorch'))
await popup.waitForVisible(action, { timeout: 60_000 })
Expand Down Expand Up @@ -910,7 +908,7 @@ async function changePytorchStack(option: PytorchPickerOption): Promise<void> {
.toBe(true)
await closeTitlePopupIfOpen(ctx.app)

const verifyPopup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'update')
const verifyPopup = await openPickerInWindow(ctx.app, ctx.titleBar, 'update')
const picker = await readPytorchPicker(verifyPopup)
expect(picker.current.value).toBe(option.value)
await expect
Expand All @@ -926,7 +924,7 @@ test('captures the baseline pytorch stack @sec-pytorch @real-comfy', async () =>
await ctx.panel.evaluate(
`window.api.runAction(${JSON.stringify(_updateInstallId)}, 'check-update', { silent: true })`
)
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'update')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'update')
const picker = await readPytorchPicker(popup)
_baselinePytorchOption = picker.current
_baselinePytorchSignature = queryTorchSignature()
Expand All @@ -939,7 +937,7 @@ test('captures the baseline pytorch stack @sec-pytorch @real-comfy', async () =>
test('switches to a different compatible stack via the picker @sec-pytorch @real-comfy', async () => {
test.setTimeout(GPU_VARIANT ? 2_700_000 : 1_200_000)
expect(_baselinePytorchOption, 'baseline PyTorch picker option not captured').not.toBeNull()
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'update')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'update')
const picker = await readPytorchPicker(popup)
_targetPytorchOption =
picker.options.find(
Expand Down Expand Up @@ -1128,7 +1126,7 @@ function findStackSnapshot(
async function restoreSnapshotViaPicker(filename: string): Promise<void> {
await waitForOperationDrain(_updateInstallId)
const beforeSession = await getRunningSessionSnapshot(ctx.app, _updateInstallId)
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'snapshots')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'snapshots')
await popup.waitForSelector(byTestId(TID.snapshotRow(filename)), { timeout: 30_000 })
await popup.clickUntilVisible(
byTestId(TID.snapshotRow(filename)),
Expand Down Expand Up @@ -1241,7 +1239,7 @@ test('captures a snapshot for the picker-driven restore test @sec-snapshot @real
).snapshots.map((s) => s.filename)
)

const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'snapshots')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'snapshots')
await popup.waitForVisible(byTestId(TID.snapshotsSaveCta), { timeout: 15_000 })
expect(await popup.click(byTestId(TID.snapshotsSaveCta))).toBe(true)
await popup.waitForVisible(byTestId(TID.basePromptInput), { timeout: 15_000 })
Expand Down Expand Up @@ -1398,7 +1396,7 @@ test('per-install Manager security level + network mode land in Manager config.i
`window.api.getSetting('managerNetworkMode')`
)

const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'config')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'config')

const trigger = 'button.ui-select-trigger[aria-label="Manager Security Level"]'
await popup.waitForVisible(trigger, { timeout: 15_000 })
Expand Down Expand Up @@ -1540,7 +1538,7 @@ test('picker-driven cross-channel update-comfyui (stable → latest) IN_PLACE_RE
await resetIpcInvocations(ctx.app, 'stop-comfyui')
await resetIpcInvocations(ctx.app, 'run-action')

const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'update')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'update')

const channelSelect = 'button[role="combobox"][aria-label="Update Channel"]'
await popup.waitForSelector(channelSelect, { timeout: 60_000 })
Expand Down Expand Up @@ -1622,7 +1620,7 @@ test('picker-driven snapshot-restore IN_PLACE_RELAUNCH while running @sec-snapsh
await resetIpcInvocations(ctx.app, 'stop-comfyui')
await resetIpcInvocations(ctx.app, 'run-action')

const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'snapshots')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'snapshots')
await popup.waitForSelector(byTestId(TID.snapshotRow(_restoreSnapshotFilename)), {
timeout: 30_000
})
Expand Down Expand Up @@ -1686,7 +1684,7 @@ test('picker primary CTA Restart drives in-drawer confirm + re-launch @sec-picke
.not.toBeNull()
expect(beforeSnapshot, 'expected a running session before Restart').not.toBeNull()

const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar)
const popup = await openPickerInWindow(ctx.app, ctx.titleBar)

await popup.waitForVisible(byTestId(TID.pickerPrimaryCta), { timeout: 15_000 })
await expect
Expand Down Expand Up @@ -1745,7 +1743,7 @@ test('picker More-menu Stop fires stop-comfyui; stopped-card Relaunch restores i
await resetIpcInvocations(ctx.app, 'stop-comfyui')
await resetIpcInvocations(ctx.app, 'run-action')

const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'config')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'config')

await popup.waitForVisible(byTestId(TID.pickerMoreTrigger), { timeout: 15_000 })
await popup.clickUntilVisible(
Expand Down Expand Up @@ -1862,7 +1860,7 @@ async function confirmPickerRestart(popup: WebContentsPage): Promise<void> {
}

async function openBootWindowViaPickerRestart(): Promise<void> {
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar)
const popup = await openPickerInWindow(ctx.app, ctx.titleBar)
await confirmPickerRestart(popup)
await expect
.poll(
Expand Down Expand Up @@ -1906,7 +1904,7 @@ test('boot-window --port edit surfaces Restart-to-apply and the restart applies
let popup: WebContentsPage
try {
await restartAndHoldTheBootBeforeItCountsAsRunning()
popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'config')
popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'config')
await setPortArgViaPicker(popup, targetPort)
expect(
await getRunningSessionSnapshot(ctx.app, _updateInstallId),
Expand Down Expand Up @@ -1983,7 +1981,7 @@ test('restart clicked during boot cancels the in-flight boot and applies the edi

try {
await restartAndHoldTheBootBeforeItCountsAsRunning()
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar, 'config')
const popup = await openPickerInWindow(ctx.app, ctx.titleBar, 'config')
await setPortArgViaPicker(popup, targetPort)

await popup.waitForVisible(byTestId(TID.pickerPrimaryCta), { timeout: 15_000 })
Expand Down Expand Up @@ -2383,7 +2381,7 @@ async function openDashboardWindowViaPickerHome(): Promise<number> {
.map((w) => w.id)
)
)
const popup = await openPickerViaTitlePill(ctx.app, ctx.titleBar)
const popup = await openPickerInWindow(ctx.app, ctx.titleBar)
await popup.waitForVisible('.picker-home', { timeout: 10_000 })
expect(await popup.click('.picker-home')).toBe(true)
await closeTitlePopupIfOpen(ctx.app)
Expand Down
10 changes: 5 additions & 5 deletions e2e/support/chooserHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,20 @@ export async function openManageViaDashboard(
return popup
}

export async function openPickerViaTitlePill(
export async function openPickerInWindow(
app: ElectronApplication,
titleBar: WebContentsPage,
tabKey?: string
): Promise<WebContentsPage> {
if (await isPopupVisible(app, 'comfyTitlePopup.html')) {
throw new Error(
'openPickerViaTitlePill: picker popup is already open - close it before re-entering via the pill'
'openPickerInWindow: picker popup is already open - close it before opening it again'
)
}
await titleBar.waitForVisible('.title-install-pill.is-interactive', { timeout: 15_000 })
await titleBar.waitForVisible('.title-trailing', { timeout: 15_000 })
expect(
await titleBar.click('.title-install-pill.is-interactive'),
'title-bar install pill clicked'
await titleBar.evaluate<boolean>('(() => { window.api.openInstancePicker(); return true })()'),
'picker requested from the title bar'
).toBe(true)
await waitForWebContents(app, 'comfyTitlePopup.html')
await expect
Expand Down
11 changes: 0 additions & 11 deletions e2e/update-pills.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,6 @@ test('clicking the ready desktop-update pill opens the embedded system-modal res
.toBe(true)
})

test('install-update chip stays hidden on the install-less chooser host even with an override @windows @macos @linux', async () => {
await setInstallUpdate(ctx.app, { available: true, version: '99.0.0' })
await new Promise((r) => setTimeout(r, 250))
await expect
.poll(() => ctx.titleBar.exists('.title-install-update-chip'), {
timeout: 3_000,
intervals: [100, 200]
})
.toBe(false)
})

async function isSystemModalVisible(app: ElectronApplication): Promise<boolean> {
try {
return await evalWithRetry(() =>
Expand Down
4 changes: 0 additions & 4 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@
"appUpdateAvailable": "Update {version}",
"appUpdateReady": "Restart to update",
"installUpdateAvailable": "Update available",
"installUpdateShort": "Update",
"home": "Home",
"menu": "Menu",
"feedback": "Feedback",
Expand All @@ -258,9 +257,6 @@
"installUpdateVersion": "ComfyUI {version}",
"refreshInstanceTooltip": "Refresh",
"resetZoomTooltip": "Reset zoom to 100%",
"pillHintTitle": "Switch & manage instances",
"pillHintBody": "Click here to switch instances, start a new local instance, or return to the dashboard.",
"pillHintDismiss": "Got it",
"betaNoticeTitle": "A beta feature is on",
"betaNoticeBody": "This instance started with a beta feature enabled. You can turn beta features off in Settings.",
"betaNoticeTitleNamed": "The {feature} beta is on",
Expand Down
4 changes: 0 additions & 4 deletions locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@
"appUpdateAvailable": "更新 {version}",
"appUpdateReady": "重启以更新",
"installUpdateAvailable": "有可用更新",
"installUpdateShort": "更新",
"home": "主页",
"menu": "菜单",
"feedback": "反馈",
Expand All @@ -258,9 +257,6 @@
"installUpdateVersion": "ComfyUI {version}",
"refreshInstanceTooltip": "刷新",
"resetZoomTooltip": "将缩放重置为 100%",
"pillHintTitle": "切换和管理实例",
"pillHintBody": "点击这里切换实例、启动新的本地实例,或返回仪表板。",
"pillHintDismiss": "知道了",
"betaNoticeTitle": "已启用 Beta 功能",
"betaNoticeBody": "此实例启动时启用了一项 Beta 功能。你可以在设置中关闭 Beta 功能。",
"betaNoticeTitleNamed": "已启用 {feature} Beta 功能",
Expand Down
18 changes: 9 additions & 9 deletions src/main/popups/titleCoachmark.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ import {
describe('buildCoachmarkConfig', () => {
it('stamps the coachmark variant and carries title + body + dismiss copy', () => {
const cfg = buildCoachmarkConfig({
kind: 'pill-hint',
title: 'Switch & manage instances',
body: 'Click here to switch instances.',
kind: 'beta-notice',
title: 'A beta feature is on',
body: 'This instance started with a beta feature enabled.',
dismissLabel: 'Got it',
token: 'cm-1'
})
expect(cfg.variant).toBe('coachmark')
expect(cfg.kind).toBe('pill-hint')
expect(cfg.title).toBe('Switch & manage instances')
expect(cfg.body).toBe('Click here to switch instances.')
expect(cfg.kind).toBe('beta-notice')
expect(cfg.title).toBe('A beta feature is on')
expect(cfg.body).toBe('This instance started with a beta feature enabled.')
expect(cfg.dismissLabel).toBe('Got it')
expect(cfg.configToken).toBe('cm-1')
expect(cfg.theme.accent).toMatch(/^#/)
})

it('omits actionLabel entirely for a card with no secondary action', () => {
const cfg = buildCoachmarkConfig({
kind: 'pill-hint',
title: 'Switch & manage instances',
body: 'Click here to switch instances.',
kind: 'beta-notice',
title: 'A beta feature is on',
body: 'This instance started with a beta feature enabled.',
dismissLabel: 'Got it',
token: 'cm-1'
})
Expand Down
9 changes: 3 additions & 6 deletions src/main/popups/titleCoachmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface CoachmarkTheme {
accent: string
}

export type CoachmarkKind = 'pill-hint' | 'beta-notice'
export type CoachmarkKind = 'beta-notice'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Nit — With CoachmarkKind narrowed to the single member 'beta-notice', the entry.kind !== kind displacement check can never be true, so comfy-titlebar:coachmark-displaced is now dead code even though the renderer still registers onCoachmarkDisplaced. Likewise the preload handlers hardcode kind: 'beta-notice' and discard main's payload, so reintroducing a second kind would silently route every dismiss/action to useBetaActivationNotice. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max edge-case, claude-opus-5-thinking-max adversarial).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing: this PR only removes the pill kind. Collapsing the remaining single-kind coachmark plumbing, including the displaced channel, is a separate cleanup and keeps this diff small.


export interface CoachmarkConfig {
variant: 'coachmark'
Expand Down Expand Up @@ -163,7 +163,7 @@ function ensureCoachmarkPopup(parent: BrowserWindow): CoachmarkPopupEntry {
pendingConfig: null,
pendingAnchor: null,
pendingConfigToken: null,
kind: 'pill-hint',
kind: 'beta-notice',
settleTimer: null
}
coachmarkPopupsByParent.set(view.parentWindowId, entry)
Expand Down Expand Up @@ -227,7 +227,7 @@ export function openCoachmarkPopup(opts: {

entry.pendingAnchor = { leftX: opts.leftX, rightX: opts.rightX, bottomY: opts.bottomY }
const token = nextCoachmarkToken()
const kind = opts.kind ?? 'pill-hint'
const kind = opts.kind ?? 'beta-notice'
const config = buildCoachmarkConfig({
kind,
title: opts.title,
Expand Down Expand Up @@ -295,7 +295,6 @@ export function registerTitleCoachmarkIpc(opts: {
(
event,
payload: {
kind?: unknown
title?: unknown
body?: unknown
dismissLabel?: unknown
Expand All @@ -312,15 +311,13 @@ export function registerTitleCoachmarkIpc(opts: {
if (!title && !body) return
const dismissLabel = typeof payload?.dismissLabel === 'string' ? payload.dismissLabel : ''
const actionLabel = typeof payload?.actionLabel === 'string' ? payload.actionLabel : undefined
const kind: CoachmarkKind = payload?.kind === 'beta-notice' ? 'beta-notice' : 'pill-hint'
const finite = (v: unknown, fallback: number): number =>
typeof v === 'number' && Number.isFinite(v) ? v : fallback
const leftX = finite(payload?.leftX, 0)
const rightX = finite(payload?.rightX, leftX)
const bottomY = finite(payload?.bottomY, TITLEBAR_HEIGHT)
openCoachmarkPopup({
parent,
kind,
title,
body,
dismissLabel,
Expand Down
Loading
Loading