Launch scenarios from a folder of exported event logs - #657
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new scenario launch path that opens scenarios from a folder of exported .evtx files (matching each file’s channel to the scenario) and introduces “live presence” gating so scenarios can be shown even when their channels are not available on the host. It also changes timeline behavior so it defaults hidden and is only revealed by scenarios that opt into timeline activation (notably update-triage scenarios).
Changes:
- Add “Open from folder” scenario launch flow with cancellable off-thread folder enumeration and parallel per-file channel probing.
- Add host “live presence” snapshot + UI gating/UX to handle offline scenarios (disable live launch, keep folder launch available).
- Default timeline hidden; add per-scenario
ActivatesTimelineflag and wire it into scenario launches + built-in catalog validation.
Reviewed changes
Copilot reviewed 47 out of 47 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 enumeration tests for cancellation-token support and adds a cancelled-token test. |
| tests/Unit/EventLogExpert.UI.Tests/Dashboard/ScenarioDetailTests.cs | Updates dashboard detail tests for admin/offline messaging and the new “Open from folder” action. |
| tests/Unit/EventLogExpert.UI.Tests/Dashboard/ScenarioBrowserPanelTests.cs | Adjusts scenario list option behavior and adds coverage for offline scenario note rendering. |
| tests/Unit/EventLogExpert.UI.Tests/Dashboard/EmptyStateDashboardTests.cs | Adds tests for offline live-launch gating and folder-launch outcomes (alerts/announcements). |
| tests/Unit/EventLogExpert.Scenarios.Tests/ScenarioCatalogLoaderTests.cs | Adds tests for parsing activatesTimeline (default false; true parsed). |
| tests/Unit/EventLogExpert.Scenarios.Tests/BuiltInCatalogValidationTests.cs | Validates timeline activation policy for update vs non-update scenarios. |
| tests/Unit/EventLogExpert.Runtime.Tests/Scenarios/ScenarioQueryServiceTests.cs | Adds GetLivePresence behavior tests and updates splash scenario expectations. |
| tests/Unit/EventLogExpert.Runtime.Tests/Scenarios/ScenarioLaunchServiceTests.cs | Adds timeline activation tests and extensive folder-launch cancellation/outcome tests. |
| tests/Unit/EventLogExpert.Runtime.Tests/Scenarios/EvtxChannelReaderTests.cs | New tests for unreadable/non-evtx/missing file channel probing behavior. |
| tests/Unit/EventLogExpert.Runtime.Tests/Scenarios/ChannelPresenceProbeTests.cs | Adds tests for TryGetPresentChannels null-on-failure and success behavior. |
| tests/Unit/EventLogExpert.Runtime.Tests/Histogram/HistogramStateTests.cs | New test asserting histogram visibility defaults to hidden. |
| tests/Unit/EventLogExpert.Runtime.Tests/DependencyInjection/RuntimeServiceCollectionExtensionsTests.cs | Updates DI tests for new runtime dependencies (histogram state, folder picker/enumerator). |
| src/EventLogExpert/DependencyInjection/MauiProgramExtensions.cs | Wires MAUI platform adapters for the new folder enumerator; removes histogram preference adapter wiring. |
| src/EventLogExpert/Adapters/Settings/HistogramPreferencesAdapter.cs | Removes persisted histogram visibility preferences adapter (timeline no longer persisted). |
| src/EventLogExpert/Adapters/Menu/MauiMenuActionService.cs | Adds OpenLogFilesAsync to open file paths via the existing batch open core. |
| src/EventLogExpert/Adapters/FilePicker/MauiEvtxFolderEnumerator.cs | New adapter implementing runtime folder-scan abstraction using WindowsPlatform enumerator. |
| src/EventLogExpert.WindowsPlatform/Activation/EvtxFolderEnumerator.cs | Adds cancellation-token support to top-level .evtx enumeration. |
| src/EventLogExpert.UI/LogTable/LogTablePane.razor.cs | Avoids render/context-menu exceptions by handling stale row locators defensively. |
| src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor.css | Adds styles for offline note and “Open from folder” action button. |
| src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor.cs | Adds live presence inputs + folder launch callback and IDs for aria-describedby wiring. |
| src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor | Adds offline note, updates admin badge copy, and adds “Open from folder” action. |
| src/EventLogExpert.UI/Dashboard/ScenarioBrowserPanel.razor.cs | Adds live presence delegate + folder-launch callback; removes elevation reason parameter. |
| src/EventLogExpert.UI/Dashboard/ScenarioBrowserPanel.razor | Routes live presence + folder-launch callback to ScenarioDetail; simplifies option ARIA attributes. |
| src/EventLogExpert.UI/Dashboard/EmptyStateDashboard.razor.cs | Adds lifetime CTS for scan cancellation-on-dispose, live presence snapshot, folder launch messaging/alerts. |
| src/EventLogExpert.UI/Dashboard/EmptyStateDashboard.razor | Updates empty-catalog message and wires folder-launch action through the scenario browser panel. |
| src/EventLogExpert.Scenarios/Serialization/ScenarioDto.cs | Adds ActivatesTimeline to the scenario DTO. |
| src/EventLogExpert.Scenarios/Serialization/ScenarioCatalogLoader.cs | Maps DTO ActivatesTimeline onto ScenarioDefinition. |
| src/EventLogExpert.Scenarios/Scenarios/built-in/updates-and-policy.json | Sets activatesTimeline: true for update-triage scenarios. |
| src/EventLogExpert.Scenarios/Catalog/ScenarioDefinition.cs | Adds ActivatesTimeline flag to scenario definition. |
| src/EventLogExpert.Runtime/Scenarios/ScenarioQueryService.cs | Adds GetLivePresence and changes splash scenarios to return full catalog subset (no host gating). |
| src/EventLogExpert.Runtime/Scenarios/ScenarioLaunchService.cs | Adds timeline activation behavior + new “launch from folder” workflow with cancellation and matching. |
| src/EventLogExpert.Runtime/Scenarios/ScenarioFolderLaunchResult.cs | New result type for folder-based scenario launches. |
| src/EventLogExpert.Runtime/Scenarios/LivePresence.cs | New host channel presence snapshot record used for live-launch gating. |
| src/EventLogExpert.Runtime/Scenarios/IScenarioQueryService.cs | Adds GetLivePresence and updates splash scenario contract. |
| src/EventLogExpert.Runtime/Scenarios/IScenarioLaunchService.cs | Adds LaunchFromFolderAsync contract. |
| src/EventLogExpert.Runtime/Scenarios/IEvtxFolderEnumerator.cs | New runtime abstraction for enumerating .evtx files in a folder. |
| src/EventLogExpert.Runtime/Scenarios/IEvtxChannelReader.cs | New abstraction for probing an exported .evtx file’s channel. |
| src/EventLogExpert.Runtime/Scenarios/IChannelPresenceProbe.cs | Adds TryGetPresentChannels for null-on-failure probing semantics. |
| src/EventLogExpert.Runtime/Scenarios/EvtxFolderScanResult.cs | New discriminated result for folder scans (Files/Empty/AccessDenied/IoError). |
| src/EventLogExpert.Runtime/Scenarios/EvtxChannelReadResult.cs | New lightweight result for channel probe (Channel + Failed). |
| src/EventLogExpert.Runtime/Scenarios/EvtxChannelReader.cs | New implementation that probes an .evtx file’s channel via a lightweight record read. |
| src/EventLogExpert.Runtime/Scenarios/ChannelPresenceProbe.cs | Implements TryGetPresentChannels, keeping failure reads uncached. |
| src/EventLogExpert.Runtime/Menu/IMenuActionService.cs | Adds OpenLogFilesAsync for opening exported log files. |
| src/EventLogExpert.Runtime/Histogram/IHistogramPreferencesProvider.cs | Removes histogram preferences provider contract (no persisted visibility). |
| src/EventLogExpert.Runtime/Histogram/HistogramState.cs | Changes default visibility to hidden by default. |
| src/EventLogExpert.Runtime/Histogram/Effects.cs | Removes effects that hydrated/persisted histogram visibility. |
| src/EventLogExpert.Runtime/DependencyInjection/RuntimeServiceCollectionExtensions.cs | Registers IEvtxChannelReader in runtime DI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6b3eb72 to
e53602c
Compare
e53602c to
affbdc0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 50 out of 50 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/EventLogExpert.UI/Dashboard/ScenarioDetail.razor:60
- When the dashboard is busy (
IsBusy=true) the button is rendered with the nativedisabledattribute (viaDisabled="@IsBusy"), butaria-disabledis still computed only fromIsDisabled. This can produce an inconsistent accessibility state (e.g.,disabled+aria-disabled="false"), which may confuse assistive tech. IncludeIsBusyin thearia-disabledcomputation (or removearia-disabledwhen using the native disabled attribute).
<ChromelessButton aria-describedby="@((IsDisabled && !IsLivePresent) ? _offlineId : (IsDisabled ? _adminBadgeId : null))"
aria-disabled="@(IsDisabled ? "true" : "false")"
CssClass="scenario-detail__launch"
Disabled="@IsBusy"
IconClass="bi bi-play-fill"
Adds "Open from folder" to scenario launch: pick a folder of exported .evtx files, match each file's channel to the scenario, and open the matches in a fresh filtered view - working even for logs not present on the local host. Also defaults the timeline off (activated by update scenarios) and exposes the full scenario catalog for folder launch.
The folder scan runs off the UI thread and is fully cancellable: enumeration streams with per-item cancellation, the parallel per-file channel probe honors the token, and the scan is tied to the dashboard's lifetime (cancelled on dispose). A cancelled scan never opens logs or dispatches filters.
Follow-up: a user-facing Cancel control during the scan is tracked in #656.
Tests: Runtime 1919, UI 1131, Windows 46, Scenarios green.