Skip to content

Commit 1d74ae5

Browse files
committed
fix(studio): complete GIF export review follow-ups
1 parent f203896 commit 1d74ae5

4 files changed

Lines changed: 40 additions & 10 deletions

File tree

‎docs/guides/rendering.mdx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ The whole loop: the project, the render command, progress, and the finished file
1717
playing. The flags shown are the ones people actually reach for — format,
1818
resolution, frame rate, quality.
1919

20+
## Export a GIF from Studio
21+
22+
Open the **Renders** panel, choose **GIF**, set the loop count, and click **Export**.
23+
Use `0` to loop forever or an integer from `1` to `65535` for a finite loop count.
24+
GIF exports have no audio and are capped at 30 fps; the 60 fps option is disabled
25+
while GIF is selected. Finished GIFs preview in the render list and can be
26+
opened, downloaded, or deleted there.
27+
2028
## Render a normal video
2129

2230
From the project folder:

‎packages/studio-server/src/history/uncopied.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ describe("project history and media files", () => {
7171
expect(blobBytes(historyRoot, history)).toBeLessThan(1024);
7272
});
7373

74+
it("leaves GIF render outputs out of project history", async () => {
75+
const { history, historyRoot, projectDir, write } = await project({ "index.html": "A" });
76+
const render = await history.beginWindow(you, "Export GIF");
77+
write("renders/export.gif", Buffer.alloc(2 * MiB, 7));
78+
const entry = await render.close();
79+
expect(entry?.files ?? []).toEqual([]);
80+
expect(history.peek("start")).not.toHaveProperty(["renders/export.gif"]);
81+
expect(statSync(join(projectDir, "renders/export.gif")).size).toBe(2 * MiB);
82+
expect(blobBytes(historyRoot, history)).toBeLessThan(1024);
83+
});
84+
7485
it("copies no bytes of media written or replaced while history is open", async () => {
7586
const { history, historyRoot, write } = await project({ "index.html": "A" });
7687
const window = await history.beginWindow(you, "Render");
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function formatEta(ms: number): string {
2+
const s = Math.round(ms / 1000);
3+
return s < 60 ? `${s}s` : `${Math.floor(s / 60)}m ${s % 60}s`;
4+
}
5+
6+
export function RenderDurationNote({
7+
durationMs,
8+
isRendering,
9+
}: {
10+
durationMs?: number;
11+
isRendering: boolean;
12+
}) {
13+
if (durationMs === undefined || isRendering) return null;
14+
return (
15+
<p className="text-step-9 text-text-5 text-center -mt-1.5">
16+
Last render took {formatEta(durationMs)}
17+
</p>
18+
);
19+
}

‎packages/studio/src/components/renders/RenderQueue.tsx‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { memo, useState, useRef, useEffect, useLayoutEffect, useId } from "react";
22
import { createPortal } from "react-dom";
33
import { CANVAS_DIMENSIONS } from "@hyperframes/parsers";
4+
import { RenderDurationNote } from "./RenderDurationNote";
45
import { RenderQueueItem } from "./RenderQueueItem";
56
import { FfmpegRequiredNotice } from "./FfmpegRequiredNotice";
67
import type { FfmpegStatus } from "./useFfmpegStatus";
@@ -272,11 +273,6 @@ const QUALITY_OPTIONS: SelectOption[] = [
272273
{ value: "high", label: "High Quality" },
273274
];
274275

275-
function formatEta(ms: number): string {
276-
const s = Math.round(ms / 1000);
277-
return s < 60 ? `${s}s` : `${Math.floor(s / 60)}m ${s % 60}s`;
278-
}
279-
280276
function FormatExportButton({
281277
onStartRender,
282278
isRendering,
@@ -432,11 +428,7 @@ function FormatExportButton({
432428
>
433429
{isRendering ? "Rendering…" : "Export"}
434430
</Button>
435-
{lastRenderDurationMs !== undefined && !isRendering && (
436-
<p className="text-step-9 text-text-5 text-center -mt-1.5">
437-
Last render took {formatEta(lastRenderDurationMs)}
438-
</p>
439-
)}
431+
<RenderDurationNote durationMs={lastRenderDurationMs} isRendering={isRendering} />
440432
</div>
441433
);
442434
}

0 commit comments

Comments
 (0)