feat: virtualize Event Explorer table rows - #877
Open
tobitaiwo16 wants to merge 2 commits into
Open
tobitaiwo16 wants to merge 2 commits into
tobitaiwo16 wants to merge 2 commits into
Conversation
Window the Event Explorer table body so only visible rows are mounted, and repair the table and row card.
|
@tobitaiwo16 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…-virtualization-652 Resolves the merge conflicts with main.
Author
|
@Core-Foundry I've resolved the merge conflicts with All other changes from Merge commit: Could you take another look when you have a moment? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The Event Explorer table still mounted one DOM node per event (
events.map(...)), so a large page of results produced thousands of live rows and janky scrolling.EventListwas already windowed, butEventExplorerTable— the component the Event Explorer page actually renders — was not. This PR introduces fixed-height windowed rendering for the table body so only the visible slice of rows (plus a small overscan) is mounted, and repairs the table (and the row card it renders) so the module is valid, compile-clean TypeScript again.Related Issue
#652 — Introduce Event List Virtualization.
EventListalready virtualizes; the remaining naive full render wasEventExplorerTable. The issue asks to evaluate this independently from the dashboard loading-performance work, so the change is scoped to the table body and does not touch data fetching.Changes
dashboard/src/components/EventExplorerTable.tsx— repaired the corrupted module (loadColumnWidthshad lost its closing braces and nestedsyncCopyTextinside itself;widthsToGridTemplate,columnWidths,startResizewere undefined) and rewrote it coherently: fixed-height windowing (ROW_HEIGHT/OVERSCAN, scroll listener +slice+translateYinside a full-height spacer), props that match how the page calls it (onSelectEvent,contractStatuses), resizable + persisted column widths (loadColumnWidths/persistColumnWidths/widthsToGridTemplate), and unchanged class names and roles (rowgroup/columnheader/cell).dashboard/src/components/EventExplorerCard.tsx— made the row card valid again (duplicateformatTimestampimport, undefinedshortenedContract/handleCopyClick, an unclosed<time>element) so the table compiles and every interaction keeps working: click / Enter / Space selection, copy-contract, paused-contract badge, kind badge, and the event-id / tx-hash copy buttons.dashboard/src/index.css— added.event-explorer__table-body--virtualized,.event-explorer__table-spacerand.event-explorer__virtual-rowso the body becomes a bounded scroll viewport and rows are absolutely positioned inside the spacer that carries the full list height.dashboard/src/components/EventExplorerTable.virtualization.test.tsx— renders 5,000 events and asserts that only a bounded window of rows is in the DOM, that scrolling moves the window, and that a small dataset still renders in full.No new dependencies: React 19 plus native DOM/CSS only. The stacked mobile card layout (
max-width: 640px) renders the plain list, because the fixed-height maths assumes the desktop grid row.Verification Results
The fetched
dashboard/tree has nonode_modules, and no installs are permitted, so the repo's ownnpm test/npm run buildcould not be executed end-to-end. What was actually run:tsc(TypeScript 5.9.3) with--strict --noEmit,jsx: react-jsx,moduleResolution: bundlerover the two rewritten modules and their real import graph: 0 errors..event-explorer__rownodes in the DOM (naive rendering would mount 5,000); the spacer reports560000px=5000 × 112.event-44(still 18 nodes) — only the visible slice is mounted.onSelectEventfires when a row is clicked.gridTemplateColumnsfrom220px …to280px …, keeps six columns, and persists the widths tolocalStorage.Unknown timewith nodateTimeattribute.EventExplorerTable.test.tsx(resize persistence and malformed timestamps) were reproduced successfully in the same harness. The new Jest test file was not executed here (Jest is not installed in this workspace); it is written for the repo'snpm testworkflow.startIndex/endIndexslice with overscan; compact layout falls back to a plain listROW_HEIGHT+translateY, overscan rows, spacer preserves total scroll heightCloses #652