Skip to content

DataTable virtualization breaks column alignment under non-default density #262

Description

@usmanimamu17-create

The DataTable component (src/components/data-table.tsx) uses a virtualized rendering mode when virtualized=true and rows exceed 100 entries. In virtualized mode, columns are assigned equal percentage widths but when the density prop is changed, the padding changes but the fixed-percentage column widths do not account for altered content sizes. This causes header and body column misalignment.

Root cause: Line 318-324 in src/components/data-table.tsx - Equal percentage width ignores content width per density.

Why this is architecturally hard

  1. Virtualized table uses absolute positioning with sticky header - width mismatch is immediately visible
  2. TanStack Table's column sizing API is not integrated with the custom density system
  3. table-layout: fixed enforces equal widths but doesn't account for padding differences

Acceptance criteria

  • Switching density in virtualized table with >100 rows maintains column alignment
  • Visual alignment verified via screenshot comparison test
  • No unexpected horizontal scrollbar when switching density

Getting started

Files: src/components/data-table.tsx
Commands: npm run dev, npm run test

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignbugSomething isn't workinguiissue-tracking

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions