Skip to content

Fix settings autosave and publish icon configuration#707

Open
klebr55 wants to merge 1 commit intounchihugo:masterfrom
klebr55:fix/settings-reset-on-restart
Open

Fix settings autosave and publish icon configuration#707
klebr55 wants to merge 1 commit intounchihugo:masterfrom
klebr55:fix/settings-reset-on-restart

Conversation

@klebr55
Copy link
Copy Markdown

@klebr55 klebr55 commented Apr 21, 2026

This PR addresses two user-facing reliability issues observed in FluentFlyoutWPF:

Settings changes not always persisting across sessions.

Startup failures in published builds caused by a missing icon asset.

🛠️ Settings Persistence Hardening
Centralized persistence: Integrated save operations directly into property change notifications within the settings model.

Initialization Safeguards: Added logic to ensure autosave only triggers when:

The application initialization has fully completed.

The modified instance is the active settings instance.

The changed property is intended for persistence (ignoring runtime-only or XmlIgnore properties).

This refactoring eliminates the need for manual save calls throughout the codebase and ensures deterministic persistence behavior.

🚀 Publish/Runtime Reliability
Icon Declaration: Explicitly declared the application icon in the project properties.

Asset Management: Enforced the icon asset copy to the publish output directory using PreserveNewest.

This fix prevents XamlParseException and resource resolution failures in standalone builds, ensuring the icon is correctly bundled during the publish process.

⚖️ Scope and Risk
Changes are minimal and isolated to the settings persistence flow and project asset configuration.

There is no functional redesign of UI or core runtime behavior, focusing strictly on making persistence reliable and the publish output complete.

✅ Validation Performed
Build/Publish: Successfully completed a Release publish for win-x64.

Asset Verification: Confirmed the required icon asset is present in the published output folder.

Runtime Test: Verified the published executable starts correctly, persists settings immediately upon change, and survives process termination/restarts.

Log Audit: Confirmed that startup logs are clean of ERROR or WARN entries regarding resource resolution.

💡 Potential Follow-up
Consider implementing a debounce or throttle strategy for the autosave mechanism if high-frequency property changes lead to excessive disk I/O in future versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant