diff --git a/apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx b/apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx index 7287547df71fc..915ed5f929538 100644 --- a/apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx +++ b/apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx @@ -53,7 +53,9 @@ describe("ExpandedImageDialog", () => { await userEvent.keyboard("{Tab}"); await userEvent.keyboard("{Enter}"); } - await expect.element(page.getByRole("button", { name: "Close image preview" })).toHaveFocus(); + await expect + .element(page.getByRole("button", { name: "Back, close image preview" })) + .toHaveFocus(); await userEvent.keyboard("{Escape}"); await expect.element(opener).toHaveFocus(); expect(opener.element().matches(":focus-visible")).toBe(c.focusVisible); @@ -114,7 +116,9 @@ describe("ExpandedImageDialog", () => { expect(onClose).not.toHaveBeenCalled(); // Focus returns to the popup's trigger and opens its tooltip; leave it for a plain control. - (screen.getByRole("button", { name: "Close image preview" }).element() as HTMLElement).focus(); + ( + screen.getByRole("button", { name: "Back, close image preview" }).element() as HTMLElement + ).focus(); await userEvent.keyboard("{Escape}"); await vi.waitFor(() => expect(onClose).toHaveBeenCalledOnce()); }); diff --git a/apps/web/src/components/chat/ExpandedImageDialog.tsx b/apps/web/src/components/chat/ExpandedImageDialog.tsx index dad9280ad6dca..2d70c5f2ef1dc 100644 --- a/apps/web/src/components/chat/ExpandedImageDialog.tsx +++ b/apps/web/src/components/chat/ExpandedImageDialog.tsx @@ -1,6 +1,12 @@ import { memo, useRef, useState, type ReactNode, type KeyboardEvent } from "react"; import { flushSync } from "react-dom"; -import { ChevronLeftIcon, ChevronRightIcon, XIcon, ImageIcon, TextIcon } from "lucide-react"; +import { + ArrowLeftIcon, + ChevronLeftIcon, + ChevronRightIcon, + ImageIcon, + TextIcon, +} from "lucide-react"; import { Button } from "../ui/button"; import { Dialog, DialogPopup, DialogTitle } from "../ui/dialog"; import type { ExpandedImageItem, ExpandedImagePreview } from "./ExpandedImagePreview"; @@ -174,6 +180,7 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({ - +