Skip to content

Conversation

@Light2Dark
Copy link
Contributor

📝 Summary

Row viewer now supports moving to different pages when using the keyboard shortcuts to move to next/previous row.

CleanShot.2025-11-03.at.16.42.18.mp4

🔍 Description of Changes

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

@Light2Dark Light2Dark requested a review from manzt as a code owner November 3, 2025 08:43
@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Nov 3, 2025 3:34pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automatic pagination navigation when viewing rows in a data table. When a user navigates to a row that's on a different page, the table now automatically updates to display that page. Additionally, it improves the error message handling for LazyFrame data.

  • Introduces a getPageIndexForRow utility function to calculate which page a row belongs to
  • Wraps setViewedRowIdx in a new setViewedRow function that automatically updates pagination state when navigating to rows on different pages
  • Updates the row viewer error message to handle LazyFrame cases more gracefully

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
frontend/src/components/data-table/utils.ts Adds getPageIndexForRow utility function to calculate the page index for a given row
frontend/src/plugins/impl/DataTablePlugin.tsx Implements setViewedRow wrapper that automatically updates pagination when viewing rows on different pages
frontend/src/components/data-table/row-viewer-panel/row-viewer.tsx Improves error message to differentiate between LazyFrame and unexpected row count scenarios
frontend/src/components/data-table/__tests__/utils.test.ts Adds comprehensive test coverage for the getPageIndexForRow function
Comments suppressed due to low confidence (1)

frontend/src/plugins/impl/DataTablePlugin.tsx:995

  • The onViewedRowChange callback should use setViewedRow instead of setViewedRowIdx to ensure pagination is updated when rows are changed from within the DataTable component. Currently, line 934 correctly uses setViewedRow for the RowViewerPanel, but line 995 bypasses the pagination logic by calling setViewedRowIdx directly.
            onViewedRowChange={(rowIdx) => setViewedRowIdx(rowIdx)}

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

@Light2Dark Light2Dark merged commit 2805303 into main Nov 3, 2025
26 checks passed
@Light2Dark Light2Dark deleted the sham/row-viewer-move-rows-to-new-page branch November 3, 2025 18:14
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