[PR #839] [CLOSED] Centralize app state on store and comfy settings #1142

Closed
opened 2026-10-31 22:19:51 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/desktop/pull/839
Author: @christian-byrne
Created: 2/6/2025
Status: ❌ Closed

Base: main ← Head: cb-store


📝 Commits (10+)

  • cc50c76 Use electron store and comfy settings for app state
  • 57d75f6 Fix unit tests
  • b1ebaf8 initialize settings on first access
  • 3bdc9d4 Use store in install wizard and config manager
  • 9db9fb8 make VirtualEnvironment use store
  • 5680557 Remove injection of telemetry singleton
  • 565e317 Fix telemetry test
  • 622442a use cloned defaults
  • ba8f47a inline createComfyDirectories call
  • 5f8e273 use async in settings, initialize explicitly on startup

📊 Changes

18 files changed (+323 additions, -346 deletions)

View changed files

📝 src/config/comfySettings.ts (+20 -4)
📝 src/desktopApp.ts (+7 -14)
📝 src/install/installWizard.ts (+19 -31)
📝 src/install/installationManager.ts (+13 -18)
📝 src/main-process/comfyDesktopApp.ts (+13 -17)
📝 src/main-process/comfyInstallation.ts (+13 -37)
📝 src/main-process/comfyServer.ts (+11 -10)
📝 src/main.ts (+8 -4)
📝 src/models/DownloadManager.ts (+10 -10)
📝 src/services/cmCli.ts (+3 -5)
📝 src/services/telemetry.ts (+5 -7)
📝 src/utils.ts (+3 -2)
📝 src/virtualEnvironment.ts (+35 -53)
📝 tests/unit/config/comfyConfigManager.test.ts (+23 -13)
📝 tests/unit/config/comfySettings.test.ts (+45 -45)
📝 tests/unit/desktopApp.test.ts (+10 -26)
📝 tests/unit/install/installationManager.test.ts (+23 -27)
📝 tests/unit/services/telemetry.test.ts (+62 -23)

📄 Description

This PR centralizes application state management by:

  1. Converting instance-scoped state to use electron-store and ComfySettings singletons
  2. Removing redundant state storage and instance variables in individual classes

General benefits of centralizing app state:

  • Single source of truth for app configuration
  • Easier debugging and testing through observable and controllable global state
  • Ability to listen and react to state changes

┆Issue is synchronized with this Notion page by Unito


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/desktop/pull/839 **Author:** [@christian-byrne](https://github.com/christian-byrne) **Created:** 2/6/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `cb-store` --- ### 📝 Commits (10+) - [`cc50c76`](https://github.com/Comfy-Org/desktop/commit/cc50c76beb38579b09ac7f3450f03b5e78b73f7c) Use electron store and comfy settings for app state - [`57d75f6`](https://github.com/Comfy-Org/desktop/commit/57d75f6cf48ca99ef77945c27a9485406931cfe0) Fix unit tests - [`b1ebaf8`](https://github.com/Comfy-Org/desktop/commit/b1ebaf82cd5ab7714af5252b503a496ca90134fd) initialize settings on first access - [`3bdc9d4`](https://github.com/Comfy-Org/desktop/commit/3bdc9d4d595fdd292734aaadd6252e97c2cef27e) Use store in install wizard and config manager - [`9db9fb8`](https://github.com/Comfy-Org/desktop/commit/9db9fb82aab4379d4df39c7131726c891685a7dd) make VirtualEnvironment use store - [`5680557`](https://github.com/Comfy-Org/desktop/commit/5680557f1ca0caebcaa4fe1dfaaef187dc444874) Remove injection of telemetry singleton - [`565e317`](https://github.com/Comfy-Org/desktop/commit/565e317199bc691c2a2ec3cd824687392768224e) Fix telemetry test - [`622442a`](https://github.com/Comfy-Org/desktop/commit/622442af5cde13aa50778ab23015f3e0b3a9ecb0) use cloned defaults - [`ba8f47a`](https://github.com/Comfy-Org/desktop/commit/ba8f47a5e7fb4864681b0707980e00d0a4d512e6) inline createComfyDirectories call - [`5f8e273`](https://github.com/Comfy-Org/desktop/commit/5f8e2730d17caf8b274868601abe12336e55cbf7) use async in settings, initialize explicitly on startup ### 📊 Changes **18 files changed** (+323 additions, -346 deletions) <details> <summary>View changed files</summary> 📝 `src/config/comfySettings.ts` (+20 -4) 📝 `src/desktopApp.ts` (+7 -14) 📝 `src/install/installWizard.ts` (+19 -31) 📝 `src/install/installationManager.ts` (+13 -18) 📝 `src/main-process/comfyDesktopApp.ts` (+13 -17) 📝 `src/main-process/comfyInstallation.ts` (+13 -37) 📝 `src/main-process/comfyServer.ts` (+11 -10) 📝 `src/main.ts` (+8 -4) 📝 `src/models/DownloadManager.ts` (+10 -10) 📝 `src/services/cmCli.ts` (+3 -5) 📝 `src/services/telemetry.ts` (+5 -7) 📝 `src/utils.ts` (+3 -2) 📝 `src/virtualEnvironment.ts` (+35 -53) 📝 `tests/unit/config/comfyConfigManager.test.ts` (+23 -13) 📝 `tests/unit/config/comfySettings.test.ts` (+45 -45) 📝 `tests/unit/desktopApp.test.ts` (+10 -26) 📝 `tests/unit/install/installationManager.test.ts` (+23 -27) 📝 `tests/unit/services/telemetry.test.ts` (+62 -23) </details> ### 📄 Description This PR centralizes application state management by: 1. Converting instance-scoped state to use electron-store and ComfySettings singletons 2. Removing redundant state storage and instance variables in individual classes General benefits of centralizing app state: - Single source of truth for app configuration - Easier debugging and testing through observable and controllable global state - Ability to listen and react to state changes ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-839-Centralize-app-state-on-store-and-comfy-settings-1926d73d3650818c9a00e10039c3c56d) by [Unito](https://www.unito.io) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 22:19:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/desktop#1142
No description provided.