Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version-file: .nvmrc
# Shape the app accepts, and every example downloadable from GitHub `main`.
- run: node scripts/benchmark-templates.mjs validate
2 changes: 1 addition & 1 deletion .github/workflows/build-bootstrap-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
uses: actions/setup-node@v7
with:
package-manager-cache: false
node-version: "20"
node-version-file: .nvmrc

- name: Build bootstrap Python
# The script downloads python-build-standalone, installs pygit2, and
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
node-version-file: .nvmrc
cache: pnpm

- name: Validate ToDesktop credentials
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
node-version-file: .nvmrc

- name: Require a version bump when the contract changes
env:
Expand Down Expand Up @@ -196,7 +196,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-from-pr-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
node-version-file: .nvmrc

- name: Detect package.json version change from pull request files
id: version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/starter-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: actions/setup-node@v7
with:
package-manager-cache: false
node-version: 22
node-version-file: .nvmrc
# Checks the tab counts and the one-paid-per-tab rule, and confirms every
# id still exists upstream.
- run: node scripts/starter-templates.mjs validate
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
- uses: actions/setup-node@v7
with:
package-manager-cache: false
node-version: 22
node-version-file: .nvmrc

# Authenticate first. It is the likeliest failure and writes nothing, so
# a bad key aborts before R2 is mutated and the hosts can diverge.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 22
node-version-file: .nvmrc

- name: Configure Git author
run: |
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.18.0
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ Contributions are welcome. The app is an [Electron](https://www.electronjs.org/)

### Prerequisites

- [**Node.js**](https://nodejs.org/) v22 LTS or later
- [**Node.js**](https://nodejs.org/) at the version pinned in [`.nvmrc`](.nvmrc)
- [**pnpm**](https://pnpm.io/) v10 or later (via Corepack)

```bash
nvm install 22 && nvm use 22 # recommended — https://github.com/nvm-sh/nvm
corepack enable # enables pnpm (bundled with Node)
nvm install && nvm use # reads .nvmrc; mise and fnm read it too
corepack enable # enables pnpm (bundled with Node 24)
```

### Setup
Expand Down
2 changes: 1 addition & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Snapshot of `e2e/` as of 2026-07. "Meets zero-mock bar" applies the policy above
| `progress-error-overflow.test.ts` | platform | n/a | Pure UI overflow regression test. |
| `progress-reboot.test.ts` | platform | n/a | `injectRetryableProgressError` fakes a failing operation and its retry outcome. |
| `quit-flow.spec.ts` | `@macos` | n/a | Tray-close quit behavior. |
| `title-bar-hover-gate-comfy-window.test.ts` | platform | n/a | Hover-gate state machine (probes cloud.comfy.org for the host window). |
| `title-bar-hover-gate-comfy-window.test.ts` | platform | n/a | Hover-gate state machine with a test-owned loopback server and seeded Cloud record. |
| `title-bar-hover-gate.test.ts` | platform | n/a | Hover-gate state machine. |
| `update-pills.test.ts` | platform | n/a | Injects update states via `setAppUpdateState` / `setInstallUpdate`. |
| `window-visible.spec.ts` | platform | n/a | Launch smoke test. |
Expand Down
2 changes: 1 addition & 1 deletion e2e/beta-activation-notice-firstrun.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ test('first run: the hint takes the popup, and dismissing it releases the beta c
expect(await popup.textOf('.coachmark-title')).toBe('Switch & manage instances')

// The notice is queued in main the whole time, waiting for the popup to free up.
expect(await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`))
expect(await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`, { readOnly: true }))
.not.toBeNull()

expect(await popup.click('.coachmark-dismiss')).toBe(true)
Expand Down
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 @@ -175,7 +175,7 @@ test('first-use lockdown never costs the user the beta notice @linux', async ()

// Armed in main: the grant cleared every gate and the notice is waiting on the renderer.
expect(
await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`)
await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`, { readOnly: true })
).not.toBeNull()

// REASON 1. The launch ended the lockdown by itself, so the anchor is back and the card is
Expand Down Expand Up @@ -203,7 +203,7 @@ test('first-use lockdown never costs the user the beta notice @linux', async ()

// Hidden, never retired: main still holds it, so it is not spent.
expect(
await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`)
await ctx.titleBar.evaluate(`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`, { readOnly: true })
).not.toBeNull()

// THE ASSERTION. Lockdown ends, and the card comes back in the SAME session — no relaunch,
Expand Down
10 changes: 6 additions & 4 deletions e2e/beta-activation-notice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ test('the card is anchored on the bell it points at @linux', async () => {
if (!el) return -1
const r = el.getBoundingClientRect()
return (r.left + r.right) / 2
})()`)
})()`, { readOnly: true })
expect(bellCentre).toBeGreaterThan(0)

const popup = await ctx.app.evaluate(({ BrowserWindow, WebContentsView }) => {
Expand Down Expand Up @@ -247,7 +247,7 @@ test('the card is anchored on the bell it points at @linux', async () => {
if (!el) return -1
const r = el.getBoundingClientRect()
return (r.left + r.right) / 2
})()`)
})()`, { readOnly: true })
const view = await ctx.app.evaluate(({ BrowserWindow, WebContentsView }) => {
const win = BrowserWindow.getAllWindows().find((w) => !w.isDestroyed() && w.isVisible())
if (!win) return null
Expand All @@ -272,7 +272,7 @@ test('the card is anchored on the bell it points at @linux', async () => {
' beakInlineStyle=' + (b.style.left || '<none>') +
' pageWidth=' + window.innerWidth
})
})()`)
})()`, { readOnly: true })
const card = JSON.parse(raw) as { beak: number; card: string }
if (bell < 0 || !view || card.beak < 0) return null
return {
Expand Down Expand Up @@ -370,7 +370,7 @@ test('the settings link lands on the beta opt-in row and retires the card @linux
checked: el.getAttribute('aria-checked'),
disabled: el.getAttribute('aria-disabled'),
}
})()`)
})()`, { readOnly: true })
expect(state.checked).toBe('true')
expect(state.disabled).toBe('false')

Expand All @@ -383,11 +383,13 @@ test('the notice is spent: a second launch stays silent @linux', async () => {
// the title bar uses, so this asserts the contract the renderer actually depends on.
const stillPending = await ctx.titleBar.evaluate<unknown>(
`window.api.getPendingBetaNotice(${JSON.stringify(INSTALL_ID)})`,
{ readOnly: true },
)
expect(stillPending).toBeNull()

const announced = await ctx.titleBar.evaluate<unknown>(
`window.api.getSetting('betaNoticeAnnouncedArgs')`,
{ readOnly: true },
)
expect(announced).toEqual([GRANT_ARG])
})
3 changes: 2 additions & 1 deletion e2e/cancel-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async function runGuardInBackground(actionLabel: string): Promise<void> {
}

function readGuardVerdict(): Promise<boolean> {
return ctx.panel.evaluate<boolean>('window.__guardPromise')
return ctx.panel.evaluate<boolean>('window.__guardPromise', { readOnly: true })
}

test('useActionGuard fires cancel-operation when the user confirms cancelling the busy op @windows @macos @linux', async () => {
Expand Down Expand Up @@ -172,6 +172,7 @@ test('Return-to-Dashboard from in-flight op cancels and closes the takeover @win
.poll(
async () => ctx.panel.evaluate<boolean>(
`window.__e2eRenderer.isRunning(${JSON.stringify(INSTALL_ID)})`,
{ readOnly: true },
),
{ timeout: 5_000, intervals: [100, 200] },
)
Expand Down
10 changes: 9 additions & 1 deletion e2e/chooser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ test.afterAll(async () => {

test('chooser body renders on cold start @windows @macos @linux', async () => {
await expectChooserVisible(ctx.panel)
expect(await ctx.panel.exists('.chooser-tile-new')).toBe(true)
// The shell mounts before scope and installation hydration reveal the tiles.
await ctx.panel.waitForVisible('.chooser-tile-new')
expect(
(
await ctx.panel.textOf(
Expand Down Expand Up @@ -188,6 +189,13 @@ test('title popup reopens after a blur dismiss (menu-closed IPC clears the reope
})

test('title-bar tooltip popup is created on demand and hides cleanly @windows @macos @linux', async () => {
// Tooltip visibility requires the host to retain native focus.
await ctx.app.evaluate(({ app, BrowserWindow, webContents }) => {
app.focus({ steal: true })
BrowserWindow.getAllWindows()[0]?.focus()
webContents.getAllWebContents().find((wc) => wc.getURL().includes('comfyTitleBar.html'))?.focus()
})
await expect.poll(() => ctx.titleBar.evaluate<boolean>('document.hasFocus()', { readOnly: true })).toBe(true)
// No webContents for the tooltip popup exists before the first show —
// unlike titlePopup / systemModal, the tooltip is NOT pre-warmed.
expect(await findWebContentsId(ctx.app, 'comfyTitleTooltip.html')).toBeNull()
Expand Down
1 change: 1 addition & 0 deletions e2e/core-beta-args-pill-commit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ async function openStartupArgs(): Promise<WebContentsPage> {
const pillLabel = (popup: WebContentsPage): Promise<string | null> =>
popup.evaluate<string | null>(
`document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null`,
{ readOnly: true },
)

/** Open with the request count reset, so absence can be read against this open's own answers. */
Expand Down
1 change: 1 addition & 0 deletions e2e/core-beta-args-pill-restart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ async function openStartupArgs(): Promise<WebContentsPage> {
const pillLabel = (popup: WebContentsPage): Promise<string | null> =>
popup.evaluate<string | null>(
`document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null`,
{ readOnly: true },
)

test('the pill follows the new session after a Restart that drops a grant @linux', async () => {
Expand Down
4 changes: 4 additions & 0 deletions e2e/core-beta-args-pill-stopped.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ async function openStartupArgs(): Promise<WebContentsPage> {
async function pillAriaLabel(popup: WebContentsPage): Promise<string | null> {
return popup.evaluate<string | null>(
`document.querySelector(${JSON.stringify(PILL)})?.getAttribute('aria-label') ?? null`,
{ readOnly: true },
)
}

Expand All @@ -133,6 +134,7 @@ test('shows the grants the next launch is eligible for @linux', async () => {
await popup.clickUntilVisible(PILL, MENU, { timeout: 10_000 })
const text = await popup.evaluate<string>(
`document.querySelector(${JSON.stringify(MENU)}).textContent`,
{ readOnly: true },
)
expect(text).toContain('Eligible for next launch')
expect(text).toContain('--enable-asset-hashing')
Expand All @@ -148,6 +150,7 @@ test('turning the beta opt-in off removes the pill on the next open, and on rest
const checked = (): Promise<string | null> =>
popup.evaluate<string | null>(
`document.querySelector(${JSON.stringify(BETA_SWITCH)})?.getAttribute('aria-checked') ?? null`,
{ readOnly: true },
)
expect(await checked()).toBe('true')
expect(await popup.click(BETA_SWITCH)).toBe(true)
Expand Down Expand Up @@ -218,6 +221,7 @@ test('only the pill asks: another field\'s save asks nothing, an args commit ask
const stored = (): Promise<unknown> =>
ctx.panel.evaluate(
`window.api.getInstallations().then((all) => all.find((i) => i.id === ${JSON.stringify(INSTALL_ID)})?.portConflict ?? null)`,
{ readOnly: true },
)
await expect.poll(stored, { timeout: 10_000, intervals: [100, 200] }).not.toBeNull()
// The view re-reads its sections after a save; give that re-read time to land, then count.
Expand Down
6 changes: 4 additions & 2 deletions e2e/core-beta-args-pill.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function openStartupArgs(): Promise<WebContentsPage> {
test('a stopped install whose next launch cannot be predicted shows no beta pill @windows @macos @linux', async () => {
const popup = await openStartupArgs()
// The args field is on screen (waited above), so the pill's absence is a real answer.
expect(await popup.evaluate<boolean>(`!!document.querySelector(${JSON.stringify(PILL)})`)).toBe(
expect(await popup.evaluate<boolean>(`!!document.querySelector(${JSON.stringify(PILL)})`, { readOnly: true })).toBe(
false,
)
})
Expand All @@ -118,6 +118,7 @@ test('a running install shows its grants and links to the beta opt-in @windows @
const el = document.querySelector(${JSON.stringify(PILL)})
return { text: (el.textContent || '').trim(), expanded: el.getAttribute('aria-expanded') }
})()`,
{ readOnly: true },
)
expect(pill).toEqual({ text: '+2 beta', expanded: 'false' })

Expand All @@ -128,6 +129,7 @@ test('a running install shows its grants and links to the beta opt-in @windows @
row.querySelector('.ui-menu-item-label').textContent.trim(),
row.querySelector('.ui-menu-item-detail').textContent.trim(),
])`,
{ readOnly: true },
)
expect(rows).toEqual([
['--enable-agent', 'Agent'],
Expand All @@ -152,7 +154,7 @@ test('a running install shows its grants and links to the beta opt-in @windows @
timeout: 10_000,
})
await popup.waitFor(
async () => (await popup.evaluate<boolean>('window.__betaRowFlashed === true')) === true,
async () => (await popup.evaluate<boolean>('window.__betaRowFlashed === true', { readOnly: true })) === true,
{ timeout: 5_000, message: 'the beta opt-in row was never flashed' },
)
})
2 changes: 1 addition & 1 deletion e2e/core-beta-optin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function readBetaRow(popup: WebContentsPage): Promise<BetaRowState | null>
title: el.getAttribute('title'),
describedText: description ? (description.textContent || '').trim() : null,
}
})()`)
})()`, { readOnly: true })
}

/** Walk the real UI to the Privacy section: title menu -> Desktop Settings ->
Expand Down
6 changes: 3 additions & 3 deletions e2e/downloads-shelf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ test('many entries cap at the ceiling and the list scrolls @windows @macos @linu
const overflow = await popup.evaluate<{ scroll: number; client: number }>(`(() => {
const el = document.querySelector('.downloads-list')
return el ? { scroll: el.scrollHeight, client: el.clientHeight } : { scroll: 0, client: 0 }
})()`)
})()`, { readOnly: true })
expect(overflow.scroll).toBeGreaterThan(overflow.client)
})

Expand Down Expand Up @@ -162,7 +162,7 @@ test('per-status row close button maps to the right action @windows @macos @linu
}
}
return out
})()`)
})()`, { readOnly: true })

// Active rows: close X cancels the in-flight download.
expect(summary['dl.safetensors']?.close).toContain('cancel')
Expand Down Expand Up @@ -197,7 +197,7 @@ test('retry affordance shows on error + cancelled rows only @windows @macos @lin
out[name] = { retry: !!li.querySelector('.downloads-item-retry') }
}
return out
})()`)
})()`, { readOnly: true })

expect(summary['er.safetensors']?.retry).toBe(true)
expect(summary['ca.safetensors']?.retry).toBe(true)
Expand Down
6 changes: 4 additions & 2 deletions e2e/hardware-acceleration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ async function disableHardwareAccelerationFromDesktopSettings(ctx: AppContext):
await popup.waitForVisible(selector, { timeout: 5_000 })
expect(
await popup.evaluate(
`document.querySelector(${JSON.stringify(selector)})?.getAttribute('aria-checked')`
`document.querySelector(${JSON.stringify(selector)})?.getAttribute('aria-checked')`,
{ readOnly: true },
)
).toBe('true')
expect(await popup.allText('.settings-v2-field-description')).toContain(
Expand All @@ -136,7 +137,8 @@ async function disableHardwareAccelerationFromDesktopSettings(ctx: AppContext):
await popup.waitFor(
async () =>
(await popup.evaluate(
`document.querySelector(${JSON.stringify(selector)})?.getAttribute('aria-checked')`
`document.querySelector(${JSON.stringify(selector)})?.getAttribute('aria-checked')`,
{ readOnly: true },
)) === 'false',
{ timeout: 5_000, message: 'hardware acceleration toggle did not switch off' }
)
Expand Down
1 change: 1 addition & 0 deletions e2e/lifecycle-add-existing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ test('waffle menu → Add Existing → Browse probes the staged directory → Tr

const installs = await ctx.panel.evaluate<Installation[]>(
`window.api.getInstallations()`,
{ readOnly: true },
)
const tracked = installs.find((i) => i.name === TRACKED_NAME)
expect(tracked, 'tracked install not present in get-installations result').toBeDefined()
Expand Down
1 change: 1 addition & 0 deletions e2e/lifecycle-cloud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ test('accept ToS + pick cloud auto-launches the seeded Cloud install @lifecycle'
await ctx.panel.waitFor(
async () => ctx.panel.evaluate<boolean>(
`!document.querySelector('[data-testid="first-use-continue"]').disabled`,
{ readOnly: true },
),
{ timeout: 5_000, message: 'Continue never became enabled after ticking ToS' },
)
Expand Down
Loading
Loading