Skip to content

feat(event-log): timeline swimlanes (Phase 13, #845) - #1003

Open
adamgell wants to merge 19 commits into
feat/event-logs-histogram-835from
feat/event-logs-swimlanes-845
Open

adamgell wants to merge 19 commits into
feat/event-logs-histogram-835from
feat/event-logs-swimlanes-845

Conversation

@adamgell

Copy link
Copy Markdown
Owner

Closes #845. Part of #823. Stacked on Phase 6b (#835, the histogram with brush): this PR's base is feat/event-logs-histogram-835, and 6b's PR is not open yet. 6b itself sits on Phase 6a (#834). The diff against that base is this lane's 18 commits and one merge commit that takes 6b at cee16160; it shows nothing of 6b.

What it adds

The Timeline view of the Event Logs workbench (spec 8.9): events drawn as dots in lanes over time, with the same time brush as the histogram.

  • evtx-swimlanes.ts (new): lanes by provider, channel or event ID, top 12 plus "Other".
  • evtx-swimlane-canvas.ts (new): mark geometry, batched paint, hit-testing and the colour resolution.
  • EvtxSwimlaneView.tsx (new): one canvas for the lane stack, with DOM labels and a DOM wash, a legend, a hidden table, the brush by pointer and keyboard, click-to-select, and the loading, empty and unavailable states.
  • EventLogWorkspace.tsx: mounts the view lazily on the Timeline tab, fed the context records (the events the filters leave without the time range), so a brush never empties the lanes it was drawn on.
  • evtx-coverage.ts and evtx-histogram.ts: the coverage-gap count and the range-outside note are shared with the histogram instead of copied.
  • EvtxHistogram.tsx: uses the shared count.
  • __fixtures__/recording-canvas.ts and e2e/screenshots/event-logs.spec.ts: a recording canvas for unit tests, and the Timeline capture with real-canvas and diagonal-click checks.

Evidence rules

  1. Copy (spec 8.9 deviation). The help text reads "drag to select a time range", not the spec's "drag to zoom": the lanes do not rescale, and the narrowing is the filter.
  2. Marks are circles (D21). Critical is 10 px, Error 9, Warning 7, Information 5 at 55% opacity, and Verbose a 5 px hollow ring at full opacity. Without colour, Critical and Error differ by 1 px of size, by paint order where they overlap, and by the text carriers (the tooltip, the value text, the hidden table and Details). The legend's 5 entries come from the same table.
  3. Ring. The ring is a 1 px knockout (destination-out) on every level but Information, a reading of the spec's 1 px colorNeutralBackground1 ring. It shows the surface outside a brush, the wash inside one, and Canvas under forced colors.
  4. Colours. They are resolved through resolveToken over the theme object, not getComputedStyle (spec 6); it is the same object FluentProvider receives. A matchMedia resolution listener follows DPR changes.
  5. Overlay and text. The overlay opacity is 6b's solver unchanged: 60% in six themes and 25% in high contrast (6b rule 1). Lane-count and axis text use Foreground2 (6b rule 1). Lane baselines (Stroke2) and separators (Stroke3) are decorative and exempt from 3:1.
  6. One canvas for the lane stack, with DOM labels and a DOM wash behind a transparent canvas. This overrides spec 8.9's recommendation of a canvas per lane plus a hit layer.
  7. Forced colours. The wash is dropped and every mark is ringed in CanvasText, read from a probe element on every paint. A colour-scheme change repaints while forced colors are on.
  8. Click versus drag. Below 3 px a press is a click, which selects the nearest dot within 4 px of its edge and never sets or clears a range. A drag snaps to the axis buckets and commits through rangeAfterActivate, so a drag over the one applied bucket clears it. This is tested for both figures over applied ranges.
  9. Hit metric. Edge distance within 4 CSS px for every level; every mark is a circle, and the metric is checked at any angle against the drawn geometry, on the rounded plot width the canvas uses. The tie-break is the smallest distance, then the more severe, then the nearer centre, then the earlier time, then the lower position. The tooltip says "+k more within 4 px". Records are held as objects and .id is read at click time. A click, Space or the selected ring acts only on a record the store resolves its id to (findRecordById), so a scene left over from a reload inside the throttle window acts on nothing.
  10. Keyboard. Up and Down move between lanes, Space selects the cell's most severe event (the earliest on ties) and opens Details, and Enter applies as the histogram does. The cursor lane is held by lane id across live-tail re-ranks, falling back to the clamped row only when the lane is gone, and scrolls into view. The Table view is the full record path.
  11. Lanes. Thirteen keys stay thirteen lanes. Event ID lanes are keyed by the ID alone, like Group by and Top event IDs; the Charts view will key by provider and ID. The Lanes choice is component-local and resets when the view is left; the view is lazy and not kept alive.
  12. Gesture machine not extracted. The pointer and keyboard gesture machine is a copy of the histogram's with the lane additions. A parity suite runs the same scenarios against both figures, including drags over applied ranges. The extraction is tracked in Event Logs: extract one useTimeBrush hook for the histogram and the swimlanes #961.
  13. Not built here. The spec 10 live-tail announcer (status-bar phase or Phase 20), and a "not read" lane for unreadable channels (Event Logs swimlanes: show an unread channel as a 'not read' lane #962).
  14. Geometry. Lane height is max(36, label block), 52 px at list size 20. The scene (axis, lane set, lane order) is frozen from the press.
  15. Trailers. The commit trailers name the model that wrote them.

Scope

17 files against the issue's 4, over 18 commits (9 build and 9 fix) of at most 5 files each, so the CLAUDE.md issue-lane exception applies. The files: evtx-swimlanes.ts and its test; evtx-swimlane-canvas.ts and its test; EvtxSwimlaneView.tsx with its main, brush and contrast tests; __fixtures__/recording-canvas.ts; EventLogWorkspace.tsx, EventLogWorkspace.swimlanes.test.tsx and EventLogWorkspace.layout.test.tsx (the layout test's list of placeholder views loses "Timeline"; that edit will conflict textually with the other view phases); evtx-coverage.ts and its test, evtx-histogram.ts and EvtxHistogram.tsx (the shared count and note); and e2e/screenshots/event-logs.spec.ts.

Known limits

Reviews

  • Review at c5457b88: 11 findings, ruled and fixed or recorded. Verification at c14219cb: 6 findings, none a source defect: five are contract deviations recorded in the decision list (rules 1, 4, 5 and the Critical and Error size difference in rule 2) and one is the capture gate. No source finding is open at c14219cb.
  • 6b was merged in at cee16160, after that verification, with no conflicts.

Verification

At head 95510bb0e03f713502b3f50aa4f96deafe055850 (the merge of 6b at cee16160):

  • npx tsc --noEmit: exit 0.
  • npx vitest run --maxWorkers=3: exit 0, 195 files, 4210 tests, no "Unhandled Errors".
  • node e2e/fixtures/capture-event-log-replies.mjs --check: exit 0.
  • git diff feat/event-logs-histogram-835 --check: exit 0. No U+2013 or U+2014 in added lines, in the log's added lines or in commit messages. No real account name or machine identifier in added lines or in git log -p feat/event-logs-histogram-835..HEAD.
  • Every commit in the range is signed.
  • src-tauri and crates are untouched, so no Rust gates apply. E2E and screenshots were not run locally (the Vite port is shared).

Screenshots

A new event-logs-timeline.png is captured, and the three existing captures (table, selected, insights) must be confirmed unchanged. The real-canvas and diagonal-click e2e tests have never run; their first run is Main's capture session. The clock pin is shared with 6b and Phase 10 as a literal, and Phase 15 uses a fixture constant instead; pick one at merge. PNGs are regenerated in Main's capture session before merge.

🤖 Generated with Claude Code

adamgell and others added 19 commits October 17, 2026 14:28
…e are shared (#845)

The histogram and the swimlanes both say how many gaps may hide events and that a range lies
outside the charted events. The count moves to evtx-coverage.ts and the note to evtx-histogram.ts,
beside describeUntimed and describeCoverage, so the two figures cannot count or word them apart.
No behavior change: every 6b suite passes unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…Other (#845)

The pure side of the Timeline swimlanes (spec 8.9). A scene is the histogram axis of the same
records plus one lane per key: the top 12 by placed events, and an 'Other (n lanes)' lane for the
rest (thirteen keys stay thirteen lanes). Dots sit at the histogram's bucket-wise fractionAt, so a
dot and the brush wash over its bucket cannot disagree across a DST change. Untimed records are in
no lane and are counted once, so lanes plus untimed are the records given. Lanes hold the record
objects in time order; the lane height follows the list font size.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rs (#845)

The canvas side of the swimlanes (spec 8.9), with no React: a mark per level that does not rely on
colour (the 10, 9, 7 and 5 px ladder, a Critical diamond, a hollow Verbose ring, Information at 55%),
a plan that draws a level's dots once per device-pixel column of a lane so paint costs by columns and
not by events, a painter over a narrow 2D interface (knockout rings, severity on top, a CanvasText
outline under forced colors), and a hit test that is a 1-D search in the lane under the pointer with
a stated metric (edge distance within 4 px) and a five-step tie-break. A recording 2D context lets
tests read the calls a browser would receive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ates (#845)

The Timeline view of spec 8.9 without its gestures. One transparent canvas for the lane stack with DOM
lane labels (172 px plus 8 px padding, taller with the list font size), a legend drawn from the same
marks table as the canvas, the Lanes dropdown (provider, channel, event ID), and the histogram's axis,
ladder labels and zone. The wash over an applied range is a DOM layer behind the canvas at the
histogram's solved opacity and is dropped under forced colors, where the marks get a CanvasText ring
resolved from a probe element. Colours are resolved from the theme object, so a theme switch repaints
without a remount; the backing store follows the device pixel ratio and its changes. Loading, empty,
untimed, coverage-gap and live-tail states follow the histogram's. The help text says drag selects a
time range: the lanes do not zoom.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… layering (#845)

A drag across the lanes sets the same time range as a drag across the histogram: whole buckets of the
shared axis, committed through the histogram's rangeAfterActivate, with the same draft, keyboard model
and Escape layering (a pending selection takes the first Escape, the workspace's window handler the
second). A press that moves less than 3 px is a click: it selects the nearest dot within 4 px through
selectRecordAndShowDetails and never sets or clears a range. The scene (axis, lanes and their order)
is held from the press, so a live tail cannot move what a drag is aimed at. The slider is named apart
from the histogram's, adds Up and Down between lanes and Space to select the most severe event in the
cell, and the tooltip is drawn by the component so Fluent's Escape handling cannot swallow the key.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n all seven themes (#845)

Adam's criterion on #845, measured on what is painted: the dot colours are read from the canvas calls,
the wash opacity and fill from the DOM, both resolved through the theme object, and the contrast is
taken at each mark's own alpha against the wash composite. The wash is the histogram's, at 60% in six
themes and 25% in high contrast (where 60% puts Error at 1.01:1). Information at 55% is the one
exemption; Verbose stays solid (3.03:1 in light, 1.75:1 at 55%). Every level but Information has a
knockout ring, the wash is behind the canvas in the document, and the edge borders, keyboard cursor,
focus, selection and hover rings keep 3:1 on both the surface and the wash.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The view bar's Timeline tab now renders the lanes in place of the placeholder, loaded on demand inside
the view host's Suspense boundary (spec 11). They chart the same context records as the histogram, the
events the filters leave without the time range, so a brush on either never empties or rescales the
other. The view is not kept alive. The workspace tests cover the shared criterion end to end: a drag on
the lanes shows the Time chip and narrows the count, Escape takes the pending selection then the range,
and a clicked dot opens Details.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
event-logs-timeline captures the Timeline view of the fixture (twelve provider lanes and 'Other (2
lanes)'). jsdom has no pixels, so the spec also reads the real canvas: the lone Critical event's dot is
painted in the theme's Critical colour at its centre, a store theme switch repaints it without a reload,
the canvas is backed at the device pixel ratio, and a real mouse click 3 px off that dot selects the
event and opens Details without setting a time range. Like the other specs in this file it runs only
under playwright.screenshots.config.ts, and the PNG is generated by the capture run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the keyboard cursor lane scrolls into view (#845)

A press holds the scene it was aimed at; if the capture is taken from it before the release there is no
click and the scene is let go, as a cancel does (a pending keyboard selection still keeps it). The lane
stack scrolls, so the lane the Up and Down keys move to is brought into view. The cursor cell's words
are kept while only the pointer moves.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ircular and the hit geometry is the drawn one (#845)

Spec D21 says level dots stay circular, and 8.9's 10, 9, 7 and 5 px ladder is its own non-colour
channel. The Critical diamond is withdrawn: it also made hitTest score the diamond as a radius-5 circle,
so a point outside it scored 0 and a point 5.46 px from its edge hit. Critical and Error now differ by one
pixel of size, said so in the tests, with Verbose's hollow ring, the knockout ring, paint order and the
text carriers as the other channels; no shape is added. The hit tests gain probes at every angle
and the brute-force oracle takes each level's radius from the calls the painter makes, not from
hitRadiusOf, so the hit geometry is checked against the pixels' geometry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
#845)

hitAt passed the sub-pixel width of the plot to the hit test while planPaint draws on the rounded one,
so on a fractional layout a dot at the far end could be up to half a pixel from where it was tested.
Both now use Math.round(width). Tested at 720.49 and 720.6 px, where rounding down, not rounding and
flooring give three different answers at the 4 px boundary, and on a click at the plot's right edge.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… when a live tail re-ranks (#845)

The cursor's lane was a row index, so a throttled rebuild that re-ranked the top 12 slid the outline,
the value text and Space onto whichever lane took the row. It is held by lane id now, bound the first
time it is derived, and falls back to the clamped row only when its lane is gone. Tested with a re-rank
between Down and Space: the event selected is the original lane's.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…re it is acted on (#845)

isCurrentRecord says a record is the store's own under its id (ids are indexes the store rewrites in place
on a merge), and findRecordInScene takes the store's records and finds nothing for a record that is not.
A scene is published up to one throttle window late, so after a reload inside it the scene still holds the
previous set's objects under ids that are now other events' indexes. The view uses it in the next commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ore acts on nothing (#845)

The scene is published up to 75 ms late. A reload that finishes inside that window leaves the previous set's
objects on screen, clickable, with ids that are now the new set's indexes: selecting by one opened an
event the user did not click, and the selected ring could land on the wrong dot. A click and Space now
act only on a record the store holds under its own id (a merge's in-place renumber still passes), and
the ring looks the selected id up against the store's records. Tests use ids that are indexes, as the
store leaves them, and run a reload inside the window for a click, for Space and for the ring.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…845)

The CanvasText ring colour was resolved only when forced colors or the app theme changed. Switching from
one Windows contrast theme to another keeps forced colors on and flips the system colours, and a canvas is
not recoloured with the page, so the rings kept the old colour against the new Canvas. The probe is now
read on every paint while forced colors are active, and the colour-scheme query, which flips with the
contrast theme, repaints (only while forced). Tested by changing the stubbed probe colour with forced
colors still on, for a repaint from any cause and for a scheme flip.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d range too (#845)

Every drag in the parity suite started from no range, where rangeAfterActivate and rangeOfSpan agree, so
replacing the lanes' commit with rangeOfSpan left every suite green. Seven drags now run on both figures
from an applied single-bucket range (dragged within it, within another bucket, over several, over it and its
neighbours) and an applied multi-bucket range (over exactly it, within one bucket, elsewhere), each
checked for equality between the figures and against the literal range. A drag within the one applied
bucket clears it; that case fails the rangeOfSpan mutant.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…company (#845)

The real click was 3 px off the dot's centre along the x axis, where a circle and a diamond agree, so it
could not have caught a shape error in the hit geometry. It is now two clicks on the 45 degree line: 9.2 px
from the centre of the 10 px circle (4.2 px beyond its rim) selects nothing, and 8.8 px (3.8 px beyond)
selects the Critical event and opens Details. The dot's x uses the rounded plot width the canvas is drawn on.
Like the rest of this spec it runs only under the screenshots config and has not been run in this round.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… it, as Details does (#845)

The identity check compared records[record.id] with the record, which assumes the store's ids are always
its indexes. They are after a merge, but a channel cleared or re-read drops records without renumbering the
rest (evtx-store.ts: the re-read replay and the tail clear), so until the next merge the check refused real
records and a click on them did nothing. It now uses findRecordById, the lookup Details and the rail use:
the index first, a scan as the fallback. A record from a scene a reload left behind still resolves to another
object and is refused. Tested for a click and for the pure check after the store dropped records unrenumbered.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added enhancement New feature or request feature New feature labels Oct 22, 2026
@adamgell adamgell mentioned this pull request Oct 22, 2026
4 of 34 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant