Add image art direction, Thai date picker on week board, sturdier image download
- Share IMAGE_ART_DIRECTION between editable image prompts and queued post drafts - Use ThaiDateTimePicker for week board planning; a11y, clear action, mobile layout - Show planned day in Thai format in the generation queue - Wait longer for ChatGPT image download and handle the download menu item Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,9 +88,18 @@ async function image(body, dir) {
|
||||
await generatedImage.click();
|
||||
const downloadButton = page.getByRole("button", { name: /^(download|ดาวน์โหลด)$/i }).last();
|
||||
await downloadButton.waitFor({ state: "visible", timeout: 20_000 });
|
||||
const downloadEvent = page.waitForEvent("download", { timeout: 20_000 });
|
||||
await downloadButton.click();
|
||||
const download = await downloadEvent;
|
||||
const [download] = await Promise.all([
|
||||
page.waitForEvent("download", { timeout: 60_000 }),
|
||||
(async () => {
|
||||
await downloadButton.click();
|
||||
const menuItem = page.getByRole("menuitem", { name: /^(download image|ดาวน์โหลดรูปภาพ)$/i }).first();
|
||||
if (await menuItem.waitFor({ state: "visible", timeout: 1_000 }).then(() => true, () => false)) {
|
||||
await menuItem.click();
|
||||
}
|
||||
})(),
|
||||
]).catch((error) => {
|
||||
throw new Error("ChatGPT image download failed", { cause: error });
|
||||
});
|
||||
const file = await download.path();
|
||||
if (!file) throw new Error("No downloaded image");
|
||||
const dimensions = body.size === "landscape" ? [1536, 1024] : [1024, 1024];
|
||||
|
||||
Reference in New Issue
Block a user