Skip to content
Toolkit

ADR-0045: The class that never truncated anything — DataTableColumn gets truncate, not className

  • Status: Accepted
  • Date: 2026-08-22
  • Deciders: Renaissance workstream 002, close-out sweeps, second data-table slice (LEDGER row "DataTableColumn has no per-cell className", opened by #129); applies ADR-0021 and ADR-0023

Context

DataTable classes its own <td>: align and numeric, and nothing else. AdminBiolinkBlocks' URL cell was <td class="muted truncate">, so converting it meant dropping a class, and the page was held out of the first data-table slice for it. The ledger row offered two ways out — a cellClassName on the column, or a documented "class the node, not the cell" rule — and named .truncate as the thing that decides between them, because .truncate on an inline <span> is inert.

.truncate (patterns.css:156) is overflow: hidden; text-overflow: ellipsis; white-space: nowrap. Five more <td>s carry it: AdminPages, AdminLinks, AdminAffiliates, PaymentLinks and LinksPage. Every one of them is a URL column.

The measurement

The class does not work on the cell either. .data-table and .lk-table are both table-layout: auto, where a cell is as wide as its content — so overflow: hidden has nothing to clip. Measured in Chromium, four cells holding the same 88-character URL in a 600px wrapper:

celltable widthellipsed?
the app's td.truncate858px, wrapper scrollsno
td.truncate + max-width: 0600px, fitsyes
the same + width: 30% on the header600px, fitsyes
a block span at max-width: 100% inside the cell858px, wrapper scrollsno

So the class the conversion was said to be losing has, for six pages, only ever done the white-space: nowrap third of its name: long URLs did not wrap, they widened the table and .table-scroll scrolled. The fourth row is the one that settles the API question — 100% of an unconstrained cell is the full width of the text, so no node inside the cell can express truncation. Only the cell box can.

Decision

DataTableColumn gets truncate?: boolean, a fourth statement about the cell box beside align, numeric and width. It emits lk-table__cell--truncate on the <td>, whose rule in 55-components-extended.css is the measured one:

.lk-table td.lk-table__cell--truncate {
  max-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

max-width: 0 takes the cell out of the intrinsic-width calculation; the table falls back to .lk-table's width: 100% and the column takes its share, steered by width if the column gives one.

No cellClassName. The rule for everything else is class the node, not the cell — a colour, a size, a weight all work on the node cell returns, which is what the thirteen pages already converted do. It is written on DataTableColumn itself so a consumer meets it where the question arises.

Consequences

  • A cell-box need is a prop, so it is typed, documented and testable, and the class it emits is in the component layer. cellClassName would have been none of those: it is a hole through which app CSS re-enters a converted table, in a workstream whose direction is deleting it.
  • The bar for the next such prop is this ADR's table — a measurement showing no node inside the cell can do the job. Four cell-box statements are enough for 31 tables; a fifth needs the same evidence.
  • AdminBiolinkBlocks' URL column truncates for the first time, with a title carrying what the ellipsis takes away. This is a change, not a preservation: the page used to scroll sideways. Stated rather than smuggled, because "the conversion changes nothing visually" is the claim this workstream is otherwise built on.
  • The five remaining td.truncate columns convert the same way and get the same first working ellipsis. None is on a page in this slice.
  • .truncate keeps 24 positions outside a <td> and the five URL cells above, so nothing is deleted from patterns.css here.

Verification

DataTable.test.tsx gains three assertions — the class on the cell, its absence from the header, and the rule's max-width: 0 read out of dist/studio.components.css. Four mutations, all dead: dropping the class from the cell, adding it to the header, emitting it unconditionally, and deleting max-width: 0 from the rule.

The first three of those survived on the first run, and did not fail: the mutation worktree's node_modules/@studio/react was a symlink into the run's tree, so vitest read the unmutated source while the mutation sat in the worktree. Fourth distinct cause of a false survivor after ADR-0038's first-occurrence bug, ADR-0040's region scoping and the CSS-mirroring one. A worktree is only isolated for the files nothing resolves around it.

Source: docs/decisions/0045-the-class-that-never-truncated-anything.md

Library