Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(desktop): Network gets its own Settings tab, and this computer comes first

leepokai31a2932a16fb
diff --git a/apps/desktop/src/renderer/store/app-model.ts b/apps/desktop/src/renderer/store/app-model.ts
index aa400ee5..df20173a 100644
--- a/apps/desktop/src/renderer/store/app-model.ts
+++ b/apps/desktop/src/renderer/store/app-model.ts
@@ -179,9 +179,9 @@ export class AppModel extends Observable {
return this.selection ? this.store(this.selection.computerId) : null
}
- /** Computers this app manages over loopback (itself and SSH tunnels): they take approvals and pairing. */
+ /** Computers this app manages over loopback (itself and SSH tunnels), this one first: they take approvals and pairing. */
get managedStores() {
- return [...this.stores.values()].filter((s) => s.isLoopback)
+ return [...this.stores.values()].filter((s) => s.isLoopback).sort((a, b) => Number(b === this.local) - Number(a === this.local))
}
get approvals(): Approval[] {
diff --git a/apps/desktop/src/renderer/views/settings/ComputersView.tsx b/apps/desktop/src/renderer/views/settings/ComputersView.tsx
index 1cedf9d7..ff5be769 100644
--- a/apps/desktop/src/renderer/views/settings/ComputersView.tsx
+++ b/apps/desktop/src/renderer/views/settings/ComputersView.tsx
@@ -14,7 +14,6 @@ import { StoreContext, useApp } from '../../store/context'
import { ComputerBadge } from '../ComputerBadge'
import { PairingCode } from '../PairingCode'
import { AuthorizedDevicesSection } from './AuthorizedDevicesSection'
-import { NetworkSection } from './NetworkSection'
import { cloudStatusLine } from '../../lib/relay-copy'
import { useTr } from '../../lib/use-language'
import { errorText, liveClient, relativeDay, SectionHeader, statusText, thisMac } from './parts'
@@ -240,8 +239,6 @@ function ManagedComputerCard({ store, ssh: overSSH }: { store: BotStore; ssh: bo
]}
</CardSection>
- <NetworkSection store={store} />
-
<AuthorizedDevicesSection store={store} />
<Sheet open={showVoice} onClose={() => setShowVoice(false)}>
diff --git a/apps/desktop/src/renderer/views/settings/NetworkSection.tsx b/apps/desktop/src/renderer/views/settings/NetworkSection.tsx
index 1a90a8d1..cab02ab9 100644
--- a/apps/desktop/src/renderer/views/settings/NetworkSection.tsx
+++ b/apps/desktop/src/renderer/views/settings/NetworkSection.tsx
@@ -23,10 +23,10 @@ type Open =
/**
* A managed computer's networks of the user's computers (codync-network): one card per
* network, with who is in it and who may message the bots here, and making or joining another.
- * Hidden on hosts without `networkView`. Membership is decided here, at the computer; phones
+ * Empty on hosts without `networkView`. Membership is decided here, at the computer; phones
* only see it.
*/
-export function NetworkSection({ store }: { store: BotStore }) {
+export function NetworkSection({ store, heading }: { store: BotStore; /** The computer's name when the page lists several; else the section's own title. */ heading?: string }) {
const tr = useTr()
useModel(store)
const [open, setOpen] = useState<Open | null>(null)
@@ -39,7 +39,8 @@ export function NetworkSection({ store }: { store: BotStore }) {
if (manageable) void refreshNetwork(store)
}, [store, manageable])
- if (!view) return null
+ // A host without networks shows its page empty, with what they are for when it is the only computer.
+ if (!view) return heading ? null : <Text size="callout" tone="secondary">{tr('Connect your computers so bots on one can message bots on another.')}</Text>
const run = (work: () => Promise<unknown>) => {
setBusy(true)
@@ -59,7 +60,7 @@ export function NetworkSection({ store }: { store: BotStore }) {
return (
<VStack gap={14}>
<HStack gap={6} className="settings-section-header">
- <Text as="h3" size="body" weight="semibold" tone="text">{tr('Network')}</Text>
+ <Text as="h3" size="body" weight="semibold" tone="text">{heading ?? tr('Network')}</Text>
<Text as="span" size="caption" weight="semibold" className="beta-tag">{tr('Beta')}</Text>
</HStack>
{view.networks.map((net) => (
diff --git a/apps/desktop/src/renderer/views/settings/NetworkView.tsx b/apps/desktop/src/renderer/views/settings/NetworkView.tsx
new file mode 100644
index 00000000..a6db882d
--- /dev/null
+++ b/apps/desktop/src/renderer/views/settings/NetworkView.tsx
@@ -0,0 +1,17 @@
+import { VStack } from '../../components/Stack'
+import { useApp } from '../../store/context'
+import { NetworkSection } from './NetworkSection'
+
+/** Settings → Network: the networks of each computer this app manages, this one first (a section stays hidden on a host without them). */
+export function NetworkView() {
+ const managed = useApp().managedStores
+ return (
+ <div className="settings-computers">
+ <VStack gap={26} className="settings-computers-content">
+ {managed.map((store) => (
+ <NetworkSection key={store.computer.id} store={store} heading={managed.length > 1 ? store.hostName : undefined} />
+ ))}
+ </VStack>
+ </div>
+ )
+}
diff --git a/apps/desktop/src/renderer/views/settings/SettingsView.tsx b/apps/desktop/src/renderer/views/settings/SettingsView.tsx
index 5e6e7995..f1d06ec7 100644
--- a/apps/desktop/src/renderer/views/settings/SettingsView.tsx
+++ b/apps/desktop/src/renderer/views/settings/SettingsView.tsx
@@ -18,6 +18,7 @@ import { StoreContext, useApp } from '../../store/context'
import { ComputerBadge } from '../ComputerBadge'
import { UpdateButton, useUpdates } from '../UpdateButton'
import { ComputersView } from './ComputersView'
+import { NetworkView } from './NetworkView'
import { errorText, isMac, thisMac } from './parts'
import { UsageLimits } from './UsageLimits'
import { VoiceChatSettingsView } from './VoiceChatSettingsView'
@@ -27,12 +28,13 @@ import { AnalyticsSheet } from './AnalyticsSheet'
import { HiddenBotsSection } from './HiddenBotsSection'
/** The chat window's Settings: pages in a sidebar, ChatGPT's settings layout. */
-export type SettingsPage = 'general' | 'computers' | 'access' | 'voice' | 'usage' | 'updates'
+export type SettingsPage = 'general' | 'computers' | 'network' | 'access' | 'voice' | 'usage' | 'updates'
const thisComputer = isMac ? 'This Mac' : 'This computer'
const pages: { id: SettingsPage; title: string; label?: string; group: string; icon: string }[] = [
{ id: 'general', title: 'General', group: 'Personal', icon: 'gearshape' },
{ id: 'computers', title: 'Computers & devices', label: 'Computers', group: thisComputer, icon: 'desktopcomputer' },
+ { id: 'network', title: 'Network', group: thisComputer, icon: 'point.3.connected.trianglepath.dotted' },
{ id: 'access', title: 'Computer access', group: thisComputer, icon: 'hand.raised' },
{ id: 'voice', title: 'Voice chat', group: 'Personal', icon: 'waveform' },
{ id: 'usage', title: 'Usage', group: 'Personal', icon: 'gauge.with.dots.needle.33percent' },
@@ -40,7 +42,7 @@ const pages: { id: SettingsPage; title: string; label?: string; group: string; i
]
/** Each page as `screen_viewed` names it; Computer access and Voice chat report themselves. */
-const pageScreens: Record<SettingsPage, Screen | null> = { general: 'settings', updates: 'settings', computers: 'computers', usage: 'usage', access: null, voice: null }
+const pageScreens: Record<SettingsPage, Screen | null> = { general: 'settings', updates: 'settings', computers: 'computers', network: 'settings', usage: 'usage', access: null, voice: null }
export function SettingsView({ page: initial }: { page: SettingsPage }) {
// Kept here: the sheet's content doesn't follow the window's state once shown.
@@ -97,6 +99,8 @@ function PageContent({ page }: { page: SettingsPage }) {
return <GeneralSettings />
case 'computers':
return <ComputersView />
+ case 'network':
+ return <NetworkView />
case 'voice':
return app.local ? (
<StoreContext.Provider value={app.local}>
diff --git a/docs/features/codync-network.md b/docs/features/codync-network.md
index 0483cc0b..79821fd6 100644
--- a/docs/features/codync-network.md
+++ b/docs/features/codync-network.md
@@ -9,8 +9,8 @@ Why it is built this way, the options weighed and what comes next: [design](../d
## Set it up
-On each computer, in the desktop app (Settings → Computers, the **Network** section of each computer it manages,
-`NetworkSection.tsx`), the terminal UI (`N`, `host/src/tui/manage/network.rs`) or the CLI. These are the only
+On each computer, in the desktop app (Settings → Network, a section per computer it manages, this one first,
+`NetworkView.tsx` / `NetworkSection.tsx`), the terminal UI (`N`, `host/src/tui/manage/network.rs`) or the CLI. These are the only
clients that change membership: the `network*` API methods are loopback-only, like pairing a device.
```sh