Show milestone progress bar for post generation queue jobs
Add percentage-by-stage progress in the queue UI, a progress rendering test script, and clearer Chrome focus error details in the ChatGPT worker. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ export const POST_JOB_STATUS = {
|
||||
} as const;
|
||||
|
||||
export const POST_JOB_STAGE: Record<string, string> = {
|
||||
queued: "รอ worker รับงาน",
|
||||
queued: "รอเริ่มสร้างโพสต์",
|
||||
content: "Codex กำลังเขียนเนื้อหาและพรอมต์ภาพ",
|
||||
image: "ChatGPT กำลังสร้างภาพ",
|
||||
saving: "กำลังบันทึกฉบับร่าง",
|
||||
@@ -24,3 +24,10 @@ export interface PostJobView {
|
||||
startedAt: string | null;
|
||||
finishedAt: string | null;
|
||||
}
|
||||
|
||||
/** Milestones, not an estimate of the image model's internal rendering progress. */
|
||||
export function postJobProgress(job: Pick<PostJobView, "status" | "stage">): number {
|
||||
if (job.status === "COMPLETED") return 100;
|
||||
if (job.status === "QUEUED" || job.status === "CANCELLED") return 0;
|
||||
return ({ content: 10, image: 50, saving: 90 } as Record<string, number>)[job.stage] ?? 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user