diff --git a/solvway-admin-portal/app/components/pages/CmsEdit.tsx b/solvway-admin-portal/app/components/pages/CmsEdit.tsx index 5fce674..97c90fb 100644 --- a/solvway-admin-portal/app/components/pages/CmsEdit.tsx +++ b/solvway-admin-portal/app/components/pages/CmsEdit.tsx @@ -102,7 +102,7 @@ export function ImageSpot({ index, src, className, corner }: { index: number; sr <> {img} > diff --git a/solvway-admin-portal/app/components/pages/visual/VisualEditor.test.tsx b/solvway-admin-portal/app/components/pages/visual/VisualEditor.test.tsx index f890d67..007cbee 100644 --- a/solvway-admin-portal/app/components/pages/visual/VisualEditor.test.tsx +++ b/solvway-admin-portal/app/components/pages/visual/VisualEditor.test.tsx @@ -118,6 +118,17 @@ describe("VisualEditor", () => { expect(section(1)).toHaveAttribute("data-selected", "true"); }); + // A toolbar hung above the section was clipped at the canvas top (first section, or a section scrolled to the top). + it("keeps the section toolbar inside the section, clear of the hero's image button", async () => { + const canvas = await open(); + fireEvent.click(section(0)); + const bar = canvas.getByRole("toolbar"); + expect(bar.className).not.toMatch(/(^|\s)-top-/); + expect(bar.className).toMatch(/(^|\s)top-2(\s|$)/); + expect(bar.className).toMatch(/(^|\s)right-2(\s|$)/); + expect(within(section(0)).getByRole("button", { name: "Image" }).className).toMatch(/(^|\s)left-3(\s|$)/); + }); + it("undoes a delete with Ctrl+Z and redoes it with Ctrl+Shift+Z", async () => { const canvas = await open(); fireEvent.click(section(2)); diff --git a/solvway-admin-portal/app/components/pages/visual/VisualEditor.tsx b/solvway-admin-portal/app/components/pages/visual/VisualEditor.tsx index b3945cc..0662d28 100644 --- a/solvway-admin-portal/app/components/pages/visual/VisualEditor.tsx +++ b/solvway-admin-portal/app/components/pages/visual/VisualEditor.tsx @@ -119,7 +119,7 @@ export function VisualEditor({ p, ask }: { p: Draft; ask: Ask }) { <> {selected === i ? (