Skip to content

Data grid pagy scroll#63

Open
joshsadam wants to merge 15 commits into
mainfrom
data-grid-pagy-scroll
Open

Data grid pagy scroll#63
joshsadam wants to merge 15 commits into
mainfrom
data-grid-pagy-scroll

Conversation

@joshsadam

@joshsadam joshsadam commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

What does this PR do and why?

  • Adds paginated virtual scroll to DataGrid, fetching row pages from the server as the user scrolls instead of rendering the full dataset in memory.
  • Supports virtual_pagination config (total_count, rows_url, page_size, row_offset) plus a demo samples endpoint and Lookbook preview for manual validation.

Screenshots or screen recordings

image

How to set up and validate locally

  1. From the repo root: bin/setup (or cd demo && bundle install).
  2. Start Lookbook: cd demo && bin/devData Grid → Virtual Infinite Scroll; scroll to load additional pages and exercise keyboard navigation (including Ctrl+Home / Ctrl+End).
  3. Optional API check: curl "http://localhost:3001/demo/samples/rows.json?page=2&limit=20".

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

@joshsadam joshsadam self-assigned this Jun 5, 2026
@joshsadam joshsadam force-pushed the data-grid-pagy-scroll branch 2 times, most recently from faa5d39 to 9043a10 Compare June 12, 2026 15:08
@joshsadam joshsadam requested a review from ericenns June 12, 2026 17:38
@joshsadam joshsadam force-pushed the data-grid-pagy-scroll branch from 9fa3936 to ead7311 Compare June 13, 2026 21:42
@joshsadam joshsadam force-pushed the data-grid-pagy-scroll branch 4 times, most recently from 5813a99 to 23246c2 Compare July 6, 2026 16:25
Copilot AI review requested due to automatic review settings July 10, 2026 13:28

This comment was marked as resolved.

@joshsadam joshsadam force-pushed the data-grid-pagy-scroll branch from b1f9266 to 73144fe Compare July 10, 2026 13:51
joshsadam added 15 commits July 10, 2026 10:38
Large datasets can exceed what is practical to render upfront.
Fetch row pages on scroll with a client-side page cache so the
grid stays responsive while preserving keyboard navigation across
the full row count.
Exercise pagination config validation, virtual contract
attributes, page cache behaviour, and a Lookbook preview for
manual verification.
Provide a runnable example that serves row pages with Pagy and
shows how host apps wire virtual_pagination into the data grid.
Removed unnecessary comments from the data grid controller for improved readability. Enhanced keyboard navigation by implementing a new method to focus on the absolute last cell when Ctrl+End is pressed in a paginated virtual grid. Updated tests to cover this new behavior.
Implemented a feature to rerender the top rows when Ctrl+Home is pressed from the bottom of a paginated virtual grid. This change ensures that the visible rows are updated correctly, improving user experience. Added a corresponding test to validate this behavior.
Refactored CSS variables in the data grid styles to align with the new theming system. Updated colors for borders, text, backgrounds, and focus rings to use the new variable names, enhancing design consistency across light and dark modes. Additionally, improved the HTML structure in the data grid preview for better styling and accessibility.
Added functionality to restore cell focus when navigating through a virtual data grid, including handling focus after scrolling and paginated row loads. Introduced a new method to manage pending focus coordinates and updated related tests to ensure proper focus behavior across various interactions.
Refactored the column rendering logic in the DataGrid component to improve handling of content blocks. Added a new method to resolve column cell renderers, ensuring proper rendering of dynamic content. Updated the demo samples grid to utilize a helper for rendering organism names with HTML tags, enhancing the display of data. Added a test to verify the correct rendering of organism names in the output.
Updated CSS variables in the data grid styles to improve theming consistency, including new variables for error states and enhanced border and background colors. Refactored component styles to utilize these variables, ensuring better responsiveness and accessibility. Adjusted the DataGrid component to reflect these changes in its layout and appearance.
Remove the pagination adapter layer and dead row-offset parsing so the
controller talks directly to PaginatedVirtualRows with less indirection.

Replace the fragile ViewComponent slot internals workaround with an
explicit renderer API and keep paginated cell ordering stable for focus
restoration and keyboard navigation.
Per-cell sticky top offsets misaligned pinned and center header
cells in paginated virtual grids. Let the header row own the bottom
border and reset virtual header cells to relative positioning.
Restore the sticky-cell box-shadow so the pinned/center divider
matches body rows.
Modified the column rendering logic to utilize a renderer block instead of a direct value block. This change enhances flexibility in rendering values within the DataGrid component. Updated the corresponding test to reflect this new implementation.
Restore initial viewport position from row offset, sort cached rows
by global index, track concurrent page fetches for aria-busy, and
clear the error state after a successful load.
Custom cell blocks need the caller's self for helper methods. Use
block.call instead of instance_exec so the original receiver is kept.
…ll cache

Restore ColumnComponent block support for direct instantiation and rebuild
paginated virtual cell maps from CenterColumnWindow's full lane cache so
keyboard navigation keeps offscreen columns after horizontal slicing.
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.

2 participants