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
feat(launch): add the after-recording auto-zoom toggle
超超超超超级喜欢你的达妮娅4c5003b389e5
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.tsindex 57f8f507a..c5100fe11 100644--- a/electron/ipc/handlers.ts+++ b/electron/ipc/handlers.ts@@ -608,6 +608,8 @@ export interface RecordingPrefs {camDeviceId: string | null;systemAudioEnabled: boolean;cursorCaptureMode: CursorCaptureMode;+ /** After a take, suggest cursor-dwell zooms. Default on, matching 1.5. */+ autoZoomEnabled: boolean;}let recordingPrefs: RecordingPrefs = {micEnabled: false,@@ -617,6 +619,7 @@ let recordingPrefs: RecordingPrefs = {camDeviceId: null,systemAudioEnabled: false,cursorCaptureMode: "editable-overlay",+ autoZoomEnabled: true,};// Cached source from the user's pick. Used by setDisplayMediaRequestHandler in main.ts for cursor-free capture.diff --git a/src/components/ai-edition/v4/RecStage.test.tsx b/src/components/ai-edition/v4/RecStage.test.tsxnew file mode 100644index 000000000..ac98dbe3e--- /dev/null+++ b/src/components/ai-edition/v4/RecStage.test.tsx@@ -0,0 +1,113 @@+// @vitest-environment jsdom+import "@testing-library/jest-dom";+import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { RecStage } from "./RecStage";++vi.mock("@/contexts/I18nContext", () => ({+ useScopedT: () => (key: string) => key,+}));++vi.mock("@/hooks/useMicrophoneDevices", () => ({+ useMicrophoneDevices: () => ({+ devices: [],+ selectedDeviceId: "default",+ setSelectedDeviceId: vi.fn(),+ isLoading: false,+ }),+}));++vi.mock("@/hooks/useCameraDevices", () => ({+ useCameraDevices: () => ({+ devices: [],+ selectedDeviceId: "",+ setSelectedDeviceId: vi.fn(),+ isLoading: false,+ error: null,+ }),+}));++vi.mock("@/hooks/useAudioLevelMeter", () => ({+ useAudioLevelMeter: () => ({ level: 0 }),+}));++vi.mock("@/hooks/useCameraPreviewStream", () => ({+ useCameraPreviewStream: () => ({ stream: null, error: null }),+}));++vi.mock("@/hooks/usePortalOwnsSource", () => ({+ usePortalOwnsSource: () => false,+}));++function stubRecordingPrefs(prefs: Record<string, unknown> = {}) {+ const getRecordingPrefs = vi.fn(async () => prefs);+ const setRecordingPrefs = vi.fn(async () => undefined);+ (window as unknown as { electronAPI?: unknown }).electronAPI = {+ getRecordingPrefs,+ setRecordingPrefs,+ getSelectedSource: vi.fn(async () => null),+ };+ return { getRecordingPrefs, setRecordingPrefs };+}++function renderRecStage() {+ const onStartRecording = vi.fn();+ render(<RecStage onStartRecording={onStartRecording} />);+ return { onStartRecording };+}++describe("RecStage auto-zoom", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ });++ afterEach(() => {+ cleanup();+ (window as unknown as { electronAPI?: unknown }).electronAPI = undefined;+ });++ it("defaults on when a legacy prefs blob has no autoZoomEnabled key", async () => {+ const { getRecordingPrefs } = stubRecordingPrefs({+ micEnabled: false,+ cursorCaptureMode: "editable-overlay",+ });+ renderRecStage();+ await waitFor(() => {+ expect(getRecordingPrefs).toHaveBeenCalled();+ });+ const button = await screen.findByTestId("rec-auto-zoom-button");+ expect(button).toHaveAttribute("aria-pressed", "true");+ expect(button).toHaveTextContent("rec.on");+ expect(button).toBeEnabled();+ });++ it("writes autoZoomEnabled through setRecordingPrefs on click", async () => {+ const { setRecordingPrefs } = stubRecordingPrefs({+ cursorCaptureMode: "editable-overlay",+ autoZoomEnabled: true,+ });+ renderRecStage();+ const button = await screen.findByTestId("rec-auto-zoom-button");+ await waitFor(() => {+ expect(button).toBeEnabled();+ });+ fireEvent.click(button);+ expect(setRecordingPrefs).toHaveBeenCalledWith({ autoZoomEnabled: false });+ });++ it("disables auto-zoom while Rec-stage cursor capture is system", async () => {+ const { setRecordingPrefs } = stubRecordingPrefs({+ cursorCaptureMode: "system",+ autoZoomEnabled: true,+ });+ renderRecStage();+ const button = await screen.findByTestId("rec-auto-zoom-button");+ await waitFor(() => {+ expect(button).toBeDisabled();+ });+ expect(button).toHaveAttribute("title", "rec.autoZoomNeedsEditableCursor");+ expect(button).toHaveAttribute("aria-pressed", "false");+ fireEvent.click(button);+ expect(setRecordingPrefs).not.toHaveBeenCalled();+ });+});diff --git a/src/components/ai-edition/v4/RecStage.tsx b/src/components/ai-edition/v4/RecStage.tsxindex 9ad6975ad..cc8585ece 100644--- a/src/components/ai-edition/v4/RecStage.tsx+++ b/src/components/ai-edition/v4/RecStage.tsx@@ -9,6 +9,7 @@ import {MousePointer2,Volume2,VolumeX,+ ZoomIn,} from "lucide-react";import { useEffect, useRef, useState } from "react";import { AudioLevelMeter } from "@/components/ui/audio-level-meter";@@ -28,6 +29,7 @@ interface RecordingPrefsState {camDeviceId: string | null;systemAudioEnabled: boolean;cursorCaptureMode: "editable-overlay" | "system";+ autoZoomEnabled: boolean;}const DEFAULT_PREFS: RecordingPrefsState = {@@ -38,6 +40,7 @@ const DEFAULT_PREFS: RecordingPrefsState = {camDeviceId: null,systemAudioEnabled: false,cursorCaptureMode: "editable-overlay",+ autoZoomEnabled: true,};/**@@ -67,7 +70,13 @@ export function RecStage({void window.electronAPI?.getRecordingPrefs?.().then((p) => {- if (!cancelled && p) setPrefsState(p as RecordingPrefsState);+ if (!cancelled && p) {+ setPrefsState({+ ...DEFAULT_PREFS,+ ...p,+ autoZoomEnabled: p.autoZoomEnabled !== false,+ } as RecordingPrefsState);+ }}).catch((err) => {// Bare ipcRenderer.invoke — rejects if the main handler throws. Keeping@@ -370,6 +379,27 @@ export function RecStage({{cursorHighlight ? t("rec.on") : t("rec.off")}</button></div>++ <div className={styles.recRow}>+ <div className={styles.recRowLabel}>+ <ZoomIn size={15} />+ {t("rec.autoZoom")}+ </div>+ <button+ type="button"+ data-testid="rec-auto-zoom-button"+ className={`${styles.recToggleBtn}${prefs.autoZoomEnabled !== false && cursorHighlight ? ` ${styles.on}` : ""}`}+ aria-pressed={prefs.autoZoomEnabled !== false && cursorHighlight}+ disabled={!cursorHighlight}+ title={cursorHighlight ? undefined : t("rec.autoZoomNeedsEditableCursor")}+ onClick={() => {+ if (!cursorHighlight) return;+ updatePrefs({ autoZoomEnabled: prefs.autoZoomEnabled === false });+ }}+ >+ {prefs.autoZoomEnabled !== false && cursorHighlight ? t("rec.on") : t("rec.off")}+ </button>+ </div></div></div>diff --git a/src/components/ai-edition/v4/V4Timeline.tsx b/src/components/ai-edition/v4/V4Timeline.tsxindex 86524447c..8dd426376 100644--- a/src/components/ai-edition/v4/V4Timeline.tsx+++ b/src/components/ai-edition/v4/V4Timeline.tsx@@ -28,7 +28,7 @@ import {import { toast } from "sonner";import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";import { Tooltip, TooltipProvider } from "@/components/ui/tooltip";-import { fromFileUrl, toFileUrl } from "@/components/video-editor/projectPersistence";+import { toFileUrl } from "@/components/video-editor/projectPersistence";import { ZOOM_DEPTH_SCALES } from "@/components/video-editor/types";import { useScopedT } from "@/contexts/I18nContext";import { useShortcuts } from "@/contexts/ShortcutsContext";@@ -52,6 +52,7 @@ import { useTimelineTranscriptGate } from "@/lib/ai-edition/store/transcriptionSimport { useChatPromptBus } from "@/lib/ai-edition/store/useChatPromptBus";import { useEditorSettings } from "@/lib/ai-edition/store/useEditorSettings";import type { useTimeline } from "@/lib/ai-edition/store/useTimeline";+import { collectAutoZoomSuggestionsForDocument } from "@/lib/ai-edition/timeline/apply-auto-zooms";import { hasAnyClipWithCamera } from "@/lib/ai-edition/timeline/camera";import { formatSec } from "@/lib/ai-edition/timeline/format";import {@@ -65,10 +66,6 @@ import {resolveTimelineSpanToTrim,ventilateTimelineSpanToTrims,} from "@/lib/ai-edition/timeline/trim-mapping";-import {- type AutoZoomSuggestion,- buildAutoZoomSuggestionsForClips,-} from "@/lib/ai-edition/timeline/zoom-suggestions";import { formatBinding } from "@/lib/shortcuts";import { nativeBridgeClient } from "@/native/client";import { TransportBar } from "../TransportBar";@@ -1484,44 +1481,15 @@ export function V4Timeline({// timeline was previously never consulted at all.const runAutoZooms = useCallback(async () => {setAutoEnhanceOpen(false);- const sources = videoSources.filter((source) => clips.some((c) => c.assetId === source.id));- if (sources.length === 0) {+ const document = useProjectStore.getState().document;+ if (!document || document.timeline.clips.length === 0) {toast.error(t("toolbar.importRecordingFirst"));return;}setAutoBusy(true);try {- // Telemetry first, and nothing derived from the document until it is back.- // `Promise.all` preserves input order, so the suggestions still come out in the- // same sequence a loop would have produced.- const perSource = await Promise.all(- sources.map(async (source) => ({- assetId: source.id,- telemetry: (await nativeBridgeClient.cursor.getTelemetry(fromFileUrl(source.src))) ?? [],- })),- );- // Read AFTER the round trip, not before it. `addZoomsBulk` anchors what comes out- // of here against the document IT reads at write time, so building the spans from- // the pre-await `clips` puts the two halves on different rulers: a trim landing- // during the wait moves every clip, and a span that no longer falls in one is- // stored unanchored. A stale `zoomRegions` is the same shape one step over — a- // zoom the user added during the wait would not be reserved, and the region- // minted here would sit on top of it.- //- // Still read ONCE for every asset rather than per asset: each clip reserves- // against the zooms the document already holds, and two clips can never contest- // the same stretch of ruler, so nothing depends on the order they are visited.- const doc = useProjectStore.getState().document;- if (!doc) return;- const existingRegions = doc.zoomRanges.map((z) => ({ startMs: z.startMs, endMs: z.endMs }));- const suggestions: AutoZoomSuggestion[] = perSource.flatMap(({ assetId, telemetry }) =>- buildAutoZoomSuggestionsForClips({- cursorTelemetry: telemetry,- assetId,- clips: doc.timeline.clips,- existingRegions,- defaultDurationMs: 2000,- }),+ const suggestions = await collectAutoZoomSuggestionsForDocument(document, (videoPath) =>+ nativeBridgeClient.cursor.getTelemetry(videoPath),);if (suggestions.length === 0) {toast.info(t("toolbar.noAutoZoomMoments"), {@@ -1544,7 +1512,7 @@ export function V4Timeline({} finally {setAutoBusy(false);}- }, [videoSources, clips, tl, t]);+ }, [tl, t]);// Auto-enhance option 2 — hand a generic prompt to the AI agent (smart// zooms + cuts) via the chat prompt-bus. The chat panel owns the outcomediff --git a/src/components/launch/HudControls.tsx b/src/components/launch/HudControls.tsxindex 360499c79..72547f29c 100644--- a/src/components/launch/HudControls.tsx+++ b/src/components/launch/HudControls.tsx@@ -4,6 +4,7 @@ import { formatTimePadded } from "../../utils/timeUtils";import { Button } from "../ui/button";import { Tooltip } from "../ui/tooltip";import {+ AutoZoomIcon,CameraIcon,CursorIcon,getIcon,@@ -253,6 +254,35 @@ export const HudSettingsButton = memo(function HudSettingsButton({);});+export const HudAutoZoomButton = memo(function HudAutoZoomButton({+ enabled,+ disabled,+ label,+ onClick,+}: {+ enabled: boolean;+ disabled: boolean;+ label: string;+ onClick: () => void;+}) {+ return (+ <button+ data-testid="launch-auto-zoom-button"+ className={`flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-[10px] border-0 cursor-pointer transition-all duration-150 active:scale-95 ${hudDisabledClasses} ${styles.electronNoDrag} ${+ enabled+ ? "bg-[#10b981] text-[#08090d] hover:bg-[#0e9e6e]"+ : "bg-transparent text-[#828c99] hover:bg-[#1a1e25] hover:text-[#f5f7fa]"+ }`}+ aria-pressed={enabled}+ onClick={onClick}+ disabled={disabled}+ title={label}+ >+ <AutoZoomIcon />+ </button>+ );+});+export const HudCursorButton = memo(function HudCursorButton({editableOverlay,disabled,diff --git a/src/components/launch/HudIcons.tsx b/src/components/launch/HudIcons.tsxindex 0ec73bdff..f8e527abb 100644--- a/src/components/launch/HudIcons.tsx+++ b/src/components/launch/HudIcons.tsx@@ -117,6 +117,16 @@ export function CameraIcon({ off, className }: { off: boolean; className?: strin);}+export function AutoZoomIcon({ className }: { className?: string }) {+ return (+ <svg {...HUD_SVG_PROPS} className={className} aria-hidden="true">+ <circle cx="10.5" cy="10.5" r="5.5" />+ <path d="M14.5 14.5 20 20" />+ <path d="M10.5 8v5M8 10.5h5" />+ </svg>+ );+}+export function CursorIcon({ className }: { className?: string }) {return (<svgdiff --git a/src/components/launch/LaunchWindow.test.tsx b/src/components/launch/LaunchWindow.test.tsxindex 60894f9e0..0632d524d 100644--- a/src/components/launch/LaunchWindow.test.tsx+++ b/src/components/launch/LaunchWindow.test.tsx@@ -3,6 +3,8 @@ import "@testing-library/jest-dom";import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";import { StrictMode } from "react";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { nativeBridgeClient } from "@/native";+import type { NativePlatform } from "@/native/contracts";import { TooltipProvider } from "../ui/tooltip";import { HUD_BAR_BOTTOM, HUD_POPOVER_GAP, HUD_POPOVER_MAX_HEIGHT } from "./hudGeometry";import { LaunchWindow } from "./LaunchWindow";@@ -11,7 +13,7 @@ type SelectedSourceChangedListener = Parameters<Window["electronAPI"]["onSelectedSourceChanged"]>[0];-const platformState = vi.hoisted(() => ({ value: "darwin" }));+const platformState = vi.hoisted(() => ({ value: "darwin" as NativePlatform }));const linuxHelperAvailable = vi.hoisted(() => ({ value: true }));const resizeCallbacks = vi.hoisted(() => [] as Array<ResizeObserverCallback>);@@ -59,6 +61,8 @@ const recorderState = vi.hoisted(() => ({setSystemAudioEnabled: vi.fn(),cursorCaptureMode: "editable-overlay",setCursorCaptureMode: vi.fn(),+ autoZoomEnabled: true,+ setAutoZoomEnabled: vi.fn(),softwareEncoderFallbackNoticeVisible: false,dismissSoftwareEncoderFallbackNotice: vi.fn(),},@@ -171,6 +175,10 @@ vi.mock("@/contexts/I18nContext", () => ({"webcam.cameraDevice": "Camera device","cursor.useEditableCursor": "Use editable cursor","cursor.useSystemCursor": "Use system cursor",+ "autoZoom.enable": "Enable auto-zoom after recording",+ "autoZoom.disable": "Disable auto-zoom after recording",+ "autoZoom.needsEditableCursor":+ "Auto-zoom needs the editable cursor. Switch cursor mode to enable.","tooltips.openStudio": "Open Studio","tooltips.hideHUD": "Hide HUD","tooltips.closeApp": "Close App",@@ -237,6 +245,7 @@ function stubElectronAPI(getSelectedSource: Window["electronAPI"]["getSelectedSoendHudOverlayDrag: vi.fn(),hudOverlayHide: vi.fn(),hudOverlayClose: vi.fn(),+ setRecordingPrefs: vi.fn(async (prefs) => prefs),openNotes: vi.fn(),switchToEditor: vi.fn(async () => undefined),onSelectedSourceChanged: vi.fn((callback) => {@@ -287,6 +296,10 @@ function emitSourceSelectorClosed() {function resetLaunchMocks() {vi.stubGlobal("ResizeObserver", StubResizeObserver);recorderState.value.toggleRecording.mockClear();+ recorderState.value.cursorCaptureMode = "editable-overlay";+ recorderState.value.autoZoomEnabled = true;+ recorderState.value.setAutoZoomEnabled.mockClear();+ recorderState.value.setCursorCaptureMode.mockClear();recorderState.value.softwareEncoderFallbackNoticeVisible = false;recorderState.value.dismissSoftwareEncoderFallbackNotice.mockClear();recorderState.value.recording = false;@@ -305,6 +318,9 @@ function resetLaunchMocks() {i18nState.value.resolveSystemLocaleSuggestion.mockClear();i18nState.value.setLocale.mockClear();linuxHelperAvailable.value = true;+ vi.mocked(nativeBridgeClient.system.getPlatform).mockImplementation(+ async () => platformState.value,+ );appInfoState.value = { version: "1.9.6", canCheckForUpdates: true };updateCheckMock.mockReset();updateCheckMock.mockResolvedValue(undefined);@@ -338,6 +354,63 @@ describe("LaunchWindow record button", () => {expect(recorderState.value.toggleRecording).not.toHaveBeenCalled();});+ // The button says "on" with a colour fill and nothing else, so a screen reader+ // gets no toggle state at all — the same `aria-pressed` the mic and camera+ // buttons beside it already carry.+ it("reports the auto-zoom toggle state", () => {+ renderLaunchWindow();++ expect(screen.getByTestId("launch-auto-zoom-button")).toHaveAttribute("aria-pressed", "true");++ cleanup();+ recorderState.value.autoZoomEnabled = false;+ renderLaunchWindow();++ expect(screen.getByTestId("launch-auto-zoom-button")).toHaveAttribute("aria-pressed", "false");+ });++ it("toggles post-record auto-zoom without touching cursor capture", () => {+ renderLaunchWindow();++ const button = screen.getByTestId("launch-auto-zoom-button");+ expect(button).toHaveAttribute("title", "Disable auto-zoom after recording");+ fireEvent.click(button);++ expect(recorderState.value.setAutoZoomEnabled).toHaveBeenCalledWith(false);+ expect(window.electronAPI.setRecordingPrefs).toHaveBeenCalledWith({ autoZoomEnabled: false });+ expect(recorderState.value.setCursorCaptureMode).not.toHaveBeenCalled();+ });++ it("disables auto-zoom while the HUD is in system-cursor mode", async () => {+ recorderState.value.cursorCaptureMode = "system";+ renderLaunchWindow();++ const button = await waitFor(() => {+ const el = screen.getByTestId("launch-auto-zoom-button");+ expect(el).toBeDisabled();+ return el;+ });+ expect(button).toHaveAttribute(+ "title",+ "Auto-zoom needs the editable cursor. Switch cursor mode to enable.",+ );+ fireEvent.click(button);+ expect(recorderState.value.setAutoZoomEnabled).not.toHaveBeenCalled();+ });++ it("disables auto-zoom in system-cursor mode before platform detection finishes", () => {+ vi.mocked(nativeBridgeClient.system.getPlatform).mockImplementation(+ () => new Promise(() => undefined),+ );+ recorderState.value.cursorCaptureMode = "system";+ renderLaunchWindow();++ const button = screen.getByTestId("launch-auto-zoom-button");+ expect(button).toBeDisabled();+ fireEvent.click(button);+ expect(recorderState.value.setAutoZoomEnabled).not.toHaveBeenCalled();+ });+it("records immediately after source selection when the record button opened the picker", async () => {renderLaunchWindow();await waitForSourceSelectionSubscription();diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsxindex 8a2427fc1..ea1573028 100644--- a/src/components/launch/LaunchWindow.tsx+++ b/src/components/launch/LaunchWindow.tsx@@ -9,6 +9,7 @@ import { usePortalOwnsSource } from "../../hooks/usePortalOwnsSource";import { useScreenRecorder } from "../../hooks/useScreenRecorder";import { requestCameraAccess } from "../../lib/requestCameraAccess";import {+ HudAutoZoomButton,HudCameraButton,HudCursorButton,HudDivider,@@ -105,6 +106,8 @@ export function LaunchWindow() {setWebcamDeviceName,cursorCaptureMode,setCursorCaptureMode,+ autoZoomEnabled,+ setAutoZoomEnabled,softwareEncoderFallbackNoticeVisible,dismissSoftwareEncoderFallbackNotice,} = useScreenRecorder();@@ -720,6 +723,7 @@ export function LaunchWindow() {camDeviceId?: string;micDeviceId?: string;micDeviceName?: string;+ autoZoomEnabled?: boolean;}) => {void window.electronAPI?.setRecordingPrefs?.(patch).catch((error) => {console.warn("Failed to persist the device preference:", error);@@ -728,6 +732,21 @@ export function LaunchWindow() {[],);+ const systemCursorLocksAutoZoom = cursorCaptureMode === "system";+ const toggleAutoZoom = useCallback(() => {+ if (controlsLocked) return;+ if (systemCursorLocksAutoZoom) return;+ const next = !autoZoomEnabled;+ setAutoZoomEnabled(next);+ persistRecordingPrefs({ autoZoomEnabled: next });+ }, [+ autoZoomEnabled,+ controlsLocked,+ persistRecordingPrefs,+ setAutoZoomEnabled,+ systemCursorLocksAutoZoom,+ ]);+const toggleWebcam = useCallback(() => {if (controlsLocked) return;const next = !webcamEnabled;@@ -1009,6 +1028,18 @@ export function LaunchWindow() {onClick={toggleDeviceSettings}/></div>+ <HudAutoZoomButton+ enabled={autoZoomEnabled && !systemCursorLocksAutoZoom}+ disabled={controlsLocked || systemCursorLocksAutoZoom}+ label={+ systemCursorLocksAutoZoom+ ? t("autoZoom.needsEditableCursor")+ : autoZoomEnabled+ ? t("autoZoom.disable")+ : t("autoZoom.enable")+ }+ onClick={toggleAutoZoom}+ />{supportsCursorModeToggle && (<HudCursorButtoneditableOverlay={cursorCaptureMode === "editable-overlay"}diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.tsindex fcab5452b..396866b0f 100644--- a/src/hooks/useScreenRecorder.ts+++ b/src/hooks/useScreenRecorder.ts@@ -106,6 +106,8 @@ type UseScreenRecorderReturn = {setWebcamEnabled: (enabled: boolean) => Promise<boolean>;cursorCaptureMode: CursorCaptureMode;setCursorCaptureMode: (mode: CursorCaptureMode) => void;+ autoZoomEnabled: boolean;+ setAutoZoomEnabled: (enabled: boolean) => void;softwareEncoderFallbackNoticeVisible: boolean;dismissSoftwareEncoderFallbackNotice: (dontShowAgain?: boolean) => void;};@@ -242,6 +244,7 @@ export function useScreenRecorder(): UseScreenRecorderReturn {const [systemAudioEnabled, setSystemAudioEnabled] = useState(false);const [webcamEnabled, setWebcamEnabledState] = useState(false);const [cursorCaptureMode, setCursorCaptureMode] = useState<CursorCaptureMode>("editable-overlay");+ const [autoZoomEnabled, setAutoZoomEnabled] = useState(true);const [softwareEncoderFallbackNoticeVisible, setSoftwareEncoderFallbackNoticeVisible] =useState(false);@@ -267,6 +270,7 @@ export function useScreenRecorder(): UseScreenRecorderReturn {if (prefs.camDeviceId) setWebcamDeviceId(prefs.camDeviceId);setSystemAudioEnabled(prefs.systemAudioEnabled);setCursorCaptureMode(prefs.cursorCaptureMode);+ setAutoZoomEnabled(prefs.autoZoomEnabled !== false);}).catch((err) => {// Bare ipcRenderer.invoke — rejects if the main handler throws. Falling@@ -2347,6 +2351,8 @@ export function useScreenRecorder(): UseScreenRecorderReturn {setWebcamEnabled,cursorCaptureMode,setCursorCaptureMode,+ autoZoomEnabled,+ setAutoZoomEnabled,softwareEncoderFallbackNoticeVisible,dismissSoftwareEncoderFallbackNotice,};diff --git a/src/i18n/locales/ar/editor.json b/src/i18n/locales/ar/editor.jsonindex 45190b2eb..98e0f38f0 100644--- a/src/i18n/locales/ar/editor.json+++ b/src/i18n/locales/ar/editor.json@@ -110,6 +110,8 @@"microphone": "الميكروفون","camera": "الكاميرا","cursorHighlight": "إبراز المؤشر",+ "autoZoom": "تكبير تلقائي بعد التسجيل",+ "autoZoomNeedsEditableCursor": "التكبير التلقائي يحتاج إلى المؤشر القابل للتحرير. بدّل وضع المؤشر للتفعيل.","on": "تشغيل","off": "إيقاف","loading": "جارٍ التحميل...",diff --git a/src/i18n/locales/ar/launch.json b/src/i18n/locales/ar/launch.jsonindex 0198af382..d632953b3 100644--- a/src/i18n/locales/ar/launch.json+++ b/src/i18n/locales/ar/launch.json@@ -78,6 +78,11 @@"useEditableCursor": "استخدام مؤشر قابل للتحرير","useSystemCursor": "استخدام مؤشر النظام"},+ "autoZoom": {+ "enable": "تفعيل التكبير التلقائي بعد التسجيل",+ "disable": "تعطيل التكبير التلقائي بعد التسجيل",+ "needsEditableCursor": "التكبير التلقائي يحتاج إلى المؤشر القابل للتحرير. بدّل وضع المؤشر للتفعيل."+ },"softwareEncoderFallback": {"title": "تم التبديل إلى الترميز البرمجي","description": "تعذّر تشغيل مرمّز GPU الافتراضي، لذا تحوّل OpenScreen إلى ترميز H.264 البرمجي. سيستمر التسجيل كالمعتاد، لكن استخدام المعالج قد يكون أعلى.",diff --git a/src/i18n/locales/en/editor.json b/src/i18n/locales/en/editor.jsonindex 6b738c399..2c4ddc248 100644--- a/src/i18n/locales/en/editor.json+++ b/src/i18n/locales/en/editor.json@@ -110,6 +110,8 @@"microphone": "Microphone","camera": "Camera","cursorHighlight": "Cursor highlight",+ "autoZoom": "Auto-zoom after recording",+ "autoZoomNeedsEditableCursor": "Auto-zoom needs the editable cursor. Switch cursor mode to enable.","on": "On","off": "Off","loading": "Loading…",diff --git a/src/i18n/locales/en/launch.json b/src/i18n/locales/en/launch.jsonindex ad2385c02..3c60aad22 100644--- a/src/i18n/locales/en/launch.json+++ b/src/i18n/locales/en/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "Use editable cursor","useSystemCursor": "Use system cursor"},+ "autoZoom": {+ "enable": "Enable auto-zoom after recording",+ "disable": "Disable auto-zoom after recording",+ "needsEditableCursor": "Auto-zoom needs the editable cursor. Switch cursor mode to enable."+ },"sourceSelector": {"loading": "Loading sources...","screens": "Screens ({{count}})",diff --git a/src/i18n/locales/es/editor.json b/src/i18n/locales/es/editor.jsonindex 397a86298..68b3fbc2c 100644--- a/src/i18n/locales/es/editor.json+++ b/src/i18n/locales/es/editor.json@@ -110,6 +110,8 @@"microphone": "Micrófono","camera": "Cámara","cursorHighlight": "Resaltar cursor",+ "autoZoom": "Zoom automático tras grabar",+ "autoZoomNeedsEditableCursor": "El zoom automático necesita el cursor editable. Cambia el modo del cursor para activarlo.","on": "Activado","off": "Desactivado","loading": "Cargando…",diff --git a/src/i18n/locales/es/launch.json b/src/i18n/locales/es/launch.jsonindex 7a2c92a55..7fe44a485 100644--- a/src/i18n/locales/es/launch.json+++ b/src/i18n/locales/es/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "Usar cursor editable","useSystemCursor": "Usar cursor del sistema"},+ "autoZoom": {+ "enable": "Activar zoom automático tras grabar",+ "disable": "Desactivar zoom automático tras grabar",+ "needsEditableCursor": "El zoom automático necesita el cursor editable. Cambia el modo del cursor para activarlo."+ },"sourceSelector": {"loading": "Cargando fuentes...","screens": "Pantallas ({{count}})",diff --git a/src/i18n/locales/fr/editor.json b/src/i18n/locales/fr/editor.jsonindex dcc83218f..b38fff0b6 100644--- a/src/i18n/locales/fr/editor.json+++ b/src/i18n/locales/fr/editor.json@@ -110,6 +110,8 @@"microphone": "Microphone","camera": "Caméra","cursorHighlight": "Curseur en surbrillance",+ "autoZoom": "Zoom automatique après l'enregistrement",+ "autoZoomNeedsEditableCursor": "Le zoom automatique nécessite le curseur modifiable. Changez le mode du curseur pour l'activer.","on": "Activé","off": "Désactivé","loading": "Chargement…",diff --git a/src/i18n/locales/fr/launch.json b/src/i18n/locales/fr/launch.jsonindex 858fd58f1..a1819e350 100644--- a/src/i18n/locales/fr/launch.json+++ b/src/i18n/locales/fr/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "Utiliser le curseur éditable","useSystemCursor": "Utiliser le curseur système"},+ "autoZoom": {+ "enable": "Activer le zoom automatique après l'enregistrement",+ "disable": "Désactiver le zoom automatique après l'enregistrement",+ "needsEditableCursor": "Le zoom automatique nécessite le curseur modifiable. Changez le mode du curseur pour l'activer."+ },"sourceSelector": {"loading": "Chargement des sources...","screens": "Écrans ({{count}})",diff --git a/src/i18n/locales/it/editor.json b/src/i18n/locales/it/editor.jsonindex e343d482e..00a092ee7 100644--- a/src/i18n/locales/it/editor.json+++ b/src/i18n/locales/it/editor.json@@ -110,6 +110,8 @@"microphone": "Microfono","camera": "Fotocamera","cursorHighlight": "Evidenzia cursore",+ "autoZoom": "Zoom automatico dopo la registrazione",+ "autoZoomNeedsEditableCursor": "Lo zoom automatico richiede il cursore modificabile. Cambia la modalità del cursore per attivarlo.","on": "Attivo","off": "Disattivo","loading": "Caricamento…",diff --git a/src/i18n/locales/it/launch.json b/src/i18n/locales/it/launch.jsonindex ed5088d67..e4adbc465 100644--- a/src/i18n/locales/it/launch.json+++ b/src/i18n/locales/it/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "Usa cursore modificabile","useSystemCursor": "Usa cursore di sistema"},+ "autoZoom": {+ "enable": "Attiva lo zoom automatico dopo la registrazione",+ "disable": "Disattiva lo zoom automatico dopo la registrazione",+ "needsEditableCursor": "Lo zoom automatico richiede il cursore modificabile. Cambia la modalità del cursore per attivarlo."+ },"sourceSelector": {"loading": "Caricamento sorgenti...","screens": "Schermi ({{count}})",diff --git a/src/i18n/locales/ja-JP/editor.json b/src/i18n/locales/ja-JP/editor.jsonindex 239bc1287..b8f600334 100644--- a/src/i18n/locales/ja-JP/editor.json+++ b/src/i18n/locales/ja-JP/editor.json@@ -110,6 +110,8 @@"microphone": "マイク","camera": "カメラ","cursorHighlight": "カーソルの強調表示",+ "autoZoom": "録画後に自動ズーム",+ "autoZoomNeedsEditableCursor": "自動ズームには編集可能なカーソルが必要です。カーソルモードを切り替えてください。","on": "オン","off": "オフ","loading": "読み込み中…",diff --git a/src/i18n/locales/ja-JP/launch.json b/src/i18n/locales/ja-JP/launch.jsonindex ab9cebbd5..bf940cc04 100644--- a/src/i18n/locales/ja-JP/launch.json+++ b/src/i18n/locales/ja-JP/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "編集可能なカーソルを使う","useSystemCursor": "システムカーソルを使う"},+ "autoZoom": {+ "enable": "録画後の自動ズームをオンにする",+ "disable": "録画後の自動ズームをオフにする",+ "needsEditableCursor": "自動ズームには編集可能なカーソルが必要です。カーソルモードを切り替えてください。"+ },"sourceSelector": {"loading": "ソースを読み込み中...","screens": "画面 ({{count}})",diff --git a/src/i18n/locales/ko-KR/editor.json b/src/i18n/locales/ko-KR/editor.jsonindex 8dd4be036..2f382d135 100644--- a/src/i18n/locales/ko-KR/editor.json+++ b/src/i18n/locales/ko-KR/editor.json@@ -110,6 +110,8 @@"microphone": "마이크","camera": "카메라","cursorHighlight": "커서 강조",+ "autoZoom": "녹화 후 자동 확대",+ "autoZoomNeedsEditableCursor": "자동 확대는 편집 가능한 커서가 필요합니다. 커서 모드를 전환하세요.","on": "켜짐","off": "꺼짐","loading": "로딩 중…",diff --git a/src/i18n/locales/ko-KR/launch.json b/src/i18n/locales/ko-KR/launch.jsonindex 192089224..6e13f7ba5 100644--- a/src/i18n/locales/ko-KR/launch.json+++ b/src/i18n/locales/ko-KR/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "편집 가능한 커서 사용","useSystemCursor": "시스템 커서 사용"},+ "autoZoom": {+ "enable": "녹화 후 자동 확대 켜기",+ "disable": "녹화 후 자동 확대 끄기",+ "needsEditableCursor": "자동 확대는 편집 가능한 커서가 필요합니다. 커서 모드를 전환하세요."+ },"sourceSelector": {"loading": "소스 불러오는 중...","screens": "화면 ({{count}}개)",diff --git a/src/i18n/locales/pt-BR/editor.json b/src/i18n/locales/pt-BR/editor.jsonindex 5a6219e6c..7bdb2a2d4 100644--- a/src/i18n/locales/pt-BR/editor.json+++ b/src/i18n/locales/pt-BR/editor.json@@ -110,6 +110,8 @@"microphone": "Microfone","camera": "Câmera","cursorHighlight": "Destaque do cursor",+ "autoZoom": "Zoom automático após a gravação",+ "autoZoomNeedsEditableCursor": "O zoom automático precisa do cursor editável. Alterne o modo do cursor para ativar.","on": "Ativado","off": "Desativado","loading": "Carregando…",diff --git a/src/i18n/locales/pt-BR/launch.json b/src/i18n/locales/pt-BR/launch.jsonindex 4d1fc9270..a10645385 100644--- a/src/i18n/locales/pt-BR/launch.json+++ b/src/i18n/locales/pt-BR/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "Usar cursor editável","useSystemCursor": "Usar cursor do sistema"},+ "autoZoom": {+ "enable": "Ativar zoom automático após a gravação",+ "disable": "Desativar zoom automático após a gravação",+ "needsEditableCursor": "O zoom automático precisa do cursor editável. Alterne o modo do cursor para ativar."+ },"sourceSelector": {"loading": "Carregando fontes...","screens": "Telas ({{count}})",diff --git a/src/i18n/locales/ru/editor.json b/src/i18n/locales/ru/editor.jsonindex 86830571b..dd531e56b 100644--- a/src/i18n/locales/ru/editor.json+++ b/src/i18n/locales/ru/editor.json@@ -110,6 +110,8 @@"microphone": "Микрофон","camera": "Камера","cursorHighlight": "Подсветка курсора",+ "autoZoom": "Автомасштабирование после записи",+ "autoZoomNeedsEditableCursor": "Автомасштабирование требует редактируемый курсор. Переключите режим курсора.","on": "Вкл","off": "Выкл","loading": "Загрузка…",diff --git a/src/i18n/locales/ru/launch.json b/src/i18n/locales/ru/launch.jsonindex 0af9564c4..67fb6f637 100644--- a/src/i18n/locales/ru/launch.json+++ b/src/i18n/locales/ru/launch.json@@ -78,6 +78,11 @@"useEditableCursor": "Использовать редактируемый курсор","useSystemCursor": "Использовать системный курсор"},+ "autoZoom": {+ "enable": "Включить автомасштабирование после записи",+ "disable": "Отключить автомасштабирование после записи",+ "needsEditableCursor": "Автомасштабирование требует редактируемый курсор. Переключите режим курсора."+ },"softwareEncoderFallback": {"title": "Выполнен переход на программное кодирование","description": "Стандартный GPU-кодировщик не запустился, поэтому OpenScreen перешёл на программное кодирование H.264. Запись продолжится как обычно, но нагрузка на процессор может быть выше.",diff --git a/src/i18n/locales/tr/editor.json b/src/i18n/locales/tr/editor.jsonindex cb1c1906e..b94ba0e84 100644--- a/src/i18n/locales/tr/editor.json+++ b/src/i18n/locales/tr/editor.json@@ -110,6 +110,8 @@"microphone": "Mikrofon","camera": "Kamera","cursorHighlight": "İmleç vurgusu",+ "autoZoom": "Kayıttan sonra otomatik yakınlaştırma",+ "autoZoomNeedsEditableCursor": "Otomatik yakınlaştırma düzenlenebilir imleç ister. Etkinleştirmek için imleç modunu değiştirin.","on": "Açık","off": "Kapalı","loading": "Yükleniyor…",diff --git a/src/i18n/locales/tr/launch.json b/src/i18n/locales/tr/launch.jsonindex 632709c82..a5b84df60 100644--- a/src/i18n/locales/tr/launch.json+++ b/src/i18n/locales/tr/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "Düzenlenebilir imleci kullan","useSystemCursor": "Sistem imlecini kullan"},+ "autoZoom": {+ "enable": "Kayıttan sonra otomatik yakınlaştırmayı aç",+ "disable": "Kayıttan sonra otomatik yakınlaştırmayı kapat",+ "needsEditableCursor": "Otomatik yakınlaştırma düzenlenebilir imleç ister. Etkinleştirmek için imleç modunu değiştirin."+ },"sourceSelector": {"loading": "Kaynaklar yükleniyor...","screens": "Ekranlar ({{count}})",diff --git a/src/i18n/locales/vi/editor.json b/src/i18n/locales/vi/editor.jsonindex 9f484688c..59ba3489b 100644--- a/src/i18n/locales/vi/editor.json+++ b/src/i18n/locales/vi/editor.json@@ -110,6 +110,8 @@"microphone": "Micro","camera": "Máy ảnh","cursorHighlight": "Làm nổi bật con trỏ",+ "autoZoom": "Tự động phóng to sau khi ghi",+ "autoZoomNeedsEditableCursor": "Tự động phóng to cần con trỏ chỉnh sửa được. Hãy đổi chế độ con trỏ.","on": "Bật","off": "Tắt","loading": "Đang tải…",diff --git a/src/i18n/locales/vi/launch.json b/src/i18n/locales/vi/launch.jsonindex 98405bf99..e4997af28 100644--- a/src/i18n/locales/vi/launch.json+++ b/src/i18n/locales/vi/launch.json@@ -78,6 +78,11 @@"useEditableCursor": "Dùng con trỏ có thể chỉnh sửa","useSystemCursor": "Dùng con trỏ hệ thống"},+ "autoZoom": {+ "enable": "Bật tự động phóng to sau khi ghi",+ "disable": "Tắt tự động phóng to sau khi ghi",+ "needsEditableCursor": "Tự động phóng to cần con trỏ chỉnh sửa được. Hãy đổi chế độ con trỏ."+ },"softwareEncoderFallback": {"title": "Đã chuyển sang mã hóa bằng phần mềm","description": "Bộ mã hóa GPU mặc định không khởi động được, nên OpenScreen đã chuyển sang mã hóa H.264 bằng phần mềm. Quá trình ghi vẫn tiếp tục bình thường, nhưng mức sử dụng CPU có thể cao hơn.",diff --git a/src/i18n/locales/zh-CN/editor.json b/src/i18n/locales/zh-CN/editor.jsonindex 0405b5c13..7c3a6d98e 100644--- a/src/i18n/locales/zh-CN/editor.json+++ b/src/i18n/locales/zh-CN/editor.json@@ -110,6 +110,8 @@"microphone": "麦克风","camera": "摄像头","cursorHighlight": "光标高亮",+ "autoZoom": "录制后自动缩放",+ "autoZoomNeedsEditableCursor": "自动缩放需要可编辑光标。请先切换光标模式。","on": "开","off": "关","loading": "加载中…",diff --git a/src/i18n/locales/zh-CN/launch.json b/src/i18n/locales/zh-CN/launch.jsonindex e7efe8eec..521591aaa 100644--- a/src/i18n/locales/zh-CN/launch.json+++ b/src/i18n/locales/zh-CN/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "使用可编辑光标","useSystemCursor": "使用系统光标"},+ "autoZoom": {+ "enable": "启用录制后自动缩放",+ "disable": "关闭录制后自动缩放",+ "needsEditableCursor": "自动缩放需要可编辑光标。请先切换光标模式。"+ },"sourceSelector": {"loading": "正在加载源...","screens": "屏幕 ({{count}})",diff --git a/src/i18n/locales/zh-TW/editor.json b/src/i18n/locales/zh-TW/editor.jsonindex f4d10694f..fefdaf004 100644--- a/src/i18n/locales/zh-TW/editor.json+++ b/src/i18n/locales/zh-TW/editor.json@@ -110,6 +110,8 @@"microphone": "麥克風","camera": "攝影機","cursorHighlight": "游標醒目提示",+ "autoZoom": "錄製後自動縮放",+ "autoZoomNeedsEditableCursor": "自動縮放需要可編輯游標。請先切換游標模式。","on": "開","off": "關","loading": "載入中…",diff --git a/src/i18n/locales/zh-TW/launch.json b/src/i18n/locales/zh-TW/launch.jsonindex 025e422e7..9e6361bd8 100644--- a/src/i18n/locales/zh-TW/launch.json+++ b/src/i18n/locales/zh-TW/launch.json@@ -56,6 +56,11 @@"useEditableCursor": "使用可編輯游標","useSystemCursor": "使用系統游標"},+ "autoZoom": {+ "enable": "啟用錄製後自動縮放",+ "disable": "關閉錄製後自動縮放",+ "needsEditableCursor": "自動縮放需要可編輯游標。請先切換游標模式。"+ },"sourceSelector": {"loading": "正在載入來源...","screens": "螢幕 ({{count}})",