Overview and Save BehaviorUpdated 4 hours ago
Summary
- The Global Settings screen centralizes configuration for the entire FMX application.
- Changes you make in tabs update the in-memory configuration immediately for preview/testing.
- Nothing is written to disk until you click the Save Changes button on the Global Settings screen.
Where settings are stored
- Path (source tree): C:/FMX/appsettings.json
- Format: JSON, human-readable, versioned by app updates
In-memory vs disk: how changes apply
- Immediate preview (in-memory):
- When you adjust a control (e.g., toggle, slider, dropdown) the setting updates the live runtime state immediately where supported.
- This enables testing before committing.
- Persist to disk (by user action):
- Persisting requires an explicit Save via the Save Changes button.
- If you close FMX or switch projects without saving, in-memory changes are discarded on next launch.
- Error behavior:
- If a save fails, your in-memory changes remain active; you can correct the issue and try saving again.
Single point of control for saving
- Designated save entry point:
- Only the Save Changes button in GlobalSettingsView writes to appsettings.json.
- It performs validation, logs with the [SAVE-BUTTON] prefix, and shows user feedback via Snackbar.
- What happens on save:
- Validate settings across all tabs.
- If valid write appsettings.json atomically if supported by the environment.
- Show a Snackbar with success or error (see UI feedback below).
- Logging (if enabled):
- Success: [SAVE-BUTTON] Settings saved successfully
- Validation fail: [SAVE-BUTTON] Validation error: <details>
- IO fail: [SAVE-BUTTON] Save failed: <exception>
Allowed exception: selected Event
- Event selection updates may save the selected Event ID immediately using SaveSelectedEventToSettings() (internally calls settingsService.SaveAsync()).
- This is the only allowed exception to the “Save button only” policy because event selection is critical for sync and state management.
- No other general settings should persist automatically on property changes.
What does not save automatically (examples)
- Changing camera, audio, display, media, or sharing options in tabs does not persist to disk until Save Changes is clicked.
- Adjusting workflow, triggers, sync toggles, or diagnostics levels also requires Save Changes.
- Bulk edits or importing presets still require an explicit Save to commit.
Recommended workflow
Step-by-step:
- Open Global Settings and navigate to the relevant tab(s).
- Adjust values and verify behavior live (where supported).
- Click Save Changes.
- Look for the Snackbar confirmation. If an error appears, fix issues and save again.
UI feedback (Snackbar)
- Success (uses centralized status resources):
- Style: SnackbarWarning/Error styles are reserved for status; success uses the app’s default success/info style.
- Message: “Settings saved successfully.”
- Error (must follow project status style):
- Color: Error #FF5630
- Icon: Error icon per centralized resources
- Message: concise cause + “See logs for details.”
- Warning (non-blocking issues):
- Color: Warning #FFAB00
- Icon: Warning icon per centralized resources
- Message: guidance on potential side effects
Backup, restore, and reset
- Backup:
- Manually copy Config/appsettings.json before large edits or upgrades.
- Restore:
- Replace with a known-good backup while FMX is closed, then reopen FMX.
- Reset to defaults:
- Otherwise, replace appsettings.json with a default template from your version’s distribution.
Troubleshooting
- Settings revert after restart:
- You likely didn’t click Save Changes. Reopen Global Settings, reapply, then Save.
- Save button disabled:
- One or more tabs may be in an invalid state. Resolve inline validation errors first.
- Save fails (IO/permissions):
- Ensure write permission to the config directory. Check disk space and antivirus/EDR interference. Review logs.
- Unsaved edits lost after a crash/restart:
- In-memory changes are not persisted until saved. Reapply and Save.
Quick checklist (operators)
Make edits → Verify behavior → Click Save Changes → Confirm Snackbar → Optionally back up appsettings.json
Do/Don’t summary
- Do use only the Save Changes button to persist general settings.
- Do look for [SAVE-BUTTON] entries in logs when auditing saves.
- Don’t rely on auto-save; it is intentionally disabled by design.