Skip to content

update settings, should now no longer be lost#485

Merged
Hirogen merged 7 commits intoDevelopmentfrom
480-importing-settings-doesnt-work
Nov 4, 2025
Merged

update settings, should now no longer be lost#485
Hirogen merged 7 commits intoDevelopmentfrom
480-importing-settings-doesnt-work

Conversation

@Hirogen
Copy link
Copy Markdown
Collaborator

@Hirogen Hirogen commented Nov 3, 2025

  • update settings, should now no longer be lost
  • added old xml persister, so if the new json one fails, it tries the old one
  • new files are still saved in the json format, but old ones are converted
  • added configmanager tests
  • added load xml project, if the new json one fails

this should also fix the following issues:

added old xml persister, so if the new json one fails, it tries the old one
new files are still saved in the json format, but old ones are converted
@Hirogen Hirogen linked an issue Nov 3, 2025 that may be closed by this pull request
@Hirogen Hirogen requested a review from Copilot November 3, 2025 21:12
@Hirogen Hirogen self-assigned this Nov 3, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements settings loss prevention features for LogExpert, including import validation, atomic file writes with backup, deserialization recovery, and comprehensive unit tests. The changes add robustness to configuration management by detecting empty/corrupt settings, implementing backup recovery mechanisms, and providing better error handling.

Key Changes

  • Import validation with user confirmation for empty/default settings
  • Atomic file write operations with automatic backup creation and recovery
  • Comprehensive unit test suite covering import validation, atomic writes, and deserialization recovery
  • Enum renaming from DragOrientationsEnum to DragOrientations for consistency
  • XML persistence fallback support for legacy project files

Reviewed Changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 25 comments.

Show a summary per file
File Description
Program.cs Updated to handle ImportResult return value from config import
ConfigManager.cs Major refactoring with import validation, atomic writes, backup recovery, and settings validation
SettingsDialog.cs Updated to handle ImportResult with user confirmation flow and code style improvements
ConfigManagerTest.cs New comprehensive test suite covering all 4 priority 1 implementations
ImportResult.cs New result type for import operations with success/error/confirmation states
LoadResult.cs New result type for load operations with backup recovery information
DragOrientations.cs Renamed enum from DragOrientationsEnum for consistency
DateTimeDragControl.cs Updated to use renamed enum
LogTabWindow.designer.cs Updated to use renamed enum
Preferences.cs Updated to use renamed enum
ProjectPersister.cs Added XML fallback support for legacy project files
ProjectPersisterXML.cs New XML persistence implementation for legacy project support
PersisterXML.cs New XML persistence implementation for legacy persistence data
Persister.cs Added XML fallback support with JsonReaderException handling
.editorconfig Updated code style rules and formatting preferences
README.md Improved markdown formatting and structure
LogExpert.Core.csproj Added RootNamespace property
IConfigManager.cs Updated Import method signature to return ImportResult
Files not reviewed (1)
  • src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindow.designer.cs: Language not supported

Hirogen and others added 4 commits November 3, 2025 22:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…om/LogExperts/LogExpert into 480-importing-settings-doesnt-work

# Conflicts:
#	src/LogExpert.Core/Config/LoadResult.cs
@Hirogen Hirogen requested a review from Copilot November 4, 2025 17:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 26 out of 27 changed files in this pull request and generated 9 comments.

Files not reviewed (1)
  • src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindow.designer.cs: Language not supported
Comments suppressed due to low confidence (1)

src/LogExpert.Core/Classes/Attributes/JsonColumnizerPropertyAttribute.cs:7

  • Adding the sealed modifier to an existing attribute class could be a breaking change if external code has derived from this attribute. Verify that no external or internal code extends this attribute before making it sealed.

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