[PR #362] [MERGED] Settings store #818

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

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/desktop/pull/362
Author: @webfiltered
Created: 11/26/2024
Status: ✅ Merged
Merged: 12/3/2024
Merged by: @huchenlei

Base: main ← Head: settings-store


📝 Commits (10+)

  • a8dabfd Rename window settings: AppWindowSettings
  • 6676969 Add settings store, required for startup
  • 34d9353 Add shell open option to debug
  • 7f198a9 Add initial DesktopSettings type
  • 45c3748 Use app settings store for install state
  • f5fed9d Add setting store reset to resetInstall script
  • d1a1d51 Add file validation to pre-window checks
  • ce2d921 [Refactor] Desktop config store back to class
  • 64fab8d Add better handling for showing file on exit
  • 4f27889 Add documentation

📊 Changes

7 files changed (+282 additions, -27 deletions)

View changed files

📝 scripts/resetInstall.js (+41 -13)
➕ src/install/installationValidator.ts (+58 -0)
📝 src/main-process/appWindow.ts (+4 -4)
📝 src/main-process/comfyDesktopApp.ts (+46 -8)
📝 src/main.ts (+16 -1)
➕ src/store/desktopConfig.ts (+104 -0)
📝 src/store/index.ts (+13 -1)

📄 Description

Adds an electron-store config store to house desktop-specific installation state / config. Includes fairly(?) complete error handling and pre-window interaction.

config.json

{
  "basePath": "C:\\Users\\User\\Documents\\ComfyUI",
  "installState": "installed"
}
  • Install state is undefined until an install has started, 'started', or 'installed'.
    • 'upgraded' status is temporarily used when upgrading from a version prior to this PR, and changed to 'installed' when successful
  • Base path is set immediately before the install process starts
    • The base_path in extra_models_config.yaml is still the source of truth
    • basePath in config.json is used as a fallback only

Failures

If the settings store is invalid (file is present, but can't be parsed as json), the user is prompted to resolve the issue:

image

Confirmation if they choose to reset:

image

Resolves #360


🔄 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/362 **Author:** [@webfiltered](https://github.com/webfiltered) **Created:** 11/26/2024 **Status:** ✅ Merged **Merged:** 12/3/2024 **Merged by:** [@huchenlei](https://github.com/huchenlei) **Base:** `main` ← **Head:** `settings-store` --- ### 📝 Commits (10+) - [`a8dabfd`](https://github.com/Comfy-Org/desktop/commit/a8dabfd6e5ee21c29951fe914c85f46a89cb777d) Rename window settings: AppWindowSettings - [`6676969`](https://github.com/Comfy-Org/desktop/commit/66769691408d9048c2206628fa091baf341de951) Add settings store, required for startup - [`34d9353`](https://github.com/Comfy-Org/desktop/commit/34d9353918c34fef46d868a35b449f04bf16e690) Add shell open option to debug - [`7f198a9`](https://github.com/Comfy-Org/desktop/commit/7f198a9c5623d3e1bdeab32d2afea8b30b643f6f) Add initial DesktopSettings type - [`45c3748`](https://github.com/Comfy-Org/desktop/commit/45c37485b835ec87c2b72e3e95e2a96387d32ade) Use app settings store for install state - [`f5fed9d`](https://github.com/Comfy-Org/desktop/commit/f5fed9dfe0844f0ad79193bc68dc9e1bbe710fa1) Add setting store reset to resetInstall script - [`d1a1d51`](https://github.com/Comfy-Org/desktop/commit/d1a1d5134beafbd3868d5aa1a00d3ec98bbbfc76) Add file validation to pre-window checks - [`ce2d921`](https://github.com/Comfy-Org/desktop/commit/ce2d921d0a1baec9b6bc63111ff94eb2b8958059) [Refactor] Desktop config store back to class - [`64fab8d`](https://github.com/Comfy-Org/desktop/commit/64fab8d63780bff18f0c093a7c84eacfcc18e0af) Add better handling for showing file on exit - [`4f27889`](https://github.com/Comfy-Org/desktop/commit/4f27889919ebe7f89c482bbd3993ea8fafb091f5) Add documentation ### 📊 Changes **7 files changed** (+282 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `scripts/resetInstall.js` (+41 -13) ➕ `src/install/installationValidator.ts` (+58 -0) 📝 `src/main-process/appWindow.ts` (+4 -4) 📝 `src/main-process/comfyDesktopApp.ts` (+46 -8) 📝 `src/main.ts` (+16 -1) ➕ `src/store/desktopConfig.ts` (+104 -0) 📝 `src/store/index.ts` (+13 -1) </details> ### 📄 Description Adds an electron-store config store to house desktop-specific installation state / config. Includes fairly(?) complete error handling and pre-window interaction. ### `config.json` ```json { "basePath": "C:\\Users\\User\\Documents\\ComfyUI", "installState": "installed" } ``` - Install state is `undefined` until an install has started, `'started'`, or `'installed'`. - `'upgraded'` status is temporarily used when upgrading from a version prior to this PR, and changed to `'installed'` when successful - Base path is set immediately before the install process starts - The `base_path` in `extra_models_config.yaml` is still the source of truth - `basePath` in config.json is used as a fallback only ### Failures If the settings store is invalid (file is present, but can't be parsed as json), the user is prompted to resolve the issue: ![image](https://github.com/user-attachments/assets/400dfb8d-6a5b-4711-8c90-75bf7f8a26c8) Confirmation if they choose to reset: ![image](https://github.com/user-attachments/assets/a3354f96-4599-437f-91e4-5d141dd5b339) Resolves #360 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 22:17:10 +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#818
No description provided.