Skip to content

Commit 9439b31

Browse files
docs: weekly documentation accuracy update
1 parent 3effe71 commit 9439b31

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ When referencing Comfy-Org repos:
9191

9292
### Settings Usage
9393
```typescript
94+
import { useSettingStore } from '@/platform/settings/settingStore'
95+
9496
const settingStore = useSettingStore()
9597
const value = settingStore.get('Comfy.SomeSetting') // Get setting
9698
await settingStore.set('Comfy.SomeSetting', newValue) // Update setting

docs/SETTINGS.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
ComfyUI frontend uses a comprehensive settings system for user preferences with support for dynamic defaults, version-based rollouts, and environment-aware configuration.
66

77
### Settings Architecture
8-
- Settings are defined as `SettingParams` in `src/constants/coreSettings.ts`
8+
- Settings are defined as `SettingParams` in `src/platform/settings/constants/coreSettings.ts`
99
- Registered at app startup, loaded/saved via `useSettingStore` (Pinia)
1010
- Persisted per user via backend `/settings` endpoint
1111
- If a value hasn't been set by the user, the store returns the computed default
1212

1313
```typescript
14-
// From src/stores/settingStore.ts:105-122
14+
// From src/platform/settings/settingStore.ts
1515
function getDefaultValue<K extends keyof Settings>(
1616
key: K
1717
): Settings[K] | undefined {
@@ -48,7 +48,7 @@ await newUserService().initializeIfNewUser(settingStore)
4848
You can compute defaults dynamically using function defaults that access runtime context:
4949

5050
```typescript
51-
// From src/constants/coreSettings.ts:94-101
51+
// From src/platform/settings/constants/coreSettings.ts
5252
{
5353
id: 'Comfy.Sidebar.Size',
5454
// Default to small if the window is less than 1536px(2xl) wide
@@ -57,7 +57,7 @@ You can compute defaults dynamically using function defaults that access runtime
5757
```
5858

5959
```typescript
60-
// From src/constants/coreSettings.ts:306
60+
// From src/platform/settings/constants/coreSettings.ts
6161
{
6262
id: 'Comfy.Locale',
6363
defaultValue: () => navigator.language.split('-')[0] || 'en'
@@ -68,7 +68,7 @@ You can compute defaults dynamically using function defaults that access runtime
6868
You can vary defaults by installed frontend version using `defaultsByInstallVersion`:
6969

7070
```typescript
71-
// From src/stores/settingStore.ts:129-150
71+
// From src/platform/settings/settingStore.ts
7272
function getVersionedDefaultValue<K extends keyof Settings, TValue = Settings[K]>(
7373
key: K,
7474
param: SettingParams<TValue> | undefined
@@ -98,7 +98,7 @@ function getVersionedDefaultValue<K extends keyof Settings, TValue = Settings[K]
9898
Example versioned defaults from codebase:
9999

100100
```typescript
101-
// From src/constants/coreSettings.ts:38-40
101+
// From src/platform/settings/constants/coreSettings.ts
102102
{
103103
id: 'Comfy.Graph.LinkReleaseAction',
104104
defaultValue: LinkReleaseTriggerAction.CONTEXT_MENU,
@@ -217,7 +217,7 @@ await settingStore.set(
217217
Values are stored per user via the backend. The store writes through API and falls back to defaults when not set:
218218

219219
```typescript
220-
// From src/stores/settingStore.ts:73-75
220+
// From src/platform/settings/settingStore.ts
221221
onChange(settingsById.value[key], newValue, oldValue)
222222
settingValues.value[key] = newValue
223223
await api.storeSetting(key, newValue)
@@ -242,7 +242,7 @@ await settingStore.set('Comfy.SomeSetting', newValue)
242242
Settings support migration from deprecated values:
243243

244244
```typescript
245-
// From src/stores/settingStore.ts:68-69, 172-175
245+
// From src/platform/settings/settingStore.ts
246246
const newValue = tryMigrateDeprecatedValue(
247247
settingsById.value[key],
248248
clonedValue
@@ -262,7 +262,7 @@ if (settingValues.value[setting.id] !== undefined) {
262262
Settings can define onChange callbacks that receive the setting definition, new value, and old value:
263263

264264
```typescript
265-
// From src/stores/settingStore.ts:73, 177
265+
// From src/platform/settings/settingStore.ts
266266
onChange(settingsById.value[key], newValue, oldValue) // During set()
267267
onChange(setting, get(setting.id), undefined) // During addSetting()
268268
```

0 commit comments

Comments
 (0)