Make canonical DisplayedEvents primary and drop per-table materialization#510
Make canonical DisplayedEvents primary and drop per-table materialization#510
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the event-table store so the combined view becomes the single canonical materialized list, with per-log tabs derived from that canonical data instead of maintaining separate per-table DisplayedEvents collections. In the broader codebase, this moves work out of the old repeated combined-view rebuild path and centralizes filtering/sorting/count state in EventTableState.
Changes:
- Add canonical
DisplayedEventsand per-log visible-count tracking toEventTableState, and remove per-table materialized event lists fromEventTableModel. - Rewrite
EventTableReducersto maintain the canonical list incrementally on append, batch append, full table update, filter update, sort, and close paths. - Update UI components and tests to read from the canonical state shape, and delete the obsolete
UpdateCombinedEventsaction/effects.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/EventLogExpert/Components/StatusBar.razor |
Switches visible/hidden event counts to the canonical table state and per-log count map. |
src/EventLogExpert/Components/SplitLogTabPane.razor.cs |
Updates tab naming/empty-state logic to use stored metadata and per-log visible counts. |
src/EventLogExpert/Components/EventTable.razor.cs |
Derives the active table view from canonical events, adds per-log filtering/cache, and adjusts rescroll behavior. |
src/EventLogExpert/Components/EventTable.razor |
Binds the rendered grid and ARIA row count to the derived active event list. |
src/EventLogExpert.UI/Store/EventTable/EventTableState.cs |
Introduces canonical displayed events and EventCountByLog into Fluxor state. |
src/EventLogExpert.UI/Store/EventTable/EventTableReducers.cs |
Reworks reducers around canonical event storage and removes combined-view recomputation. |
src/EventLogExpert.UI/Store/EventTable/EventTableEffects.cs |
Removes now-unneeded effects that used to trigger combined-view updates. |
src/EventLogExpert.UI/Store/EventTable/EventTableAction.cs |
Deletes the obsolete UpdateCombinedEvents action. |
src/EventLogExpert.UI/Models/EventTableModel.cs |
Converts table models to metadata-only records with stored ComputerName. |
src/EventLogExpert.UI.Tests/Store/EventTable/EventTableStoreTests.cs |
Rewrites reducer tests for the canonical-state design and new metadata behavior. |
src/EventLogExpert.UI.Tests/Store/EventTable/EventTableEffectsTests.cs |
Removes tests for the deleted combined-update effect path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
50e5c32 to
03c0eaf
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
The "Combined" view is the user's primary view when ≥2 logs are open, but the architecture inverts this: it materializes a
DisplayedEventslist per log (treated as primary), then maintains an additional materialized list for Combined that is rebuilt from scratch on every event-flow tick viaReduceUpdateCombinedEvents(a full k-way merge plus an O(N)SequenceEqualsanity check). The merge work is paid even when nothing changed, dispatched after everyAppendTableEvents,AppendTableEventsBatch,UpdateDisplayedEvents, andUpdateTable.Approach
Make Combined the single canonical materialized view, maintained incrementally. Drop per-log
DisplayedEventsmaterialization. Per-log tabs derive their view byOwningLogfilter on demand when activated.EventTableStategains a canonicalIReadOnlyList<DisplayEventModel> DisplayedEvents.EventTableModelbecomes metadata-only (no per-logDisplayedEvents).EventTableReducersmaintains the canonical list incrementally on append / batch / filter / sort / close paths.ReduceUpdateCombinedEvents(and its action) deleted entirely along with the four effects that dispatched it.EventTable.razor.csreads fromstate.DisplayedEvents, applying a per-log filter only when a per-log tab is active (with a 1-entry cache keyed by table id + canonical reference).StatusBarandSplitLogTabPaneupdated to read counts and ComputerName from the canonical list.Performance (benchmarks captured pre/post; project not landed in this PR)
Host: AMD EPYC 7763 2.44GHz (Hyper-V VM), .NET 10.0.7, BenchmarkDotNet v0.15.4, RunStrategy=Throughput.
The hot live-tail path (every event tick) is 92–94% faster and uses ~17–50% less memory — that's what dominates real-world usage. Cold paths (filter change, load completion, close log) are 22–48% faster with neutral or slight allocation deltas.
Verification
EventTableStoreTestsfor the new shape;EventTableEffectsTestsshrunk by 26 lines as the deleted action removed test surface).