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
2 changes: 1 addition & 1 deletion .agents/checks/follower-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ boundary keyed on `DISTRIBUTION`.

Flag:

- **`DISTRIBUTION` / `isCloud` / `isDesktop` checks scattered through follower core** —
- **`DISTRIBUTION` / `isCloud` / `isLegacyDesktopBuild` / `isComfyDesktop2()` checks scattered through follower core** —
distribution conditionals inside the CRDT apply seam, `DocFrameClient`, or rendering.
They belong only in the agent connection/configuration boundary.
- **Auth reduced to `isCloud`** — resolving credentials by distribution instead of
Expand Down
5 changes: 3 additions & 2 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ reviews:
semantic doc, an optimistic overlay merged back as a Yjs update,
`op_id` regeneration on retry, a second applier reimplemented instead
of importing `@comfyorg/comfy-multi-player`, `DISTRIBUTION`/`isCloud`/
`isDesktop` checks scattered outside the agent connection boundary, and
auth reduced to `isCloud` instead of `authStore.getAuthHeader()`.
`isLegacyDesktopBuild`/`isComfyDesktop2()` checks scattered outside the
agent connection boundary, and auth reduced to `isCloud` instead of
`authStore.getAuthHeader()`.
- path: '**/*.test.ts'
instructions: |
Treat `.agents/checks/test-quality.md`, `docs/testing/README.md`,
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This project uses **pnpm**. Always prefer scripts defined in `package.json` (e.g

- `pnpm dev`: Start Vite dev server.
- `pnpm dev:cloud`: Dev server connected to cloud backend (testcloud.comfy.org)
- `pnpm dev:electron`: Dev server with Electron API mocks
- `pnpm dev:electron`: Dev server with legacy Desktop 1 Electron API mocks
- `pnpm build`: Type-check then production build to `dist/`
- `pnpm preview`: Preview the production build locally
- `pnpm test:unit`: Run Vitest unit tests
Expand Down
2 changes: 1 addition & 1 deletion docs/SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Example versioned defaults from codebase:
{
id: 'Comfy.VueNodes.Enabled',
defaultValue: false,
defaultsByInstallVersion: { '1.41.0': isCloud || isDesktop }
defaultsByInstallVersion: { '1.41.0': isCloud || isLegacyDesktopBuild }
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ on the user's own machine — a real product surface, not a dev rig), and
**Dev/ephemeral** (a Vite dev server against a selected backend). The build
models this in `src/platform/distribution/types.ts`
(`Distribution = 'desktop' | 'localhost' | 'cloud'`, `DISTRIBUTION`, `isCloud`,
`isDesktop`), resolved by `vite.config.mts` into the compile-time
`__DISTRIBUTION__` define.
`isLegacyDesktopBuild`), resolved by `vite.config.mts` into the compile-time
`__DISTRIBUTION__` define. The `desktop` build ships only in the legacy
Electron app (Desktop 1). Comfy-Desktop (Desktop 2) runs the standard
`localhost` build and is detected at runtime with `isComfyDesktop2()`
(`window.__comfyDesktop2`), not by the build.

The follower **apply** path has no product-specific graph semantics — every
surface receives the same host-made `doc_update` and applies it the same way.
Expand Down Expand Up @@ -182,7 +185,7 @@ module **when direct-to-agent product wiring is implemented** — it resolves th
agent HTTP/WS base URL (an `AGENT_BASE_URL`-style value), whether the route is
same-origin through cloud ingest or direct to the local/Desktop agent binary,
and credentials by delegating to `authStore.getAuthHeader()`. Use
`DISTRIBUTION`/`isCloud`/`isDesktop` **inside that boundary only**; do not
`DISTRIBUTION`/`isCloud`/`isLegacyDesktopBuild`/`isComfyDesktop2()` **inside that boundary only**; do not
scatter distribution checks through the follower apply path or rendering, and never
reduce auth to `isCloud` (Local and Desktop are authenticated product
surfaces). Dev-only Vite proxy/credential behavior stays in Vite config and is
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import config from '@/config'
import TooltipProvider from '@/components/ui/tooltip/TooltipProvider.vue'
import SessionReconnecting from '@/platform/auth/session/components/SessionReconnecting.vue'
import { isCloud, isDesktop } from '@/platform/distribution/types'
import { isCloud, isLegacyDesktopBuild } from '@/platform/distribution/types'

Check warning on line 29 in src/App.vue

View workflow job for this annotation

GitHub Actions / fallow / fallow

Boundary violation

Import from zone 'app-host/presentation' to zone 'app-host/infrastructure' is not allowed. src/App.vue -> src/platform/distribution/types.ts Route the import through an allowed zone or restructure the dependency.
import {
reportPreloadError,
reportResourceLoadError
Expand Down Expand Up @@ -79,7 +79,7 @@
onMounted(() => {
window['__COMFYUI_FRONTEND_VERSION__'] = config.app_version

if (isDesktop) {
if (isLegacyDesktopBuild) {
document.addEventListener('contextmenu', showContextMenu)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ vi.mock<unknown>(import('@/utils/envUtil'), () => ({
electronAPI: vi.fn(() => null)
}))

const mockData = vi.hoisted(() => ({ isDesktop: false }))
const mockData = vi.hoisted(() => ({ isLegacyDesktopBuild: false }))

vi.mock(import('@/platform/distribution/types'), () => ({
get isDesktop() {
return mockData.isDesktop
get isLegacyDesktopBuild() {
return mockData.isLegacyDesktopBuild
}
}))

Expand Down
4 changes: 2 additions & 2 deletions src/components/bottomPanel/tabs/terminal/BaseTerminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import Button from '@/components/ui/button/Button.vue'
import { useTerminal } from '@/composables/bottomPanelTabs/useTerminal'
import { electronAPI } from '@/utils/envUtil'
import { isDesktop } from '@/platform/distribution/types'
import { isLegacyDesktopBuild } from '@/platform/distribution/types'

Check warning on line 41 in src/components/bottomPanel/tabs/terminal/BaseTerminal.vue

View workflow job for this annotation

GitHub Actions / fallow / fallow

Boundary violation

Import from zone 'bottom-panel/presentation' to zone 'app-host/infrastructure' is not allowed. src/components/bottomPanel/tabs/terminal/BaseTerminal.vue -> src/platform/distribution/types.ts Route the import through an allowed zone or restructure the dependency.
import { cn } from '@comfyorg/tailwind-utils'

const { t } = useI18n()
Expand Down Expand Up @@ -88,7 +88,7 @@
electronAPI()?.showContextMenu({ type: 'text' })
}

if (isDesktop) {
if (isLegacyDesktopBuild) {
useEventListener(terminalEl, 'contextmenu', showContextMenu)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ const fixtures = vi.hoisted(() => {
}
})

const runtime = vi.hoisted(() => ({ isCloud: false, isDesktop: true }))
const runtime = vi.hoisted(() => ({
isCloud: false,
isLegacyDesktopBuild: true
}))
const mocks = vi.hoisted(() => ({
filterTemplatesByCategory: vi.fn(() => [fixtures.template]),
getTemplateDescription: vi.fn(
Expand Down Expand Up @@ -173,8 +176,8 @@ vi.mock(import('@/platform/distribution/types'), () => ({
get isCloud() {
return runtime.isCloud
},
get isDesktop() {
return runtime.isDesktop
get isLegacyDesktopBuild() {
return runtime.isLegacyDesktopBuild
}
}))

Expand Down Expand Up @@ -364,7 +367,7 @@ describe('WorkflowTemplateSelectorDialog detail routing', () => {
).mockImplementation(mocks.filterTemplatesByCategory)
vi.mocked(workflowTemplatesStore.loadWorkflowTemplates).mockResolvedValue()
runtime.isCloud = false
runtime.isDesktop = true
runtime.isLegacyDesktopBuild = true
mocks.prepareWorkflowTemplate.mockResolvedValue(fixtures.prepared)
mocks.openPreparedWorkflowTemplate.mockResolvedValue('loaded')
mocks.resolveAvailability.mockResolvedValue([
Expand Down Expand Up @@ -659,7 +662,7 @@ describe('WorkflowTemplateSelectorDialog detail routing', () => {
})

it('opens directly outside Desktop without resolving model inventory', async () => {
runtime.isDesktop = false
runtime.isLegacyDesktopBuild = false
renderDialog()
await clickTemplateCard()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
import type { TemplateSortMode } from '@/composables/useTemplateFiltering'
import { getComfyCloudBaseUrl } from '@/config/comfyApi'
import { formatCategoryLabel } from '@/platform/assets/utils/categoryLabel'
import { isCloud, isDesktop } from '@/platform/distribution/types'
import { isCloud, isLegacyDesktopBuild } from '@/platform/distribution/types'

Check warning on line 483 in src/components/custom/widget/WorkflowTemplateSelectorDialog.vue

View workflow job for this annotation

GitHub Actions / fallow / fallow

Boundary violation

Import from zone 'workflow-templates/presentation' to zone 'app-host/infrastructure' is not allowed. src/components/custom/widget/WorkflowTemplateSelectorDialog.vue -> src/platform/distribution/types.ts Route the import through an allowed zone or restructure the dependency.
import { loadFolderPathsOnce } from '@/platform/missingModel/folderPathCache'
import {
isModelDownloadable,
Expand Down Expand Up @@ -1258,7 +1258,7 @@
prepared: PreparedWorkflowTemplate,
generation: number
): Promise<boolean> {
if (!isDesktop) return false
if (!isLegacyDesktopBuild) return false

const requirements = extractTemplateModelRequirementDetails(
prepared.data.json
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/content/setting/UserPanel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ vi.mock(import('@/services/dialogService'))
vi.mock(import('@/platform/distribution/types'), () => ({
DISTRIBUTION: 'cloud' as const,
isCloud: true,
isDesktop: false,
isLegacyDesktopBuild: false,
isNightly: false
}))
vi.mock(import('@/platform/auth/firebaseIdentity'), () => ({
Expand Down
2 changes: 1 addition & 1 deletion src/components/graph/GraphCanvas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import GraphCanvas from './GraphCanvas.vue'
const distribution = vi.hoisted(() => ({ isCloud: false }))
vi.mock(import('@/platform/distribution/types'), () => ({
DISTRIBUTION: 'localhost' as const,
isDesktop: false,
isLegacyDesktopBuild: false,
isNightly: false,
get isCloud() {
return distribution.isCloud
Expand Down
14 changes: 7 additions & 7 deletions src/components/helpcenter/HelpCenterMenuContent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ beforeEach(() => {

const distribution = vi.hoisted(() => ({
isCloud: false,
isDesktop: false,
isLegacyDesktopBuild: false,
isNightly: false
}))

Expand All @@ -35,8 +35,8 @@ vi.mock(import('@/platform/distribution/types'), () => ({
get isCloud() {
return distribution.isCloud
},
get isDesktop() {
return distribution.isDesktop
get isLegacyDesktopBuild() {
return distribution.isLegacyDesktopBuild
},
get isNightly() {
return distribution.isNightly
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('HelpCenterMenuContent feedback item', () => {

beforeEach(() => {
distribution.isCloud = false
distribution.isDesktop = false
distribution.isLegacyDesktopBuild = false
distribution.isNightly = false
openSpy = vi.spyOn(window, 'open').mockReturnValue(null)
})
Expand Down Expand Up @@ -139,7 +139,7 @@ describe('HelpCenterMenuContent system status item', () => {

beforeEach(() => {
distribution.isCloud = false
distribution.isDesktop = false
distribution.isLegacyDesktopBuild = false
distribution.isNightly = false
openSpy = vi.spyOn(window, 'open').mockReturnValue(null)
})
Expand All @@ -166,7 +166,7 @@ describe('HelpCenterMenuContent system status item', () => {

describe('HelpCenterMenuContent onboarding replay', () => {
it('is hidden outside developer mode', async () => {
distribution.isDesktop = true
distribution.isLegacyDesktopBuild = true
useSettingStore().settingValues['Comfy.DevMode'] = false
const { user } = renderComponent()

Expand Down Expand Up @@ -196,7 +196,7 @@ describe('HelpCenterMenuContent onboarding replay', () => {
describe('HelpCenterMenuContent ComfyUI update', () => {
beforeEach(() => {
distribution.isCloud = false
distribution.isDesktop = false
distribution.isLegacyDesktopBuild = false
managerState.isNewManagerUI.value = true
})

Expand Down
20 changes: 12 additions & 8 deletions src/components/helpcenter/HelpCenterMenuContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@

import PuzzleIcon from '@/components/icons/PuzzleIcon.vue'
import { useExternalLink } from '@/composables/useExternalLink'
import { isCloud, isDesktop, isNightly } from '@/platform/distribution/types'
import {
isCloud,

Check warning on line 165 in src/components/helpcenter/HelpCenterMenuContent.vue

View workflow job for this annotation

GitHub Actions / fallow / fallow

Boundary violation

Import from zone 'help-center/presentation' to zone 'app-host/infrastructure' is not allowed. src/components/helpcenter/HelpCenterMenuContent.vue -> src/platform/distribution/types.ts Route the import through an allowed zone or restructure the dependency.
isLegacyDesktopBuild,
isNightly
} from '@/platform/distribution/types'
import { useSettingStore } from '@/platform/settings/settingStore'
import { buildFeedbackTypeformUrl } from '@/platform/support/config'
import { useTelemetry } from '@/platform/telemetry'
Expand Down Expand Up @@ -247,7 +251,7 @@
key: 'desktop-guide',
type: 'item',
label: t('helpCenter.desktopUserGuide'),
visible: isDesktop,
visible: isLegacyDesktopBuild,
action: () => {
trackResourceClick('docs', true)
openExternalLink(
Expand All @@ -263,7 +267,7 @@
key: 'dev-tools',
type: 'item',
label: t('helpCenter.openDevTools'),
visible: isDesktop,
visible: isLegacyDesktopBuild,
action: () => {
openDevTools()
emit('close')
Expand All @@ -272,13 +276,13 @@
{
key: 'divider-1',
type: 'divider',
visible: isDesktop
visible: isLegacyDesktopBuild
},
{
key: 'reinstall',
type: 'item',
label: t('helpCenter.reinstall'),
visible: isDesktop,
visible: isLegacyDesktopBuild,
action: () => {
onReinstall()
emit('close')
Expand Down Expand Up @@ -415,7 +419,7 @@
})
}
// Update ComfyUI - only for non-desktop, non-cloud with new manager UI
if (!isDesktop && !isCloud && isNewManagerUI.value) {
if (!isLegacyDesktopBuild && !isCloud && isNewManagerUI.value) {
items.push({
key: 'update-comfyui',
type: 'item',
Expand Down Expand Up @@ -593,13 +597,13 @@
}

const openDevTools = (): void => {
if (isDesktop) {
if (isLegacyDesktopBuild) {
electronAPI().openDevTools()
}
}

const onReinstall = (): void => {
if (isDesktop) {
if (isLegacyDesktopBuild) {
void electronAPI().reinstall()
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/components/rightSidePanel/errors/TabErrors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@
import { useI18n } from 'vue-i18n'

import Button from '@/components/ui/button/Button.vue'
import { isCloud, isDesktop, isNightly } from '@/platform/distribution/types'
import {
isCloud,

Check warning on line 47 in src/components/rightSidePanel/errors/TabErrors.vue

View workflow job for this annotation

GitHub Actions / fallow / fallow

Boundary violation

Import from zone 'workflow-errors/presentation/outer-1' to zone 'app-host/infrastructure' is not allowed. src/components/rightSidePanel/errors/TabErrors.vue -> src/platform/distribution/types.ts Route the import through an allowed zone or restructure the dependency.
isLegacyDesktopBuild,
isNightly
} from '@/platform/distribution/types'

import ErrorGroupList from './ErrorGroupList.vue'
import { useErrorActions } from './useErrorActions'

const ErrorPanelSurveyCta =
isNightly && !isCloud && !isDesktop
isNightly && !isCloud && !isLegacyDesktopBuild
? defineAsyncComponent(
() => import('@/platform/surveys/ErrorPanelSurveyCta.vue')
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/SideToolbar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const spies = vi.hoisted(() => ({

vi.mock(import('@/platform/distribution/types'), () => ({
isCloud: false,
isDesktop: false,
isLegacyDesktopBuild: false,
isNightly: false
}))

Expand Down
8 changes: 6 additions & 2 deletions src/components/sidebar/SideToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@
import SidebarBottomPanelToggleButton from '@/components/sidebar/SidebarBottomPanelToggleButton.vue'
import SidebarSettingsButton from '@/components/sidebar/SidebarSettingsButton.vue'
import SidebarShortcutsToggleButton from '@/components/sidebar/SidebarShortcutsToggleButton.vue'
import { isCloud, isDesktop, isNightly } from '@/platform/distribution/types'
import {
isCloud,

Check warning on line 96 in src/components/sidebar/SideToolbar.vue

View workflow job for this annotation

GitHub Actions / fallow / fallow

Boundary violation

Import from zone 'workbench-shell/presentation/outer-2' to zone 'app-host/infrastructure' is not allowed. src/components/sidebar/SideToolbar.vue -> src/platform/distribution/types.ts Route the import through an allowed zone or restructure the dependency.
isLegacyDesktopBuild,
isNightly
} from '@/platform/distribution/types'
import { useSettingStore } from '@/platform/settings/settingStore'
import { useTelemetry } from '@/platform/telemetry'
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
Expand All @@ -119,7 +123,7 @@
}>()

const NightlySurveyController =
isNightly && !isCloud && !isDesktop
isNightly && !isCloud && !isLegacyDesktopBuild
? defineAsyncComponent(
() => import('@/platform/surveys/NightlySurveyController.vue')
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/sidebar/tabs/ModelLibrarySidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</SidebarTopArea>
</template>
<template #body>
<ElectronDownloadItems v-if="isDesktop" />
<ElectronDownloadItems v-if="isLegacyDesktopBuild" />

<TreeExplorer
v-model:expanded-keys="expandedKeys"
Expand Down Expand Up @@ -94,7 +94,7 @@
} from '@/stores/modelStore'
import { useModelToNodeStore } from '@/stores/modelToNodeStore'
import type { TreeExplorerNode, TreeNode } from '@/types/treeExplorerTypes'
import { isDesktop } from '@/platform/distribution/types'
import { isLegacyDesktopBuild } from '@/platform/distribution/types'

Check warning on line 97 in src/components/sidebar/tabs/ModelLibrarySidebarTab.vue

View workflow job for this annotation

GitHub Actions / fallow / fallow

Boundary violation

Import from zone 'model-library/presentation' to zone 'app-host/infrastructure' is not allowed. src/components/sidebar/tabs/ModelLibrarySidebarTab.vue -> src/platform/distribution/types.ts Route the import through an allowed zone or restructure the dependency.
import { buildTree } from '@/utils/treeUtil'

const modelStore = useModelStore()
Expand Down
Loading
Loading