Skip to content

Add a time-window filter lens (Show Events Near This Time)#645

Merged
NikTilton merged 2 commits into
mainfrom
feat/time-window-lens
Jul 14, 2026
Merged

Add a time-window filter lens (Show Events Near This Time)#645
NikTilton merged 2 commits into
mainfrom
feat/time-window-lens

Conversation

@jschick04

Copy link
Copy Markdown
Collaborator

Summary

Adds a transient, reversible time-window filter lens surfaced as a "Show Events Near This Time" context-menu submenu on an event row. Selecting a duration pushes a lens that narrows the event table to a centered window [TimeCreated - d, TimeCreated + d] and drops a removable breadcrumb chip (for example Near 2:03:22 PM +/-5m). Like the other lenses it never mutates the saved/persistent filter and pops off cleanly.

This completes the Wave-2 lens set alongside the merged Filter Stack (#643) and Related Activity ID lenses (#644). It is a genuinely new "zoom into the time neighborhood of an event, look around, then pop back" gesture, distinct from the existing persistent "Exclude Events Before/After" items.

Tracks ADO 62704670.

Durations

Five fixed centered windows: +/-30s, +/-1m, +/-5m, +/-15m, +/-1h (capped at 1 hour; day-scale browsing remains the persistent date range's job).

Design

Informed by a 5-reviewer UX design panel:

  • Centered "around" only - one-sided transient lenses were deferred as they would duplicate/confuse next to the persistent "Exclude Before/After".
  • Menu placement in the lens "Show..." group, separated from the persistent "Exclude..." group; the "Show" (transient lens) vs "Exclude" (persistent) verb split is the anti-confusion lever.
  • Inclusive bounds so the clicked event always stays in view.
  • Window math in UTC; chip anchor rendered in the grid's display timezone so the chip time matches the clicked row.

Implementation

  • FilterLensFactory.ForTimeWindow - builds the windowed FilterLens; bounds clamped to the DateTime range (boundary arithmetic throws on overflow), radius validated to (0, 1 hour] and whole seconds, chip suffix rendered losslessly.
  • IFilterLensCommands.ShowEventsNearTime / FilterLensCommands - dispatches the lens via the existing push path.
  • LogTablePane - the "Show Events Near This Time" submenu (5 durations), no gating (every event has a timestamp).

Tests

  • End-to-end via the composer: inclusive bounds + source-event survival + radius exclusion (below and above the window).
  • Command dispatch: centered enabled window bounds, chip-suffix mapping for all five durations, display-zone anchor rendering, origin-log tagging, degenerate MinValue anchor clamp (no throw), radius-contract rejection (zero / negative / >1h / sub-second).

Validation

Runtime.Tests 1702/1702, UI.Tests 1038/1038, full-solution Release build 0 warnings / 0 errors.

Copilot AI review requested due to automatic review settings July 13, 2026 23:03

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

Adds a new transient “time-window” filter lens that can be pushed from an event row’s context menu (“Show Events Near This Time”), narrowing the grid to an inclusive centered window around the clicked event and presenting a removable breadcrumb chip.

Changes:

  • Introduces FilterLensFactory.ForTimeWindow(...) to build a validated, clamped centered [T-d, T+d] time-window lens with a compact chip label.
  • Adds IFilterLensCommands.ShowEventsNearTime(...) and implements it in FilterLensCommands to push the new lens through the existing lens stack pipeline.
  • Wires a new context-menu submenu in LogTablePane and adds unit tests covering bounds, chip formatting, dispatch behavior, and validation.

Reviewed changes

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

Show a summary per file
File Description
tests/Unit/EventLogExpert.Runtime.Tests/FilterLenses/FilterLensCommandsTests.cs Adds command-level tests for dispatch, chip label formatting, bounds, and validation behavior.
tests/Unit/EventLogExpert.Runtime.Tests/FilterLenses/EffectiveFilterBuilderTests.cs Adds an end-to-end composition test proving inclusive bounds and source-event survival within the time window.
src/EventLogExpert.UI/LogTable/LogTablePane.razor.cs Adds the “Show Events Near This Time” submenu with five fixed durations.
src/EventLogExpert.Runtime/FilterLenses/IFilterLensCommands.cs Extends the lens command interface with ShowEventsNearTime.
src/EventLogExpert.Runtime/FilterLenses/FilterLensFactory.cs Implements the time-window lens factory and radius formatting.
src/EventLogExpert.Runtime/FilterLenses/FilterLensCommands.cs Implements the new command by pushing a factory-built time-window lens.

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

Comment thread src/EventLogExpert.Runtime/FilterLenses/FilterLensFactory.cs
Copilot AI review requested due to automatic review settings July 13, 2026 23:19

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

@jschick04 jschick04 marked this pull request as ready for review July 13, 2026 23:24
@jschick04 jschick04 requested a review from a team as a code owner July 13, 2026 23:24
@NikTilton NikTilton merged commit f5650c9 into main Jul 14, 2026
8 checks passed
@NikTilton NikTilton deleted the feat/time-window-lens branch July 14, 2026 02:06
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