diff --git a/frontend/src/components/SavedViewsPopover.dom.test.tsx b/frontend/src/components/SavedViewsPopover.dom.test.tsx index 4de6ad92..1cbc9685 100644 --- a/frontend/src/components/SavedViewsPopover.dom.test.tsx +++ b/frontend/src/components/SavedViewsPopover.dom.test.tsx @@ -49,3 +49,24 @@ describe("SavedViewsPopover · Manage views…", () => { await vi.waitFor(() => expect(openModal).toHaveBeenCalledTimes(1)); }); }); + +// E28: the toolbar chip's glyph sat INSIDE the value text, and an is display:block under the +// preflight, so the chip broke onto two lines (the bookmark above "gaming ▾"). The glyph and the +// modified dot ride in the trigger's own slots; the value is a row. +describe("SavedViewsPopover · toolbar chip", () => { + it("puts the glyph in the trigger's icon slot, not inside the value", () => { + render( + + } + trigger={gaming} + ariaLabel="View chip" + /> + , + ); + const button = screen.getByRole("button", { name: "View chip" }); + expect(screen.getByTestId("glyph").parentElement).toBe(button); + expect(screen.getByText("gaming").parentElement!.className).toContain("flex"); + }); +}); diff --git a/frontend/src/components/SavedViewsPopover.tsx b/frontend/src/components/SavedViewsPopover.tsx index a4b15732..c372fd20 100644 --- a/frontend/src/components/SavedViewsPopover.tsx +++ b/frontend/src/components/SavedViewsPopover.tsx @@ -14,12 +14,17 @@ import { SelectTrigger } from "./ui/SelectTrigger"; export default function SavedViewsPopover({ trigger, toolbar = false, + icon, + trailing, ariaLabel, placement = "bottom-start", }: { trigger: ReactNode; /** The toolbar's view chip: the A5 dropdown trigger around `trigger`, instead of a glyph. */ toolbar?: boolean; + /** Toolbar only: the trigger's leading glyph and its after-the-value mark, in their own slots. */ + icon?: ReactNode; + trailing?: ReactNode; ariaLabel?: string; placement?: "bottom-start" | "bottom-end"; }) { @@ -34,6 +39,8 @@ export default function SavedViewsPopover({ -