Create polished demo videos without editing skills. Mac/Windows/Linux
Merge branch 'main' into feature/ui-improvements
Gurpreet Kait81ce72aca78d
diff --cc electron/electron-env.d.tsindex a1734748,94610648..cfeef004--- a/electron/electron-env.d.ts+++ b/electron/electron-env.d.ts@@@ -1,117 -1,227 +1,228 @@@-/// <reference types="vite-plugin-electron/electron-env" />--declare namespace NodeJS {- interface ProcessEnv {- /**- * The built directory structure- *- * ```tree- * ├─┬─┬ dist- * │ │ └── index.html- * │ │- * │ ├─┬ dist-electron- * │ │ ├── main.js- * │ │ └── preload.js- * │- * ```- */- APP_ROOT: string;- /** /dist/ or /public/ */- VITE_PUBLIC: string;- }-}--// Used in Renderer process, expose in `preload.ts`-interface Window {- electronAPI: {- getSources: (opts: Electron.SourcesOptions) => Promise<ProcessedDesktopSource[]>;- switchToEditor: () => Promise<void>;- openSourceSelector: () => Promise<void>;- selectSource: (source: any) => Promise<any>;- getSelectedSource: () => Promise<any>;- startNativeScreenRecording: (- source: any,- options?: {- capturesSystemAudio?: boolean;- capturesMicrophone?: boolean;- microphoneDeviceId?: string;- microphoneLabel?: string;- },- ) => Promise<{ success: boolean; path?: string; message?: string; error?: string }>;- stopNativeScreenRecording: () => Promise<{- success: boolean;- path?: string;- message?: string;- error?: string;- }>;- startFfmpegRecording: (- source: any,- ) => Promise<{ success: boolean; path?: string; message?: string; error?: string }>;- stopFfmpegRecording: () => Promise<{- success: boolean;- path?: string;- message?: string;- error?: string;- }>;- storeRecordedVideo: (- videoData: ArrayBuffer,- fileName: string,- ) => Promise<{ success: boolean; path?: string; message?: string }>;- getRecordedVideoPath: () => Promise<{ success: boolean; path?: string; message?: string }>;- readLocalFile: (- filePath: string,- ) => Promise<{ success: boolean; data?: Uint8Array; error?: string }>;- setRecordingState: (recording: boolean) => Promise<void>;- getCursorTelemetry: (videoPath?: string) => Promise<{- success: boolean;- samples: CursorTelemetryPoint[];- message?: string;- error?: string;- }>;- getSystemCursorAssets: () => Promise<{- success: boolean;- cursors: Record<string, SystemCursorAsset>;- error?: string;- }>;- onStopRecordingFromTray: (callback: () => void) => () => void;- onRecordingStateChanged: (- callback: (state: { recording: boolean; sourceName: string }) => void,- ) => () => void;- onRecordingInterrupted: (- callback: (state: { reason: string; message: string }) => void,- ) => () => void;- onCursorStateChanged: (- callback: (state: { cursorType: CursorTelemetryPoint["cursorType"] }) => void,- ) => () => void;- openExternalUrl: (url: string) => Promise<{ success: boolean; error?: string }>;- getAccessibilityPermissionStatus: () => Promise<{- success: boolean;- trusted: boolean;- prompted: boolean;- error?: string;- }>;- requestAccessibilityPermission: () => Promise<{- success: boolean;- trusted: boolean;- prompted: boolean;- error?: string;- }>;- getScreenRecordingPermissionStatus: () => Promise<{- success: boolean;- status: string;- error?: string;- }>;- openScreenRecordingPreferences: () => Promise<{ success: boolean; error?: string }>;- openAccessibilityPreferences: () => Promise<{ success: boolean; error?: string }>;- saveExportedVideo: (- videoData: ArrayBuffer,- fileName: string,- ) => Promise<{ success: boolean; path?: string; message?: string; canceled?: boolean }>;- openVideoFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>;- openAudioFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>;- setCurrentVideoPath: (path: string) => Promise<{ success: boolean }>;- getCurrentVideoPath: () => Promise<{ success: boolean; path?: string }>;- clearCurrentVideoPath: () => Promise<{ success: boolean }>;- saveProjectFile: (- projectData: unknown,- suggestedName?: string,- existingProjectPath?: string,- ) => Promise<{- success: boolean;- path?: string;- message?: string;- canceled?: boolean;- error?: string;- }>;- loadProjectFile: () => Promise<{- success: boolean;- path?: string;- project?: unknown;- message?: string;- canceled?: boolean;- error?: string;- }>;- loadCurrentProjectFile: () => Promise<{- success: boolean;- path?: string;- project?: unknown;- message?: string;- canceled?: boolean;- error?: string;- }>;- onMenuLoadProject: (callback: () => void) => () => void;- onMenuSaveProject: (callback: () => void) => () => void;- onMenuSaveProjectAs: (callback: () => void) => () => void;- getPlatform: () => Promise<string>;- revealInFolder: (- filePath: string,- ) => Promise<{ success: boolean; error?: string; message?: string }>;- openRecordingsFolder: () => Promise<{ success: boolean; error?: string; message?: string }>;- getRecordingsDirectory: () => Promise<{- success: boolean;- path: string;- isDefault: boolean;- error?: string;- }>;- chooseRecordingsDirectory: () => Promise<{- success: boolean;- canceled?: boolean;- path?: string;- isDefault?: boolean;- message?: string;- error?: string;- }>;- getShortcuts: () => Promise<Record<string, unknown> | null>;- saveShortcuts: (shortcuts: unknown) => Promise<{ success: boolean; error?: string }>;- hudOverlayHide: () => void;- hudOverlayClose: () => void;- getHudOverlayCaptureProtection: () => Promise<{ success: boolean; enabled: boolean }>;- setHudOverlayCaptureProtection: (- enabled: boolean,- ) => Promise<{ success: boolean; enabled: boolean }>;- setHasUnsavedChanges: (hasChanges: boolean) => void;- onRequestSaveBeforeClose: (callback: () => Promise<void>) => () => void;- isWgcAvailable: () => Promise<{ available: boolean }>;- muxWgcRecording: () => Promise<{- success: boolean;- path?: string;- message?: string;- error?: string;- }>;- /** Hide the OS cursor before browser capture starts. */- hideOsCursor: () => Promise<{ success: boolean }>;- /** Countdown timer before recording */- getCountdownDelay: () => Promise<{ success: boolean; delay: number }>;- setCountdownDelay: (delay: number) => Promise<{ success: boolean; error?: string }>;- startCountdown: (seconds: number) => Promise<{ success: boolean; cancelled?: boolean }>;- cancelCountdown: () => Promise<{ success: boolean }>;- onCountdownTick: (callback: (seconds: number) => void) => () => void;- };-}--interface ProcessedDesktopSource {- id: string;- name: string;- display_id: string;- thumbnail: string | null;- appIcon: string | null;- originalName?: string;- sourceType?: "screen" | "window";- appName?: string;- windowTitle?: string;-}--interface CursorTelemetryPoint {- timeMs: number;- cx: number;- cy: number;- interactionType?: "move" | "click" | "double-click" | "right-click" | "middle-click" | "mouseup";- cursorType?:- | "arrow"- | "text"- | "pointer"- | "crosshair"- | "open-hand"- | "closed-hand"- | "resize-ew"- | "resize-ns"- | "not-allowed";-}--interface SystemCursorAsset {- dataUrl: string;- hotspotX: number;- hotspotY: number;- width: number;- height: number;-}+/// <reference types="vite-plugin-electron/electron-env" />++declare namespace NodeJS {- interface ProcessEnv {- /**- * The built directory structure- *- * ```tree- * ├─┬─┬ dist- * │ │ └── index.html- * │ │- * │ ├─┬ dist-electron- * │ │ ├── main.js- * │ │ └── preload.js- * │- * ```- */- APP_ROOT: string- /** /dist/ or /public/ */- VITE_PUBLIC: string- }++ interface ProcessEnv {++ /**++ * The built directory structure++ *++ * ```tree++ * ├─┬─┬ dist++ * │ │ └── index.html++ * │ │++ * │ ├─┬ dist-electron++ * │ │ ├── main.js++ * │ │ └── preload.js++ * │++ * ```++ */++ APP_ROOT: string;++ /** /dist/ or /public/ */++ VITE_PUBLIC: string;++ }+}++// Used in Renderer process, expose in `preload.ts`+interface Window {- electronAPI: {- getSources: (opts: Electron.SourcesOptions) => Promise<ProcessedDesktopSource[]>- switchToEditor: () => Promise<void>- openSourceSelector: () => Promise<void>- selectSource: (source: any) => Promise<any>- showSourceHighlight: (source: any) => Promise<{ success: boolean }>- getSelectedSource: () => Promise<any>- startNativeScreenRecording: (- source: any,- options?: {- capturesSystemAudio?: boolean- capturesMicrophone?: boolean- microphoneDeviceId?: string- microphoneLabel?: string- }- ) => Promise<{ success: boolean; path?: string; message?: string; error?: string }>- stopNativeScreenRecording: () => Promise<{ success: boolean; path?: string; message?: string; error?: string }>- startFfmpegRecording: (source: any) => Promise<{ success: boolean; path?: string; message?: string; error?: string }>- stopFfmpegRecording: () => Promise<{ success: boolean; path?: string; message?: string; error?: string }>- storeRecordedVideo: (videoData: ArrayBuffer, fileName: string) => Promise<{ success: boolean; path?: string; message?: string }>- getRecordedVideoPath: () => Promise<{ success: boolean; path?: string; message?: string }>- readLocalFile: (filePath: string) => Promise<{ success: boolean; data?: Uint8Array; error?: string }>- setRecordingState: (recording: boolean) => Promise<void>- getCursorTelemetry: (videoPath?: string) => Promise<{ success: boolean; samples: CursorTelemetryPoint[]; message?: string; error?: string }>- getSystemCursorAssets: () => Promise<{ success: boolean; cursors: Record<string, SystemCursorAsset>; error?: string }>- onStopRecordingFromTray: (callback: () => void) => () => void- onRecordingStateChanged: (callback: (state: { recording: boolean; sourceName: string }) => void) => () => void- onRecordingInterrupted: (callback: (state: { reason: string; message: string }) => void) => () => void- onCursorStateChanged: (callback: (state: { cursorType: CursorTelemetryPoint['cursorType'] }) => void) => () => void- openExternalUrl: (url: string) => Promise<{ success: boolean; error?: string }>- getAccessibilityPermissionStatus: () => Promise<{ success: boolean; trusted: boolean; prompted: boolean; error?: string }>- requestAccessibilityPermission: () => Promise<{ success: boolean; trusted: boolean; prompted: boolean; error?: string }>- getScreenRecordingPermissionStatus: () => Promise<{ success: boolean; status: string; error?: string }>- openScreenRecordingPreferences: () => Promise<{ success: boolean; error?: string }>- openAccessibilityPreferences: () => Promise<{ success: boolean; error?: string }>- saveExportedVideo: (videoData: ArrayBuffer, fileName: string) => Promise<{ success: boolean; path?: string; message?: string; canceled?: boolean }>- openVideoFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>- setCurrentVideoPath: (path: string) => Promise<{ success: boolean }>- getCurrentVideoPath: () => Promise<{ success: boolean; path?: string }>- clearCurrentVideoPath: () => Promise<{ success: boolean }>- saveProjectFile: (projectData: unknown, suggestedName?: string, existingProjectPath?: string) => Promise<{ success: boolean; path?: string; message?: string; canceled?: boolean; error?: string }>- loadProjectFile: () => Promise<{ success: boolean; path?: string; project?: unknown; message?: string; canceled?: boolean; error?: string }>- loadCurrentProjectFile: () => Promise<{ success: boolean; path?: string; project?: unknown; message?: string; canceled?: boolean; error?: string }>- onMenuLoadProject: (callback: () => void) => () => void- onMenuSaveProject: (callback: () => void) => () => void- onMenuSaveProjectAs: (callback: () => void) => () => void- getPlatform: () => Promise<string>- revealInFolder: (filePath: string) => Promise<{ success: boolean; error?: string; message?: string }>,- openRecordingsFolder: () => Promise<{ success: boolean; error?: string; message?: string }>,- getRecordingsDirectory: () => Promise<{ success: boolean; path: string; isDefault: boolean; error?: string }>- chooseRecordingsDirectory: () => Promise<{ success: boolean; canceled?: boolean; path?: string; isDefault?: boolean; message?: string; error?: string }>- getShortcuts: () => Promise<Record<string, unknown> | null>- saveShortcuts: (shortcuts: unknown) => Promise<{ success: boolean; error?: string }>- hudOverlayHide: () => void;- hudOverlayClose: () => void;- setHasUnsavedChanges: (hasChanges: boolean) => void- onRequestSaveBeforeClose: (callback: () => Promise<void>) => () => void- isWgcAvailable: () => Promise<{ available: boolean }>- muxWgcRecording: () => Promise<{ success: boolean; path?: string; message?: string; error?: string }>- /** Hide the OS cursor before browser capture starts. */- hideOsCursor: () => Promise<{ success: boolean }>- }++ electronAPI: {++ getSources: (opts: Electron.SourcesOptions) => Promise<ProcessedDesktopSource[]>;++ switchToEditor: () => Promise<void>;++ openSourceSelector: () => Promise<void>;++ selectSource: (source: any) => Promise<any>;++ showSourceHighlight: (source: any) => Promise<{ success: boolean }>;++ getSelectedSource: () => Promise<any>;++ startNativeScreenRecording: (++ source: any,++ options?: {++ capturesSystemAudio?: boolean;++ capturesMicrophone?: boolean;++ microphoneDeviceId?: string;++ microphoneLabel?: string;++ },++ ) => Promise<{ success: boolean; path?: string; message?: string; error?: string }>;++ stopNativeScreenRecording: () => Promise<{++ success: boolean;++ path?: string;++ message?: string;++ error?: string;++ }>;++ startFfmpegRecording: (++ source: any,++ ) => Promise<{ success: boolean; path?: string; message?: string; error?: string }>;++ stopFfmpegRecording: () => Promise<{++ success: boolean;++ path?: string;++ message?: string;++ error?: string;++ }>;++ storeRecordedVideo: (++ videoData: ArrayBuffer,++ fileName: string,++ ) => Promise<{ success: boolean; path?: string; message?: string }>;++ getRecordedVideoPath: () => Promise<{ success: boolean; path?: string; message?: string }>;++ readLocalFile: (++ filePath: string,++ ) => Promise<{ success: boolean; data?: Uint8Array; error?: string }>;++ setRecordingState: (recording: boolean) => Promise<void>;++ getCursorTelemetry: (videoPath?: string) => Promise<{++ success: boolean;++ samples: CursorTelemetryPoint[];++ message?: string;++ error?: string;++ }>;++ getSystemCursorAssets: () => Promise<{++ success: boolean;++ cursors: Record<string, SystemCursorAsset>;++ error?: string;++ }>;++ onStopRecordingFromTray: (callback: () => void) => () => void;++ onRecordingStateChanged: (++ callback: (state: { recording: boolean; sourceName: string }) => void,++ ) => () => void;++ onRecordingInterrupted: (++ callback: (state: { reason: string; message: string }) => void,++ ) => () => void;++ onCursorStateChanged: (++ callback: (state: { cursorType: CursorTelemetryPoint["cursorType"] }) => void,++ ) => () => void;++ openExternalUrl: (url: string) => Promise<{ success: boolean; error?: string }>;++ getAccessibilityPermissionStatus: () => Promise<{++ success: boolean;++ trusted: boolean;++ prompted: boolean;++ error?: string;++ }>;++ requestAccessibilityPermission: () => Promise<{++ success: boolean;++ trusted: boolean;++ prompted: boolean;++ error?: string;++ }>;++ getScreenRecordingPermissionStatus: () => Promise<{++ success: boolean;++ status: string;++ error?: string;++ }>;++ openScreenRecordingPreferences: () => Promise<{ success: boolean; error?: string }>;++ openAccessibilityPreferences: () => Promise<{ success: boolean; error?: string }>;++ saveExportedVideo: (++ videoData: ArrayBuffer,++ fileName: string,++ ) => Promise<{ success: boolean; path?: string; message?: string; canceled?: boolean }>;++ openVideoFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>;++ openAudioFilePicker: () => Promise<{ success: boolean; path?: string; canceled?: boolean }>;++ setCurrentVideoPath: (path: string) => Promise<{ success: boolean }>;++ getCurrentVideoPath: () => Promise<{ success: boolean; path?: string }>;++ clearCurrentVideoPath: () => Promise<{ success: boolean }>;++ saveProjectFile: (++ projectData: unknown,++ suggestedName?: string,++ existingProjectPath?: string,++ ) => Promise<{++ success: boolean;++ path?: string;++ message?: string;++ canceled?: boolean;++ error?: string;++ }>;++ loadProjectFile: () => Promise<{++ success: boolean;++ path?: string;++ project?: unknown;++ message?: string;++ canceled?: boolean;++ error?: string;++ }>;++ loadCurrentProjectFile: () => Promise<{++ success: boolean;++ path?: string;++ project?: unknown;++ message?: string;++ canceled?: boolean;++ error?: string;++ }>;++ onMenuLoadProject: (callback: () => void) => () => void;++ onMenuSaveProject: (callback: () => void) => () => void;++ onMenuSaveProjectAs: (callback: () => void) => () => void;++ getPlatform: () => Promise<string>;++ revealInFolder: (++ filePath: string,++ ) => Promise<{ success: boolean; error?: string; message?: string }>;++ openRecordingsFolder: () => Promise<{ success: boolean; error?: string; message?: string }>;++ getRecordingsDirectory: () => Promise<{++ success: boolean;++ path: string;++ isDefault: boolean;++ error?: string;++ }>;++ chooseRecordingsDirectory: () => Promise<{++ success: boolean;++ canceled?: boolean;++ path?: string;++ isDefault?: boolean;++ message?: string;++ error?: string;++ }>;++ getShortcuts: () => Promise<Record<string, unknown> | null>;++ saveShortcuts: (shortcuts: unknown) => Promise<{ success: boolean; error?: string }>;++ hudOverlayHide: () => void;++ hudOverlayClose: () => void;++ getHudOverlayCaptureProtection: () => Promise<{ success: boolean; enabled: boolean }>;++ setHudOverlayCaptureProtection: (++ enabled: boolean,++ ) => Promise<{ success: boolean; enabled: boolean }>;++ setHasUnsavedChanges: (hasChanges: boolean) => void;++ onRequestSaveBeforeClose: (callback: () => Promise<void>) => () => void;++ isWgcAvailable: () => Promise<{ available: boolean }>;++ muxWgcRecording: () => Promise<{++ success: boolean;++ path?: string;++ message?: string;++ error?: string;++ }>;++ /** Hide the OS cursor before browser capture starts. */++ hideOsCursor: () => Promise<{ success: boolean }>;++ /** Countdown timer before recording */++ getCountdownDelay: () => Promise<{ success: boolean; delay: number }>;++ setCountdownDelay: (delay: number) => Promise<{ success: boolean; error?: string }>;++ startCountdown: (seconds: number) => Promise<{ success: boolean; cancelled?: boolean }>;++ cancelCountdown: () => Promise<{ success: boolean }>;++ onCountdownTick: (callback: (seconds: number) => void) => () => void;++ };+}++interface ProcessedDesktopSource {- id: string- name: string- display_id: string- thumbnail: string | null- appIcon: string | null- originalName?: string- sourceType?: 'screen' | 'window'- appName?: string- windowTitle?: string++ id: string;++ name: string;++ display_id: string;++ thumbnail: string | null;++ appIcon: string | null;++ originalName?: string;++ sourceType?: "screen" | "window";++ appName?: string;++ windowTitle?: string;+}++interface CursorTelemetryPoint {- timeMs: number- cx: number- cy: number- interactionType?: 'move' | 'click' | 'double-click' | 'right-click' | 'middle-click' | 'mouseup'- cursorType?: 'arrow' | 'text' | 'pointer' | 'crosshair' | 'open-hand' | 'closed-hand' | 'resize-ew' | 'resize-ns' | 'not-allowed'++ timeMs: number;++ cx: number;++ cy: number;++ interactionType?: "move" | "click" | "double-click" | "right-click" | "middle-click" | "mouseup";++ cursorType?:++ | "arrow"++ | "text"++ | "pointer"++ | "crosshair"++ | "open-hand"++ | "closed-hand"++ | "resize-ew"++ | "resize-ns"++ | "not-allowed";+}++interface SystemCursorAsset {- dataUrl: string- hotspotX: number- hotspotY: number- width: number- height: number++ dataUrl: string;++ hotspotX: number;++ hotspotY: number;++ width: number;++ height: number;+}-diff --cc electron/preload.tsindex 50fe9712,e56b0b85..baea77dd--- a/electron/preload.ts+++ b/electron/preload.ts@@@ -1,189 -1,212 +1,215 @@@- import { contextBridge, ipcRenderer } from 'electron'-- contextBridge.exposeInMainWorld('electronAPI', {- hudOverlayHide: () => {- ipcRenderer.send('hud-overlay-hide');- },- hudOverlayClose: () => {- ipcRenderer.send('hud-overlay-close');- },- getAssetBasePath: async () => {- // ask main process for the correct base path (production vs dev)- return await ipcRenderer.invoke('get-asset-base-path')- },- readLocalFile: (filePath: string) => {- return ipcRenderer.invoke('read-local-file', filePath)- },- getSources: async (opts: Electron.SourcesOptions) => {- return await ipcRenderer.invoke('get-sources', opts)- },- switchToEditor: () => {- return ipcRenderer.invoke('switch-to-editor')- },- openSourceSelector: () => {- return ipcRenderer.invoke('open-source-selector')- },- selectSource: (source: any) => {- return ipcRenderer.invoke('select-source', source)- },- showSourceHighlight: (source: any) => {- return ipcRenderer.invoke('show-source-highlight', source)- },- getSelectedSource: () => {- return ipcRenderer.invoke('get-selected-source')- },- startNativeScreenRecording: (- source: any,- options?: {- capturesSystemAudio?: boolean- capturesMicrophone?: boolean- microphoneDeviceId?: string- microphoneLabel?: string- },- ) => {- return ipcRenderer.invoke('start-native-screen-recording', source, options)- },- stopNativeScreenRecording: () => {- return ipcRenderer.invoke('stop-native-screen-recording')- },- startFfmpegRecording: (source: any) => {- return ipcRenderer.invoke('start-ffmpeg-recording', source)- },- stopFfmpegRecording: () => {- return ipcRenderer.invoke('stop-ffmpeg-recording')- },-- storeRecordedVideo: (videoData: ArrayBuffer, fileName: string) => {- return ipcRenderer.invoke('store-recorded-video', videoData, fileName)- },-- getRecordedVideoPath: () => {- return ipcRenderer.invoke('get-recorded-video-path')- },- setRecordingState: (recording: boolean) => {- return ipcRenderer.invoke('set-recording-state', recording)- },- setCursorScale: (scale: number) => {- return ipcRenderer.invoke('set-cursor-scale', scale)- },- getCursorTelemetry: (videoPath?: string) => {- return ipcRenderer.invoke('get-cursor-telemetry', videoPath)- },- getSystemCursorAssets: () => {- return ipcRenderer.invoke('get-system-cursor-assets')- },- onStopRecordingFromTray: (callback: () => void) => {- const listener = () => callback()- ipcRenderer.on('stop-recording-from-tray', listener)- return () => ipcRenderer.removeListener('stop-recording-from-tray', listener)- },- onRecordingStateChanged: (callback: (state: { recording: boolean; sourceName: string }) => void) => {- const listener = (_event: Electron.IpcRendererEvent, payload: { recording: boolean; sourceName: string }) => callback(payload)- ipcRenderer.on('recording-state-changed', listener)- return () => ipcRenderer.removeListener('recording-state-changed', listener)- },- onRecordingInterrupted: (callback: (state: { reason: string; message: string }) => void) => {- const listener = (_event: Electron.IpcRendererEvent, payload: { reason: string; message: string }) => callback(payload)- ipcRenderer.on('recording-interrupted', listener)- return () => ipcRenderer.removeListener('recording-interrupted', listener)- },- onCursorStateChanged: (callback: (state: { cursorType: CursorTelemetryPoint['cursorType'] }) => void) => {- const listener = (_event: Electron.IpcRendererEvent, payload: { cursorType: CursorTelemetryPoint['cursorType'] }) => callback(payload)- ipcRenderer.on('cursor-state-changed', listener)- return () => ipcRenderer.removeListener('cursor-state-changed', listener)- },- openExternalUrl: (url: string) => {- return ipcRenderer.invoke('open-external-url', url)- },- getAccessibilityPermissionStatus: () => {- return ipcRenderer.invoke('get-accessibility-permission-status')- },- requestAccessibilityPermission: () => {- return ipcRenderer.invoke('request-accessibility-permission')- },- getScreenRecordingPermissionStatus: () => {- return ipcRenderer.invoke('get-screen-recording-permission-status')- },- openScreenRecordingPreferences: () => {- return ipcRenderer.invoke('open-screen-recording-preferences')- },- openAccessibilityPreferences: () => {- return ipcRenderer.invoke('open-accessibility-preferences')- },- saveExportedVideo: (videoData: ArrayBuffer, fileName: string) => {- return ipcRenderer.invoke('save-exported-video', videoData, fileName)- },- openVideoFilePicker: () => {- return ipcRenderer.invoke('open-video-file-picker')- },- setCurrentVideoPath: (path: string) => {- return ipcRenderer.invoke('set-current-video-path', path)- },- getCurrentVideoPath: () => {- return ipcRenderer.invoke('get-current-video-path')- },- clearCurrentVideoPath: () => {- return ipcRenderer.invoke('clear-current-video-path')- },- saveProjectFile: (projectData: unknown, suggestedName?: string, existingProjectPath?: string) => {- return ipcRenderer.invoke('save-project-file', projectData, suggestedName, existingProjectPath)- },- loadProjectFile: () => {- return ipcRenderer.invoke('load-project-file')- },- loadCurrentProjectFile: () => {- return ipcRenderer.invoke('load-current-project-file')- },- onMenuLoadProject: (callback: () => void) => {- const listener = () => callback()- ipcRenderer.on('menu-load-project', listener)- return () => ipcRenderer.removeListener('menu-load-project', listener)- },- onMenuSaveProject: (callback: () => void) => {- const listener = () => callback()- ipcRenderer.on('menu-save-project', listener)- return () => ipcRenderer.removeListener('menu-save-project', listener)- },- onMenuSaveProjectAs: (callback: () => void) => {- const listener = () => callback()- ipcRenderer.on('menu-save-project-as', listener)- return () => ipcRenderer.removeListener('menu-save-project-as', listener)- },- getPlatform: () => {- return ipcRenderer.invoke('get-platform')- },- revealInFolder: (filePath: string) => {- return ipcRenderer.invoke('reveal-in-folder', filePath)- },- openRecordingsFolder: () => {- return ipcRenderer.invoke('open-recordings-folder')- },- getRecordingsDirectory: () => {- return ipcRenderer.invoke('get-recordings-directory')- },- chooseRecordingsDirectory: () => {- return ipcRenderer.invoke('choose-recordings-directory')- },- getShortcuts: () => {- return ipcRenderer.invoke('get-shortcuts')- },- saveShortcuts: (shortcuts: unknown) => {- return ipcRenderer.invoke('save-shortcuts', shortcuts)- },- setHasUnsavedChanges: (hasChanges: boolean) => {- ipcRenderer.send('set-has-unsaved-changes', hasChanges)- },- onRequestSaveBeforeClose: (callback: () => Promise<void>) => {- const listener = async () => {- await callback()- ipcRenderer.send('save-before-close-done')- }- ipcRenderer.on('request-save-before-close', listener)- return () => ipcRenderer.removeListener('request-save-before-close', listener)- },- isWgcAvailable: () => ipcRenderer.invoke('is-wgc-available'),- muxWgcRecording: () => ipcRenderer.invoke('mux-wgc-recording'),- // Cursor visibility control for cursor-free browser capture fallback- hideOsCursor: () => ipcRenderer.invoke('hide-cursor'),- })+ import { contextBridge, ipcRenderer } from "electron";+ contextBridge.exposeInMainWorld("electronAPI", {+ hudOverlayHide: () => {+ ipcRenderer.send("hud-overlay-hide");+ },+ hudOverlayClose: () => {+ ipcRenderer.send("hud-overlay-close");+ },+ getHudOverlayCaptureProtection: () => {+ return ipcRenderer.invoke("get-hud-overlay-capture-protection");+ },+ setHudOverlayCaptureProtection: (enabled: boolean) => {+ return ipcRenderer.invoke("set-hud-overlay-capture-protection", enabled);+ },+ getAssetBasePath: async () => {+ return await ipcRenderer.invoke("get-asset-base-path");+ },+ readLocalFile: (filePath: string) => {+ return ipcRenderer.invoke("read-local-file", filePath);+ },+ getSources: async (opts: Electron.SourcesOptions) => {+ return await ipcRenderer.invoke("get-sources", opts);+ },+ switchToEditor: () => {+ return ipcRenderer.invoke("switch-to-editor");+ },+ openSourceSelector: () => {+ return ipcRenderer.invoke("open-source-selector");+ },+ selectSource: (source: any) => {+ return ipcRenderer.invoke("select-source", source);+ },++ showSourceHighlight: (source: any) => {++ return ipcRenderer.invoke("show-source-highlight", source);++ },+ getSelectedSource: () => {+ return ipcRenderer.invoke("get-selected-source");+ },+ startNativeScreenRecording: (+ source: any,+ options?: {+ capturesSystemAudio?: boolean;+ capturesMicrophone?: boolean;+ microphoneDeviceId?: string;+ microphoneLabel?: string;+ },+ ) => {+ return ipcRenderer.invoke("start-native-screen-recording", source, options);+ },+ stopNativeScreenRecording: () => {+ return ipcRenderer.invoke("stop-native-screen-recording");+ },+ startFfmpegRecording: (source: any) => {+ return ipcRenderer.invoke("start-ffmpeg-recording", source);+ },+ stopFfmpegRecording: () => {+ return ipcRenderer.invoke("stop-ffmpeg-recording");+ },+ storeRecordedVideo: (videoData: ArrayBuffer, fileName: string) => {+ return ipcRenderer.invoke("store-recorded-video", videoData, fileName);+ },+ getRecordedVideoPath: () => {+ return ipcRenderer.invoke("get-recorded-video-path");+ },+ setRecordingState: (recording: boolean) => {+ return ipcRenderer.invoke("set-recording-state", recording);+ },+ setCursorScale: (scale: number) => {+ return ipcRenderer.invoke("set-cursor-scale", scale);+ },+ getCursorTelemetry: (videoPath?: string) => {+ return ipcRenderer.invoke("get-cursor-telemetry", videoPath);+ },+ getSystemCursorAssets: () => {+ return ipcRenderer.invoke("get-system-cursor-assets");+ },+ onStopRecordingFromTray: (callback: () => void) => {+ const listener = () => callback();+ ipcRenderer.on("stop-recording-from-tray", listener);+ return () => ipcRenderer.removeListener("stop-recording-from-tray", listener);+ },+ onRecordingStateChanged: (+ callback: (state: { recording: boolean; sourceName: string }) => void,+ ) => {+ const listener = (+ _event: Electron.IpcRendererEvent,+ payload: { recording: boolean; sourceName: string },+ ) => callback(payload);+ ipcRenderer.on("recording-state-changed", listener);+ return () => ipcRenderer.removeListener("recording-state-changed", listener);+ },+ onRecordingInterrupted: (callback: (state: { reason: string; message: string }) => void) => {+ const listener = (+ _event: Electron.IpcRendererEvent,+ payload: { reason: string; message: string },+ ) => callback(payload);+ ipcRenderer.on("recording-interrupted", listener);+ return () => ipcRenderer.removeListener("recording-interrupted", listener);+ },+ onCursorStateChanged: (+ callback: (state: { cursorType: CursorTelemetryPoint["cursorType"] }) => void,+ ) => {+ const listener = (+ _event: Electron.IpcRendererEvent,+ payload: { cursorType: CursorTelemetryPoint["cursorType"] },+ ) => callback(payload);+ ipcRenderer.on("cursor-state-changed", listener);+ return () => ipcRenderer.removeListener("cursor-state-changed", listener);+ },+ openExternalUrl: (url: string) => {+ return ipcRenderer.invoke("open-external-url", url);+ },+ getAccessibilityPermissionStatus: () => {+ return ipcRenderer.invoke("get-accessibility-permission-status");+ },+ requestAccessibilityPermission: () => {+ return ipcRenderer.invoke("request-accessibility-permission");+ },+ getScreenRecordingPermissionStatus: () => {+ return ipcRenderer.invoke("get-screen-recording-permission-status");+ },+ openScreenRecordingPreferences: () => {+ return ipcRenderer.invoke("open-screen-recording-preferences");+ },+ openAccessibilityPreferences: () => {+ return ipcRenderer.invoke("open-accessibility-preferences");+ },+ saveExportedVideo: (videoData: ArrayBuffer, fileName: string) => {+ return ipcRenderer.invoke("save-exported-video", videoData, fileName);+ },+ openVideoFilePicker: () => {+ return ipcRenderer.invoke("open-video-file-picker");+ },+ openAudioFilePicker: () => {+ return ipcRenderer.invoke("open-audio-file-picker");+ },+ setCurrentVideoPath: (path: string) => {+ return ipcRenderer.invoke("set-current-video-path", path);+ },+ getCurrentVideoPath: () => {+ return ipcRenderer.invoke("get-current-video-path");+ },+ clearCurrentVideoPath: () => {+ return ipcRenderer.invoke("clear-current-video-path");+ },+ saveProjectFile: (projectData: unknown, suggestedName?: string, existingProjectPath?: string) => {+ return ipcRenderer.invoke("save-project-file", projectData, suggestedName, existingProjectPath);+ },+ loadProjectFile: () => {+ return ipcRenderer.invoke("load-project-file");+ },+ loadCurrentProjectFile: () => {+ return ipcRenderer.invoke("load-current-project-file");+ },+ onMenuLoadProject: (callback: () => void) => {+ const listener = () => callback();+ ipcRenderer.on("menu-load-project", listener);+ return () => ipcRenderer.removeListener("menu-load-project", listener);+ },+ onMenuSaveProject: (callback: () => void) => {+ const listener = () => callback();+ ipcRenderer.on("menu-save-project", listener);+ return () => ipcRenderer.removeListener("menu-save-project", listener);+ },+ onMenuSaveProjectAs: (callback: () => void) => {+ const listener = () => callback();+ ipcRenderer.on("menu-save-project-as", listener);+ return () => ipcRenderer.removeListener("menu-save-project-as", listener);+ },+ getPlatform: () => {+ return ipcRenderer.invoke("get-platform");+ },+ revealInFolder: (filePath: string) => {+ return ipcRenderer.invoke("reveal-in-folder", filePath);+ },+ openRecordingsFolder: () => {+ return ipcRenderer.invoke("open-recordings-folder");+ },+ getRecordingsDirectory: () => {+ return ipcRenderer.invoke("get-recordings-directory");+ },+ chooseRecordingsDirectory: () => {+ return ipcRenderer.invoke("choose-recordings-directory");+ },+ getShortcuts: () => {+ return ipcRenderer.invoke("get-shortcuts");+ },+ saveShortcuts: (shortcuts: unknown) => {+ return ipcRenderer.invoke("save-shortcuts", shortcuts);+ },+ setHasUnsavedChanges: (hasChanges: boolean) => {+ ipcRenderer.send("set-has-unsaved-changes", hasChanges);+ },+ onRequestSaveBeforeClose: (callback: () => Promise<void>) => {+ const listener = async () => {+ await callback();+ ipcRenderer.send("save-before-close-done");+ };+ ipcRenderer.on("request-save-before-close", listener);+ return () => ipcRenderer.removeListener("request-save-before-close", listener);+ },+ isWgcAvailable: () => ipcRenderer.invoke("is-wgc-available"),+ muxWgcRecording: () => ipcRenderer.invoke("mux-wgc-recording"),+ hideOsCursor: () => ipcRenderer.invoke("hide-cursor"),+ getCountdownDelay: () => ipcRenderer.invoke("get-countdown-delay"),+ setCountdownDelay: (delay: number) => ipcRenderer.invoke("set-countdown-delay", delay),+ startCountdown: (seconds: number) => ipcRenderer.invoke("start-countdown", seconds),+ cancelCountdown: () => ipcRenderer.invoke("cancel-countdown"),+ onCountdownTick: (callback: (seconds: number) => void) => {+ const listener = (_event: Electron.IpcRendererEvent, seconds: number) => callback(seconds);+ ipcRenderer.on("countdown-tick", listener);+ return () => ipcRenderer.removeListener("countdown-tick", listener);+ },+ });diff --cc electron/windows.tsindex f5a46a54,762f0ae0..19f101d4--- a/electron/windows.ts+++ b/electron/windows.ts@@@ -24,62 -102,71 +102,71 @@@ ipcMain.handle("set-hud-overlay-capture});export function createHudOverlayWindow(): BrowserWindow {- const primaryDisplay = getScreen().getPrimaryDisplay();- const { workArea } = primaryDisplay;--- const windowWidth = 620;- const windowHeight = 520;-- const x = Math.floor(workArea.x + (workArea.width - windowWidth) / 2);- const y = Math.floor(workArea.y + workArea.height - windowHeight - 5);-- const win = new BrowserWindow({- width: windowWidth,- height: windowHeight,- minWidth: 620,- maxWidth: 620,- minHeight: 520,- maxHeight: 520,- x: x,- y: y,- frame: false,- transparent: true,- resizable: false,- alwaysOnTop: true,- skipTaskbar: true,- hasShadow: false,- webPreferences: {- preload: path.join(__dirname, 'preload.mjs'),- nodeIntegration: false,- contextIsolation: true,- backgroundThrottling: false,- },- })--- win.webContents.on('did-finish-load', () => {- win?.webContents.send('main-process-message', (new Date).toLocaleString())- })-- hudOverlayWindow = win;-- win.on('closed', () => {- if (hudOverlayWindow === win) {- hudOverlayWindow = null;- }- });--- if (VITE_DEV_SERVER_URL) {- win.loadURL(VITE_DEV_SERVER_URL + '?windowType=hud-overlay')- } else {- win.loadFile(path.join(RENDERER_DIST, 'index.html'), {- query: { windowType: 'hud-overlay' }- })- }-- return win+ loadHudOverlayCaptureProtectionSetting();++ const primaryDisplay = getScreen().getPrimaryDisplay();+ const { workArea } = primaryDisplay;+- const windowWidth = 660;- const windowHeight = 170;++ const windowWidth = 620;++ const windowHeight = 520;++ const x = Math.floor(workArea.x + (workArea.width - windowWidth) / 2);+ const y = Math.floor(workArea.y + workArea.height - windowHeight - 5);++ const win = new BrowserWindow({+ width: windowWidth,+ height: windowHeight,- minWidth: windowWidth,- maxWidth: windowWidth,- minHeight: windowHeight,- maxHeight: windowHeight,++ minWidth: 620,++ maxWidth: 620,++ minHeight: 520,++ maxHeight: 520,+ x: x,+ y: y,+ frame: false,+ transparent: true,+ resizable: false,+ alwaysOnTop: true,+ skipTaskbar: true,+ hasShadow: false,+ show: false,+ webPreferences: {+ preload: path.join(__dirname, "preload.mjs"),+ nodeIntegration: false,+ contextIsolation: true,+ backgroundThrottling: false,+ },+ });++ if (isHudOverlayCaptureProtectionSupported()) {+ win.setContentProtection(hudOverlayHiddenFromCapture);+ }++ win.webContents.on("did-finish-load", () => {+ win?.webContents.send("main-process-message", new Date().toLocaleString());+ setTimeout(() => {+ if (!win.isDestroyed()) {+ win.show();+ }+ }, 100);+ });++ hudOverlayWindow = win;++ win.on("closed", () => {+ if (hudOverlayWindow === win) {+ hudOverlayWindow = null;+ }+ });++ if (VITE_DEV_SERVER_URL) {+ win.loadURL(VITE_DEV_SERVER_URL + "?windowType=hud-overlay");+ } else {+ win.loadFile(path.join(RENDERER_DIST, "index.html"), {+ query: { windowType: "hud-overlay" },+ });+ }++ return win;}export function createEditorWindow(): BrowserWindow {diff --cc src/App.tsxindex 242e464b,67c5df21..332df09e--- a/src/App.tsx+++ b/src/App.tsx@@@ -1,69 -1,69 +1,75 @@@-import { useEffect, useState } from "react";-import { CountdownOverlay } from "./components/countdown/CountdownOverlay";-import { LaunchWindow } from "./components/launch/LaunchWindow";-import { SourceSelector } from "./components/launch/SourceSelector";-import { ShortcutsConfigDialog } from "./components/video-editor/ShortcutsConfigDialog";-import VideoEditor from "./components/video-editor/VideoEditor";-import { useI18n } from "./contexts/I18nContext";-import { ShortcutsProvider } from "./contexts/ShortcutsContext";-import { loadAllCustomFonts } from "./lib/customFonts";--export default function App() {- const [windowType, setWindowType] = useState("");- const { locale, t } = useI18n();-- useEffect(() => {- const params = new URLSearchParams(window.location.search);- const type = params.get("windowType") || "";- setWindowType(type);-- if (type === "hud-overlay" || type === "source-selector" || type === "countdown") {- document.body.style.background = "transparent";- document.documentElement.style.background = "transparent";- document.getElementById("root")?.style.setProperty("background", "transparent");- }-- loadAllCustomFonts().catch((error) => {- console.error("Failed to load custom fonts:", error);- });- }, []);-- useEffect(() => {- document.title =- windowType === "editor" ? t("app.editorTitle", "Recordly Editor") : t("app.name", "Recordly");- }, [windowType, locale, t]);-- switch (windowType) {- case "hud-overlay":- return <LaunchWindow />;- case "source-selector":- return <SourceSelector />;- case "countdown":- return <CountdownOverlay />;- case "editor":- return (- <ShortcutsProvider>- <VideoEditor />- <ShortcutsConfigDialog />- </ShortcutsProvider>- );- default:- return (- <div className="flex h-full w-full items-center justify-center bg-slate-950 text-white">- <div className="flex items-center gap-4 rounded-2xl border border-white/10 bg-white/5 px-6 py-5 shadow-2xl shadow-black/30 backdrop-blur-xl">- <img- src="/app-icons/recordly-128.png"- alt={t("app.name", "Recordly")}- className="h-12 w-12 rounded-xl"- />- <div>- <h1 className="text-xl font-semibold tracking-tight">{t("app.name", "Recordly")}</h1>- <p className="text-sm text-white/65">- {t("app.subtitle", "Screen recording and editing")}- </p>- </div>- </div>- </div>- );- }-}+import { useEffect, useState } from "react";++import { CountdownOverlay } from "./components/countdown/CountdownOverlay";+import { LaunchWindow } from "./components/launch/LaunchWindow";+import { SourceSelector } from "./components/launch/SourceSelector";- import VideoEditor from "./components/video-editor/VideoEditor";- import { loadAllCustomFonts } from "./lib/customFonts";- import { ShortcutsProvider } from "./contexts/ShortcutsContext";+import { ShortcutsConfigDialog } from "./components/video-editor/ShortcutsConfigDialog";++import VideoEditor from "./components/video-editor/VideoEditor";+import { useI18n } from "./contexts/I18nContext";++import { ShortcutsProvider } from "./contexts/ShortcutsContext";++import { loadAllCustomFonts } from "./lib/customFonts";++export default function App() {- const [windowType, setWindowType] = useState('');- const { locale, t } = useI18n();++ const [windowType, setWindowType] = useState("");++ const { locale, t } = useI18n();+- useEffect(() => {- const params = new URLSearchParams(window.location.search);- const type = params.get('windowType') || '';- setWindowType(type);++ useEffect(() => {++ const params = new URLSearchParams(window.location.search);++ const type = params.get("windowType") || "";++ setWindowType(type);+- if (type === 'hud-overlay' || type === 'source-selector') {- document.body.style.background = 'transparent';- document.documentElement.style.background = 'transparent';- document.getElementById('root')?.style.setProperty('background', 'transparent');- }++ if (type === "hud-overlay" || type === "source-selector" || type === "countdown") {++ document.body.style.background = "transparent";++ document.documentElement.style.background = "transparent";++ document.getElementById("root")?.style.setProperty("background", "transparent");++ }+- if (type === 'hud-overlay') {- document.documentElement.style.overflow = 'visible';- document.body.style.overflow = 'visible';- document.getElementById('root')?.style.setProperty('overflow', 'visible');- }++ if (type === "hud-overlay") {++ document.documentElement.style.overflow = "visible";++ document.body.style.overflow = "visible";++ document.getElementById("root")?.style.setProperty("overflow", "visible");++ }+- // Load custom fonts on app initialization- loadAllCustomFonts().catch((error) => {- console.error('Failed to load custom fonts:', error);- });- }, []);++ loadAllCustomFonts().catch((error) => {++ console.error("Failed to load custom fonts:", error);++ });++ }, []);+- useEffect(() => {- document.title = windowType === 'editor'- ? t('app.editorTitle', 'Recordly Editor')- : t('app.name', 'Recordly');- }, [windowType, locale, t]);++ useEffect(() => {++ document.title =++ windowType === "editor" ? t("app.editorTitle", "Recordly Editor") : t("app.name", "Recordly");++ }, [windowType, locale, t]);+- switch (windowType) {- case 'hud-overlay':- return <LaunchWindow />;- case 'source-selector':- return <SourceSelector />;- case 'editor':- return (- <ShortcutsProvider>- <VideoEditor />- <ShortcutsConfigDialog />- </ShortcutsProvider>- );- default:- return (- <div className="flex h-full w-full items-center justify-center bg-slate-950 text-white">- <div className="flex items-center gap-4 rounded-2xl border border-white/10 bg-white/5 px-6 py-5 shadow-2xl shadow-black/30 backdrop-blur-xl">- <img src="/app-icons/recordly-128.png" alt={t('app.name', 'Recordly')} className="h-12 w-12 rounded-xl" />- <div>- <h1 className="text-xl font-semibold tracking-tight">{t('app.name', 'Recordly')}</h1>- <p className="text-sm text-white/65">{t('app.subtitle', 'Screen recording and editing')}</p>- </div>- </div>- </div>- );- }++ switch (windowType) {++ case "hud-overlay":++ return <LaunchWindow />;++ case "source-selector":++ return <SourceSelector />;++ case "countdown":++ return <CountdownOverlay />;++ case "editor":++ return (++ <ShortcutsProvider>++ <VideoEditor />++ <ShortcutsConfigDialog />++ </ShortcutsProvider>++ );++ default:++ return (++ <div className="flex h-full w-full items-center justify-center bg-slate-950 text-white">++ <div className="flex items-center gap-4 rounded-2xl border border-white/10 bg-white/5 px-6 py-5 shadow-2xl shadow-black/30 backdrop-blur-xl">++ <img++ src="/app-icons/recordly-128.png"++ alt={t("app.name", "Recordly")}++ className="h-12 w-12 rounded-xl"++ />++ <div>++ <h1 className="text-xl font-semibold tracking-tight">{t("app.name", "Recordly")}</h1>++ <p className="text-sm text-white/65">++ {t("app.subtitle", "Screen recording and editing")}++ </p>++ </div>++ </div>++ </div>++ );++ }+}-diff --cc src/components/launch/LaunchWindow.tsxindex 388af224,0ee828af..c2d2a30a--- a/src/components/launch/LaunchWindow.tsx+++ b/src/components/launch/LaunchWindow.tsx@@@ -1,167 -1,57 +1,179 @@@-import { Eye, EyeOff, Languages, Timer } from "lucide-react";-import { useEffect, useState } from "react";-import { BsRecordCircle } from "react-icons/bs";-import { FaRegStopCircle } from "react-icons/fa";-import { FaFolderOpen } from "react-icons/fa6";-import { FiMinus, FiX } from "react-icons/fi";-import { MdMic, MdMicOff, MdMonitor, MdVideoFile, MdVolumeOff, MdVolumeUp } from "react-icons/md";+import type { ReactNode } from "react";+import { useCallback, useEffect, useRef, useState } from "react";+import {+ Monitor,+ Mic,+ MicOff,+ ChevronUp,+ Pause,+ Square,+ X,+ Play,+ Minus,+ MoreVertical,+ FolderOpen,+ VideoIcon,+ Languages,+ Volume2,+ VolumeX,+ AppWindow,++ Eye,++ EyeOff,++ Timer,+} from "lucide-react";import { RxDragHandleDots2 } from "react-icons/rx";-import { useI18n } from "@/contexts/I18nContext";-import type { AppLocale } from "@/i18n/config";-import { SUPPORTED_LOCALES } from "@/i18n/config";-import { useScopedT } from "../../contexts/I18nContext";import { useAudioLevelMeter } from "../../hooks/useAudioLevelMeter";import { useMicrophoneDevices } from "../../hooks/useMicrophoneDevices";import { useScreenRecorder } from "../../hooks/useScreenRecorder";+import { useScopedT } from "../../contexts/I18nContext";import { AudioLevelMeter } from "../ui/audio-level-meter";-import { Button } from "../ui/button";import { ContentClamp } from "../ui/content-clamp";-import {- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,-} from "../ui/dropdown-menu";+import { useI18n } from "@/contexts/I18nContext";+import { SUPPORTED_LOCALES } from "@/i18n/config";+import type { AppLocale } from "@/i18n/config";import styles from "./LaunchWindow.module.css";+interface DesktopSource {+ id: string;+ name: string;+ thumbnail: string | null;+ display_id: string;+ appIcon: string | null;+ sourceType?: "screen" | "window";+ appName?: string;+ windowTitle?: string;+}++const LOCALE_LABELS: Record<string, string> = {+ en: "EN",+ es: "ES",+ "zh-CN": "中文",+};+++const COUNTDOWN_OPTIONS = [0, 3, 5, 10];+++function IconButton({+ onClick,+ title,+ className = "",+ children,+}: {+ onClick?: () => void;+ title?: string;+ className?: string;+ children: ReactNode;+}) {+ return (+ <button+ type="button"+ className={`${styles.ib} ${styles.electronNoDrag} ${className}`}+ onClick={onClick}+ title={title}+ >+ {children}+ </button>+ );+}++function DropdownItem({+ onClick,+ selected,+ icon,+ children,+ trailing,+}: {+ onClick: () => void;+ selected?: boolean;+ icon: ReactNode;+ children: ReactNode;+ trailing?: ReactNode;+}) {+ return (+ <button+ type="button"+ className={`${styles.ddItem} ${selected ? styles.ddItemSelected : ""}`}+ onClick={onClick}+ >+ <span className="shrink-0">{icon}</span>+ <span className="truncate">{children}</span>+ {trailing}+ </button>+ );+}++function Separator() {+ return <div className={styles.sep} />;+}++function MicDeviceRow({+ device,+ selected,+ onSelect,+}: {+ device: { deviceId: string; label: string };+ selected: boolean;+ onSelect: () => void;+}) {+ const { level } = useAudioLevelMeter({+ enabled: true,+ deviceId: device.deviceId,+ });++ return (+ <button+ type="button"+ className={`${styles.ddItem} ${selected ? styles.ddItemSelected : ""}`}+ onClick={onSelect}+ >+ <span className="shrink-0">{selected ? <Mic size={16} /> : <MicOff size={16} />}</span>+ <span className="truncate flex-1">{device.label}</span>+ <AudioLevelMeter level={level} className="w-16 shrink-0" />+ </button>+ );+}+export function LaunchWindow() {const { locale, setLocale } = useI18n();const t = useScopedT("launch");- const LOCALE_LABELS: Record<string, string> = { en: "EN", es: "ES", "zh-CN": "中文" };const {recording,+ paused,+ countdownActive,toggleRecording,+ pauseRecording,+ resumeRecording,+ cancelRecording,microphoneEnabled,setMicrophoneEnabled,microphoneDeviceId,setMicrophoneDeviceId,systemAudioEnabled,setSystemAudioEnabled,+ countdownDelay,+ setCountdownDelay,} = useScreenRecorder();+const [recordingStart, setRecordingStart] = useState<number | null>(null);const [elapsed, setElapsed] = useState(0);- const showMicControls = microphoneEnabled && !recording;+ const [pausedAt, setPausedAt] = useState<number | null>(null);+ const [pausedTotal, setPausedTotal] = useState(0);+ const [selectedSource, setSelectedSource] = useState("Screen");+ const [hasSelectedSource, setHasSelectedSource] = useState(false);+ const [recordingsDirectory, setRecordingsDirectory] = useState<string | null>(null);- const [activeDropdown, setActiveDropdown] = useState<"none" | "sources" | "more" | "mic">("none");++ const [activeDropdown, setActiveDropdown] = useState<"none" | "sources" | "more" | "mic" | "countdown">("none");+ const [sources, setSources] = useState<DesktopSource[]>([]);+ const [sourcesLoading, setSourcesLoading] = useState(false);++ const [hideHudFromCapture, setHideHudFromCapture] = useState(true);++ const [platform, setPlatform] = useState<string | null>(null);+ const dropdownRef = useRef<HTMLDivElement>(null);++ const micDropdownOpen = activeDropdown === "mic";const { devices, selectedDeviceId, setSelectedDeviceId } =- useMicrophoneDevices(microphoneEnabled);- const { level } = useAudioLevelMeter({- enabled: showMicControls,- deviceId: microphoneDeviceId,- });+ useMicrophoneDevices(microphoneEnabled || micDropdownOpen);+++ const supportsHudCaptureProtection = platform !== "linux";+useEffect(() => {if (selectedDeviceId && selectedDeviceId !== "default") {setMicrophoneDeviceId(selectedDeviceId);@@@ -225,79 -111,49 +237,109 @@@}, []);useEffect(() => {- let cancelled = false;+ const load = async () => {+ const result = await window.electronAPI.getRecordingsDirectory();+ if (result.success) setRecordingsDirectory(result.path);+ };+ void load();+ }, []);++ useEffect(() => {++ let cancelled = false;+ const loadPlatform = async () => {+ try {+ const nextPlatform = await window.electronAPI.getPlatform();- if (!cancelled) {- setPlatform(nextPlatform);- }++ if (!cancelled) setPlatform(nextPlatform);+ } catch (error) {+ console.error("Failed to load platform:", error);+ }+ };-+ void loadPlatform();-- return () => {- cancelled = true;- };++ return () => { cancelled = true; };+ }, []);++ useEffect(() => {+ let cancelled = false;-+ const loadHudCaptureProtection = async () => {+ try {+ const result = await window.electronAPI.getHudOverlayCaptureProtection();+ if (!cancelled && result.success) {+ setHideHudFromCapture(result.enabled);+ }+ } catch (error) {+ console.error("Failed to load HUD capture protection state:", error);+ }+ };-+ void loadHudCaptureProtection();++ return () => { cancelled = true; };++ }, []);+- return () => {- cancelled = true;+ useEffect(() => {+ const handleClick = (e: MouseEvent) => {+ if (dropdownRef.current && !dropdownRef.current.contains(e.target as Node)) {+ setActiveDropdown("none");+ }};+ document.addEventListener("mousedown", handleClick);+ return () => document.removeEventListener("mousedown", handleClick);+ }, []);++ const fetchSources = useCallback(async () => {+ if (!window.electronAPI) return;+ setSourcesLoading(true);+ try {+ const rawSources = await window.electronAPI.getSources({+ types: ["screen", "window"],+ thumbnailSize: { width: 160, height: 90 },+ fetchWindowIcons: true,+ });+ setSources(+ rawSources.map((s) => {+ const isWindow = s.id.startsWith("window:");+ const type = s.sourceType ?? (isWindow ? "window" : "screen");+ let displayName = s.name;+ let appName = s.appName;+ if (isWindow && !appName && s.name.includes(" — ")) {+ const parts = s.name.split(" — ");+ appName = parts[0]?.trim();+ displayName = parts.slice(1).join(" — ").trim() || s.name;+ } else if (isWindow && s.windowTitle) {+ displayName = s.windowTitle;+ }+ return {+ id: s.id,+ name: displayName,+ thumbnail: s.thumbnail,+ display_id: s.display_id,+ appIcon: s.appIcon,+ sourceType: type,+ appName,+ windowTitle: s.windowTitle ?? displayName,+ };+ }),+ );+ } catch (error) {+ console.error("Failed to fetch sources:", error);+ } finally {+ setSourcesLoading(false);+ }}, []);- const toggleDropdown = (which: "sources" | "more" | "mic") => {- const openSourceSelector = () => {- window.electronAPI?.openSourceSelector();++ const toggleDropdown = (which: "sources" | "more" | "mic" | "countdown") => {+ setActiveDropdown(activeDropdown === which ? "none" : which);+ if (activeDropdown !== which && which === "sources") fetchSources();+ };++ const handleSourceSelect = async (source: DesktopSource) => {+ await window.electronAPI.selectSource(source);+ setSelectedSource(source.name);+ setHasSelectedSource(true);+ setActiveDropdown("none");+ window.electronAPI.showSourceHighlight?.({+ ...source,+ name: source.appName ? `${source.appName} — ${source.name}` : source.name,+ appName: source.appName,+ });};const openVideoFile = async () => {@@@ -317,244 -176,326 +359,294 @@@await window.electronAPI.switchToEditor();};- const sendHudOverlayHide = () => {- window.electronAPI?.hudOverlayHide?.();+ const chooseRecordingsDirectory = async () => {+ setActiveDropdown("none");+ const result = await window.electronAPI.chooseRecordingsDirectory();+ if (result.canceled) return;+ if (result.success && result.path) setRecordingsDirectory(result.path);};- const sendHudOverlayClose = () => {- window.electronAPI?.hudOverlayClose?.();+ const toggleMicrophone = () => {+ if (recording) return;+ toggleDropdown("mic");};+ const toggleHudCaptureProtection = async () => {+ const nextValue = !hideHudFromCapture;-+ setHideHudFromCapture(nextValue);-+ try {+ const result = await window.electronAPI.setHudOverlayCaptureProtection(nextValue);-+ if (!result.success) {+ setHideHudFromCapture(!nextValue);+ return;+ }-+ setHideHudFromCapture(result.enabled);+ } catch (error) {+ console.error("Failed to update HUD capture protection:", error);+ setHideHudFromCapture(!nextValue);+ }+ };+- const chooseRecordingsDirectory = async () => {- const result = await window.electronAPI.chooseRecordingsDirectory();- if (result.canceled) {- return;- }- if (result.success && result.path) {- setRecordingsDirectory(result.path);- }- };-- useEffect(() => {- const loadRecordingsDirectory = async () => {- const result = await window.electronAPI.getRecordingsDirectory();- if (result.success) {- setRecordingsDirectory(result.path);- }- };-- void loadRecordingsDirectory();- }, []);-- const recordingsDirectoryName = recordingsDirectory- ? recordingsDirectory.split(/[\\/]/).filter(Boolean).pop() || recordingsDirectory- : "recordings";- const dividerClass = "mx-1 h-5 w-px shrink-0 bg-white/35";- const supportsHudCaptureProtection = platform !== "linux";-- const toggleMicrophone = () => {- if (!recording) {- setMicrophoneEnabled(!microphoneEnabled);- }- };+ const screenSources = sources.filter((s) => s.sourceType === "screen");+ const windowSources = sources.filter((s) => s.sourceType === "window");return (- <div className="flex h-full w-full items-end justify-center overflow-hidden bg-transparent px-3 pb-3 pt-2">- <div className={`flex flex-col items-center gap-2 mx-auto ${styles.electronDrag}`}>- {showMicControls && (- <div- className={`flex items-center gap-2 rounded-full border border-white/15 bg-[rgba(18,18,26,0.92)] px-3 py-2 shadow-xl backdrop-blur-xl ${styles.electronNoDrag}`}- >- <select- value={microphoneDeviceId || selectedDeviceId}- onChange={(event) => {- setSelectedDeviceId(event.target.value);- setMicrophoneDeviceId(event.target.value);- }}- className={`max-w-[230px] rounded-full border border-white/15 bg-[#131722] px-3 py-1 text-xs text-slate-100 outline-none ${styles.micSelect}`}- >- {devices.map((device) => (- <option key={device.deviceId} value={device.deviceId}>- {device.label}- </option>- ))}- </select>- <AudioLevelMeter level={level} className="w-24" />- </div>- )}-- <div- className={`mx-auto inline-flex max-w-full items-center gap-1.5 px-3 py-2 ${styles.electronDrag} ${styles.hudBar}`}- style={{- borderRadius: 9999,- background: "linear-gradient(135deg, rgba(28,28,36,0.97) 0%, rgba(18,18,26,0.96) 100%)",- backdropFilter: "blur(16px) saturate(140%)",- WebkitBackdropFilter: "blur(16px) saturate(140%)",- border: "1px solid rgba(80,80,120,0.25)",- minHeight: 48,- }}- >- <div className={`flex items-center px-1 ${styles.electronDrag}`}>- <RxDragHandleDots2 size={16} className="text-white/35" />- </div>-- <Button- variant="link"- size="sm"- className={`gap-1 text-white/80 bg-transparent hover:bg-transparent px-0 text-xs ${styles.electronNoDrag}`}- onClick={openSourceSelector}- disabled={recording}- title={selectedSource}- >- <MdMonitor size={14} className="text-white/80" />- <ContentClamp truncateLength={6}>{selectedSource}</ContentClamp>- </Button>-- <div className={dividerClass} />-- <div className={`flex items-center gap-1 ${styles.electronNoDrag}`}>- {supportsHudCaptureProtection && (- <Button- variant="link"- size="icon"- onClick={() => void toggleHudCaptureProtection()}- title={- hideHudFromCapture- ? t("recording.showHudInVideo")- : t("recording.hideHudFromVideo")- }- className="text-white/80 hover:bg-transparent"- >- {hideHudFromCapture ? (- <EyeOff size={16} className="text-white/35" />+ <div+ className="w-full flex flex-col bg-transparent"+ style={{ height: "100vh" }}+ ref={dropdownRef}+ >+ {/* Top area — flex:1 reserves space, menu card sits at bottom of this area */}+ <div className={styles.menuArea}>+ {activeDropdown !== "none" && (+ <div className={`${styles.menuCard} ${styles.electronNoDrag}`}>+ {activeDropdown === "sources" && (+ <>+ {sourcesLoading ? (+ <div className="flex items-center justify-center py-6">+ <div className="animate-spin rounded-full h-4 w-4 border-b-2 border-[#6b6b78]" />+ </div>) : (- <Eye size={16} className="text-[#2563EB]" />+ <>+ {screenSources.length > 0 && (+ <>+ <div className={styles.ddLabel}>Screens</div>+ {screenSources.map((source) => (+ <DropdownItem+ key={source.id}+ icon={<Monitor size={16} />}+ selected={selectedSource === source.name}+ onClick={() => handleSourceSelect(source)}+ >+ {source.name}+ </DropdownItem>+ ))}+ </>+ )}+ {windowSources.length > 0 && (+ <>+ <div className={styles.ddLabel} style={screenSources.length > 0 ? { marginTop: 4 } : undefined}>+ Windows+ </div>+ {windowSources.map((source) => (+ <DropdownItem+ key={source.id}+ icon={<AppWindow size={16} />}+ selected={selectedSource === source.name}+ onClick={() => handleSourceSelect(source)}+ >+ {source.appName && source.appName !== source.name+ ? `${source.appName} — ${source.name}`+ : source.name}+ </DropdownItem>+ ))}+ </>+ )}+ {screenSources.length === 0 && windowSources.length === 0 && (+ <div className="text-center text-xs text-[#6b6b78] py-4">+ No sources found+ </div>+ )}+ </>)}- </Button>+ </>)}- <Button- variant="link"- size="icon"- onClick={() => !recording && setSystemAudioEnabled(!systemAudioEnabled)}- disabled={recording}- title={- systemAudioEnabled- ? t("recording.disableSystemAudio")- : t("recording.enableSystemAudio")- }- className="text-white/80 hover:bg-transparent"- >- {systemAudioEnabled ? (- <MdVolumeUp size={16} className="text-[#2563EB]" />- ) : (- <MdVolumeOff size={16} className="text-white/35" />- )}- </Button>- <Button- variant="link"- size="icon"- onClick={toggleMicrophone}- disabled={recording}- title={- microphoneEnabled- ? t("recording.disableMicrophone")- : t("recording.enableMicrophone")- }- className="text-white/80 hover:bg-transparent"- >- {microphoneEnabled ? (- <MdMic size={16} className="text-[#2563EB]" />- ) : (- <MdMicOff size={16} className="text-white/35" />- )}- </Button>- </div>- <div className={dividerClass} />-- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button- variant="link"- size="sm"- disabled={recording || countdownActive}- title={t("recording.countdownDelay")}- className={`gap-1 px-1 text-xs text-white/70 hover:bg-transparent ${styles.electronNoDrag}`}- >- <Timer size={14} />- <span>{countdownDelay > 0 ? `${countdownDelay}s` : t("recording.noDelay")}</span>- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent- side="top"- align="center"- className="min-w-[80px] max-h-none overflow-visible border-white/15 bg-[rgba(28,28,36,0.97)] text-white/90 backdrop-blur-xl"- >- {[0, 3, 5, 10].map((delay) => (- <DropdownMenuItem- key={delay}- onSelect={() => setCountdownDelay(delay)}- className={`cursor-pointer text-xs ${- countdownDelay === delay ? "font-medium text-white" : "text-white/60"- }`}- >- {delay === 0 ? t("recording.noDelay") : `${delay}s`}- </DropdownMenuItem>- ))}- </DropdownMenuContent>- </DropdownMenu>-- <Button- variant="link"- size="sm"- onClick={hasSelectedSource ? toggleRecording : openSourceSelector}- disabled={countdownActive || (!hasSelectedSource && !recording)}- className={`gap-1 text-white bg-transparent hover:bg-transparent px-0 text-xs ${styles.electronNoDrag}`}- >- {recording ? (+ {activeDropdown === "mic" && (<>- <FaRegStopCircle size={14} className="text-red-400" />- <span className="text-red-400 font-medium tabular-nums">{formatTime(elapsed)}</span>+ <div className={styles.ddLabel}>Microphone</div>+ {microphoneEnabled && (+ <DropdownItem+ icon={<MicOff size={16} />}+ onClick={() => { setMicrophoneEnabled(false); setActiveDropdown("none"); }}+ >+ Turn Off Microphone+ </DropdownItem>+ )}+ {!microphoneEnabled && (+ <div className="px-3 py-2 text-xs text-[#6b6b78]">+ Select a microphone to enable+ </div>+ )}+ {devices.map((device) => (+ <MicDeviceRow+ key={device.deviceId}+ device={device}+ selected={microphoneEnabled && (microphoneDeviceId === device.deviceId || selectedDeviceId === device.deviceId)}+ onSelect={() => {+ setMicrophoneEnabled(true);+ setSelectedDeviceId(device.deviceId);+ setMicrophoneDeviceId(device.deviceId);+ }}+ />+ ))}+ {devices.length === 0 && (+ <div className="text-center text-xs text-[#6b6b78] py-4">+ No microphones found+ </div>+ )}</>- ) : (+ )}+++ {activeDropdown === "countdown" && (+ <>- <BsRecordCircle- size={14}- className={hasSelectedSource ? "text-white/85" : "text-white/35"}- />- <span className={hasSelectedSource ? "text-white/80" : "text-white/35"}>- {t("recording.record")}- </span>++ <div className={styles.ddLabel}>{t("recording.countdownDelay")}</div>++ {COUNTDOWN_OPTIONS.map((delay) => (++ <DropdownItem++ key={delay}++ icon={<Timer size={16} />}++ selected={countdownDelay === delay}++ onClick={() => { setCountdownDelay(delay); setActiveDropdown("none"); }}++ >++ {delay === 0 ? t("recording.noDelay") : `${delay}s`}++ </DropdownItem>++ ))}+ </>+ )}- </Button>-- <Button- variant="link"- size="sm"- onClick={chooseRecordingsDirectory}- disabled={recording}- title={- recordingsDirectory- ? t("recording.recordingFolder", undefined, { path: recordingsDirectory })- : t("recording.chooseRecordingsFolder")- }- className={`text-white/75 hover:bg-transparent px-1 text-[11px] underline decoration-white/45 underline-offset-2 ${styles.electronNoDrag}`}- >- <ContentClamp truncateLength={18}>- {t("recording.folderPath", undefined, { name: recordingsDirectoryName })}- </ContentClamp>- </Button>-- <div className="ml-auto flex items-center gap-0.5">- <div className={dividerClass} />- <Button- variant="link"- size="icon"- onClick={openVideoFile}- disabled={recording}- title={t("recording.openVideoFile")}- className={`text-white/70 hover:bg-transparent ${styles.electronNoDrag}`}- >- <MdVideoFile size={15} />- </Button>- <Button- variant="link"- size="icon"- onClick={openProjectFile}- disabled={recording}- title={t("recording.openProject")}- className={`text-white/70 hover:bg-transparent ${styles.electronNoDrag}`}- >- <FaFolderOpen size={14} />- </Button>- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button- variant="link"- size="icon"- title="Language"- className={`text-white/70 hover:bg-transparent ${styles.electronNoDrag}`}- >- <Languages size={14} />- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent- side="top"- align="end"- className="min-w-[90px] bg-[rgba(28,28,36,0.97)] border-white/15 text-white/90 backdrop-blur-xl"- >+++ {activeDropdown === "more" && (+ <>+ <DropdownItem icon={<FolderOpen size={16} />} onClick={chooseRecordingsDirectory}>+ Recordings Folder+ </DropdownItem>+ <DropdownItem icon={<VideoIcon size={16} />} onClick={openVideoFile}>+ {t("recording.openVideoFile")}+ </DropdownItem>+ <DropdownItem icon={<FolderOpen size={16} />} onClick={openProjectFile}>+ {t("recording.openProject")}+ </DropdownItem>+ <div className={styles.ddLabel} style={{ marginTop: 4 }}>Language</div>{SUPPORTED_LOCALES.map((code) => (- <DropdownMenuItem+ <DropdownItemkey={code}- onSelect={() => setLocale(code as AppLocale)}- className={`text-xs cursor-pointer ${- locale === code ? "text-white font-medium" : "text-white/60"- }`}+ icon={<Languages size={16} />}+ selected={locale === code}+ onClick={() => { setLocale(code as AppLocale); setActiveDropdown("none"); }}>{LOCALE_LABELS[code] ?? code}- </DropdownMenuItem>+ </DropdownItem>))}- </DropdownMenuContent>- </DropdownMenu>- <div className={dividerClass} />- <Button- variant="link"- size="icon"- onClick={sendHudOverlayHide}- title={t("recording.hideHud")}- className={`text-white/70 hover:bg-transparent ${styles.electronNoDrag}`}+ </>+ )}+ </div>+ )}+ </div>++ {/* Bottom section — fixed height, bar always stays here */}+ <div className="flex flex-col items-center">+ <div className={`${styles.bar} ${styles.electronDrag} mb-2`}>+ <div className={`flex items-center px-0.5 ${styles.electronDrag}`}>+ <RxDragHandleDots2 size={14} className="text-[#6b6b78]" />+ </div>++ {recording ? (+ <>+ <div className="flex items-center gap-[5px]">+ <div className={`w-[7px] h-[7px] rounded-full ${paused ? "bg-[#fbbf24]" : `bg-[#f43f5e] ${styles.recDotBlink}`}`} />+ <span className={`text-[10px] font-bold tracking-[0.06em] ${paused ? "text-[#fbbf24]" : "text-[#f43f5e]"}`}>+ {paused ? "PAUSED" : "REC"}+ </span>+ </div>++ <span className={`font-mono text-xs font-semibold min-w-[52px] text-center tracking-[0.02em] ${paused ? "text-[#fbbf24]" : "text-[#eeeef2]"}`}>+ {formatTime(elapsed)}+ </span>++ <Separator />++ <IconButton title={microphoneEnabled ? t("recording.disableMicrophone") : t("recording.enableMicrophone")} className={microphoneEnabled ? styles.ibActive : ""}>+ {microphoneEnabled ? <Mic size={18} /> : <MicOff size={18} />}+ </IconButton>++ <Separator />++ <IconButton onClick={paused ? resumeRecording : pauseRecording} title={paused ? "Resume" : "Pause"} className={paused ? styles.ibGreen : ""}>+ {paused ? <Play size={18} fill="currentColor" strokeWidth={0} /> : <Pause size={18} />}+ </IconButton>++ <IconButton onClick={toggleRecording} title="Stop" className={styles.ibRed}>+ <Square size={16} fill="currentColor" strokeWidth={0} />+ </IconButton>++ <IconButton onClick={cancelRecording} title="Cancel">+ <X size={18} />+ </IconButton>+ </>+ ) : (+ <>+ <button+ type="button"+ className={`${styles.screenSel} ${styles.electronNoDrag}`}+ onClick={() => toggleDropdown("sources")}+ title={selectedSource}>- <FiMinus size={16} />- </Button>- <Button- variant="link"- size="icon"- onClick={sendHudOverlayClose}- title={t("recording.closeApp")}- className={`text-white/70 hover:bg-transparent ${styles.electronNoDrag}`}+ <Monitor size={16} />+ <ContentClamp truncateLength={10}>{selectedSource}</ContentClamp>+ <ChevronUp size={10} className={`text-[#6b6b78] ml-0.5 transition-transform duration-200 ${activeDropdown === "sources" ? "" : "rotate-180"}`} />+ </button>++ <Separator />++ <IconButton+ onClick={toggleMicrophone}+ title={microphoneEnabled ? t("recording.disableMicrophone") : t("recording.enableMicrophone")}+ className={microphoneEnabled ? styles.ibActive : ""}>- <FiX size={16} />- </Button>- </div>+ {microphoneEnabled ? <Mic size={18} /> : <MicOff size={18} />}+ </IconButton>++ <IconButton+ onClick={() => setSystemAudioEnabled(!systemAudioEnabled)}- title={systemAudioEnabled ? "Disable System Audio" : "Enable System Audio"}++ title={systemAudioEnabled ? t("recording.disableSystemAudio") : t("recording.enableSystemAudio")}+ className={systemAudioEnabled ? styles.ibActive : ""}+ >+ {systemAudioEnabled ? <Volume2 size={18} /> : <VolumeX size={18} />}+ </IconButton>+++ {supportsHudCaptureProtection && (++ <IconButton++ onClick={() => void toggleHudCaptureProtection()}++ title={hideHudFromCapture ? t("recording.showHudInVideo") : t("recording.hideHudFromVideo")}++ >++ {hideHudFromCapture ? <EyeOff size={18} className="text-[#6b6b78]" /> : <Eye size={18} className="text-[#6360f5]" />}++ </IconButton>++ )}++++ <IconButton++ onClick={() => toggleDropdown("countdown")}++ title={t("recording.countdownDelay")}++ className={countdownDelay > 0 ? styles.ibActive : ""}++ >++ <Timer size={18} />++ </IconButton>+++ <Separator />++ <button+ type="button"+ className={`${styles.recBtn} ${styles.electronNoDrag}`}+ onClick={hasSelectedSource ? toggleRecording : () => toggleDropdown("sources")}++ disabled={countdownActive}+ title={t("recording.record")}+ >+ <div className={styles.recDot} />+ </button>++ <Separator />++ <IconButton onClick={() => toggleDropdown("more")} title="More">+ <MoreVertical size={18} />+ </IconButton>++ <IconButton onClick={() => window.electronAPI?.hudOverlayHide?.()} title={t("recording.hideHud")}>+ <Minus size={16} />+ </IconButton>++ <IconButton onClick={() => window.electronAPI?.hudOverlayClose?.()} title={t("recording.closeApp")}>+ <X size={16} />+ </IconButton>+ </>+ )}</div></div></div>diff --cc src/hooks/useScreenRecorder.tsindex 26a43851,57f26a91..11e3bd11--- a/src/hooks/useScreenRecorder.ts+++ b/src/hooks/useScreenRecorder.ts@@@ -28,11 -29,8 +29,12 @@@ const MIC_GAIN_BOOST = 1.4type UseScreenRecorderReturn = {recording: boolean;+ paused: boolean;+ countdownActive: boolean;toggleRecording: () => void;+ pauseRecording: () => void;+ resumeRecording: () => void;+ cancelRecording: () => void;preparePermissions: (options?: { startup?: boolean }) => Promise<boolean>;isMacOS: boolean;microphoneEnabled: boolean;@@@ -45,8 -45,8 +49,9 @@@export function useScreenRecorder(): UseScreenRecorderReturn {const [recording, setRecording] = useState(false);+ const [paused, setPaused] = useState(false);const [starting, setStarting] = useState(false);+ const [countdownActive, setCountdownActive] = useState(false);const [isMacOS, setIsMacOS] = useState(false);const [microphoneEnabled, setMicrophoneEnabled] = useState(false);const [microphoneDeviceId, setMicrophoneDeviceId] = useState<string | undefined>(undefined);@@@ -553,50 -591,13 +602,55 @@@}};+ const pauseRecording = useCallback(() => {+ if (!recording || paused) return;+ // Native recordings (macOS SCK / Windows WGC) don't support pause yet+ if (nativeScreenRecording.current) return;+ if (mediaRecorder.current?.state === "recording") {+ mediaRecorder.current.pause();+ setPaused(true);+ }+ }, [recording, paused]);++ const resumeRecording = useCallback(() => {+ if (!recording || !paused) return;+ if (mediaRecorder.current?.state === "paused") {+ mediaRecorder.current.resume();+ setPaused(false);+ }+ }, [recording, paused]);++ const cancelRecording = useCallback(() => {+ if (!recording) return;+ setPaused(false);++ if (nativeScreenRecording.current) {+ nativeScreenRecording.current = false;+ wgcRecording.current = false;+ setRecording(false);+ window.electronAPI?.setRecordingState(false);+ void window.electronAPI.stopNativeScreenRecording();+ return;+ }++ if (mediaRecorder.current) {+ chunks.current = [];+ cleanupCapturedMedia();+ if (mediaRecorder.current.state !== "inactive") {+ mediaRecorder.current.stop();+ }+ setRecording(false);+ window.electronAPI?.setRecordingState(false);+ }+ }, [recording, cleanupCapturedMedia]);+- const toggleRecording = () => {- if (starting) {+ const toggleRecording = async () => {+ if (starting || countdownActive) {+ return;+ }++ if (recording) {+ stopRecording.current();return;}@@@ -605,11 -619,8 +672,12 @@@return {recording,+ paused,+ countdownActive,toggleRecording,+ pauseRecording,+ resumeRecording,+ cancelRecording,preparePermissions,isMacOS,microphoneEnabled,@@@ -618,6 -629,8 +686,7 @@@setMicrophoneDeviceId,systemAudioEnabled,setSystemAudioEnabled,+ countdownDelay,+ setCountdownDelay,};}--