📱 sweep the last shrink-0 action row into the same pattern
Browse files at this commita3421b2656a5df7ad92becadf6eb4e0581a1f2a7Parent: 90cf972- fix
- 📱 sweep the last shrink-0 action row into the same pattern
2 changed files +4 -2
src/components/layout/page-header.tsxmodified+1 -1
| @@ -55,7 +55,7 @@ export function PageHeader( | |||
| 55 | {props.children} | 55 | {props.children} |
| 56 | </div> | 56 | </div> |
| 57 | <Show when={props.actions}> | 57 | <Show when={props.actions}> |
| 58 | - <div class="flex shrink-0 flex-wrap items-center gap-2">{props.actions}</div> | 58 | + <div class="flex min-w-0 flex-wrap items-center gap-2">{props.actions}</div> |
| 59 | </Show> | 59 | </Show> |
| 60 | </div> | 60 | </div> |
| 61 | </div> | 61 | </div> |
src/components/ui/data-table.test.tsxmodified+3 -1
| @@ -2,6 +2,7 @@ import { fireEvent, render, screen } from "@solidjs/testing-library"; | |||
| 2 | import type { ColumnDef } from "@tanstack/solid-table"; | 2 | import type { ColumnDef } from "@tanstack/solid-table"; |
| 3 | import { DataTable } from "@/components/ui/data-table"; | 3 | import { DataTable } from "@/components/ui/data-table"; |
| 4 | import { DataSection } from "@/components/ui/data-section"; | 4 | import { DataSection } from "@/components/ui/data-section"; |
| 5 | +import { PageHeader } from "@/components/layout/page-header"; | ||
| 5 | import { PreferencesProvider } from "@/stores/preferences-context"; | 6 | import { PreferencesProvider } from "@/stores/preferences-context"; |
| 6 | 7 | ||
| 7 | type Row = { name: string; role?: string }; | 8 | type Row = { name: string; role?: string }; |
| @@ -136,11 +137,12 @@ test("the header action toolbar of every shared host can shrink below its max-co | |||
| 136 | /> | 137 | /> |
| 137 | </PreferencesProvider> | 138 | </PreferencesProvider> |
| 138 | <DataSection title="Card" actions={<button type="button">Export</button>} /> | 139 | <DataSection title="Card" actions={<button type="button">Export</button>} /> |
| 140 | + <PageHeader title="Page" actions={<button type="button">Export</button>} /> | ||
| 139 | </> | 141 | </> |
| 140 | )); | 142 | )); |
| 141 | 143 | ||
| 142 | const toolbars = screen.getAllByText("Export").map((action) => action.parentElement as HTMLElement); | 144 | const toolbars = screen.getAllByText("Export").map((action) => action.parentElement as HTMLElement); |
| 143 | - expect(toolbars).toHaveLength(2); | 145 | + expect(toolbars).toHaveLength(3); |
| 144 | for (const toolbar of toolbars) { | 146 | for (const toolbar of toolbars) { |
| 145 | expect(toolbar.classList).toContain("flex-wrap"); | 147 | expect(toolbar.classList).toContain("flex-wrap"); |
| 146 | expect(toolbar.classList).toContain("min-w-0"); | 148 | expect(toolbar.classList).toContain("min-w-0"); |