# Remove const generics from data table \(runtime column count support\) \(\#46341\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fa08e503462547820e251c1ef89ba445fbbe873d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fa08e503462547820e251c1ef89ba445fbbe873d

Requested commit: fa08e503462547820e251c1ef89ba445fbbe873d

Commit: fa08e503462547820e251c1ef89ba445fbbe873d

Tree: 05fd7120a314bb3056efe893067d26e46f06e808

Author: Oleksandr Kholiavko

Committer: GitHub

## Message

```
Remove const generics from data table (runtime column count support) (#46341)

This PR removes the const generics limitation from the data table
component, enabling tables with a dynamic number of columns determined
at runtime.

**Context:**  
This is the next infrastructure step split out from the [original CSV
preview draft PR](https://github.com/zed-industries/zed/pull/44344). The
draft PR remains open as a reference and will continue to be decomposed
into smaller, reviewable pieces.

**Details:**  
- Introduces a `TableRow` newtype to enforce column count invariants at
runtime, replacing the previous const generic approach. It's api surface
is larger than is currently used, as it's planned to be used in CSV
feature itself.
- Refactors the data table and all usages (including the keymap editor)
to work with runtime column counts.
- This change is foundational for supporting CSV preview and other
features that require flexible, dynamic tables.
- Performance impact has not been formally measured, but there is no
noticeable slowdown in practice.

---

Release Notes:
- N/A (internal infrastructure change, no user impact)

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
```

## Parents

- [7a0b19b6b5fb2e41d3c519971129de5dcd8b5fe5](https://git.cafe/gitcafe/zed/commit/7a0b19b6b5fb2e41d3c519971129de5dcd8b5fe5?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fa08e503462547820e251c1ef89ba445fbbe873d?format=markdown)
