Delete legacy FilterCache + FilterGroup runtime+UI domains, rewire FilterPane/FilterRow consumers to FilterLibrary, gate LegacyFilterMigrator behind feature flag, fix migration retry duplicate-insertion bug, and reorganize MauiProgram#567
Conversation
There was a problem hiding this comment.
Pull request overview
This PR completes a large step in the FilterLibrary refactor by removing the legacy FilterCache/FilterGroup runtime and UI domains, rewiring remaining consumers (FilterPane/FilterRow, modal launchers, host startup) onto FilterLibrary, and hardening the legacy migration path with a feature gate and retry/idempotency protections.
Changes:
- Deleted the legacy FilterCache + FilterGroup runtime/UI slices (including preferences adapters, commands, effects/reducers, and related tests) and removed DI registrations.
- Updated UI entry points to use FilterLibrary (modal launcher API now supports an optional initial tab; FilterPane/FilterRow now read cached/preset data from FilterLibrary state and commands).
- Added a legacy-migration feature gate and improved migration retry behavior (per-section completion tracking + deduping migration candidates against existing store content), plus new/updated tests.
Reviewed changes
Copilot reviewed 88 out of 88 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/EventLogExpert.UI.Tests/Modal/ModalCoordinatorLaunchersTests.cs | Updates modal launcher tests to validate FilterLibrary modal opening (including initial tab parameter passing). |
| tests/Unit/EventLogExpert.UI.Tests/FilterPane/FilterPaneTests.cs | Adds unit coverage for FilterPane behavior when applying presets / handling load and error states via FilterLibrary. |
| tests/Unit/EventLogExpert.UI.Tests/FilterEditor/Rows/FilterRowShellTests.cs | Updates tests for FilterRowShell after removing group-mode/toggle-visibility parameters. |
| tests/Unit/EventLogExpert.UI.Tests/FilterEditor/FilterRowCachedOptionsTests.cs | Adds tests for FilterRow cached-options ordering/dedup behavior sourced from FilterLibrary entries. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterPane/FilterPaneStoreTests.cs | Removes obsolete SaveFilterGroupAction test after action chain deletion. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterPane/EffectsTests.cs | Updates FilterPane effects tests to assert RecordFilterApplied dispatches instead of FilterCache recents actions; removes group-save effect tests. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterLibrary/LegacyFilterMigratorTests.cs | Adds tests for per-section completion skipping behavior in LegacyFilterMigrator. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterLibrary/FilterLibraryEffectsTests.cs | Adds/updates tests for migration retry/idempotency and deduping behavior against existing store contents. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterGroup/FilterGroupStoreTests.cs | Deletes legacy FilterGroup tests as the domain is removed. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterGroup/FilterGroupExtensionsTests.cs | Deletes legacy FilterGroup extensions tests as the domain is removed. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterGroup/EffectsTests.cs | Deletes legacy FilterGroup effects tests as the domain is removed. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterCache/FilterCacheStoreTests.cs | Deletes legacy FilterCache tests as the domain is removed. |
| tests/Unit/EventLogExpert.Runtime.Tests/FilterCache/EffectsTests.cs | Deletes legacy FilterCache effects tests as the domain is removed. |
| tests/Unit/EventLogExpert.Runtime.Tests/DependencyInjection/RuntimeServiceCollectionExtensionsTests.cs | Updates DI resolution tests after removing legacy FilterCache/FilterGroup command facades. |
| tests/Unit/EventLogExpert.Filtering.Tests/Persistence/PersistencePolicyTests.cs | Removes the SavedFiltersStorageKey pinning test tied to the deleted legacy adapter source. |
| src/EventLogExpert/MauiProgram.cs | Reorganizes MAUI host DI wiring; registers FilterLibrary store + gated legacy preferences; moves adapter registrations into extension methods. |
| src/EventLogExpert/MainPage.xaml.cs | Switches startup loading from legacy FilterCache/FilterGroup to FilterLibrary.LoadLibrary(). |
| src/EventLogExpert/DependencyInjection/MauiProgramExtensions.cs | Introduces grouped host DI extension methods for cleaner MauiProgram composition. |
| src/EventLogExpert/App.xaml.cs | Updates App/MainPage construction to use IFilterLibraryCommands instead of legacy commands. |
| src/EventLogExpert/Adapters/Settings/FilterGroupPreferencesAdapter.cs | Deletes legacy FilterGroup preferences adapter. |
| src/EventLogExpert/Adapters/Settings/FilterCachePreferencesAdapter.cs | Deletes legacy FilterCache preferences adapter. |
| src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs | Routes “save filters as group” flow to FilterLibrary.SavePaneAsPreset and updates prompt text. |
| src/EventLogExpert/_Imports.razor | Removes legacy FilterCache/FilterGroup using directives. |
| src/EventLogExpert.UI/Modal/ModalCoordinatorLaunchers.cs | Removes legacy modal launchers and adds OpenFilterLibraryAsync(initialTab) overload behavior. |
| src/EventLogExpert.UI/FilterPane/FilterPaneAnnouncements.cs | Adds centralized announcement strings for FilterPane’s FilterLibrary-based load/error messaging. |
| src/EventLogExpert.UI/FilterPane/FilterPane.razor.cs | Rewires cached/preset logic and picker application to FilterLibrary state/commands; adds load/error announcements. |
| src/EventLogExpert.UI/FilterPane/FilterPane.razor | Updates the preset picker binding to LibraryEntryPreset IDs/names sourced from FilterLibrary state. |
| src/EventLogExpert.UI/FilterLibrary/FilterLibraryModal.razor.cs | Adds InitialTab parameter support to allow callers to select a starting tab. |
| src/EventLogExpert.UI/FilterGroup/FilterGroupSection.razor.cs | Deletes legacy FilterGroup UI component. |
| src/EventLogExpert.UI/FilterGroup/FilterGroupSection.razor | Deletes legacy FilterGroup UI component markup. |
| src/EventLogExpert.UI/FilterGroup/FilterGroupModal.razor.cs | Deletes legacy FilterGroup modal implementation. |
| src/EventLogExpert.UI/FilterGroup/FilterGroupModal.razor | Deletes legacy FilterGroup modal markup. |
| src/EventLogExpert.UI/FilterGroup/FilterGroup.razor.cs | Deletes legacy FilterGroup editor component implementation. |
| src/EventLogExpert.UI/FilterGroup/FilterGroup.razor | Deletes legacy FilterGroup editor component markup. |
| src/EventLogExpert.UI/FilterEditor/Rows/FilterRowShell.razor.cs | Removes parameters only used by legacy group-mode chrome variants. |
| src/EventLogExpert.UI/FilterEditor/Rows/FilterRowShell.razor | Simplifies shell markup after removing group-mode wrapper/inline error-row variants. |
| src/EventLogExpert.UI/FilterEditor/Rows/FilterRowActions.razor.cs | Removes ShowToggleEnabled parameter after dropping group-mode toggle suppression. |
| src/EventLogExpert.UI/FilterEditor/Rows/FilterRowActions.razor | Always renders the enable toggle now that group-mode suppression is removed. |
| src/EventLogExpert.UI/FilterEditor/FilterRow.razor.cs | Removes ParentFilterGroupId routing; sources cached options from FilterLibrary state; always uses pane commands. |
| src/EventLogExpert.UI/FilterEditor/FilterRow.razor | Removes group-mode chrome parameters from FilterRowShell usage. |
| src/EventLogExpert.UI/FilterCache/FilterCacheModal.razor.css | Deletes legacy cached-filters modal styling. |
| src/EventLogExpert.UI/FilterCache/FilterCacheModal.razor.cs | Deletes legacy cached-filters modal implementation. |
| src/EventLogExpert.UI/FilterCache/FilterCacheModal.razor | Deletes legacy cached-filters modal markup. |
| src/EventLogExpert.UI/_Imports.razor | Removes legacy runtime FilterGroup using directive. |
| src/EventLogExpert.Runtime/FilterPane/SaveFilterGroupAction.cs | Deletes legacy pane-side “save group” action. |
| src/EventLogExpert.Runtime/FilterPane/IFilterPaneCommands.cs | Removes SaveFilterGroup command from the pane command facade. |
| src/EventLogExpert.Runtime/FilterPane/FilterPaneCommands.cs | Removes dispatch method for SaveFilterGroupAction. |
| src/EventLogExpert.Runtime/FilterPane/Effects.cs | Replaces legacy recents tracking with RecordFilterApplied; removes SaveFilterGroup effect. |
| src/EventLogExpert.Runtime/FilterLibrary/NoOpLegacyFilterMigrator.cs | Adds a no-op migrator for when legacy migration is feature-disabled (keeps DI graph intact). |
| src/EventLogExpert.Runtime/FilterLibrary/LegacyMigrationFeature.cs | Adds a build-time/static flag that gates legacy migration wiring and documents removal steps. |
| src/EventLogExpert.Runtime/FilterLibrary/LegacyFilterMigrator.cs | Adds persisted section-bitmask handling so retries skip already-completed sections. |
| src/EventLogExpert.Runtime/FilterLibrary/FilterLibraryServiceCollectionExtensions.cs | Registers real vs no-op migrator based on LegacyMigrationFeature.Enabled. |
| src/EventLogExpert.Runtime/FilterLibrary/Effects.cs | Removes entries.IsEmpty migration guard; adds dedup of migration candidates against existing store contents to prevent retry duplication. |
| src/EventLogExpert.Runtime/FilterGroup/ToggleGroupFilterExcludedAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/ToggleGroupAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/SetGroupFilterExcludedAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/SetGroupFilterAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/SetGroupAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/RemoveGroupFilterAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/RemoveGroupAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/Reducers.cs | Deletes legacy FilterGroup reducers/store logic. |
| src/EventLogExpert.Runtime/FilterGroup/LoadGroupsSuccessAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/LoadGroupsAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/ImportGroupsAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterGroup/IFilterGroupPreferencesProvider.cs | Deletes legacy preferences provider interface. |
| src/EventLogExpert.Runtime/FilterGroup/IFilterGroupCommands.cs | Deletes legacy commands facade interface. |
| src/EventLogExpert.Runtime/FilterGroup/FilterGroupState.cs | Deletes legacy FilterGroup feature state. |
| src/EventLogExpert.Runtime/FilterGroup/FilterGroupNode.cs | Deletes legacy FilterGroup node model. |
| src/EventLogExpert.Runtime/FilterGroup/FilterGroupExtensions.cs | Deletes legacy FilterGroup display-hierarchy extensions. |
| src/EventLogExpert.Runtime/FilterGroup/FilterGroupCommands.cs | Deletes legacy FilterGroup commands facade implementation. |
| src/EventLogExpert.Runtime/FilterGroup/Effects.cs | Deletes legacy FilterGroup effects. |
| src/EventLogExpert.Runtime/FilterGroup/AddGroupAction.cs | Deletes legacy FilterGroup action. |
| src/EventLogExpert.Runtime/FilterCache/RemoveFavoriteFilterSuccessAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/RemoveFavoriteFilterAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/Reducers.cs | Deletes legacy FilterCache reducers/store logic. |
| src/EventLogExpert.Runtime/FilterCache/LoadFiltersSuccessAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/LoadFiltersAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/ImportFavoritesAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/IFilterCachePreferencesProvider.cs | Deletes legacy preferences provider interface. |
| src/EventLogExpert.Runtime/FilterCache/IFilterCacheCommands.cs | Deletes legacy commands facade interface. |
| src/EventLogExpert.Runtime/FilterCache/FilterCacheState.cs | Deletes legacy FilterCache feature state. |
| src/EventLogExpert.Runtime/FilterCache/FilterCacheCommands.cs | Deletes legacy FilterCache commands facade implementation. |
| src/EventLogExpert.Runtime/FilterCache/Effects.cs | Deletes legacy FilterCache effects implementation. |
| src/EventLogExpert.Runtime/FilterCache/AddRecentFilterSuccessAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/AddRecentFilterAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/AddFavoriteFilterSuccessAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/FilterCache/AddFavoriteFilterAction.cs | Deletes legacy FilterCache action. |
| src/EventLogExpert.Runtime/DependencyInjection/RuntimeServiceCollectionExtensions.cs | Removes legacy FilterCache/FilterGroup command registrations from runtime DI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1861cd7 to
c08964e
Compare
c08964e to
9c0d6fa
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 112 out of 112 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/EventLogExpert.Runtime/FilterLibrary/FilterLibrarySqliteStore.cs:362
FilterLibrarySqliteStoreno longer recognizes legacy Kind values (e.g., existing rows written with Kind="Preset"). Those rows will now deserialize as null and be silently skipped, effectively deleting users’ previously-saved presets after upgrading. Please keep backward compatibility by treating "Preset" as an alias for "FilterSet" during deserialization (and optionally rewriting on update).
…lterPane/FilterRow consumers to FilterLibrary, gate LegacyFilterMigrator behind feature flag, fix migration retry duplicate-insertion bug, and reorganize MauiProgram
9c0d6fa to
493291f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 112 out of 112 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/EventLogExpert.Runtime/FilterLibrary/FilterLibrarySqliteStore.cs:362
FilterLibrarySqliteStoreno longer recognizes legacyKind="Preset"rows, so existing filter-set/preset entries would be silently skipped on load (data loss from the user's perspective) after upgrading. The loader should treat "Preset" as an alias for the new "FilterSet" kind to preserve wire compatibility.
…s/EventLogDataQueryExtensions/ProviderSource, seal Provider models (EventModel/MessageModel/ProviderDetails), drop Runtime IVT from DatabaseTools, move 4 GetEventValues tests from Runtime.Tests to Filtering.Tests, refresh FilterCompiler XML doc post-internalize
…ing, rename 4 Helper classes to intent-based names, split Provider/Models into Resolution slice, reorganize DatabaseTools into per-operation slices with full DI-seam (factory+interface moved to DatabaseTools, OperationBase+5 ops internalized, IDatabaseToolsOperationFactory publicized), refactor EventDbTool commands to use factory via DI, rename host Adapters ClipboardAdapter/FilePickerAdapter folders + ClipboardService->MauiClipboardService, internalize TitleProvider, move ToggleWithLabel to FilterEditor/Rows, rename UiServiceCollectionExtensions->MenuServiceCollectionExtensions
Combines what would normally be Commit F + Commit G of the FilterLibrary multi-PR refactor, plus 3 supporting changes. Stacked off PR #564 (Commit E — modal redesign).
Mechanical deletions
EventLogExpert.Runtime/FilterCache/(16 files) +EventLogExpert.Runtime/FilterGroup/(19 files) entire slicesEventLogExpert.UI/FilterCache/FilterCacheModal.razor*(3 files) +EventLogExpert.UI/FilterGroup/(6 files — FilterGroup + FilterGroupModal + FilterGroupSection triples)EventLogExpert/Adapters/Settings/FilterCachePreferencesAdapter.cs+FilterGroupPreferencesAdapter.csSaveFilterGroupAction.cs+IFilterPaneCommands.SaveFilterGroup+FilterPaneCommands.SaveFilterGroup+Effects.HandleSaveFilterGroup(action chain removed)IFilterCacheCommands/IFilterGroupCommandsremoved fromRuntimeServiceCollectionExtensions; provider registrations removed fromMauiProgramFilterCache/+FilterGroup/test directories;PersistencePolicyTests.SavedFiltersStorageKey(read deleted adapter source)_Imports.razorcleanup (5 lines across 2 files)LegacyFilterMigrator.cs(which has its own private const key strings)FilterRow group-mode full cascade
ParentFilterGroupIdparameter +IFilterGroupCommandsinjection + 4 derived props (OuterCssClass, RightCssClass, ShowToggleEnabled, UseInlineErrorRow) fromFilterRow.razor.csFilterRowShell.razor.cs+FilterRowActions.razor.cs+ updated markupFilterRowShellTests.cs(deleted 1 obsolete test, updated 1 helper signature)LegacyMigrationFeature gate
LegacyMigrationFeature.cs—public static readonly bool Enabled = trueflag with TODO comment encoding the future removal contractNoOpLegacyFilterMigrator.cs— inert stub registered when flag is false (FilterLibrary.EffectsrequiresILegacyFilterMigratorctor; skipping registration would break DI)AddLegacyFilterMigrationbranches on flag;MauiProgramconditionally registersILegacyPreferencesMigration retry bug fix
if (entries.IsEmpty && legacyMigrator.ShouldRunMigration())— once the library became non-empty (user added filters via UI before migration completed), the retry path was unreachable and legacy data could be permanently stranded.entries.IsEmptyguard + added per-section flag check inLegacyFilterMigrator.BuildEntriesFromLegacy(reads persisted bitmask via newReadCompletedSections, skips already-completed sections) + newDedupMigrationEntriesAgainstExistinghelper that filters migration entries against existing store contents (LibraryEntrySavedFilter by(ComparisonText.ToLowerInvariant(), Mode, IsExcluded)tuple; LibraryEntryPreset byBuildPresetIdentityKey= name + ordered filter-content fingerprint).MarkMigrationCompletedfails → next launch would re-read still-present legacy keys and create content-duplicateUserSavedrows (the partial UNIQUE INDEX only covers AutoTracked).MauiProgram reorg
EventLogExpert/DependencyInjection/MauiProgramExtensions.cswith 5 themed extension methods:AddMauiPreferenceAdapters,AddMauiPlatformAdapters,AddMauiMenuServices,AddMauiActivationDispatcher,AddMauiAlertDialogServiceMauiProgram.CreateMauiApp(): 156 → 106 lines; restructured semantically (framework → bootstrap → provider → filter-library/legacy → layers → host groupings → singletons → eager construction)Verification
Follow-up
PR-B (stacked) will land the LPA + VSA + comment-protocol audits on the 4 newly-extracted libraries (Filtering / Provider / Provider.Database / DatabaseTools) plus any audit findings.