From 4a9823890baaa6e285d44aeace3eace117f59cd7 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Wed, 23 Sep 2026 22:46:10 -0400 Subject: [PATCH] feat(desktop): "Start minimized" setting under Launch on login (cinny-desktop #3) Shown only while Launch on login is on, and only when the native side answers `get_start_minimized` (older desktop builds just don't show it). Toggling calls `set_start_minimized`. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- src/app/features/settings/general/General.tsx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/app/features/settings/general/General.tsx b/src/app/features/settings/general/General.tsx index 9cafa1a8c..cfdedc137 100644 --- a/src/app/features/settings/general/General.tsx +++ b/src/app/features/settings/general/General.tsx @@ -161,11 +161,19 @@ function DesktopChromeSetting() { */ function AutostartSetting() { const [enabled, setEnabled] = useState(false); + // [cinny-desktop #3] null until the native side answers (older builds don't + // have the command, so the switch just stays hidden there). + const [startMinimized, setStartMinimized] = useState(null); useEffect(() => { tauriInvoke()?.('plugin:autostart|is_enabled') .then((value) => setEnabled(value === true)) .catch(() => undefined); + tauriInvoke()?.('get_start_minimized') + .then((value) => { + if (typeof value === 'boolean') setStartMinimized(value); + }) + .catch(() => undefined); }, []); const handleChange = (value: boolean) => { @@ -173,6 +181,11 @@ function AutostartSetting() { setEnabled(value); }; + const handleStartMinimized = (value: boolean) => { + invokeTauri('set_start_minimized', { value }); + setStartMinimized(value); + }; + if (!isTauriEnv()) return null; return ( @@ -181,6 +194,15 @@ function AutostartSetting() { description="Start Lotus Chat automatically when you sign in to your computer." after={} /> + {enabled && startMinimized !== null && ( + + } + /> + )} ); }