Repository navigation
Description
Summary
DataTable floors the table at the sum of every visible column's declared width. A column hidden by a responsive class (hidden md:table-cell, the pattern the column option's own comment recommends) is still counted, so on a phone the table stays as wide as on a desktop and its last column, often the row menu, sits off screen inside the table's own scroll frame. The row menu is where a row's actions live (disconnecting a connected agent is one), so this is more than cosmetic on a phone.
Anchors are at main da3b98b730 (2026-10-13).
What the repo says today
- The floor is
contentSizeTotal + pinnedPx, summed overtable.getVisibleLeafColumns(): "visible" in TanStack's column-visibility state, not in CSS (packages/ui/src/components/data-table/data-table.tsx:741-793,floorPxat:792). - The column option's own comment recommends the pattern: "Use responsive utilities like
hidden md:table-cellto drop low-priority columns on small screens" (data-table.tsx:114-118,ColumnMeta.className). - Two tables use it: API keys, four columns (
services/platform/app/features/settings/api-keys/hooks/use-api-keys-table-config.tsx:78,87,96,105) and projects, three columns (services/platform/app/features/projects/components/projects-table.tsx:364,380,406). Other ways of hiding a column (max-md:hiddenand similar) were not searched for. - The Connected agents table (feat(platform): add the Connected agents page to Settings #4925) avoids the problem by building its column list from media queries and leaving out the columns a width has no room for, with each width's declared sizes kept within the page's
max-w-3xl(766 px):services/platform/app/features/settings/agent-connections/hooks/use-agent-connections-table-config.tsx. - The design system's phone test asserts that the page keeps the viewport width while the table scrolls inside it, so a menu that is off screen inside the scroll frame passes it.
What was observed
Measured on 2026-10-13 in Chromium at a 390 px viewport: the API keys table is 766 px wide inside a 356 px frame, and the projects table is the same. The first (flexible) column grows to take the whole floor, which puts the actions column to the right of the visible area. Other tables were not measured.
Options
- Teach the table which columns are hidden: a per-column "hide below this width" in the column's meta, evaluated with a media query so a hidden column leaves the floor, replacing the free-form class for this purpose.
- Move the two tables to the pattern Connected agents uses (columns built from media queries) and correct the comment on
className. - Document the limit only: change the comment and leave the tables as they are.
Questions
- Are there tables that hide columns in a way that was not searched for?
- Is a menu that needs a horizontal scroll to reach acceptable anywhere on a phone, or should the actions column be pinned?
Related
#4925, where it was found.
Activity
yannickmonney commentedon Nov 14, 2026
Decision
Option 1, plus a pinned actions column. The table decides which columns a screen has room for, and a row's menu is always on screen.
The rule
DataTablegets a typed column option,meta.hideBelow: 'sm' | 'md' | 'lg' | 'xl'. The breakpoints come from one shared set of media queries exported from@tale/ui(the Tailwind defaults: max-width 639, 767, 1023 and 1279 px).hidden md:table-celland similar) inmeta.classNameis no longer allowed. TheclassNamecomment stops recommending it, and a guard test fails if one appears.Answers
hidden sm/md/lg:table-cell. Themax-md:hiddenmatches are keyboard-hint spans, not columns, and the otherclassNamemetas areoverflow-hidden, which hides nothing. Connected agents is the only table that drops columns by media query. The guard test keeps it that way.Rationale
The table computes its own minimum width, so it is the only place that can know a column is gone. A typed option keeps the width, the cells and the skeleton in agreement by construction. Copying the Connected agents approach into each table (option 2) would mean the same breakpoint logic hand-written in every table, and documenting the limit (option 3) would leave the phone defect live. Pinning the actions column makes "the row menu is reachable" a property of the component rather than of each table's column budget.
Implementation units (all on main)
hideBelowand shared breakpoint queries (M). Hidden columns leave the minimum width and render no cells. TheclassNamecomment is rewritten, a guard test rejects CSS-hidden columns, and the ui-docs page gets a section and a demo.hideBelow(S, after 1). At 390 px, API keys and projects fit their frame. Connected agents keeps media queries only for the details it moves under the agent's name.Cross-issue amendments (decisions taken together with #5410):