Skip to content

fix(data-table): keep the footer usable at phone widths - #685

Merged
wemra3 merged 15 commits into
mainfrom
fix/data-table-footer-narrow
Nov 18, 2026
Merged

wemra3 merged 15 commits into
mainfrom
fix/data-table-footer-narrow

Conversation

@wemra3

@wemra3 wemra3 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes tailor-inc/platform-planning#2209. Part of the mobile umbrella tailor-inc/platform-planning#2207.

At phone widths, the DataTable footer pushed the page buttons outside the table frame, and the frame cut them off. With rows selected, the bulk-action bar wrapped onto three lines, and only about one table row stayed visible.

Changes

  • DataTable.Pagination: the row count, the page-size switcher, and the page controls now wrap as separate units. The page text and the four buttons stay together on one line.
  • DataTable.Footer is now a named container (@container/data-table-footer). When it is narrower than 480 px, "Rows per page" is hidden, and "Page 1 / 10" is shown as "1 / 10". Screen readers still get both texts. The full "Page 1 / 10" stays one text node, so existing text queries still work.
  • Bulk-action bar: when the footer is narrower than 480 px, every action moves into the More actions menu, and the separators are removed. The menu button uses the outline style of the inline actions, so it stands out more than Clear. The bar measures the footer width with a ResizeObserver. A CSS-only version would leave hidden buttons in the toolbar's arrow-key order.
  • The "Rows per page" label now names the page-size select (aria-labelledby), so the select keeps an accessible name when the label is hidden.
  • Docs and a patch changeset.

Nothing changes when the footer is 480 px or wider.

How to reproduce

  1. Run the vite example with a 375 x 812 viewport.
  2. Open /showcase/data-table-selection.
  3. Look at the footer. Then select two rows.

Results

Measured with Playwright (Chrome, touch, device scale 2) on /showcase/data-table-selection.

Viewport and layout Footer height (px) Visible table height (px) Buttons outside the table
375, GlobalHeaderLayout, no selection 77 → 97 197 → 177 4 → 0
375, GlobalHeaderLayout, 2 rows selected 193 → 137 81 → 137 4 → 0
375, SidebarLayout, no selection 77 → 97 237 → 217 3 → 0
375, SidebarLayout, 2 rows selected 193 → 93 121 → 221 2 → 0
390, GlobalHeaderLayout, 2 rows selected 193 → 137 113 → 169 3 → 0
768, both layouts no change (53 / 93) no change 0 → 0

Without a selection, the footer is 20 px taller at 375 px. This is because the page buttons now have their own line and are no longer cut off.

The SidebarLayout numbers come from a local switch in the example. It is not part of this PR.

Screenshots

375 px, GlobalHeaderLayout, no selection:

Footer before and after at 375 px without selection

375 px, GlobalHeaderLayout, 2 rows selected:

Footer before and after at 375 px with 2 rows selected

375 px, SidebarLayout, 2 rows selected:

Footer before and after at 375 px in SidebarLayout with 2 rows selected

768 px, 2 rows selected (no change expected):

Footer before and after at 768 px with 2 rows selected

Checks

  • pnpm type-check, lint, test, check-dts, docs:check, fmt:check, and build pass.
  • New test: the bar keeps actions inline only when the footer is wide enough. It fails without this change.
  • New tests: the page-size select is named by its label, and the short "1 / 5" text is hidden from assistive tech.
  • Not checked on a real device yet.

Review notes (not changed in this PR)

  • If the footer crosses 480 px while an inline action has keyboard focus, that button unmounts and focus is lost. This is rare at tablet widths (768 px or more).
  • The bar measures the footer in JS because Toolbar.Row arrow-key focus does not skip items hidden with CSS. Fixing that in Toolbar would allow a CSS-only version. That is a separate change.
  • The 480 px value appears twice: in NARROW_FOOTER_WIDTH and in the Tailwind class strings, which must be literal. Comments link them.
  • In narrow mode the menu trigger is still named "More actions", although no actions are inline. Renaming it needs a new label in every locale.
  • @container on the footer means its content no longer widens the table in a shrink-to-fit parent (for example, w-fit). The pagination wraps instead.

🤖 Generated with Claude Code

Hiroki Uemura and others added 5 commits November 7, 2026 17:57
DataTable.Pagination now wraps its controls instead of letting the table
frame clip them, so Next and Last stay tappable at 375px. Below a 480px
footer width, the "Rows per page" label and the "Page" word become
sr-only, and the bulk-action bar moves every action into the More actions
menu so the table rows stay visible.

Refs tailor-inc/platform-planning#2209

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rrow

Make the row count, page-size switcher and page controls siblings in one
wrapping row, so a narrow footer breaks between them rather than inside
the controls group. Drop the bar's separators when every action has
collapsed into the menu, so Clear stays on the count's line.

Refs tailor-inc/platform-planning#2209

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Rows per page" label is now tied to the select with
aria-labelledby, so the select keeps an accessible name when a narrow
footer hides the label. Also test that the short "1 / 5" page text is
hidden from assistive tech.

Refs tailor-inc/platform-planning#2209

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wemra3
wemra3 requested a review from a team as a code owner November 7, 2026 08:59
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (923933d) #685 (cdc0b72) +/-
Coverage 62.9% 62.9% +0.0%
Test Execution Time 4m3s 4m24s +21s
Details
  |                     | main (923933d) | #685 (cdc0b72) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          62.9% |          62.9% | +0.0% |
  |   Files             |            294 |            294 |     0 |
  |   Lines             |          13483 |          13513 |   +30 |
+ |   Covered           |           8485 |           8505 |   +20 |
- | Test Execution Time |           4m3s |          4m24s |  +21s |

Code coverage of files in pull request scope (9.8% → 10.2%, patch 95.4%)

Files Coverage +/- Patch Coverage Status
packages/core/dist/app-shell.js 8.5% +0.0% - affected
packages/core/src/components/data-table/footer.tsx 100.0% 0.0% - modified
packages/core/src/components/data-table/pagination.tsx 95.4% +0.4% 66.6% modified
packages/core/src/components/data-table/selection-bar.tsx 100.0% 0.0% 100.0% modified

Reported by octocov

Hiroki Uemura and others added 8 commits November 8, 2026 11:43
When the footer is narrow, every bulk action moves into the More actions
menu. The menu button now uses the outline style of the inline actions,
so it stands out more than the Clear button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@interacsean interacsean left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an improvement, but I think we can still have a more efficient use of space for the footer on smaller screens. 3 rows, which we see used when there's a selection, is still quite a lot of space

AG Grid actually just starts horizontal-scrolling.

image

If we don't want to use scrolling, some ideas:

  • we can get back a small amount of pixels by using (numRows === 1 ? "row" : "rows") for the row count, rather than always ("row(s)")
  • again only a few pixels but '2/240 selected" instead of "2 of 240 selected"
  • can we collapse 'clear' into the [...] button; or replace it with an icon button (would have to be obvious it is 'clear' and not 'delete'
  • I note MUI hides the rows-per-page control at smaller screen widths
  • We could still indicate the total number of pages without having "1 / 10" if we used page numbers on the buttons. E.g.
    • 1 [2] [3] [4] [10] // page 1
    • [1] 2 [3] [4] [10] // page 2
    • [1] [3] 4 [5] [10] // page 4
    • [1] [7] [8] 9 [10] // page 10
    • (However it seems like this is no longer preferred UX based on other libraries)
  • Or at least remove spaces between "1 / 10" => "1/10"
  • Reduce button size of the << < > >> buttons to 24px — a more compact look may help

Hiroki Uemura added 2 commits November 18, 2026 09:33
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

# Conflicts:
#	docs-manifest.json
@wemra3
wemra3 merged commit e4b5616 into main Nov 18, 2026
8 checks passed
@wemra3
wemra3 deleted the fix/data-table-footer-narrow branch November 18, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants