From 9fc047f2cdb1209c9b5b9db641d42741cb37854b Mon Sep 17 00:00:00 2001 From: "arunkumar.a" Date: Sat, 23 May 2026 23:52:21 +0530 Subject: [PATCH] Improve tray layout documentation --- src/components/launch/LaunchWindow.tsx | 3 +++ src/i18n/locales/zh-TW/launch.json | 4 ++-- src/lib/userPreferences.ts | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsx index 5b3b4af7..328db39d 100644 --- a/src/components/launch/LaunchWindow.tsx +++ b/src/components/launch/LaunchWindow.tsx @@ -60,6 +60,7 @@ const ICON_CONFIG = { type IconName = keyof typeof ICON_CONFIG; +/** Renders the configured icon for a HUD control. */ function getIcon(name: IconName, className?: string) { const { icon: Icon, size } = ICON_CONFIG[name]; return ; @@ -81,6 +82,7 @@ const hudSidebarClasses = "ml-0.5 pl-1.5 border-l border-white/10 flex items-cen const hudSidebarVerticalClasses = "mt-0.5 pt-1.5 border-t border-white/10 flex flex-col items-center gap-0.5"; +/** Launches the floating recording HUD and its recorder controls. */ export function LaunchWindow() { const t = useScopedT("launch"); const availableLocales = getAvailableLocales(); @@ -371,6 +373,7 @@ export function LaunchWindow() { window.electronAPI.hudOverlayClose(); } }; + /** Switches the HUD between horizontal and vertical tray layouts. */ const toggleTrayLayout = () => { const nextLayout = trayLayout === "horizontal" ? "vertical" : "horizontal"; setTrayLayout(nextLayout); diff --git a/src/i18n/locales/zh-TW/launch.json b/src/i18n/locales/zh-TW/launch.json index 42ba52a7..d0b529eb 100644 --- a/src/i18n/locales/zh-TW/launch.json +++ b/src/i18n/locales/zh-TW/launch.json @@ -8,8 +8,8 @@ "resumeRecording": "繼續錄製", "openVideoFile": "開啟影片檔案", "openProject": "開啟專案", - "useVerticalTray": "使用直向工具列", - "useHorizontalTray": "使用橫向工具列" + "useVerticalTray": "使用直向托盤", + "useHorizontalTray": "使用橫向托盤" }, "audio": { "enableSystemAudio": "啟用系統音訊", diff --git a/src/lib/userPreferences.ts b/src/lib/userPreferences.ts index a14b6462..128eb73b 100644 --- a/src/lib/userPreferences.ts +++ b/src/lib/userPreferences.ts @@ -42,6 +42,7 @@ export const DEFAULT_PREFS: UserPreferences = { trayLayout: "horizontal", }; +/** Parses stored preferences without throwing on malformed JSON. */ function safeJsonParse(text: string | null): Record | null { if (!text) return null; try {