Comfy-Org / Comfy-Org/ComfyUI_frontend

Track legacy isDesktop gates for Comfy Desktop parity

Open
#13,685 1 comment 1 reaction 0 assignees View on GitHub
Electron
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Context

The frontend still has 29 production consumers and 47 decision/reference sites for `isDesktop`. This constant only means the legacy compile-time distribution (`__DISTRIBUTION__ === 'desktop'`). Comfy Desktop hosts the normal localhost frontend and exposes host functionality through server feature flags and `window.__comfyDesktop2`, so these gates are false there.

This issue tracks parity work without treating every legacy Electron behavior as appropriate for Comfy Desktop.

## Migration rule

- Product/UI availability should move to server feature flags where useful.
- Native functionality must check the actual bridge/API capability. A feature flag may additionally control visibility, but must not be the only safety check.
- Deployment/content classification should use explicit deploy metadata, not rollout flags.
- Legacy-only Electron commands should not be surfaced in Comfy Desktop unless it provides a compatible bridge.

## Already migrated or in progress

- [x] Workflow-tabs sign-in button uses `show_signin_button ?? isDesktop`: #11298
- [x] Missing-model downloads prefer `window.__comfyDesktop2.downloadModel`, retain legacy Electron fallback, then use browser download.
- [x] Host telemetry detects `window.__comfyDesktop2?.Telemetry` rather than build flavor.
- [ ] Apply `show_signin_button` to the secondary `TopMenuSection` sign-in button and its layout reservation. An implementation exists on `glary/remove-legacy-tabbar-layout` (`dc9eda326a`) but is not on `main`.
- [ ] Finish interactive-terminal capability gating. Frontend work exists on `feat/desktop-terminal-feature-flag` (`443b414fd2`), Core registration exists on `feat/supports-terminal-flag` (`8a89f834`), and Comfy Desktop already attempts to inject `supports_terminal` when the running Core registry supports it.
- [ ] Version/update notification work is already covered by the active three-repo change:
- Frontend #13171
- Core Comfy-Org/ComfyUI#14646
- Desktop Comfy-Org/Comfy-Desktop#1205
- Tracking issue Comfy-Org/Comfy-Desktop#1194

## Reported metadata parity gap

A user reported that legacy Desktop let them toggle whether metadata is saved, while current Comfy Desktop apparently does not.

What legacy Desktop exposed:

- The desktop-only frontend Server Config panel included `disable-metadata`, labeled "Disable saving prompt metadata in files."
- Enabling it persisted `Comfy.Server.ServerConfigValues['disable-metadata']` / `Comfy.Server.LaunchArgs` and restarted ComfyUI with `--disable-metadata`.
- Core uses `args.disable_metadata` to omit prompt/workflow metadata from saved PNG, WebP, video, 3D, and model-merge outputs. This is output-file metadata, not telemetry and not model-library metadata.

Current Comfy Desktop code appears to retain this capability through its structured startup-arguments editor:

- `src/main/lib/comfy-args.ts` categorizes `disable-metadata` under `features`.
- Installation settings expose `launchArgs` through the `args-builder` editor and mark changes restart-required.
- The editor discovers supported arguments from `python main.py --help` and renders boolean arguments as toggles.

Follow-up:

- [ ] Verify that `--disable-metadata` appears in the currently shipped Desktop version under installation Settings -> Startup Arguments -> Features.
- [ ] If it is present, improve discoverability or add a first-class privacy-oriented toggle rather than restoring the entire legacy Server Config panel.
- [ ] If it is absent in a supported install, determine whether argument-schema discovery failed or the shipped Desktop predates the structured arguments builder.
- [ ] Document that disabling metadata prevents workflow/prompt recovery from newly saved output files and requires restarting the instance.

## High-value remaining policy gates

- [ ] Decide the Vue Nodes default currently expressed as `isCloud || isDesktop` in `coreSettings.ts`.
- [ ] Decide whether Comfy Desktop should receive the desktop user-guide entry in `HelpCenterMenuContent.vue`.
- [ ] Decide whether the unload-confirmation behavior in `GraphView.vue` should be host-controlled.
- [ ] Decide whether nightly surveys should remain localhost-nightly-only or use explicit survey flags (`useSurveyEligibility.ts`, `SideToolbar.vue`, `TabErrors.vue`).
- [ ] Decide whether desktop-only assertion reporting in `main.ts` is still needed now that host telemetry is capability-based.

## Capability/runtime gates to retain or convert to bridge checks

Do not replace these with flag-only checks:

- Legacy Electron adapter registration and commands (`electronAdapter.ts`)
- Native context menus (`App.vue`, `BaseTerminal.vue`)
- Legacy download manager and badges (`electronDownloadStore.ts`, `ModelLibrarySidebarTab.vue`, `useModelLibrarySidebarTab.ts`)
- Native window theme, drag regions, and controls (`BaseViewTemplate.vue`, `GraphView.vue`, `WorkflowTabs.vue`, `envUtil.ts`)
- Legacy updater action (`ReleaseNotificationToast.vue`)
- Legacy version/platform APIs (`aboutPanelStore.ts`, `useExternalLink.ts`)
- macOS legacy Desktop cloud notification (`DesktopCloudNotificationController.vue`)
- Help-center DevTools and reinstall commands (`HelpCenterMenuContent.vue`)
- Server Config panel restart action (`ServerConfigPanel.vue` calls the legacy `electronAPI().restartApp()`)

## Classification and cleanup

- [ ] `systemStatsStore.ts`: new Desktop currently looks like a git/local install. Use trusted host/deploy metadata if Desktop classification is required.
- [ ] `subgraphStore.ts`: decide whether Comfy Desktop should use Local or Desktop template distribution semantics. The closed Desktop2 distribution PR #12870 ultimately treated Desktop2 templates as local.
- [ ] `router.ts`: keep the desktop `/` base-path behavior as deployment configuration, not a feature flag.
- [ ] Remove unreachable `isDesktop` checks inside the outer `if (isCloud)` router block; `isCloud` and `isDesktop` are mutually exclusive compile-time values.
- [ ] Do not revive a broad `desktop2` compile-time distribution merely to make legacy gates true. That risks exposing APIs only provided by the legacy preload bridge.

## Definition of done

- Every remaining `isDesktop` use is explicitly classified as legacy-only, capability-based, deployment classification, or migrated policy.
- Comfy Desktop parity features use server flags plus bridge checks where required.
- Plain localhost installs do not accidentally receive native Desktop UI/actions.
- The metadata toggle is verified in a shipped Desktop build and made discoverable or separately tracked.

Contributor guide

Open the contributing guide

Research direction

Start by auditing the remaining isDesktop consumers and the named entry points, including coreSettings.ts, HelpCenterMenuContent.vue, GraphView.vue, and the listed bridge and store files. Verify --disable-metadata in a shipped Desktop build, then classify each gate as legacy-only, capability-based, deployment metadata, or migrated policy; done means all remaining uses are classified without exposing native actions to localhost installs.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop, frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.