Skip to content

[upstream #16489] #16489: Make DataTable Row Estimates Breakpoint- and Leaf-Column-Aware #204

Description

@berry-13

DataTable (packages/client/src/components/DataTable.tsx) now seeds its virtualizer from the themed row geometry (useTableRowHeight('titled' | 'compact')) instead of canary's flat 48px. Rendered rows are measured through measureElement, so only the estimate for rows not yet rendered, and with it the initial scroll height, can be off. Two ways it still is:

  1. Breakpoints: below sm, TableCell size="compact" renders dense padding and text-xs (about 24px), while the compact estimate is 36px. useTableRowHeight re-reads only on root style/class mutations, so crossing sm does not refresh the estimate.
  2. Column shape: hasTitleColumn inspects top-level columns only. A grouped definition ({ columns: [{ accessorKey: 'title' }] }) gets the compact estimate although its leaf renders a 48px title cell, and a title column hidden through column visibility still selects the titled estimate.

Suggested fix: derive the title check from table.getVisibleLeafColumns(), and make the row-height read breakpoint-aware (subscribe to the sm media query as well as root mutations).

Raised by the local cross-family review on LibreChat-AI#16489 (local:744d1f2:L-001, L-002). Outside that change's contract (theme roles for table header, row rule and density); not a regression against canary, which used a constant estimate.

Activity

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

    area: packagesreviewctl followups stateperfreviewctl followups statereadyreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions