From ffc324a80468d96bf5e10b5e745b7c2df586798f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 18 Sep 2026 02:36:42 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=93=B1=20let=20the=20header=20acti?= =?UTF-8?q?on=20toolbar=20shrink=20on=20narrow=20viewports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the shared header toolbar (DataTable's actions row and DataSection's twin) carried `shrink-0`, so on a 390px viewport it kept its max-content width inside the constrained parent and widened the whole document: on /management/modules document.scrollWidth measured 431 against a 390 viewport - replace `shrink-0` with `min-w-0` on both hosts, keeping `flex flex-wrap` and the `[&_button]` utilities: the row may now shrink below its content width and the action buttons wrap onto extra lines instead of overflowing, and the two renderings cannot drift apart - the table's own data-table-wrap is untouched; it already scrolls internally - guard it with a test that renders both hosts and pins `min-w-0` without `shrink-0` on each toolbar (fails before this commit, passes after) --- src/components/ui/data-section.tsx | 2 +- src/components/ui/data-table.test.tsx | 28 +++++++++++++++++++++++++++ src/components/ui/data-table.tsx | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/ui/data-section.tsx b/src/components/ui/data-section.tsx index 047e58b..046f560 100644 --- a/src/components/ui/data-section.tsx +++ b/src/components/ui/data-section.tsx @@ -22,7 +22,7 @@ export function DataSection( -
{props.actions}
+
{props.actions}
diff --git a/src/components/ui/data-table.test.tsx b/src/components/ui/data-table.test.tsx index 652d733..19d91de 100644 --- a/src/components/ui/data-table.test.tsx +++ b/src/components/ui/data-table.test.tsx @@ -1,6 +1,7 @@ import { fireEvent, render, screen } from "@solidjs/testing-library"; import type { ColumnDef } from "@tanstack/solid-table"; import { DataTable } from "@/components/ui/data-table"; +import { DataSection } from "@/components/ui/data-section"; import { PreferencesProvider } from "@/stores/preferences-context"; type Row = { name: string; role?: string }; @@ -119,3 +120,30 @@ test("a display column renders its own cell instead of the empty dash", () => { expect(screen.getByText("#ada")).toBeTruthy(); }); + +test("the header action toolbar of every shared host can shrink below its max-content width", () => { + // `shrink-0` plus the flex default `min-width: auto` pinned the toolbar to + // its max-content width, so a wide action row pushed the whole document + // past a 390px viewport instead of wrapping inside the constrained parent. + render(() => ( + <> + + Export} + /> + + Export} /> + + )); + + const toolbars = screen.getAllByText("Export").map((action) => action.parentElement as HTMLElement); + expect(toolbars).toHaveLength(2); + for (const toolbar of toolbars) { + expect(toolbar.classList).toContain("flex-wrap"); + expect(toolbar.classList).toContain("min-w-0"); + expect(toolbar.classList).not.toContain("shrink-0"); + } +}); diff --git a/src/components/ui/data-table.tsx b/src/components/ui/data-table.tsx index 2800e0f..c5b1ac1 100644 --- a/src/components/ui/data-table.tsx +++ b/src/components/ui/data-table.tsx @@ -264,7 +264,7 @@ export function DataTable(props: DataTableProps -
{props.actions}
+
{props.actions}