Repository navigation
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.tsxandDataViewPanelTree.test.tsxreplacereact-data-gridwith a fake (vi.mock).useStableColumnWidths.test.tsxbuilds RDG's DOM by hand: ardg-resize-handleelement,data-measuring-cell-keycells, andaria-colindexheaders. 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):
-
useColumnWidthsmeasures a column only if itswidthis a string and it is notresized. 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 numericwidthfor the duration of the gesture. -
During a pointer or keyboard resize, the grid ignores the
columnWidthsprop and keeps the widths internally. It reports the final map throughonColumnWidthsChangeonly when the resize ends (handleColumnResizeEnd). -
The DOM we read:
- the
.rdg-resize-handleclass; [data-measuring-cell-key]measuring cells, rendered for viewport columns only;role="columnheader"witharia-colindex.
- the
-
How a resize ends:
- drag:
lostpointercaptureon the handle; - Ctrl+Left/Right: header
keyuporblur, whilekeydowncallsstopPropagation; - double-click: the handle resizes to
max-content.
Our hold listeners rely on this order and on these events bubbling.
- drag:
-
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 therenderers.renderCellandrenderRowoverrides with the exportedCellandRow.- Our
Cellrenderer syncs the active position on focus so that a native Tab exit uses the focused cell. OurRowrenderer 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", plusaria-levelandaria-expandedonRow.
3. Selection
selectedRows,onSelectedRowsChangeandgetRowKey.- 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 atBODY, so the fallback maps the focused cell back to a row. It assumes data rows start ataria-rowindex2: one header row and no summary rows.
5. Styling and theming
- The
react-data-grid/lib/styles.csssubpath import, with an ESLint exception and a declaration intypings.d.ts. - The
--rdg-*CSS variables indataGridTheme.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
- Read RDG's changelog from beta.64 to the target version. Diff
useColumnWidths,ResizeHandle,HeaderCell,renderMeasuringCellsandDataGridHandle. - Run the unit tests and the full browser scenario suite.
- Do a manual F5 pass for column sizing and Copy in the VS Code desktop app.
- Update the pin and decision 0001 in
docs/ai-and-plans/features/data-grid/decisions.md.
Activity
[-]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[/+]tnaum-ms commentedon Dec 1, 2026
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.
[-]#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[/+]tnaum-ms commentedon Dec 2, 2026
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
dblclickto the invoking header's.rdg-resize-handle. RDG'sResizeHandlehandles it withonDoubleClickand callsonColumnResize(column, 'max-content'). It measures only rendered rows (virtualized), and the operator accepted that. On upgrade, check:role="columnheader"element, and it still has therdg-resize-handleclass.dblclickon the handle still reaches RDG's delegated React handler and fits the column tomax-content.onColumnWidthsChangeas{ type: 'resized', width }. It must persist across pane resizes and keep neighbors still in Table, through thedblclickhold inuseStableColumnWidths.contextmenucapture listener maps the header to its column througharia-colindex, then setsdata-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.