Fix settings autosave and publish icon configuration#707
Open
klebr55 wants to merge 1 commit intounchihugo:masterfrom
Open
Fix settings autosave and publish icon configuration#707klebr55 wants to merge 1 commit intounchihugo:masterfrom
klebr55 wants to merge 1 commit intounchihugo:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.