From 28a4fd482450b5e26e3e58c12661120b550276fa Mon Sep 17 00:00:00 2001 From: Rahul Sharma Date: Sat, 21 Feb 2026 00:39:39 +0530 Subject: [PATCH] feat: add network access toggle to server settings Exposes the existing remote server mode through a checkbox in Server Connection settings. When enabled, the server binds to 0.0.0.0 instead of 127.0.0.1, making it accessible from other devices on the network. The plumbing already existed (Rust sidecar passes --host 0.0.0.0 when remote=true, serverStore has mode state, Python backend accepts --host), but the UI hardcoded startServer(false). This wires it up. Closes #104 --- app/src/App.tsx | 5 +-- .../ServerSettings/ConnectionForm.tsx | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/app/src/App.tsx b/app/src/App.tsx index fbe2911..8a21874 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -93,10 +93,11 @@ function App() { } serverStartingRef.current = true; - console.log('Production mode: Starting bundled server...'); + const isRemote = useServerStore.getState().mode === 'remote'; + console.log(`Production mode: Starting bundled server... (remote: ${isRemote})`); platform.lifecycle - .startServer(false) + .startServer(isRemote) .then((serverUrl) => { console.log('Server is ready at:', serverUrl); // Update the server URL in the store with the dynamically assigned port diff --git a/app/src/components/ServerSettings/ConnectionForm.tsx b/app/src/components/ServerSettings/ConnectionForm.tsx index 9e25a52..aa659bc 100644 --- a/app/src/components/ServerSettings/ConnectionForm.tsx +++ b/app/src/components/ServerSettings/ConnectionForm.tsx @@ -31,6 +31,8 @@ export function ConnectionForm() { const setServerUrl = useServerStore((state) => state.setServerUrl); const keepServerRunningOnClose = useServerStore((state) => state.keepServerRunningOnClose); const setKeepServerRunningOnClose = useServerStore((state) => state.setKeepServerRunningOnClose); + const mode = useServerStore((state) => state.mode); + const setMode = useServerStore((state) => state.setMode); const { toast } = useToast(); const form = useForm({ @@ -115,6 +117,38 @@ export function ConnectionForm() { + + {platform.metadata.isTauri && ( +
+
+ { + setMode(checked ? 'remote' : 'local'); + toast({ + title: 'Setting updated', + description: checked + ? 'Network access enabled. Restart the app to apply.' + : 'Network access disabled. Restart the app to apply.', + }); + }} + /> +
+ +

+ Makes the server accessible from other devices on your network. Restart the app + after changing this setting. +

+
+
+
+ )} );