Skip to content

Component decomposition + FilterLibrary write-gate serialization (#540)#575

Merged
NikTilton merged 18 commits into
mainfrom
jschick/component-structure-540
Jun 9, 2026
Merged

Component decomposition + FilterLibrary write-gate serialization (#540)#575
NikTilton merged 18 commits into
mainfrom
jschick/component-structure-540

Conversation

@jschick04

Copy link
Copy Markdown
Collaborator

Resolves #540.

Track A — JS module interop centralization

  • New static JsModuleInterop.ImportModuleAsync + DisposeModuleSafelyAsync helper with the canonical 4-clause catch + optional pre-dispose callback.
  • 13 file bucketed migration of all 16 JS module disposal sites across 14 consumers / 5 inheritance contexts.
  • 9 helper unit tests.

Track B — LogTablePane decomposition prototype

  • Snapshot-in/decision-out extractions: EventSelection (12 tests), EventRowStyle (11 tests), EventColumnLayout (6 tests).
  • 9 mouse-selection characterization tests + 2 render tests as the structural-correctness payoff.
  • LogTablePane reduced by ~170 LOC; Fluxor/Blazor stays at the boundary; pure services tested at ms-level.

FilterLibrary async-store conversion + race resolution

  • FilterLibrarySqliteStore converted to async ADO.NET.
  • Async conversion surfaced lost-update races across 6+ Effects methods. Closed iteratively:
    • _writeGate semaphore serializing ALL FilterLibrary writes (replaces _migrationGate).
    • PersistAndDispatchAsync helper with ReferenceEquals no-op early-exit + re-issue against latest snapshot + LoadLibraryAction resync on re-issue failure.
    • ApplyBulkTagUpdate re-orders re-issue before dispatch; on re-issue failure falls back to LoadLibrary + announce + TagBulkUpdateFailedAction.
    • AppendFilterToSetIfMissing idempotent — dedup tuple (lower(ComparisonText), Mode, IsExcluded) checked inside the mutate lambda so concurrent-add sees the latest committed state.
    • 3 partial-field actions (SetEntryNameAction, SetEntryTagsAction, SetFilterSetFiltersAction) replace full-entry updates for single-field UI flows; 9 UI sites refactored.
    • DebugLogService now IAsyncDisposable with try-finally Mutex disposal symmetric across sync/async paths.
    • IpcMessageWriter extracted with volatile _disposed + DisposeAsync TOCTOU guard; backed by 3 new integration tests.

Structure / cleanup

  • LogRecord promoted to EventLogExpert.Logging library; DatabaseTools operations async-dispose.
  • IPC envelope vocabulary renamed to message; IpcSinks.cs split into IpcLogSink.cs + IpcProgressSink.cs.
  • FilterRegexFactory consolidated into shared EventLogExpert.DatabaseTools.Common.
  • Root-level types reorganized into feature folders (FilterCompiler->Compilation, WindowsPlatform->Activation, ElevationHelper->Ipc/Operations/Diagnostics, etc.).
  • Em-dash sweep + comment cleanup across branch-touched files.
  • New EventLogExpert.DatabaseTools.Tests + EventLogExpert.Logging.Tests unit-test projects.

Tests

  • Runtime: 1182 (+14 - race-fix + write-gate serialization + re-issue fallback + partial-field actions).
  • UI: 635 (+21 - LogTablePane characterization + EventSelection/RowStyle/ColumnLayout extractions + partial-field dispatch shape).
  • DatabaseTools.Tests: 16 (new project).
  • Logging.Tests: 7 (new project).
  • ElevationHelper integration: 15 (new Ipc/IpcMessageWriterTests).
  • Filtering 872, Windows 43, EventDbTool 3, Provider 35, Provider.Database 43, Eventing 230 - unchanged.

Panel

7 fix-and-re-panel rounds (heavy_6 initial; 4-reviewer floor for late rounds - Claude rubber-duck + 3 code-review across GPT premium/codex + Gemini). Final round: unanimous READY, zero findings.

Design artifact: component-architecture-design.md (session-only - not committed; promotion to repo docs is a follow-up).

Copilot AI review requested due to automatic review settings June 9, 2026 03:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 performs a broad refactor to improve testability and reliability across the UI and runtime layers by (1) centralizing JS module lifecycle handling, (2) decomposing LogTablePane-adjacent behaviors with new characterization tests, and (3) converting FilterLibrary persistence and DatabaseTools IPC/logging to async + serialized write patterns.

Changes:

  • Centralizes Blazor JS module teardown via JsModuleInterop.DisposeModuleSafelyAsync, and migrates multiple UI components to use it.
  • Introduces async-first DatabaseTools plumbing (IPC “message” vocabulary, async provider/source enumeration, LogRecord promotion) with updated unit/integration tests and new test projects.
  • Converts FilterLibrary store interface + SQLite implementation to async and introduces narrower “partial-field” commands/actions used by UI flows.

Reviewed changes

Copilot reviewed 102 out of 102 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/EventLogExpert.Windows.Tests/EvtxFolderEnumeratorTests.cs Updates imports for WindowsPlatform Activation namespace split.
tests/Unit/EventLogExpert.Windows.Tests/ActivationTokenClassifierTests.cs Updates imports for WindowsPlatform Activation namespace split.
tests/Unit/EventLogExpert.Windows.Tests/ActivationDispatcherTests.cs Reorders/edits tests and updates Activation namespace + comment punctuation.
tests/Unit/EventLogExpert.UI.Tests/TestUtils/LogTablePaneDependenciesExtensions.cs Adds DI helper to register LogTablePane test dependencies.
tests/Unit/EventLogExpert.UI.Tests/LogTable/LogTablePaneSelectionTests.cs Adds bUnit characterization tests for LogTablePane selection/rendering.
tests/Unit/EventLogExpert.UI.Tests/JsModuleInteropTests.cs Adds unit tests for safe JS module disposal helper.
tests/Unit/EventLogExpert.UI.Tests/FilterLibrary/LibraryEntryRowTests.cs Updates tests to assert new partial-field tag command API.
tests/Unit/EventLogExpert.UI.Tests/FilterLibrary/LibraryEntryFilterEditorTests.cs Updates tests to assert new partial-field filter-set update API.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/Elevation/ElevatedDatabaseToolsRunnerTests.cs Updates runner tests for IPC “message” vocabulary + LogRecord.
tests/Unit/EventLogExpert.Runtime.Tests/DatabaseTools/DatabaseToolsServiceTests.cs Updates service tests to consume LogRecord instead of old log entry type.
tests/Unit/EventLogExpert.Logging.Tests/Sinks/StreamingTraceLoggerTests.cs Moves/updates logger tests for new logging assembly + LogRecord.
tests/Unit/EventLogExpert.Logging.Tests/GlobalUsings.cs Adds test project global usings.
tests/Unit/EventLogExpert.Logging.Tests/EventLogExpert.Logging.Tests.csproj Adds new Logging test project referencing Logging library.
tests/Unit/EventLogExpert.Filtering.Tests/FilterCompilerTests.cs Updates imports for relocated Filtering compilation namespace.
tests/Unit/EventLogExpert.Filtering.Tests/Drafts/FilterDraftTests.cs Updates imports for relocated Filtering compilation namespace.
tests/Unit/EventLogExpert.EventDbTool.Tests/FilterRegexFactoryTests.cs Removes tests tied to old CLI-local FilterRegexFactory location.
tests/Unit/EventLogExpert.DatabaseTools.Tests/GlobalUsings.cs Adds DatabaseTools test project global usings.
tests/Unit/EventLogExpert.DatabaseTools.Tests/EventLogExpert.DatabaseTools.Tests.csproj Adds new DatabaseTools unit test project.
tests/Unit/EventLogExpert.DatabaseTools.Tests/Common/Ipc/IpcMessageRoundTripTests.cs Updates IPC round-trip tests for “message” base type + renamed records.
tests/Unit/EventLogExpert.DatabaseTools.Tests/Common/FilterRegexFactoryTests.cs Adds tests for shared DatabaseTools FilterRegexFactory.
tests/Integration/EventLogExpert.Runtime.IntegrationTests/FilterLibrary/FilterLibraryMigrationIntegrationTests.cs Updates integration tests for async FilterLibrary store API.
tests/Integration/EventLogExpert.Runtime.IntegrationTests/DebugLog/DebugLogServiceTests.cs Adds disposal/idempotency tests for sync + async DebugLogService disposal.
tests/Integration/EventLogExpert.ElevationHelper.IntegrationTests/OperationsEndToEndTests.cs Updates integration tests for LogRecord sink type.
tests/Integration/EventLogExpert.ElevationHelper.IntegrationTests/Ipc/IpcMessageWriterTests.cs Adds integration tests for new IPC message writer disposal/write behavior.
tests/Integration/EventLogExpert.ElevationHelper.IntegrationTests/DestructiveRecoveryTests.cs Updates integration tests for LogRecord sink type.
tests/Integration/EventLogExpert.DatabaseTools.IntegrationTests/Sources/ProviderSourceTests.cs Converts schema validation tests to async API.
src/EventLogExpert/Platforms/Windows/Activation/ActivationArgsExtractor.cs Updates imports after Activation types move.
src/EventLogExpert/DependencyInjection/MauiProgramExtensions.cs Updates imports after Activation types move.
src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs Updates imports and normalizes comment punctuation.
src/EventLogExpert.WindowsPlatform/Activation/EvtxFolderEnumerator.cs Moves type into EventLogExpert.WindowsPlatform.Activation namespace.
src/EventLogExpert.WindowsPlatform/Activation/EvtxEnumerationResult.cs Moves type into EventLogExpert.WindowsPlatform.Activation namespace.
src/EventLogExpert.WindowsPlatform/Activation/ActivationTokenClassifier.cs Moves type into EventLogExpert.WindowsPlatform.Activation namespace.
src/EventLogExpert.WindowsPlatform/Activation/ActivationDispatcher.cs Moves type into EventLogExpert.WindowsPlatform.Activation namespace.
src/EventLogExpert.UI/Modal/SidebarTabs.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/Modal/ModalChrome.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/Menu/MenuRenderer.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/Menu/MenuHost.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/Menu/MenuBar.razor.cs Migrates JS module teardown and updates menu text ellipsis style.
src/EventLogExpert.UI/LogTable/LogTablePane.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/LogTable/LogTabBar.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/Keyboard/KeyboardShortcutService.cs Replaces local dispose helper with centralized JsModuleInterop helper.
src/EventLogExpert.UI/Inputs/ValueSelect.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/FilterPane/FilterPane.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/FilterLibrary/LibraryEntryRow.razor.cs Switches to partial-field FilterLibrary commands + centralized JS disposal.
src/EventLogExpert.UI/FilterLibrary/LibraryEntryFilterEditor.razor.cs Switches to partial-field FilterLibrary commands for filter-set updates.
src/EventLogExpert.UI/DetailsPane/DetailsPane.razor.cs Migrates JS module teardown to centralized JsModuleInterop helper.
src/EventLogExpert.UI/DependencyInjection/UiServiceCollectionExtensions.cs Comment punctuation normalization.
src/EventLogExpert.UI/DatabaseTools/Tabs/UpgradeDatabaseTab.razor.cs Updates log sink type to LogRecord.
src/EventLogExpert.UI/DatabaseTools/Tabs/ShowProvidersTab.razor.cs Uses shared FilterRegexFactory + updates log sink type to LogRecord.
src/EventLogExpert.UI/DatabaseTools/Tabs/MergeDatabaseTab.razor.cs Updates log sink type to LogRecord.
src/EventLogExpert.UI/DatabaseTools/Tabs/DiffDatabasesTab.razor.cs Updates log sink type to LogRecord.
src/EventLogExpert.UI/DatabaseTools/Tabs/DatabaseToolsTabBase.cs Updates buffering/logging pipeline to LogRecord and string punctuation.
src/EventLogExpert.UI/DatabaseTools/Tabs/CreateDatabaseTab.razor.cs Uses shared FilterRegexFactory + updates log sink type to LogRecord.
src/EventLogExpert.UI/DatabaseTools/DatabaseToolsLogView.razor.cs Updates UI log view to render LogRecord + centralized JS disposal.
src/EventLogExpert.UI/Common/Interop/JsModuleInterop.cs Adds centralized JS module import/dispose helper.
src/EventLogExpert.Runtime/FilterLibrary/SetFilterSetFiltersAction.cs Adds partial-field action for filter-set filters updates.
src/EventLogExpert.Runtime/FilterLibrary/SetEntryTagsAction.cs Adds partial-field action for tags updates.
src/EventLogExpert.Runtime/FilterLibrary/SetEntryNameAction.cs Adds partial-field action for entry rename updates.
src/EventLogExpert.Runtime/FilterLibrary/IFilterLibraryStore.cs Converts FilterLibrary store interface to async API surface.
src/EventLogExpert.Runtime/FilterLibrary/IFilterLibraryCommands.cs Adds partial-field command APIs and adjusts formatting.
src/EventLogExpert.Runtime/FilterLibrary/FilterLibrarySqliteStore.cs Converts SQLite store implementation to async ADO.NET usage.
src/EventLogExpert.Runtime/FilterLibrary/FilterLibraryCommands.cs Wires new partial-field commands to Fluxor actions.
src/EventLogExpert.Runtime/DependencyInjection/RuntimeServiceCollectionExtensions.cs Comment/formatting adjustments in runtime DI docs.
src/EventLogExpert.Runtime/DebugLog/DebugLogService.cs Adds IAsyncDisposable, idempotent disposal guards, and async dispose path.
src/EventLogExpert.Runtime/DatabaseTools/IDatabaseToolsService.cs Updates log sink type to LogRecord and doc punctuation.
src/EventLogExpert.Runtime/DatabaseTools/Elevation/IElevatedHelperProcess.cs Updates IPC docs to “message” terminology.
src/EventLogExpert.Runtime/DatabaseTools/Elevation/IElevatedDatabaseToolsRunner.cs Updates log sink type to LogRecord and IPC docs.
src/EventLogExpert.Runtime/DatabaseTools/Elevation/ElevatedDatabaseToolsRunner.cs Renames IPC envelope->message, updates serialization + mirroring + cancellation flow.
src/EventLogExpert.Runtime/DatabaseTools/DatabaseToolsService.cs Updates logging pipeline to LogRecord + moved StreamingTraceLogger namespace.
src/EventLogExpert.Logging/Sinks/StreamingTraceLogger.cs Promotes/moves logger sink to Logging library and switches to LogRecord.
src/EventLogExpert.Logging/Abstractions/LogRecord.cs Promotes DatabaseToolsLogEntry to shared LogRecord in Logging abstractions.
src/EventLogExpert.Filtering/Persistence/SavedFilter.cs Updates imports for relocated Filtering compilation namespace.
src/EventLogExpert.Filtering/Drafts/FilterDraft.cs Updates imports for relocated Filtering compilation namespace.
src/EventLogExpert.Filtering/Compilation/FilterCompiler.cs Moves compiler into EventLogExpert.Filtering.Compilation namespace.
src/EventLogExpert.EventDbTool/Commands/Support/FilterRegexFactory.cs Removes CLI-local FilterRegexFactory in favor of shared implementation.
src/EventLogExpert.EventDbTool/Commands/ShowCommand.cs Updates to shared FilterRegexFactory API and error reporting.
src/EventLogExpert.EventDbTool/Commands/CreateDatabaseCommand.cs Updates to shared FilterRegexFactory API and error reporting.
src/EventLogExpert.ElevationHelper/ProgramEntry.cs Refactors helper entrypoint to use IPC message reader/writer types.
src/EventLogExpert.ElevationHelper/Operations/OperationDispatcher.cs Moves dispatcher into Operations namespace and updates log sink to LogRecord.
src/EventLogExpert.ElevationHelper/Operations/DestructiveRecovery.cs Moves destructive recovery wrapper into Operations namespace and updates wording.
src/EventLogExpert.ElevationHelper/IpcSinks.cs Removes legacy envelope-based sinks after splitting into dedicated files.
src/EventLogExpert.ElevationHelper/Ipc/IpcProgressSink.cs Adds progress sink that writes ProgressMessage over IPC.
src/EventLogExpert.ElevationHelper/Ipc/IpcMessageWriter.cs Adds serialized IPC message writer implementation.
src/EventLogExpert.ElevationHelper/Ipc/IpcMessageReader.cs Renames envelope reader to message reader and updates terminology.
src/EventLogExpert.ElevationHelper/Ipc/IpcLogSink.cs Adds log sink that writes LogMessage over IPC from LogRecord.
src/EventLogExpert.ElevationHelper/EventLogExpert.ElevationHelper.csproj Adds InternalsVisibleTo for helper integration tests.
src/EventLogExpert.ElevationHelper/Diagnostics/ProbeMode.cs Moves probe collector into Diagnostics namespace and updates message types.
src/EventLogExpert.DatabaseTools/UpgradeDatabase/UpgradeDatabaseOperation.cs Converts to async and uses async-dispose for DbContext.
src/EventLogExpert.DatabaseTools/ShowProviders/ShowProvidersOperation.cs Converts provider enumeration to async streaming via ProviderSource APIs.
src/EventLogExpert.DatabaseTools/MergeDatabase/MergeDatabaseOperation.cs Converts provider source loading and some EF queries to async.
src/EventLogExpert.DatabaseTools/DiffDatabase/DiffDatabaseOperation.cs Uses async schema validation + async provider enumeration + async cleanup.
src/EventLogExpert.DatabaseTools/CreateDatabase/CreateDatabaseOperation.cs Uses async provider enumeration + async cleanup and skip-name loading.
src/EventLogExpert.DatabaseTools/Common/Operations/ProviderSource.cs Converts provider discovery/loading/schema validation to async APIs.
src/EventLogExpert.DatabaseTools/Common/Operations/OperationBase.cs Adds async cleanup helper and async wrapper for local provider enumeration.
src/EventLogExpert.DatabaseTools/Common/Ipc/RegexJsonConverter.cs Updates docs for IPC “message” vocabulary.
src/EventLogExpert.DatabaseTools/Common/Ipc/DatabaseToolsIpcMessage.cs Renames IPC base/records from Envelope->Message and updates docs.
src/EventLogExpert.DatabaseTools/Common/Ipc/DatabaseToolsIpcJsonContext.cs Updates source-gen JSON context registrations for message types.
src/EventLogExpert.DatabaseTools/Common/FilterRegexFactory.cs Adds shared FilterRegexFactory (UI/CLI can surface errors consistently).
EventLogExpert.slnx Adds new DatabaseTools.Tests and Logging.Tests projects to the solution.
Comments suppressed due to low confidence (1)

src/EventLogExpert.DatabaseTools/Common/Ipc/DatabaseToolsIpcMessage.cs:102

  • XML doc comment for CancelMessage contains a standalone "." line, which will show up as odd formatting in generated docs and is likely a leftover from a wrapped sentence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/EventLogExpert.ElevationHelper/Ipc/IpcMessageWriter.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 102 out of 102 changed files in this pull request and generated no new comments.

@jschick04 jschick04 marked this pull request as ready for review June 9, 2026 13:13
@jschick04 jschick04 requested a review from a team as a code owner June 9, 2026 13:13
@NikTilton NikTilton merged commit 647f472 into main Jun 9, 2026
8 checks passed
@NikTilton NikTilton deleted the jschick/component-structure-540 branch June 9, 2026 14:03
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.

Re-evaluate Blazor ComponentBase structure for testability and code splitting

3 participants