Skip to content

fix(data-table): compact the footer at phone widths - #742

Open
wemra3 wants to merge 2 commits into
mainfrom
fix/data-table-footer-compact
Open

wemra3 wants to merge 2 commits into
mainfrom
fix/data-table-footer-compact

Conversation

@wemra3

@wemra3 wemra3 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #685, based on the review comments there. Part of the mobile umbrella tailor-inc/platform-planning#2207.

After #685, the footer still takes three lines at 375 px when rows are selected, and four lines in Japanese. This PR makes the footer more compact when the footer is narrower than 480 px. With rows selected, it now takes two lines at 375 px. Without a selection, it takes one line.

Changes

Below 480 px (the same data-table-footer container query as #685):

  • DataTable.Pagination hides the page-size switcher, as MUI does.
  • The page text is shortened from "Page 1 / 10" to "1/10".
  • The selection count is shortened from "2 of 240 selected" to "2/240 selected", in the bulk-action bar and in DataTable.Pagination. Japanese: "2/240 行を選択中". Screen readers still get the full text, and the live region still announces the full text.
  • The page buttons shrink from 36 px to 28 px. This stays above the 24 px minimum target size (WCAG 2.5.8).

At all widths:

  • English row counts use "row" or "rows" by count instead of "row(s)".

Nothing else changes at 480 px or wider.

From the review suggestions, this PR does not take these:

  • Moving Clear into the menu or making it an icon. After the changes above, the bar already fits on one line in English and Japanese, so this would not save a line. An icon could also be read as "delete".
  • Page numbers on the buttons. The review noted that other libraries no longer prefer this.
  • Horizontal scrolling. It would hide controls off screen.

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. Repeat with the browser language set to Japanese.

Results

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

State Footer height (px), before → after Lines, before → after
English, no selection 97 → 45 2 → 1
English, 2 rows selected 137 → 85 3 → 2
Japanese, 2 rows selected 175 → 85 4 → 2
1024 px, 2 rows selected no change no change

Screenshots

Checks

  • vitest run src/components/data-table: 833 passed. New tests cover the short and full texts (classes and aria-hidden), the singular and plural forms, and the Japanese short text.
  • lint, type-check, oxfmt, docs:check.
  • Docs updated in docs-src and synced. Patch changeset added.

🤖 Generated with Claude Code

Hiroki Uemura added 2 commits November 18, 2026 20:58
Below a 480px footer, hide the page-size switcher, shorten the page text
to 1/5 and the selection count to 3/240 selected (full text kept for
screen readers), and shrink the page buttons to 28px. With rows selected
the footer takes two lines at 375px instead of three (four in Japanese).
English row counts use row or rows instead of row(s).
@wemra3
wemra3 requested a review from a team as a code owner November 18, 2026 12:06
@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (e4b5616) #742 (2d6b2ba) +/-
Coverage 62.9% 62.9% +0.0%
Test Execution Time 4m29s 3m33s -56s
Details
  |                     | main (e4b5616) | #742 (2d6b2ba) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          62.9% |          62.9% | +0.0% |
  |   Files             |            294 |            294 |     0 |
  |   Lines             |          13513 |          13525 |   +12 |
+ |   Covered           |           8505 |           8513 |    +8 |
+ | Test Execution Time |          4m29s |          3m33s |  -56s |

Code coverage of files in pull request scope (10.4% → 10.6%, patch 93.3%)

Files Coverage +/- Patch Coverage Status
packages/core/dist/app-shell.js 8.5% -0.1% - affected
packages/core/src/components/data-table/i18n.ts 61.7% +8.4% 85.7% modified
packages/core/src/components/data-table/pagination.tsx 95.4% 0.0% 100.0% modified
packages/core/src/components/data-table/selection-bar.tsx 100.0% 0.0% 100.0% modified

Reported by octocov

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.

1 participant