Skip to content

#grid Data grid upgrade: what to check and test before moving off react-data-grid 7.0.0-beta.64 #rdg #1151

Backlog

Description

The Collection View Table and Tree use react-data-grid exact-pinned to 7.0.0-beta.64 (#1142, decision 0001). Upgrading is riskier than the version bump suggests. Some of our code depends on RDG's internal behavior, and the tests that would catch a break do not use the real grid.

This issue lists what to check when we upgrade and what to automate before we do.

Why an upgrade can break silently

  • DataViewPanelTable.test.tsx and DataViewPanelTree.test.tsx replace react-data-grid with a fake (vi.mock). useStableColumnWidths.test.tsx builds RDG's DOM by hand: a rdg-resize-handle element, data-measuring-cell-key cells, and aria-colindex headers. If RDG changes any of these, those tests still pass.
  • The real-browser scenario runner covers keyboard navigation, selection, step-in, Tree, virtualization and theming. It runs on demand only (decision 0002), and none of its scenarios covers column sizing, Copy or hover suppression.

Areas to check

1. Column sizing (useStableColumnWidths.ts): highest risk

It relies on these RDG internals (line numbers are from lib/index.js in beta.64):

  • useColumnWidths measures a column only if its width is a string and it is not resized. During a header drag, it also re-measures the other string-width columns, but only when every column is in the viewport (columnsCanFlex). Our hold works by giving those columns a numeric width for the duration of the gesture.

  • During a pointer or keyboard resize, the grid ignores the columnWidths prop and keeps the widths internally. It reports the final map through onColumnWidthsChange only when the resize ends (handleColumnResizeEnd).

  • The DOM we read:

    • the .rdg-resize-handle class;
    • [data-measuring-cell-key] measuring cells, rendered for viewport columns only;
    • role="columnheader" with aria-colindex.
  • How a resize ends:

    • drag: lostpointercapture on the handle;
    • Ctrl+Left/Right: header keyup or blur, while keydown calls stopPropagation;
    • double-click: the handle resizes to max-content.

    Our hold listeners rely on this order and on these events bubbling.

  • Drag clamping uses the column's minWidth/maxWidth. The 320 px content cap and the fill width are applied through them.

  • RDG re-measures columns when the grid width changes.

Decision 0006 accepted this behavior; it must keep working:

  • other columns stay put while one is dragged;
  • content-fit widths are capped at 320 px, and spare pane space is shared equally among the automatically sized columns;
  • manual widths are never capped or stretched, and they are restored per query and path for the panel's lifetime;
  • double-click autosizes a column, and Ctrl+Left/Right resizes it from the keyboard;
  • automatic columns reflow when the pane is resized.

2. Keyboard and focus

  • DataGridHandle.setActivePosition(position, { shouldFocus }), plus the renderers.renderCell and renderRow overrides with the exported Cell and Row.
  • Our Cell renderer syncs the active position on focus so that a native Tab exit uses the focused cell. Our Row renderer syncs it on Enter or Space because RDG's active position can lag behind direct focus.
  • Arrow keys between headers and cells, and the Escape exit together with the entry hint.
  • Tree: role="treegrid", plus aria-level and aria-expanded on Row.

3. Selection

  • selectedRows, onSelectedRowsChange and getRowKey.
  • Click, Ctrl/Cmd+click and Shift+click, plus Space and Shift+Space.

4. Copy

  • onCellCopy.
  • The document-level fallback in useFocusedCellCopyFallback.ts. VS Code desktop can dispatch Copy at BODY, so the fallback maps the focused cell back to a row. It assumes data rows start at aria-rowindex 2: one header row and no summary rows.

5. Styling and theming

  • The react-data-grid/lib/styles.css subpath import, with an ESLint exception and a declaration in typings.d.ts.
  • The --rdg-* CSS variables in dataGridTheme.scss. They provide the VS Code theme colors in dark, light and high-contrast themes, and hover suppression works by setting the hover variables.
  • The Lightning CSS light-dark() caveat in RDG's README.

6. Runtime floor

RDG beta.64 needs React ^19.2, and we raised the VS Code minimum to ^1.123.0 for it. Recheck the browser and React requirements of the target version before changing engines.vscode.

Prepare ahead of the upgrade

  • Add real-browser scenarios for column sizing. With Playwright, drag a header handle, double-click it, use Ctrl+Left/Right, and resize the viewport. Assert header widths for each behavior in section 1.
  • Add real-browser scenarios for Copy: Ctrl+C, Ctrl+Insert, and copy from the menu.
  • Add a real-browser scenario for hover suppression through the setting and through reduced motion.
  • Decide whether the browser scenarios must pass before a grid upgrade can merge: either run them in CI, or make them a required step in the upgrade PR.
  • Consider a small test against the real RDG for the DOM and event contract in section 1. It would fail loudly if RDG renames or reorders those hooks.

Upgrade procedure

  1. Read RDG's changelog from beta.64 to the target version. Diff useColumnWidths, ResizeHandle, HeaderCell, renderMeasuringCells and DataGridHandle.
  2. Run the unit tests and the full browser scenario suite.
  3. Do a manual F5 pass for column sizing and Copy in the VS Code desktop app.
  4. Update the pin and decision 0001 in docs/ai-and-plans/features/data-grid/decisions.md.

Activity

  1. added
    dependencies
    on Dec 1, 2026
  2. changed the title [-]Data grid upgrade: what to check and test before moving off react-data-grid 7.0.0-beta.64[/-] [+]#grid Data grid upgrade: what to check and test before moving off react-data-grid 7.0.0-beta.64[/+] on Dec 1, 2026
  3. tnaum-ms commented on Dec 1, 2026

    @tnaum-ms
    CollaboratorAuthor

    Add the latest integration boundaries to the upgrade checklist: strict resize modifiers in both views; the positional Tree-key/same-column refresh fallback from #1152; and native Copy dispatched at the document body. The latter maps ARIA coordinates assuming one header and no summary rows. Recheck that mapping before adding checkbox/pinned/reordered columns (#1155, #1156) or grouped headers. One-off F5/browser checks and tests of scenario definitions are not repeatable real-browser journeys.

    Parked experiment, not an upgrade requirement: decision 0007 left open freezing measured automatic widths as numbers until pane resize to simplify gesture listeners. Revisit only if a time-boxed prototype preserves stable neighbors, reflow/fill, and path restoration; do not freeze the layout permanently or remount and lose focus. Other unapproved maintenance ideas from review: derive fixtures from real shapers, reduce duplicate scenario assertions, simplify focus/ref bookkeeping only if permanent outside-focus cancellation survives, and move historical verification digests out of the landing README. These are suggestions, not additional upgrade gates.

  4. changed the title [-]#grid Data grid upgrade: what to check and test before moving off react-data-grid 7.0.0-beta.64[/-] [+]#grid Data grid upgrade: what to check and test before moving off react-data-grid 7.0.0-beta.64 #rdg[/+] on Dec 1, 2026
  5. tnaum-ms commented on Dec 2, 2026

    @tnaum-ms
    CollaboratorAuthor

    Add the #776 column-header menu (Table and Tree) to the upgrade checklist. It is local on dev/tnaum/a11y-issues (draft PR #1147) and not yet pushed.

    Resize by Content uses RDG's private double-click fit. It does not measure text itself. It sends a synthetic dblclick to the invoking header's .rdg-resize-handle. RDG's ResizeHandle handles it with onDoubleClick and calls onColumnResize(column, 'max-content'). It measures only rendered rows (virtualized), and the operator accepted that. On upgrade, check:

    • The handle is still a descendant of the role="columnheader" element, and it still has the rdg-resize-handle class.
    • A bubbling synthetic dblclick on the handle still reaches RDG's delegated React handler and fits the column to max-content.
    • The result still comes back through onColumnWidthsChange as { type: 'resized', width }. It must persist across pane resizes and keep neighbors still in Table, through the dblclick hold in useStableColumnWidths.
    • The native header menu still opens on a pointer right-click and on Shift+F10 or the Context Menu key on a focused header. The contextmenu capture listener maps the header to its column through aria-colindex, then sets data-vscode-context. Headers must stay focusable.

    Unit tests mock RDG, so they cannot catch a break here. Add Resize by Content and Resize… to the planned real-browser column-sizing scenarios and to the manual F5 pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependencies

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions