Skip to content

Upgrade AG Grid and enhance the data viewer - #1765

Merged
eitsupi merged 6 commits into
mainfrom
codex/ag-grid-data-viewer
Sep 26, 2026
Merged

eitsupi merged 6 commits into
mainfrom
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
@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

Comment thread src/dataViewer.ts Outdated
column.lockVisible = true;
column.floatingFilter = false;
column.suppressSizeToFit = true;
column.flex = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change column.flex = 0 to column.initialFlex = 0 should preserve the column width for the row-indicator/name column.

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.

Confirmed and fixed in e2033d5. I reproduced the case from your PR comment: Size to content → Filters → reopen changed the row-name width from 51px back to 100px. Switching to initialFlex = 0 prevents filter toggles from reintroducing flex: 0 into the resized column's saved state, so its chosen width is restored correctly.

I also made Reset view explicitly restore the row-name column's initial width, since AG Grid skips width restoration when the reset state contains flex: 0.

Chrome checks pass for numeric and long character row names, covering content sizing, manual widths, filter toggles/application, repeated reloads, Reset, and fit-width during scrolling/resizing in paged/unpaged on-demand and file-backed viewers. No browser errors or AG Grid validation warnings. All 10 viewer tests, TypeScript compilation, changed-file ESLint, and the production build pass.

@randy3k
randy3k changed the base branch from master to main September 26, 2026 16:57
@eitsupi
eitsupi merged commit ce7fa64 into main Sep 26, 2026
6 checks passed
@eitsupi
eitsupi deleted the codex/ag-grid-data-viewer branch September 26, 2026 22:25
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