Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix: address CodeRabbit review feedback
Etienne Lescot411171ce5dd3
diff --git a/electron/recording/webm-duration.test.ts b/electron/recording/webm-duration.test.tsindex e5719c450..d796bb36b 100644--- a/electron/recording/webm-duration.test.ts+++ b/electron/recording/webm-duration.test.ts@@ -5,6 +5,11 @@ import { WebmBase, WebmContainer, WebmFile, WebmString, WebmUint } from "@fix-weimport { afterEach, beforeEach, describe, expect, it } from "vitest";import { patchWebmDurationOnDisk } from "./webm-duration";+interface WebmElementMock {+ getSectionById: (id: number) => WebmElementMock;+ getValue: () => number;+}+describe("webm-duration patching", () => {let dir: string;const pathFor = (name: string) => path.join(dir, name);@@ -70,10 +75,6 @@ describe("webm-duration patching", () => {const patchedBytes = await readFile(filePath);const webm = new WebmFile(new Uint8Array(patchedBytes));- interface WebmElementMock {- getSectionById: (id: number) => WebmElementMock;- getValue: () => number;- }const segment = webm.getSectionById(0x8538067) as unknown as WebmElementMock;const info = segment.getSectionById(0x549a966);diff --git a/electron/recording/webm-duration.ts b/electron/recording/webm-duration.tsindex 4e5a847cb..d9b4b6197 100644--- a/electron/recording/webm-duration.ts+++ b/electron/recording/webm-duration.ts@@ -130,14 +130,13 @@ export async function patchWebmDurationOnDisk(const ws = createWriteStream(tmpPath);const rs = createReadStream(filePath, { start: clusterOffset });- await new Promise<void>((resolve, reject) => {- ws.write(patchedBytes, (err) => {- if (err) reject(err);- else resolve();- });- });-try {+ await new Promise<void>((resolve, reject) => {+ ws.write(patchedBytes, (err) => {+ if (err) reject(err);+ else resolve();+ });+ });await pipeline(rs, ws);} finally {rs.destroy();diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsxindex db789cce2..b8cf24f22 100644--- a/src/components/launch/LaunchWindow.tsx+++ b/src/components/launch/LaunchWindow.tsx@@ -82,17 +82,16 @@ function getIcon(name: IconName, className?: string) {return <Icon size={size} className={className} />;}-const hudGroupClasses =- "flex items-center gap-0.5 rounded-xl border border-white/[0.07] bg-white/[0.045] transition-colors duration-150 hover:bg-white/[0.075] disabled:opacity-30 disabled:cursor-not-allowed disabled:pointer-events-none";+const hudDisabledClasses =+ "disabled:opacity-30 disabled:cursor-not-allowed disabled:pointer-events-none";-const hudIconBtnClasses =- "flex h-8 w-8 items-center justify-center rounded-lg transition-all duration-150 cursor-pointer text-white hover:bg-white/10 active:scale-95 disabled:opacity-30 disabled:cursor-not-allowed disabled:pointer-events-none";+const hudGroupClasses = `flex items-center gap-0.5 rounded-xl border border-white/[0.07] bg-white/[0.045] transition-colors duration-150 hover:bg-white/[0.075] ${hudDisabledClasses}`;-const hudAuxIconBtnClasses =- "flex h-7 w-7 items-center justify-center rounded-lg transition-colors duration-150 text-white/55 hover:bg-white/10 disabled:opacity-30 disabled:cursor-not-allowed disabled:pointer-events-none";+const hudIconBtnClasses = `flex h-8 w-8 items-center justify-center rounded-lg transition-all duration-150 cursor-pointer text-white hover:bg-white/10 active:scale-95 ${hudDisabledClasses}`;-const windowBtnClasses =- "flex h-8 w-8 items-center justify-center rounded-lg transition-all duration-150 cursor-pointer opacity-50 hover:opacity-90 hover:bg-white/[0.08] disabled:opacity-30 disabled:cursor-not-allowed disabled:pointer-events-none";+const hudAuxIconBtnClasses = `flex h-7 w-7 items-center justify-center rounded-lg transition-colors duration-150 text-white/55 hover:bg-white/10 ${hudDisabledClasses}`;++const windowBtnClasses = `flex h-8 w-8 items-center justify-center rounded-lg transition-all duration-150 cursor-pointer opacity-50 hover:opacity-90 hover:bg-white/[0.08] ${hudDisabledClasses}`;const hudSidebarClasses = "ml-0.5 pl-1.5 border-l border-white/10 flex items-center gap-0.5";const hudSidebarVerticalClasses =@@ -1062,7 +1061,11 @@ export function LaunchWindow() {<Tooltipcontent={paused ? t("tooltips.resumeRecording") : t("tooltips.pauseRecording")}>- <button className={hudAuxIconBtnClasses} onClick={togglePaused}>+ <button+ className={hudAuxIconBtnClasses}+ onClick={() => !saving && togglePaused()}+ disabled={saving}+ >{getIcon(paused ? "resume" : "pause",paused ? "text-amber-400" : "text-white/60",@@ -1071,12 +1074,20 @@ export function LaunchWindow() {</Tooltip>)}<Tooltip content={t("tooltips.restartRecording")}>- <button className={hudAuxIconBtnClasses} onClick={restartRecording}>+ <button+ className={hudAuxIconBtnClasses}+ onClick={() => !saving && restartRecording()}+ disabled={saving}+ >{getIcon("restart", "text-white/60")}</button></Tooltip><Tooltip content={t("tooltips.cancelRecording")}>- <button className={hudAuxIconBtnClasses} onClick={cancelRecording}>+ <button+ className={hudAuxIconBtnClasses}+ onClick={() => !saving && cancelRecording()}+ disabled={saving}+ >{getIcon("cancel", "text-white/60")}</button></Tooltip>diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.tsindex fa6d92744..72ddc529b 100644--- a/src/hooks/useScreenRecorder.ts+++ b/src/hooks/useScreenRecorder.ts@@ -312,7 +312,12 @@ export function useScreenRecorder(): UseScreenRecorderReturn {return;}finalizingRecordingId.current = activeRecordingId;- setSaving(true);+ // Only show the "Saving…" spinner for genuine saves — not for cancel/restart+ // flows where discardRecordingId has already been set.+ const isDiscarded = discardRecordingId.current === activeRecordingId;+ if (!isDiscarded) {+ setSaving(true);+ }if (screenRecorder.current === activeScreenRecorder) {screenRecorder.current = null;