Skip to content

Upgrade AG Grid and enhance the data viewer - #1765

Open
renkun-ken wants to merge 4 commits into
masterfrom
codex/ag-grid-data-viewer
Open

renkun-ken wants to merge 4 commits into
masterfrom
codex/ag-grid-data-viewer

Conversation

@renkun-ken

@renkun-ken renkun-ken commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Upgrade AG Grid Community from 35.2.1 to 36.2.0 and add shared controls to the on-demand and file-backed data viewers. Columns fill the viewport by default and remain fitted through scrolling, page changes, and webview resizing; content sizing runs only when requested.

Closes #1586.

Changes

  • Add searchable column visibility and pinning controls, floating filters, clear-all filters, row counts, and full-value tooltips. Showing or hiding floating filters preserves the current column order.
  • Preserve compatible column layouts, sorting, filters, page sizes, and sizing modes across repeated View() calls. Reset restores fit-width sizing, and older saved fixed widths migrate to the new default.
  • Replace outdated grid/selection API usage and initialize file-backed grids after the document is ready. Share date, boolean, missing-value, and integer64 handling between viewer modes.
  • Update TypeScript to AG Grid's supported minimum of 5.8.3 and declare the test suite's glob dependency with compatible types.
  • Document the viewer controls and add regression tests for sizing, state restoration, schema changes, pagination, and column types.

Validation

  • Production bundle, TypeScript compilation, and ESLint on changed TypeScript files pass.
  • Full extension suite in VS Code 1.119.0: 141 tests pass.
  • R data-viewer suite: 79 checks pass; native AG Grid date and bigint filter models also verified against R.
  • Headless Chrome checks using all 53,940 ggplot2::diamonds rows in both viewer modes, including scrolling, new blocks/pages, widening/narrowing, mode switching, reset, manual widths, and saved-state migration. No browser errors or AG Grid validation warnings.
  • Chrome checks confirm floating filters render, apply, hide, and restore while preserving column order, widths/flex, pinning, visibility, and sorting. Reset clears sorting and filters and restores the default layout in paged, unpaged, and file-backed viewers.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Three moderate issues remain in filter toggling, sizing preservation, and reset sorting.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Upgrades AG Grid and enhances both data viewers with shared controls, state persistence, sizing, filtering, and improved type handling.

Changes:

  • Adds column search, visibility/pinning, filters, tooltips, row counts, and sizing controls.
  • Preserves compatible viewer state and migrates older sizing settings.
  • Updates dependencies, documentation, changelog, and regression tests.
File Summary
src/​test/​suite/​dataViewer.test.ts Viewer regression tests
src/​session.ts Integrates shared viewer functionality
src/​dataViewerColumnPanel.ts Searchable visibility and pinning panel
src/​dataViewer.ts Shared viewer behavior and controls
README.md Documents viewer controls
package.json Updates dependencies and TypeScript
package-lock.json Locks upgraded packages
CHANGELOG.md Records viewer changes

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/dataViewer.ts
@eitsupi
eitsupi requested a review from Fred-Wu September 25, 2026 13:44
@ThomasSoeiro

ThomasSoeiro commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

closes #1586

@eitsupi eitsupi linked an issue Sep 25, 2026 that may be closed by this pull request
Comment thread src/dataViewer.ts
Comment on lines +144 to +153
const gridState = {
version: state.version,
columnOrder: state.columnOrder,
columnSizing: state.columnSizing,
columnPinning: state.columnPinning,
columnVisibility: state.columnVisibility,
sort: state.sort,
filter: state.filter,
pagination: { pageSize: state.pagination?.pageSize }
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, this is needed because saveViewerState() builds a subset of getState() for later use as initialState. Added partialColumnState: true to every saved snapshot in c7586ec. The legacy migration still marks state as partial when dropping columnSizing; its test fixture now represents the older format without either sizingMode or the partial-state flag.

Verified that the flag survives subsequent saves and reloads, and that column layout, sorting, filters, fit-width sizing, and legacy-state migration still work in paged/unpaged on-demand and file-backed viewers. All 10 viewer tests, TypeScript compilation, changed-file ESLint, and the production build pass.

@Fred-Wu

Fred-Wu commented Sep 26, 2026

Copy link
Copy Markdown
Contributor
  • Preserve compatible column layouts, sorting, filters, page sizes, and sizing modes across repeated View() calls. Reset restores fit-width sizing, and older saved fixed widths migrate to the new default.

There is an edge case bug that the column row-name width may not be preserved after Size to content and filtering buttons are clicked and View() is called again.

image image

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.

Data viewer auto width.

5 participants