Skip to content

Improvement: DataTable's minimum width counts columns hidden by CSS, so a row menu can sit off a phone's screen #4934

Open

Description

@yannickmonney

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 over table.getVisibleLeafColumns(): "visible" in TanStack's column-visibility state, not in CSS (packages/ui/src/components/data-table/data-table.tsx:741-793, floorPx at :792).
  • The column option's own comment recommends the pattern: "Use responsive utilities like hidden md:table-cell to 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:hidden and 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

  1. 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.
  2. Move the two tables to the pattern Connected agents uses (columns built from media queries) and correct the comment on className.
  3. 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

  1. added
    needs discussion
    improvement
    on Oct 13, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    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

    • DataTable gets 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).
    • Below its breakpoint, a column is left out of the table entirely: no header, no cell, no skeleton, and its width no longer counts toward the table's minimum width.
    • Select and action columns cannot be hidden this way.
    • Hiding a column with CSS (hidden md:table-cell and similar) in meta.className is no longer allowed. The className comment stops recommending it, and a guard test fails if one appears.
    • When a table is wider than its frame, the actions column stays pinned (sticky) to the frame's right edge. It has an opaque background that follows the row's hover and selected states, and an edge shadow while content scrolls under it.

    Answers

    • Are there tables that hide columns in a way that was not searched for? No. On current main only API keys (4 columns) and projects (3 columns) hide columns, both with hidden sm/md/lg:table-cell. The max-md:hidden matches are keyboard-hint spans, not columns, and the other className metas are overflow-hidden, which hides nothing. Connected agents is the only table that drops columns by media query. The guard test keeps it that way.
    • Is a menu that needs a horizontal scroll acceptable on a phone, or should the actions column be pinned? It is not acceptable anywhere. The row menu holds actions like disconnect, revoke and delete. Documents and knowledge entries are allowed to scroll sideways on a phone (RESP-F13), so hiding columns alone cannot guarantee the menu is reachable. Pinning the actions column does.

    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)

    1. feat(ui): hideBelow and shared breakpoint queries (M). Hidden columns leave the minimum width and render no cells. The className comment is rewritten, a guard test rejects CSS-hidden columns, and the ui-docs page gets a section and a demo.
    2. feat(ui): pinned actions column (M). The actions column sticks to the frame's right edge whenever the table overflows. A browser test at 390 px checks that the menu button is inside the visible frame at both scroll ends.
    3. fix(platform): API keys, projects and Connected agents use 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.
    4. test(platform): phone tests fail on an off-screen menu (S, after 2 and 3). An e2e check at 390 px on five tables, a new manual box in the responsive suite, an extended RESP-F13, and a row in the automation reference.

    Cross-issue amendments (decisions taken together with #5410):

  3. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
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

    agent-readyimprovement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions