Skip to content

Add elevation awareness, Tools menu database entry, and split Effects.cs into 4 focused classes#537

Merged
jschick04 merged 2 commits into
jschick/provider-db-extractionfrom
jschick/provider-db-wire-up
May 21, 2026
Merged

Add elevation awareness, Tools menu database entry, and split Effects.cs into 4 focused classes#537
jschick04 merged 2 commits into
jschick/provider-db-extractionfrom
jschick/provider-db-wire-up

Conversation

@jschick04
Copy link
Copy Markdown
Collaborator

Stacked on #536. Adds elevation awareness and splits the monolithic Effects.cs into single-responsibility classes.

Changes

PR 10 — Elevation awareness + Tools menu

  • Cache \IsAdmin\ via \Lazy\ on \CurrentVersionProvider\ (process-lifetime, no repeated P/Invoke)
  • EventDbTool startup warning when running without administrator privileges
  • Add Manage Databases item to the Tools menu for direct access to database management

PR 11 — Split Effects.cs (1097 lines → 4 classes + 2 shared singletons)

  • FilteringEffects — HandleAddEvent, HandleApplyFilter, HandleSetContinuouslyUpdate
  • OpenLogEffects — HandleOpenLog, HandleCloseLog, HandleCloseAll
  • LogReloadEffects — HandleLoadEvents, HandleLoadEventsPartial, HandleLoadNewEvents
  • DatabaseCoordinationEffects — PrepareForDatabaseRemovalAsync, ReopenAfterDatabaseRemoval (implements ILogReloadCoordinator)

Shared coordination extracted into:

  • LogCloseCoordinator — close-completion handshake + pending selection restore (singleton)
  • EventLogConcurrencyState — filter/reload invalidation tokens + XML-loaded tracking (singleton)
  • EventLogEffectsUtility — static event distribution helpers

DI wiring: Fluxor auto-discovers FilteringEffects/OpenLogEffects/LogReloadEffects; DatabaseCoordinationEffects registered explicitly as singleton with ILogReloadCoordinator alias.

Test results

2,193 tests passing (unchanged from base branch), 0 failures

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 adds elevation-awareness (admin detection + warning) and refactors the runtime EventLog Fluxor effects by splitting the former monolithic Effects.cs into focused effect/coordination classes with shared singletons for cross-effect synchronization.

Changes:

  • Cache admin/elevation state (CurrentVersionProvider.IsAdmin) and emit a non-elevated warning in EventDbTool.
  • Add a Tools menu entry intended to expose database management.
  • Split EventLog/Effects.cs into FilteringEffects, OpenLogEffects, LogReloadEffects, and DatabaseCoordinationEffects, plus shared coordination helpers.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs Updates tests to use a harness over the split effects classes.
src/EventLogExpert.UI/Menu/MenuBar.razor.cs Adds “Manage Databases” item and minor formatting tweaks.
src/EventLogExpert.Runtime/EventLog/PendingSelectionRestore.cs Extracts pending selection restore record into its own file.
src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs New effects class for open/close/close-all and log loading pipeline.
src/EventLogExpert.Runtime/EventLog/LogReloadEffects.cs New effects class for load events / partial load / new events buffer.
src/EventLogExpert.Runtime/EventLog/LogCloseCoordinator.cs New shared coordinator for close-completion + pending selection restore.
src/EventLogExpert.Runtime/EventLog/FilteringEffects.cs New effects class for add-event, apply-filter, and continuously-update toggle.
src/EventLogExpert.Runtime/EventLog/EventLogEffectsUtility.cs Shared helper utilities extracted from the old monolith.
src/EventLogExpert.Runtime/EventLog/EventLogConcurrencyState.cs Shared tokens/state for filter/reload invalidation + XML-loaded tracking.
src/EventLogExpert.Runtime/EventLog/Effects.cs Removes the previous monolithic effects implementation.
src/EventLogExpert.Runtime/EventLog/DatabaseCoordinationEffects.cs New coordinator implementing ILogReloadCoordinator for db removal flows.
src/EventLogExpert.Runtime/DependencyInjection/RuntimeServiceCollectionExtensions.cs Registers shared singletons and wires ILogReloadCoordinator to the new coordinator.
src/EventLogExpert.Runtime/Common/Versioning/CurrentVersionProvider.cs Caches admin check via Lazy<bool> to avoid repeated P/Invoke.
src/EventLogExpert.EventDbTool/Program.cs Adds elevation warning on startup.

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

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
Comment thread tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs
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 14 out of 14 changed files in this pull request and generated 4 comments.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
Comment thread tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs
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 14 out of 14 changed files in this pull request and generated 4 comments.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Comment thread tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
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 14 out of 14 changed files in this pull request and generated 4 comments.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
Comment thread tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs
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 14 out of 14 changed files in this pull request and generated 3 comments.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs Outdated
Comment thread tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs
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 14 out of 14 changed files in this pull request and generated 3 comments.

Comment thread src/EventLogExpert.UI/Menu/MenuBar.razor.cs
Comment thread tests/Unit/EventLogExpert.Runtime.Tests/EventLog/EffectsTests.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
@jschick04 jschick04 force-pushed the jschick/provider-db-wire-up branch from 60a2f10 to 8db51a2 Compare May 21, 2026 17:57
@jschick04 jschick04 marked this pull request as ready for review May 21, 2026 17:57
@jschick04 jschick04 requested a review from a team as a code owner May 21, 2026 17:58
@jschick04 jschick04 merged commit fd76f44 into jschick/provider-db-extraction May 21, 2026
1 check passed
@jschick04 jschick04 deleted the jschick/provider-db-wire-up branch May 21, 2026 17:58
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.

2 participants