fix(render-page): register completion without requiring a download URL
Build backend images / build content-svc (push) Failing after 56s
Build backend images / build file-svc (push) Failing after 29s
Build backend images / build gateway (push) Failing after 41s
Build backend images / build identity-svc (push) Failing after 5m32s
Build backend images / build notification-svc (push) Failing after 1m18s
Build backend images / build render-svc (push) Failing after 56s
Build backend images / build studio-svc (push) Failing after 1m5s

The full-screen render page only transitioned to "completed" when status was
completed AND an outputUrl existed, so dev renders (which produce no export file)
polled forever at 100%. Now completion is driven by status alone; the download/
share buttons render only when a URL is present, otherwise a "dev render, no file"
note is shown. Same guard helps real renders whose export URL resolves a beat late.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-05 22:13:26 +03:30
parent 43d0e10543
commit 2a6bbcd408
@@ -109,8 +109,8 @@ export default function RenderPage() {
setProgressMessage(data.progressMessage ?? `Rendering… ${data.progress}%`);
if (data.previewB64) setPreviewB64(data.previewB64);
if (data.status === "completed" && data.outputUrl) {
setOutputUrl(data.outputUrl);
if (data.status === "completed") {
if (data.outputUrl) setOutputUrl(data.outputUrl);
setProgress(100);
setPhase("completed");
} else if (data.status === "failed") {
@@ -219,27 +219,36 @@ export default function RenderPage() {
</div>
{/* State-specific panel */}
{phase === "completed" && outputUrl ? (
{phase === "completed" ? (
<div className="w-full max-w-md space-y-3 text-center">
<p className="text-lg font-semibold text-emerald-400">ویدیوی شما آماده است!</p>
<div className="flex flex-col gap-2">
<a
href={outputUrl}
download
className="inline-flex items-center justify-center gap-2 rounded-lg bg-primary-600 px-4 py-3 text-sm font-medium text-white hover:bg-primary-700"
>
<Download className="h-4 w-4" />
دانلود MP4
</a>
<a
href={outputUrl}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center justify-center gap-2 rounded-lg border border-[#2a2d3e] px-4 py-2.5 text-sm text-gray-200 hover:bg-[#161a2b]"
>
<Link2 className="h-4 w-4" />
لینک اشتراکگذاری
</a>
{outputUrl ? (
<>
<a
href={outputUrl}
download
className="inline-flex items-center justify-center gap-2 rounded-lg bg-primary-600 px-4 py-3 text-sm font-medium text-white hover:bg-primary-700"
>
<Download className="h-4 w-4" />
دانلود MP4
</a>
<a
href={outputUrl}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center justify-center gap-2 rounded-lg border border-[#2a2d3e] px-4 py-2.5 text-sm text-gray-200 hover:bg-[#161a2b]"
>
<Link2 className="h-4 w-4" />
لینک اشتراکگذاری
</a>
</>
) : (
<p className="rounded-lg border border-[#2a2d3e] bg-[#0c0e1a] px-3 py-2.5 text-xs text-gray-400">
رندر در محیط توسعه کامل شد (بدون فایل خروجی واقعی). در محیط تولید، لینک دانلود اینجا
نمایش داده میشود.
</p>
)}
<Link
href={backToStudio}
className="mt-1 text-xs text-gray-500 hover:text-gray-300"