Skip to content

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

Merged
NikTilton merged 3 commits into
mainfrom
jschick/library-modal-rewire
Jun 4, 2026

Conversation

@jschick04
Copy link
Copy Markdown
Collaborator

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

  • Runtime: EventLogExpert.Runtime/FilterCache/ (16 files) + EventLogExpert.Runtime/FilterGroup/ (19 files) entire slices
  • UI: EventLogExpert.UI/FilterCache/FilterCacheModal.razor* (3 files) + EventLogExpert.UI/FilterGroup/ (6 files — FilterGroup + FilterGroupModal + FilterGroupSection triples)
  • Host: EventLogExpert/Adapters/Settings/FilterCachePreferencesAdapter.cs + FilterGroupPreferencesAdapter.cs
  • Pane-side seams: SaveFilterGroupAction.cs + IFilterPaneCommands.SaveFilterGroup + FilterPaneCommands.SaveFilterGroup + Effects.HandleSaveFilterGroup (action chain removed)
  • DI cleanup: IFilterCacheCommands/IFilterGroupCommands removed from RuntimeServiceCollectionExtensions; provider registrations removed from MauiProgram
  • Test deletions: legacy FilterCache/ + FilterGroup/ test directories; PersistencePolicyTests.SavedFiltersStorageKey (read deleted adapter source)
  • _Imports.razor cleanup (5 lines across 2 files)
  • Grep gate: zero references to deleted types outside LegacyFilterMigrator.cs (which has its own private const key strings)

FilterRow group-mode full cascade

  • Removed ParentFilterGroupId parameter + IFilterGroupCommands injection + 4 derived props (OuterCssClass, RightCssClass, ShowToggleEnabled, UseInlineErrorRow) from FilterRow.razor.cs
  • Removed dead parameters from FilterRowShell.razor.cs + FilterRowActions.razor.cs + updated markup
  • Updated FilterRowShellTests.cs (deleted 1 obsolete test, updated 1 helper signature)

LegacyMigrationFeature gate

  • NEW LegacyMigrationFeature.cspublic static readonly bool Enabled = true flag with TODO comment encoding the future removal contract
  • NEW NoOpLegacyFilterMigrator.cs — inert stub registered when flag is false (FilterLibrary.Effects requires ILegacyFilterMigrator ctor; skipping registration would break DI)
  • AddLegacyFilterMigration branches on flag; MauiProgram conditionally registers ILegacyPreferences

Migration retry bug fix

  • Before: 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.
  • After: dropped the entries.IsEmpty guard + added per-section flag check in LegacyFilterMigrator.BuildEntriesFromLegacy (reads persisted bitmask via new ReadCompletedSections, skips already-completed sections) + new DedupMigrationEntriesAgainstExisting helper that filters migration entries against existing store contents (LibraryEntrySavedFilter by (ComparisonText.ToLowerInvariant(), Mode, IsExcluded) tuple; LibraryEntryPreset by BuildPresetIdentityKey = name + ordered filter-content fingerprint).
  • Dedup defends against the SetString-throws-then-retry duplication scenario where AddRange succeeds but MarkMigrationCompleted fails → next launch would re-read still-present legacy keys and create content-duplicate UserSaved rows (the partial UNIQUE INDEX only covers AutoTracked).
  • 7 new tests covering retry/partial/disabled/dedup/same-name-different-filters preset survival.

MauiProgram reorg

  • NEW EventLogExpert/DependencyInjection/MauiProgramExtensions.cs with 5 themed extension methods: AddMauiPreferenceAdapters, AddMauiPlatformAdapters, AddMauiMenuServices, AddMauiActivationDispatcher, AddMauiAlertDialogService
  • MauiProgram.CreateMauiApp(): 156 → 106 lines; restructured semantically (framework → bootstrap → provider → filter-library/legacy → layers → host groupings → singletons → eager construction)
  • Bit-for-bit DI registration preservation modulo the intentional removals

Verification

  • Build: 0 warnings, 0 errors
  • Tests: UI 478, Runtime 1051 (+5 new migration/dedup tests), Filtering 868 — all green
  • §2D 5-reviewer panel: claude-opus-4.7-xhigh / gpt-5.5 / gpt-5.3-codex / gpt-5.4 / claude-opus-4.8 (rubber-duck)
  • Panel iterations: R1 (3 NEEDS, 2 READY on dedup) → R2 (3 READY, 2 NEEDS on preset name-only) → R3 (5/5 UNANIMOUS READY)
  • 2 fix iterations out of cap=3

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.

Copilot AI review requested due to automatic review settings June 3, 2026 20:04
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 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.

Comment thread src/EventLogExpert.Runtime/FilterLibrary/Effects.cs Outdated
Comment thread src/EventLogExpert.UI/FilterPane/FilterPane.razor Outdated
Comment thread src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs Outdated
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 89 out of 89 changed files in this pull request and generated 2 comments.

Comment thread src/EventLogExpert.UI/FilterPane/FilterPane.razor Outdated
Comment thread src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs Outdated
@jschick04 jschick04 force-pushed the jschick/library-modal-rewire branch from c08964e to 9c0d6fa Compare June 3, 2026 22:40
@jschick04 jschick04 requested a review from Copilot June 3, 2026 22:40
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 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

  • FilterLibrarySqliteStore no 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).

Comment thread src/EventLogExpert.Runtime/FilterLibrary/LibraryEntry.cs
Comment thread tests/Unit/EventLogExpert.UI.Tests/FilterLibrary/LibraryEntryRowTests.cs Outdated
…lterPane/FilterRow consumers to FilterLibrary, gate LegacyFilterMigrator behind feature flag, fix migration retry duplicate-insertion bug, and reorganize MauiProgram
@jschick04 jschick04 force-pushed the jschick/library-modal-rewire branch from 9c0d6fa to 493291f Compare June 3, 2026 22:53
@jschick04 jschick04 requested a review from Copilot June 3, 2026 22:54
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 112 out of 112 changed files in this pull request and generated 1 comment.

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 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

  • FilterLibrarySqliteStore no longer recognizes legacy Kind="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.

Comment thread src/EventLogExpert.Runtime/FilterLibrary/LibraryEntry.cs
jschick04 added 2 commits June 3, 2026 22:48
…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
@NikTilton NikTilton merged commit f828a8b into main Jun 4, 2026
7 checks passed
@NikTilton NikTilton deleted the jschick/library-modal-rewire branch June 4, 2026 14:02
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.

3 participants