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}