🐛 Allow SVG files for image fills (#10771)

Use Penpot's shared image type list for image fill uploads and add an integration test covering SVG file selection.

AI-assisted-by: gpt-5.6-sol

Signed-off-by: Lucas Ozdemir <lulu.58@outlook.fr>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
Lucas Ozdemir 2026-07-23 13:32:06 +02:00 committed by GitHub
parent 19bdd7081b
commit 3fa7943344
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 1 deletions

View File

@ -24,6 +24,35 @@ test("Bug 7549 - User clicks on color swatch to display the color picker next to
expect(distance).toBeLessThan(60);
});
test("Bug 10756 - Image fill picker accepts SVG files", async ({ page }) => {
const workspacePage = new WasmWorkspacePage(page);
await workspacePage.setupEmptyFile();
await workspacePage.mockRPC(
/get\-file\?/,
"workspace/get-file-not-empty.json",
);
await workspacePage.mockRPC(
"update-file?id=*",
"workspace/update-file-create-rect.json",
);
await workspacePage.goToWorkspace({
fileId: "6191cd35-bb1f-81f7-8004-7cc63d087374",
pageId: "6191cd35-bb1f-81f7-8004-7cc63d087375",
});
await workspacePage.clickLeafLayer("Rectangle");
await workspacePage.page
.getByRole("button", { name: "#B1B2B5" })
.click();
await workspacePage.page.getByText("Solid").click();
await workspacePage.page.getByText("Image").click();
await expect(workspacePage.page.locator("#fill-image-upload")).toHaveAttribute(
"accept",
/(?:^|,)image\/svg\+xml(?:,|$)/,
);
});
test("Create a LINEAR gradient", async ({ page }) => {
const workspacePage = new WasmWorkspacePage(page);
await workspacePage.setupEmptyFile();

View File

@ -489,7 +489,7 @@
(tr "media.choose-image")
[:& file-uploader
{:input-id "fill-image-upload"
:accept "image/jpeg,image/png"
:accept dwm/accept-image-types
:multi false
:ref fill-image-ref
:on-selected on-fill-image-selected}]]])