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(apps): phone settings on the Settings tab, each computer's settings on its card

leepokai1954ff5366dd
diff --git a/apps/Codync.xcodeproj/project.pbxproj b/apps/Codync.xcodeproj/project.pbxproj
index f675f173..1f757ad7 100644
--- a/apps/Codync.xcodeproj/project.pbxproj
+++ b/apps/Codync.xcodeproj/project.pbxproj
@@ -12,7 +12,6 @@
0631979397E0D6822747E03A /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6E13F8EA6C7B0DA4D899FEE /* RootView.swift */; };
0C920E4962F182ADF75670C5 /* CodyncBot-tablet-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 120FD9DBA315A6DD543463D8 /* CodyncBot-tablet-Ink.ttf */; };
0D6E2869DC5A1BC7D6385444 /* CodyncOrb-Dot.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0C44BCF971511A5E94D073D5 /* CodyncOrb-Dot.ttf */; };
- 104599A542936AD4BCF226F4 /* ComputerRows.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4174DE21C3617D694A560A9 /* ComputerRows.swift */; };
107232310A15C4D9A3BCF466 /* AppStore+Shortcuts.swift in Sources */ = {isa = PBXBuildFile; fileRef = C518FF3FFD22C3A114B6D1B8 /* AppStore+Shortcuts.swift */; };
16C24A622E33414C24B0C148 /* AppearanceSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0814BD0C30F01A163FBDF896 /* AppearanceSettings.swift */; };
17DD96A91B1EC2AE699F4A2F /* ViewingBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C0E04490F5C56FD070539E6 /* ViewingBadge.swift */; };
@@ -58,6 +57,7 @@
A1B7C7774E7FAF6D45D1BEF8 /* Permissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FA78A055791BBBA79DF8C8B /* Permissions.swift */; };
AA601649E43A5AF73DCF5B5E /* WebRTC in Frameworks */ = {isa = PBXBuildFile; productRef = 2D9748E611692583AFC5A152 /* WebRTC */; };
ABE57DA1C72A08A22262AAB1 /* CodyncOrb-Ghost.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8E783FFF5EC2697C16FA2E1B /* CodyncOrb-Ghost.ttf */; };
+ AC044B31C0B4A68463B9024E /* ComputersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3E35BCE6E7037B78D22F927 /* ComputersView.swift */; };
AF04355DFF3452C3ED0CA641 /* CallControlIntents.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1162D95B42A1BF2EB5EC0E9 /* CallControlIntents.swift */; };
B09F6D6EDC6C6B0B9919D6BF /* CodyncBot-blob-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C484135603CEF437C27BE67B /* CodyncBot-blob-Ink.ttf */; };
B1815C13D0D78E99415C2DC2 /* CodyncBot-cloud-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5A21538E748C62E82DF7B139 /* CodyncBot-cloud-Ink.ttf */; };
@@ -120,7 +120,7 @@
0C44BCF971511A5E94D073D5 /* CodyncOrb-Dot.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncOrb-Dot.ttf"; sourceTree = "<group>"; };
120FD9DBA315A6DD543463D8 /* CodyncBot-tablet-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-tablet-Ink.ttf"; sourceTree = "<group>"; };
1318104275E5BEC47B7088AD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
- 1BDF6A8F94A945065D4348F8 /* AppIcon.icon */ = {isa = PBXFileReference; lastKnownFileType = wrapper.icon; path = AppIcon.icon; sourceTree = "<group>"; };
+ 1BDF6A8F94A945065D4348F8 /* AppIcon.icon */ = {isa = PBXFileReference; path = AppIcon.icon; sourceTree = "<group>"; };
1E47C60032C326157E0386B8 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
1FECC371F3CD98687C0B69FA /* CodyncBot-pebble-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-pebble-Tint.ttf"; sourceTree = "<group>"; };
203A43D8DF8D3832F95FA837 /* CodyncBot-teardrop-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-teardrop-Ink.ttf"; sourceTree = "<group>"; };
@@ -169,7 +169,6 @@
CFEBE2E6A9D0AF0A0D89FFE7 /* UsageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UsageView.swift; sourceTree = "<group>"; };
D0DE72EEAEC947C1D3CA237F /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
D0E552136D473567E0C25ED4 /* CodyncBot-blob-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-blob-Tint.ttf"; sourceTree = "<group>"; };
- D4174DE21C3617D694A560A9 /* ComputerRows.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComputerRows.swift; sourceTree = "<group>"; };
D4D13418ABB5FD7CFC087677 /* AXTree.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AXTree.swift; sourceTree = "<group>"; };
D57A7C09154869DD84BACE19 /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = "<group>"; };
D5F23C3F9FCE63B4AFB4771A /* CodyncBot-squircle-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-squircle-Tint.ttf"; sourceTree = "<group>"; };
@@ -177,6 +176,7 @@
DC3927FC6343A00B3970BC08 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
DD3DE9A4EEB369C4F75C9448 /* ActivityGalleryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityGalleryView.swift; sourceTree = "<group>"; };
E3BF4D3B82FE8274F610C703 /* Push.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Push.swift; sourceTree = "<group>"; };
+ E3E35BCE6E7037B78D22F927 /* ComputersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComputersView.swift; sourceTree = "<group>"; };
ECD0B4EA4BBA2BB2826C4362 /* PairingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PairingView.swift; sourceTree = "<group>"; };
F1162D95B42A1BF2EB5EC0E9 /* CallControlIntents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallControlIntents.swift; sourceTree = "<group>"; };
F21AEC12DC761C28A997BEF3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
@@ -305,8 +305,8 @@
DD3DE9A4EEB369C4F75C9448 /* ActivityGalleryView.swift */,
0814BD0C30F01A163FBDF896 /* AppearanceSettings.swift */,
0582B6169BFC36E4BCD51C0D /* BotListView.swift */,
- D4174DE21C3617D694A560A9 /* ComputerRows.swift */,
6BC00039A6C2C0D3F39A5F67 /* ComputerStatus.swift */,
+ E3E35BCE6E7037B78D22F927 /* ComputersView.swift */,
73D324231A9BCE79C84C0403 /* LanguageSettings.swift */,
6FC76D28AB02DF1427D530ED /* LaunchSplash.swift */,
ECD0B4EA4BBA2BB2826C4362 /* PairingView.swift */,
@@ -536,6 +536,7 @@
};
};
buildConfigurationList = F977CF173B7D60769B393751 /* Build configuration list for PBXProject "Codync" */;
+ compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@@ -550,14 +551,13 @@
1971A679A8497DA8D0C8B77A /* XCLocalSwiftPackageReference "ios/Kit" */,
);
preferredProjectObjectVersion = 77;
- productRefGroup = 3EC1FDCCFFFB4BA1A23FDDB0 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
+ C42E5E078332C6C2B35AF5FA /* NotificationService */,
907F1F4A709111FC7178EAE9 /* Screen */,
- 913BDA9F79CE8C35A9E35830 /* iOS */,
A27E4E88D6A5B9850734B594 /* Widgets */,
- C42E5E078332C6C2B35AF5FA /* NotificationService */,
+ 913BDA9F79CE8C35A9E35830 /* iOS */,
);
};
/* End PBXProject section */
@@ -693,8 +693,8 @@
E0D116BF893B81AEC0D2135A /* BotShortcuts.swift in Sources */,
AF04355DFF3452C3ED0CA641 /* CallControlIntents.swift in Sources */,
7C20764DC05D499075BC5E8C /* CodyncApp.swift in Sources */,
- 104599A542936AD4BCF226F4 /* ComputerRows.swift in Sources */,
2002C16E427B4E4E7279E1C4 /* ComputerStatus.swift in Sources */,
+ AC044B31C0B4A68463B9024E /* ComputersView.swift in Sources */,
5A56EF5D36D12ACCEA100642 /* LanguageSettings.swift in Sources */,
35CFB641A4F10C0EBD21CB14 /* LaunchSplash.swift in Sources */,
E695251CFD06AC6F4E3396B7 /* OpenBotIntent.swift in Sources */,
diff --git a/apps/android/README.md b/apps/android/README.md
index 51d6844d..ef099fe8 100644
--- a/apps/android/README.md
+++ b/apps/android/README.md
@@ -72,7 +72,7 @@ and one-time codes remain in memory. Account login discovers computers; each
host must still approve access.
This increment supports **one paired computer per account context**. Remove the
-current pairing in Computers & settings before pairing another. Multiple-computer
+current pairing in Computer management before pairing another. Multiple-computer
support is tracked in the checklist. Accounts have separate device keys, mirrors,
files, image caches and composer drafts.
diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt
index 1c91a933..40c9329f 100644
--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt
+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/AccountScreenTest.kt
@@ -7,6 +7,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.graphics.asAndroidBitmap
import androidx.compose.ui.test.*
import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.test.platform.app.InstrumentationRegistry
import com.codync.android.core.*
@@ -22,7 +23,7 @@ import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.withContext
-/** The account sheet and Computers & settings. Read-only: no test confirms a sign-out, route, removal or reset. */
+/** The account sheet, Computer management and the Settings tab. Read-only: no test confirms a sign-out, route, removal or reset. */
class AccountScreenTest {
@get:Rule val compose = createComposeRule()
private val first = SavedAccount("first", "first-session", "[email protected]", null)
@@ -46,7 +47,6 @@ class AccountScreenTest {
val signOut = compose.onNodeWithText("Sign out").assertIsDisplayed().fetchSemanticsNode().boundsInRoot
assertTrue(scan.bottom < identity.top)
assertTrue(identity.bottom < signOut.top)
- compose.onNodeWithText("Computers & settings").assertDoesNotExist()
compose.onNodeWithContentDescription(first.email).assertIsSelected().assertIsNotEnabled()
compose.onNodeWithContentDescription(second.email).assertIsNotSelected().assertIsEnabled()
compose.onNodeWithContentDescription("Add account").assertIsDisplayed()
@@ -94,7 +94,6 @@ class AccountScreenTest {
compose.onNodeWithText("QR pairing only in this build").assertIsDisplayed()
compose.onNodeWithText("Continue with Apple").assertDoesNotExist()
compose.onNodeWithText("Scan a computer's code").assertIsDisplayed()
- compose.onNodeWithText("Computers & settings").assertDoesNotExist()
snapshot("pairing-only")
}
@@ -108,20 +107,23 @@ class AccountScreenTest {
compose.onNodeWithText(first.email).assertIsDisplayed()
}
- @Test fun computerSettingsKeepRoutesNotificationsAndResetBehindConfirmations() {
+ @Test fun computerManagementHoldsTheComputersSettingsAndKeepsRemovalBehindAConfirmation() {
val state = fixture().copy(computers = listOf(computer), connection = LinkState.Ready(HostRoute.Direct),
bots = listOf(Bot("hidden", "Hidden scout", hidden = true)))
- var paired = 0; var popped = 0; var extensions = 0
- compose.setContent { Hosted { SettingsView(state, viewModel(), { popped++ }, { paired++ }, {}, { extensions++ }) } }
+ var paired = 0; var extensions = 0
+ compose.setContent { Hosted { ComputersView(state, viewModel(), { paired++ }, {}, { extensions++ }) } }
compose.onNodeWithText("Computer management").assertIsDisplayed()
compose.onNode(hasText(computer.name) and hasClickAction()).assertIsDisplayed()
compose.onNodeWithText("1 bot · Wi-Fi/Tailscale").assertIsDisplayed()
snapshot("computer-card")
compose.onNodeWithText("Extensions").performClick()
assertEquals(1, extensions)
- compose.onNodeWithText("Pair a computer").performClick()
+ compose.onNodeWithText("Voice chat").assertIsDisplayed()
+ if (BuildConfig.PUSH_CONFIGURED) compose.onNode(hasText("Push notifications") and isToggleable()).assertIsDisplayed()
+ compose.onNodeWithText("Hidden scout").performScrollTo().assertIsDisplayed()
+ compose.onNodeWithContentDescription("Unhide").assertIsDisplayed()
+ compose.onNodeWithText("Pair a computer").performScrollTo().performClick()
assertEquals(1, paired)
- compose.onNodeWithText("Hidden scout").assertDoesNotExist()
compose.onNodeWithText("Start over").assertDoesNotExist()
compose.onNodeWithText("App version").assertDoesNotExist()
snapshot("computers")
@@ -129,18 +131,19 @@ class AccountScreenTest {
compose.onNodeWithText("Remove").performClick()
compose.onNodeWithText("Remove ${computer.name}?").assertIsDisplayed()
compose.onNodeWithText("Cancel").performClick()
- compose.onNodeWithText("Auto: Wi-Fi or Tailscale, then Cloudflare").assertIsDisplayed()
+ compose.onNodeWithText("Auto").assertIsDisplayed()
compose.onNodeWithContentDescription("Connection").performClick()
compose.onNodeWithText("Wi-Fi or Tailscale only, never Cloudflare").assertIsDisplayed()
compose.onNode(hasText("Auto: Wi-Fi or Tailscale, then Cloudflare") and isSelected()).assertIsDisplayed()
- compose.setContent { Hosted { SettingsView(state, viewModel(), null, {}, {}, {}, embedded = true) } }
+ }
+
+ @Test fun theSettingsTabHoldsOnlyThisPhonesSettingsAndKeepsResetBehindAConfirmation() {
+ val state = fixture().copy(computers = listOf(computer), connection = LinkState.Ready(HostRoute.Direct),
+ bots = listOf(Bot("hidden", "Hidden scout", hidden = true)))
+ compose.setContent { Hosted { SettingsView(state, viewModel(), 0.dp) } }
compose.onNodeWithText("Settings").assertIsDisplayed()
- compose.onNodeWithText("Pair a computer").assertDoesNotExist()
- compose.onNodeWithText(computer.name).assertDoesNotExist()
- compose.onNodeWithText("Hidden scout").performScrollTo().assertIsDisplayed()
- compose.onNodeWithContentDescription("Unhide").assertIsDisplayed()
- if (BuildConfig.PUSH_CONFIGURED) compose.onNode(hasText("Push notifications") and isToggleable()).performScrollTo().assertIsDisplayed()
- else compose.onNodeWithText("Push isn't set up in this build. Bots and chats still update while Codync is open.").performScrollTo().assertIsDisplayed()
+ listOf("Pair a computer", "Hidden scout", "Push notifications", "Voice chat").forEach { compose.onNodeWithText(it).assertDoesNotExist() }
+ if (!BuildConfig.PUSH_CONFIGURED) compose.onNodeWithText("Push isn't set up in this build. Bots and chats still update while Codync is open.").performScrollTo().assertIsDisplayed()
compose.onNodeWithText("App version").performScrollTo().assertIsDisplayed()
compose.onNodeWithText("Start over").performScrollTo().performClick()
compose.onNodeWithText("Start over?").assertIsDisplayed()
@@ -152,7 +155,7 @@ class AccountScreenTest {
val cloud = CloudComputer("account-computer", "Account computer", "account-key", online = true)
val asked = mutableListOf<CloudComputer>()
val state = mutableStateOf(fixture().copy(cloudComputers = listOf(cloud)))
- compose.setContent { Hosted { SettingsView(state.value, viewModel(), null, {}, { asked.add(it) }, {}) } }
+ compose.setContent { Hosted { ComputersView(state.value, viewModel(), {}, { asked.add(it) }, {}) } }
compose.onNodeWithText("Online · In your account").assertIsDisplayed()
compose.onNodeWithText("Ask for access").performClick()
assertEquals(listOf(cloud), asked)
@@ -166,7 +169,7 @@ class AccountScreenTest {
val asked = CloudComputer("asked-computer", "Asked computer", "asked-key", online = true)
val other = CloudComputer("other-computer", "Other computer", "other-key", online = true)
val state = fixture().copy(cloudComputers = listOf(asked, other), askingAccess = asked.computerId)
- compose.setContent { Hosted { SettingsView(state, viewModel(), null, {}, {}, {}) } }
+ compose.setContent { Hosted { ComputersView(state, viewModel(), {}, {}, {}) } }
val buttons = compose.onAllNodesWithText("Ask for access")
buttons[0].assertIsEnabled()
buttons[1].assertIsNotEnabled()
@@ -186,11 +189,11 @@ class AccountScreenTest {
val state = fixture().copy(computers = listOf(computer), cloudComputers = listOf(cloud),
connection = LinkState.Failed("This phone cannot reach the computer.", 403))
var asked: CloudComputer? = null
- compose.setContent { Hosted { SettingsView(state, viewModel(), null, {}, { asked = it }, {}) } }
+ compose.setContent { Hosted { ComputersView(state, viewModel(), {}, { asked = it }, {}) } }
compose.onNodeWithText("This phone cannot reach the computer.").assertIsDisplayed()
compose.onNodeWithText("Ask for access").performClick()
assertEquals(cloud, asked)
- compose.onNodeWithContentDescription("Remove").assertDoesNotExist()
+ compose.onNodeWithText("Remove").assertDoesNotExist()
compose.onNodeWithText(computer.name).performTouchInput { longClick() }
compose.onNodeWithText("Remove").assertDoesNotExist()
compose.onNodeWithText("Revoke this phone's access").assertIsDisplayed()
@@ -202,7 +205,7 @@ class AccountScreenTest {
val state = fixture().copy(computers = listOf(computer), cloudComputers = listOf(old, replacement),
connection = LinkState.Failed("Access revoked.", 403))
var asked: CloudComputer? = null
- compose.setContent { Hosted { SettingsView(state, viewModel(), null, {}, { asked = it }, {}) } }
+ compose.setContent { Hosted { ComputersView(state, viewModel(), {}, { asked = it }, {}) } }
compose.onAllNodesWithText("Ask for access")[1].assertIsEnabled().performClick()
assertEquals(replacement, asked)
compose.onNodeWithText("Remove this phone's computer to use this one", substring = true).assertDoesNotExist()
diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/ConnectionUiTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/ConnectionUiTest.kt
index cb332c10..a2f47646 100644
--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/ConnectionUiTest.kt
+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/ConnectionUiTest.kt
@@ -17,14 +17,14 @@ class ConnectionUiTest {
@Test fun theComputerRowNamesTheActualConnectionState() {
val state = mutableStateOf(fixture(LinkState.Failed("Your access was revoked.", 403)))
- compose.setContent { Hosted { SettingsView(state.value, viewModel(), null, {}, {}, {}) } }
+ compose.setContent { Hosted { ComputersView(state.value, viewModel(), {}, {}, {}) } }
compose.onNodeWithText("Your access was revoked.").assertIsDisplayed()
- compose.onNodeWithContentDescription("Extensions").assertDoesNotExist()
+ compose.onNodeWithText("Extensions").assertDoesNotExist()
compose.runOnUiThread { state.value = fixture(LinkState.ComputerOffline(null)) }
compose.onNodeWithText("Offline").assertIsDisplayed()
compose.runOnUiThread { state.value = fixture(LinkState.Ready(HostRoute.Direct)).copy(bots = listOf(Bot("bot", "Saved bot"))) }
compose.onNodeWithText("1 bot · Wi-Fi/Tailscale").assertIsDisplayed()
- compose.onNodeWithContentDescription("Extensions").assertIsDisplayed()
+ compose.onNodeWithText("Extensions").assertIsDisplayed()
}
@Test fun cachedBotsStayListedWhileOfflineAndAnEmptyRosterOffersTheFirstBot() {
diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/LiveManagementTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/LiveManagementTest.kt
index a4c69cff..a678722d 100644
--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/LiveManagementTest.kt
+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/LiveManagementTest.kt
@@ -1,5 +1,6 @@
package com.codync.android
+import android.view.KeyEvent
import androidx.compose.ui.test.*
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.lifecycle.ViewModelProvider
@@ -66,11 +67,12 @@ class LiveManagementTest {
compose.rosterActions("Edited group")
compose.onNodeWithText("Hide from list").performScrollTo().performClick()
compose.waitUntil(30_000) { store.state.value.bots.single { it.id == group.id }.hidden }
- // Hidden bots come back from More.
- compose.onNodeWithText("Settings").performClick()
+ // Hidden bots come back from Computer management.
+ compose.computerAction("Manage computers")
compose.onRowButton("Unhide", "Edited group").performClick()
compose.waitUntil(30_000) { !store.state.value.bots.single { it.id == group.id }.hidden }
- compose.onNodeWithText("Bots").performClick()
+ InstrumentationRegistry.getInstrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_BACK)
+ compose.waitUntil(10_000) { compose.onAllNodesWithText("Computer management").fetchSemanticsNodes().isEmpty() }
compose.rosterActions("Edited group")
compose.onNodeWithText("Edit group").performClick()
compose.onNodeWithText("Delete group chat").performScrollTo().performClick()
diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/NavigationControls.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/NavigationControls.kt
index a43ebd85..bb493254 100644
--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/NavigationControls.kt
+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/NavigationControls.kt
@@ -26,7 +26,7 @@ internal fun ComposeTestRule.onRowButton(label: String, text: String): Semantics
return buttons[index]
}
-/** Extensions opens from the paired computer's row in Manage computers. */
+/** Extensions opens from the paired computer's row in Computer management. */
internal fun ComposeTestRule.openExtensions() {
computerAction("Manage computers")
waitUntil(10_000) { onAllNodesWithText("Extensions").fetchSemanticsNodes().size == 1 }
diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.kt
index 457868bf..e90473dc 100644
--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.kt
+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.kt
@@ -32,11 +32,10 @@ class ScreenPresentationTest {
@Before fun isolatedEmulatorOnly() { assumeTrue(Build.PRODUCT.startsWith("sdk")) }
- @Test fun moreOpensComputersAndBackReturnsOneLayerAtATime() {
+ @Test fun settingsIsATabAndBackClosesComputerManagementOneLayerAtATime() {
compose.setContent { Hosted { CodyncApp(fixture(), viewModel()) } }
compose.onNodeWithContentDescription("Switch account").performClick()
compose.onNodeWithText("Account").assertIsDisplayed()
- compose.onNodeWithText("Computers & settings").assertDoesNotExist()
snapshot("account-sheet")
back()
compose.onNodeWithText("Account").assertDoesNotExist()
@@ -52,23 +51,24 @@ class ScreenPresentationTest {
back()
compose.onNodeWithText("Install Codync", substring = true).assertDoesNotExist()
compose.onNodeWithText("Pair a computer").assertIsDisplayed()
- compose.onNodeWithText(bot.name).assertDoesNotExist()
+ back()
+ compose.onNodeWithText("Computer management").assertDoesNotExist()
+ compose.onNodeWithText(bot.name).assertIsDisplayed()
}
@Test fun closingTheEditorDropsItsDraftAndANewGenerationRetiresIt() {
val state = mutableStateOf(fixture())
compose.setContent { Hosted { CodyncApp(state.value, viewModel()) } }
compose.rosterAction(bot.name, "Edit profile")
- compose.onNodeWithText("Settings").assertIsDisplayed()
compose.onNodeWithContentDescription("Save").assertIsNotEnabled()
compose.onNode(hasSetTextAction() and hasText(bot.name)).performTextReplacement("Discard this draft")
snapshot("bot-settings-sheet")
compose.onNodeWithContentDescription("Close").performClick()
- compose.onNodeWithText("Settings").assertDoesNotExist()
+ compose.onNodeWithContentDescription("Save").assertDoesNotExist()
compose.rosterAction(bot.name, "Edit profile")
compose.onNode(hasSetTextAction() and hasText(bot.name)).assertIsDisplayed()
compose.runOnUiThread { state.value = state.value.copy(generation = state.value.generation + 1) }
- compose.onNodeWithText("Settings").assertDoesNotExist()
+ compose.onNodeWithContentDescription("Save").assertDoesNotExist()
}
@Test fun onlyABotsTouchAndHoldMenuStartsANewSession() {
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AnalyticsEvent.kt b/apps/android/app/src/main/kotlin/com/codync/android/AnalyticsEvent.kt
index b31b843c..dae29f86 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AnalyticsEvent.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AnalyticsEvent.kt
@@ -163,7 +163,7 @@ internal enum class VoiceEngineKind(override val wire: String) : CatalogValue {
/** `screen_viewed` values (the catalog's *Screens* table, iOS/Android column). */
internal enum class AnalyticsScreen(override val wire: String) : CatalogValue {
- Bots("bots"), State("state"), More("more"), Chat("chat"), Trace("trace"), BotDetails("bot_details"), Memory("memory"),
+ Bots("bots"), State("state"), Chat("chat"), Trace("trace"), BotDetails("bot_details"), Memory("memory"),
Routines("routines"), Marketplace("marketplace"), Settings("settings"), Computers("computers"), Usage("usage"),
Account("account"), Pairing("pairing"), VoiceSettings("voice_settings"), RemoteScreen("remote_screen"),
Library("library"), Artifact("artifact"),
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt
index 3951a346..06d544c9 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreAccount.kt
@@ -10,7 +10,7 @@ import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlinx.serialization.json.*
-// Accounts, account computers and starting over: what the account sheet and Computers & settings ask for.
+// Accounts, account computers and starting over: what the account sheet, Computer management and Settings ask for.
internal fun AppStore.signIn(provider: SignInProvider) = sessionAction {
Analytics.capture(AnalyticsEvent.SignInStarted(provider))
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreNotifications.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreNotifications.kt
index 6e29dd83..c6163e5d 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreNotifications.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreNotifications.kt
@@ -90,7 +90,7 @@ fun AppStore.openLink(uri: Uri) {
}
}
-/** `codync://computers` and `codync://plugins`: Computers & settings, or the paired computer's extensions, over the roster. */
+/** `codync://computers` and `codync://plugins`: Computer management, or the paired computer's extensions, over the roster. */
fun AppStore.openPage(page: LinkPage) {
linkJob?.cancel()
linkJob = viewModelScope.launch {
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt b/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt
index 0d30bffa..e6ad6671 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt
@@ -91,7 +91,6 @@ private enum class Root { Loading, Welcome, Pairing, Tabs }
}
}
Root.Tabs -> MainTabs(state, store, account = { showAccount = true }, manage = { showComputers = true }, usage = { showUsage = true },
- pair = { showPairing = true }, ask = { access = it }, extensions = openMarketplace,
newBot = { creatingBot = true }, newGroup = { creatingGroup = true },
edit = edit) {
ChatScreen(state, store, edit)
@@ -105,7 +104,7 @@ private enum class Root { Loading, Welcome, Pairing, Tabs }
}
CodyncSheet(showComputers && !state.loading, { showComputers = false }) {
AnalyticsOnAppear(AnalyticsEvent.ScreenViewed(AnalyticsScreen.Computers))
- SettingsView(state, store, null, { showPairing = true }, { access = it }, openMarketplace)
+ ComputersView(state, store, { showPairing = true }, { access = it }, openMarketplace)
}
CodyncSheet(access, { access = null }) { AccessRequestView(state, store, it) }
CodyncSheet(showPairing && !state.loading, { showPairing = false }) {
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt b/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
new file mode 100644
index 00000000..0be8dcac
--- /dev/null
+++ b/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
@@ -0,0 +1,278 @@
+package com.codync.android
+
+import androidx.activity.compose.BackHandler
+import androidx.compose.animation.AnimatedVisibility
+import androidx.compose.animation.core.MutableTransitionState
+import androidx.compose.animation.fadeIn
+import androidx.compose.animation.fadeOut
+import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.interaction.MutableInteractionSource
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.width
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.semantics.Role
+import androidx.compose.ui.semantics.contentDescription
+import androidx.compose.ui.semantics.paneTitle
+import androidx.compose.ui.semantics.selected
+import androidx.compose.ui.semantics.semantics
+import androidx.compose.ui.text.style.TextOverflow
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import com.codync.android.core.Bot
+import com.codync.android.core.CloudComputer
+import com.codync.android.core.Computer
+import com.codync.android.core.ConnectionRoute
+import com.codync.android.core.LinkState
+import com.codync.android.design.*
+import com.kyant.shapes.Capsule
+import com.kyant.shapes.RoundedRectangle
+import kotlinx.serialization.json.buildJsonObject
+import kotlinx.serialization.json.put
+
+/** Computer management: every computer this phone can use or ask for, and the way to pair another (iOS `ComputersView`). */
+@Composable internal fun ComputersView(state: AppState, store: AppStore, pair: () -> Unit, ask: (CloudComputer) -> Unit, extensions: () -> Unit) {
+ val signedIn = state.account.userId != null
+ val paired = state.computers.firstOrNull()
+ var confirmForget by remember { mutableStateOf(false) }
+ var confirmRevoke by remember { mutableStateOf<CloudComputer?>(null) }
+ var coloring by remember { mutableStateOf(false) }
+ var voice by remember { mutableStateOf(false) }
+ LaunchedEffect(state.contextId) { store.refreshCloud() }
+ Column(Modifier.fillMaxSize().background(Palette.background)) {
+ PageHeader("Computer management", icon = "gearshape")
+ // One card per computer, so each one's rows read as its own.
+ PullToRefresh(store::refreshComputers, Modifier.weight(1f)) { CardForm {
+ if (paired != null) {
+ val inAccount = state.cloudComputers.firstOrNull { it.computerId == paired.id }
+ CardSection {
+ computerRows(state, store, inAccount != null, ComputerActions(extensions, store::openScreen, voice = { voice = true },
+ color = { coloring = true }, ask = inAccount?.let { c -> { ask(c) } },
+ revoke = inAccount?.takeIf { it.isGranted }?.let { c -> { confirmRevoke = c } }) { confirmForget = true })
+ }
+ }
+ for (computer in state.cloudComputers.filter { it.computerId != paired?.id }) CardSection {
+ row {
+ if (state.isOlderCopy(computer)) OlderCopyRow(computer)
+ else AccountComputerRow(computer, state.access?.takeIf { it.computerId == computer.computerId }?.code,
+ askingAnother = state.askingAccess.let { it != null && it != computer.computerId },
+ ask = { ask(computer) }, revoke = { confirmRevoke = computer })
+ }
+ }
+ val hidden = state.bots.filter { it.hidden && !it.deleted }
+ if (hidden.isNotEmpty()) CardSection("Hidden bots") {
+ for (bot in hidden) row { HiddenBotRow(state, store, bot) }
+ }
+ CardSection(footer = if (signedIn) "Computers in your account need your OK on the computer before this phone can use them."
+ else "Each bot runs on its own computer. Sign in to see the computers in your account.") {
+ row {
+ Row(Modifier.fillMaxWidth().plainButton(action = pair), verticalAlignment = Alignment.CenterVertically,
+ horizontalArrangement = Arrangement.spacedBy(10.dp)) {
+ Symbol("qrcode.viewfinder", size = 20.dp, tint = Palette.text)
+ Text(tr("Pair a computer"), style = Type.body, color = Palette.text)
+ }
+ }
+ }
+ } }
+ }
+ CodyncSheet(voice, { voice = false }) { VoiceChatSettings(state, store) }
+ SwatchPanel(coloring, paired?.color, { coloring = false }, store::setColor)
+ CodyncDialog(tr("Remove {name}?").replace("{name}", paired?.name ?: "computer"), confirmForget, { confirmForget = false },
+ "Its bots and conversations stay on that computer. You can pair again any time.") {
+ listOf(DialogAction("Remove", destructive = true, action = store::removeComputer))
+ }
+ CodyncDialog("Revoke this phone's access to ${confirmRevoke?.name ?: "the computer"}?", confirmRevoke != null, { confirmRevoke = null },
+ "You can ask for access again; the computer will show a new code to confirm.") {
+ listOfNotNull(confirmRevoke?.let { target -> DialogAction("Revoke", destructive = true) { store.revokeAccess(target.computerId) } })
+ }
+}
+
+/** What the paired computer's row and its menu open; `revoke` is set when this phone's account access can be revoked. */
+private class ComputerActions(val extensions: () -> Unit, val screen: () -> Unit, val voice: () -> Unit, val color: () -> Unit,
+ val ask: (() -> Unit)?, val revoke: (() -> Unit)?, val remove: () -> Unit)
+
+/**
+ * The paired computer as the rows of its card: its connection and whether it's in the account, then
+ * Extensions, Voice chat (its keys live on the computer), Screen, whether it sends push alerts here
+ * (the only computer this phone pairs, so the switch is the phone's), how it's reached and, for a stale
+ * pairing, Remove (iOS `ComputerRows`).
+ */
+private fun CardRows.computerRows(state: AppState, store: AppStore, inAccount: Boolean, actions: ComputerActions) {
+ row { ComputerSummary(state, inAccount, actions) }
+ if (state.connection is LinkState.Ready) {
+ row { RowLabel("Extensions", "square.grid.2x2", chevron = true, modifier = Modifier.plainButton(action = actions.extensions)) }
+ row { RowLabel("Voice chat", "waveform", chevron = true, modifier = Modifier.plainButton(action = actions.voice)) }
+ if (state.screen != null) row { RowLabel("Screen", "display", chevron = true, modifier = Modifier.plainButton(action = actions.screen)) }
+ }
+ if (BuildConfig.PUSH_CONFIGURED) row {
+ CodyncSwitch(state.notifications, store::notifications, Modifier.fillMaxWidth()) {
+ Row(Modifier.weight(1f), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
+ Box(Modifier.width(26.dp), contentAlignment = Alignment.Center) { Symbol("bell", size = 20.dp, tint = Palette.text) }
+ Text(tr("Push notifications"), style = Type.body, color = Palette.text)
+ }
+ }
+ }
+ row { ConnectionRow(state.computers.first(), store) }
+ if (state.isStale && !inAccount) row { RowLabel("Remove", "trash", Palette.danger, modifier = Modifier.plainButton(action = actions.remove)) }
+}
+
+/** Name, connection, and an access request when this phone can't reach the computer; a long press opens its menu. */
+@Composable private fun ComputerSummary(state: AppState, inAccount: Boolean, actions: ComputerActions) {
+ val computer = state.computers.first()
+ val link = state.connection
+ val online = link is LinkState.Ready
+ val detail = if (link is LinkState.Ready) {
+ val count = state.bots.count { !it.deleted && it.kind != "group" }
+ "$count bot${if (count == 1) "" else "s"} · ${routeLabel(link.route, computer.cloud)}"
+ } else computerStatusText(state)
+ Column(Modifier.fillMaxWidth().contextActions(items = {
+ listOfNotNull(
+ MenuItem("Color", icon = "paintpalette", action = actions.color),
+ if (online) MenuItem("Extensions", icon = "square.grid.2x2", action = actions.extensions) else null,
+ if (online) MenuItem("Voice chat", icon = "waveform", action = actions.voice) else null,
+ if (online && state.screen != null) MenuItem("Screen", icon = "display", action = actions.screen) else null,
+ actions.revoke?.let { MenuItem("Revoke this phone's access", icon = "lock.slash", destructive = true, divider = true, action = it) },
+ if (!inAccount) MenuItem("Remove", icon = "trash", destructive = true, divider = actions.revoke == null, action = actions.remove) else null,
+ )
+ }), verticalArrangement = Arrangement.spacedBy(6.dp)) {
+ Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
+ ComputerBadge(state.hello?.text("device"), 32.dp, computer.color)
+ Text(state.hello?.text("name") ?: computer.name, Modifier.weight(1f), style = Type.body.semibold, color = Palette.text)
+ if (inAccount) Symbol("person.crop.circle.badge.checkmark", size = 20.dp, tint = Palette.tertiary, contentDescription = "In your account")
+ }
+ val unreachable = link is LinkState.ComputerOffline || link is LinkState.Failed
+ Text(detail, style = Type.footnote, color = if (unreachable) Palette.warning else Palette.secondary)
+ if (unreachable && actions.ask != null) {
+ SecondaryButton(if (state.access?.computerId == computer.id) "Show code" else "Ask for access", action = actions.ask)
+ }
+ }
+}
+
+/** How this phone reaches the computer: the short name on the row, the whole route in the menu. */
+@Composable private fun ConnectionRow(computer: Computer, store: AppStore) {
+ DropdownMenu({ ConnectionRoute.entries.map { route -> MenuItem(routeTitle(route, computer.cloud), icon = route.icon, selected = route == computer.route) { store.setRoute(route) } } },
+ Modifier.fillMaxWidth(), label = "Connection") {
+ Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
+ Box(Modifier.width(26.dp), contentAlignment = Alignment.Center) { Symbol(computer.route.icon, size = 20.dp, tint = Palette.text) }
+ Text(tr("Connection"), Modifier.weight(1f), style = Type.body, color = Palette.text)
+ Text(tr(routeShortTitle(computer.route, computer.cloud)), style = Type.body, color = Palette.secondary, maxLines = 1)
+ Symbol("chevron.down", size = 13.dp, tint = Palette.tertiary)
+ }
+ }
+}
+
+/** A computer in the account that this phone can't use yet; `askingAnother` while this phone asks a different one. */
+@Composable private fun AccountComputerRow(computer: CloudComputer, code: String?, askingAnother: Boolean, ask: () -> Unit,
+ revoke: () -> Unit) {
+ val online = if (computer.online == true) "Online" else "Offline"
+ val detail = when {
+ code != null -> "Waiting for your OK on the computer · $code"
+ computer.isGranted -> "Approved for an earlier install of Codync. Revoke it, then ask again."
+ computer.access == "pending" -> "$online · A request is waiting"
+ else -> "$online · In your account"
+ }
+ Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
+ Box(Modifier.graphicsLayer { alpha = 0.5f }) { ComputerBadge(computer.device, 40.dp) }
+ Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
+ Text(computer.name, style = Type.body.semibold, color = Palette.text, maxLines = 1, overflow = TextOverflow.Ellipsis)
+ Text(detail, style = Type.subheadline, color = Palette.secondary, maxLines = 2, overflow = TextOverflow.Ellipsis)
+ }
+ when {
+ code != null -> SecondaryButton("Code", action = ask)
+ computer.isGranted -> SecondaryButton("Revoke", action = revoke)
+ else -> SecondaryButton("Ask for access", enabled = !askingAnother, action = ask)
+ }
+ }
+}
+
+/** An older account identity stays visible; only account management can remove it. */
+@Composable private fun OlderCopyRow(computer: CloudComputer) {
+ val seen = computer.lastSeenAt?.let { " · last seen ${RelativeTime.day(it)}" }.orEmpty()
+ Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
+ Box(Modifier.graphicsLayer { alpha = 0.35f }) { ComputerBadge(computer.device, 40.dp) }
+ Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
+ Text(computer.name, style = Type.body.semibold, color = Palette.secondary, maxLines = 1, overflow = TextOverflow.Ellipsis)
+ Text("Older copy of this computer$seen", style = Type.subheadline, color = Palette.tertiary, maxLines = 2, overflow = TextOverflow.Ellipsis)
+ }
+ }
+}
+
+@Composable private fun HiddenBotRow(state: AppState, store: AppStore, bot: Bot) {
+ Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
+ BotAvatar(bot, state.bots, 28.dp)
+ Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(1.dp)) {
+ Text(bot.name, style = Type.body, color = Palette.text, maxLines = 1, overflow = TextOverflow.Ellipsis)
+ Text(state.hello?.text("name") ?: state.computers.firstOrNull()?.name.orEmpty(), style = Type.caption, color = Palette.tertiary)
+ }
+ IconButton("Unhide", "eye") {
+ store.command("updateBot", buildJsonObject { put("id", bot.id); put("hidden", false) }, "roster:" + bot.id)
+ }
+ }
+}
+
+/** A computer's icon showing what it is (laptop, Mac mini, Linux…) in the color picked for it, as CodyncUI `ComputerBadge`. */
+@Composable internal fun ComputerBadge(device: String?, size: Dp, color: String? = null) {
+ val tint = color?.let(AvatarPalette::tint) ?: Palette.text
+ Box(Modifier.size(size), contentAlignment = Alignment.Center) {
+ if (device == "linux") Symbol("computer.linux", size = size * 0.55f, tint = tint)
+ else Symbol(when (device) {
+ "laptop" -> "laptopcomputer"
+ "macmini" -> "macmini"
+ "macstudio" -> "macstudio"
+ "macpro" -> "macpro.gen3"
+ else -> "desktopcomputer"
+ }, size = size * 0.6f, tint = tint)
+ }
+}
+
+/** The computer color choices over the dimmed app: a grid of colored dots, the current one checked. */
+@Composable private fun SwatchPanel(isPresented: Boolean, selected: String?, close: () -> Unit, pick: (String) -> Unit) {
+ val visible = remember { MutableTransitionState(false) }
+ visible.targetState = isPresented
+ if (!visible.currentState && !visible.targetState) return
+ BackHandler(isPresented, close)
+ Overlay {
+ AnimatedVisibility(visible, enter = fadeIn(Motion.layout()), exit = fadeOut(Motion.fade())) {
+ Box(Modifier.fillMaxSize().background(Color.Black.copy(alpha = 0.35f)).clickable(remember { MutableInteractionSource() }, null, onClick = close),
+ contentAlignment = Alignment.Center) {
+ Column(Modifier.graphicsLayer { shadowElevation = 24f; shape = RoundedRectangle(22.dp); clip = true }.background(Palette.bubbleAgent)
+ .clickable(remember { MutableInteractionSource() }, null) {}.semantics { paneTitle = "Color" }.padding(14.dp),
+ verticalArrangement = Arrangement.spacedBy(10.dp)) {
+ for (swatches in AvatarPalette.colors.entries.chunked(6)) Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
+ for ((id, hex) in swatches) Box(Modifier.size(36.dp), contentAlignment = Alignment.Center) {
+ Box(Modifier.size(32.dp).clip(Capsule()).background(Color(hex)).clickable(role = Role.RadioButton) { close(); pick(id) }
+ .semantics { contentDescription = id.replaceFirstChar(Char::uppercase); this.selected = id == selected },
+ contentAlignment = Alignment.Center) {
+ if (id == selected) Symbol("checkmark", size = 13.dp, tint = Color.White)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+private val ConnectionRoute.icon get() = when (this) {
+ ConnectionRoute.Automatic -> "arrow.triangle.branch"
+ ConnectionRoute.CloudflareFirst -> "cloud"
+ ConnectionRoute.DirectOnly -> "wifi"
+}
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt b/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt
index 90ec82cc..6bdcad84 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/ConnectionPresentation.kt
@@ -7,7 +7,7 @@ import com.codync.android.core.HostRoute
import com.codync.android.core.LinkState
import com.codync.android.core.Pairing
-// What the roster header, Computers & settings and the chat header say about the computer's link
+// What the roster header, Computer management and the chat header say about the computer's link
// (iOS `ComputerStatus`, `ConnectionSummary`, `BotStore.connectionLabel`).
/** Turned away by the computer: access revoked, or its identity changed. */
@@ -21,7 +21,7 @@ internal fun statusText(state: AppState): String = if (state.computers.isEmpty()
is LinkState.Failed -> if (link.unauthorized) link.message else "Can't reach"
}
-/** The status line in Computers & settings: one that's offline while its new identity is around says so. */
+/** The status line in Computer management: one that's offline while its new identity is around says so. */
internal fun computerStatusText(state: AppState): String =
if (state.isStale && !state.connection.unauthorized) "Older copy of this computer · ${statusText(state)}" else statusText(state)
@@ -56,7 +56,7 @@ internal fun relayHost(cloud: String?): String? {
return if (uri.port > 0) "$name:${uri.port}" else name
}
-/** The route after a bot count in Computers & settings (iOS `RelayCopy.detailSuffix`). */
+/** The route after a bot count in Computer management (iOS `RelayCopy.detailSuffix`). */
internal fun routeLabel(route: HostRoute, cloud: String?): String =
if (route == HostRoute.Direct) "Wi-Fi/Tailscale" else relayHost(cloud)?.let { "Private relay ($it)" } ?: "Cloudflare"
@@ -78,6 +78,13 @@ internal fun routeTitle(route: ConnectionRoute, cloud: String?): String {
}
}
+/** The route's short name on the Connection row; the menu keeps `routeTitle` (iOS `RelayCopy.routeShortTitle`). */
+internal fun routeShortTitle(route: ConnectionRoute, cloud: String?): String = when (route) {
+ ConnectionRoute.Automatic -> "Auto"
+ ConnectionRoute.CloudflareFirst -> if (relayHost(cloud) == null) "Cloudflare first" else "Private relay first"
+ ConnectionRoute.DirectOnly -> "Wi-Fi/Tailscale only"
+}
+
internal fun pairingLine(cloud: String?): String {
val host = relayHost(cloud)
return if (host == null) "Connects on Wi-Fi, over Tailscale, or from anywhere through Cloudflare, on its own. End-to-end encrypted."
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/LeadBotTile.kt b/apps/android/app/src/main/kotlin/com/codync/android/LeadBotTile.kt
index 63832456..03cbcfec 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/LeadBotTile.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/LeadBotTile.kt
@@ -12,7 +12,7 @@ import com.codync.android.design.symbolRes
/**
* The Bots tile in Quick Settings (the iOS Control Center control): the bot that needs you most
- * and its state, from the widgets' report; a tap opens it, or Computers & settings when no bot is at work.
+ * and its state, from the widgets' report; a tap opens it, or Computer management when no bot is at work.
* (Its class keeps its first name, the manifest's component: tiles already placed stay.)
*/
class LeadBotTile : TileService() {
@@ -38,7 +38,7 @@ class LeadBotTile : TileService() {
@SuppressLint("StartActivityAndCollapseDeprecated")
override fun onClick() {
val feed = WidgetStore.feed(this)
- // No bot at work: Computers & settings, as the iPhone's control does.
+ // No bot at work: Computer management, as the iPhone's control does.
val intent = mostUrgentBot(feed.bots)?.let { widgetIntent(this, feed, it.id) }
?: widgetIntent(this, feed).setData(Uri.parse("${BuildConfig.URL_SCHEME}://computers"))
// A bot's chat is private: the phone unlocks first.
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt b/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt
index 0b527bf9..0da232f8 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt
@@ -25,17 +25,15 @@ import androidx.compose.ui.zIndex
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.unit.dp
import com.codync.android.core.Bot
-import com.codync.android.core.CloudComputer
import com.codync.android.design.*
-private enum class AppTab { Bots, State, More }
+private enum class AppTab { Bots, State, Settings }
/**
- * The system tab bar over Bots, State and More, as iOS `RootView.tabs`: the three tabs stay in one bar,
- * the bar floats as glass over their content and hides while a conversation is open.
+ * The system tab bar over Bots, State and Settings, as iOS `RootView.tabs`: every tab stays alive, the bar
+ * floats as glass over their content and hides while a conversation is open.
*/
@Composable internal fun MainTabs(state: AppState, store: AppStore, account: () -> Unit, manage: () -> Unit, usage: () -> Unit,
- pair: () -> Unit, ask: (CloudComputer) -> Unit, extensions: () -> Unit,
newBot: () -> Unit, newGroup: () -> Unit, edit: (Bot) -> Unit, chat: @Composable () -> Unit) {
var tab by rememberSaveable { mutableStateOf(AppTab.Bots) }
// Opening a bot (notification, widget, link) always lands on the Bots tab.
@@ -43,7 +41,7 @@ private enum class AppTab { Bots, State, More }
AnalyticsOnAppear(AnalyticsEvent.ScreenViewed(when (tab) {
AppTab.Bots -> AnalyticsScreen.Bots
AppTab.State -> AnalyticsScreen.State
- AppTab.More -> AnalyticsScreen.More
+ AppTab.Settings -> AnalyticsScreen.Settings
}))
val bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()
val barSpace = bottom + 62.dp + 24.dp
@@ -61,7 +59,7 @@ private enum class AppTab { Bots, State, More }
Box(contentAlignment = Alignment.BottomCenter) {
ScrollEdge(Edge.Bottom, barSpace)
GlassTabBar(tab, listOf(TabItem(AppTab.Bots, "Bots", "bubble.left.and.bubble.right.fill", 33.dp),
- TabItem(AppTab.State, "State", "rectangle.stack.fill"), TabItem(AppTab.More, "Settings", "gearshape")),
+ TabItem(AppTab.State, "State", "rectangle.stack.fill"), TabItem(AppTab.Settings, "Settings", "gearshape")),
{ tab = it }, Modifier.padding(bottom = maxOf(bottom - 4.dp, 12.dp)))
}
}
@@ -73,9 +71,7 @@ private enum class AppTab { Bots, State, More }
}
}
Box(Modifier.fillMaxSize().tabLayer(tab == AppTab.State)) { StateScreen(state, store, usage, barSpace, active = tab == AppTab.State) }
- Box(Modifier.fillMaxSize().tabLayer(tab == AppTab.More)) {
- SettingsView(state, store, null, pair, ask, extensions, embedded = true, bottomInset = barSpace)
- }
+ Box(Modifier.fillMaxSize().tabLayer(tab == AppTab.Settings)) { SettingsView(state, store, barSpace) }
}
}
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.kt b/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.kt
index 44115081..05062003 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.kt
@@ -2,184 +2,96 @@ package com.codync.android
import android.Manifest
import android.os.Build
-import androidx.activity.compose.BackHandler
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
-import androidx.compose.animation.AnimatedVisibility
-import androidx.compose.animation.core.MutableTransitionState
-import androidx.compose.animation.fadeIn
-import androidx.compose.animation.fadeOut
import androidx.compose.foundation.background
-import androidx.compose.foundation.clickable
-import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.PaddingValues
-import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.statusBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.clip
-import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
-import androidx.compose.ui.semantics.Role
-import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.heading
-import androidx.compose.ui.semantics.paneTitle
-import androidx.compose.ui.semantics.selected
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
-import com.codync.android.core.Bot
-import com.codync.android.core.CloudComputer
-import com.codync.android.core.ConnectionRoute
-import com.codync.android.core.LinkState
import com.codync.android.design.*
-import com.kyant.shapes.Capsule
-import com.kyant.shapes.RoundedRectangle
-import kotlinx.serialization.json.buildJsonObject
-import kotlinx.serialization.json.put
/**
- * Every computer this phone can use or ask for, plus settings for the selected account
- * (iOS `SettingsView`). `pop` is set when it's pushed on top of another screen.
+ * The Settings tab: what belongs to this phone alone (appearance, language, notification permission,
+ * analytics, Start over; iOS `SettingsView`). Each computer's own settings (voice chat, push, connection,
+ * hidden bots) are in Computer management (`ComputersView`).
*/
-@Composable internal fun SettingsView(state: AppState, store: AppStore, pop: (() -> Unit)?, pair: () -> Unit, ask: (CloudComputer) -> Unit,
- extensions: () -> Unit, embedded: Boolean = false, bottomInset: Dp = 0.dp) {
+@Composable internal fun SettingsView(state: AppState, store: AppStore, bottomInset: Dp) {
val uri = LocalUriHandler.current
- val signedIn = state.account.userId != null
- val paired = state.computers.firstOrNull()
- var confirmForget by remember { mutableStateOf(false) }
- var confirmRevoke by remember { mutableStateOf<CloudComputer?>(null) }
- var coloring by remember { mutableStateOf(false) }
var confirmStartOver by remember { mutableStateOf(false) }
- var voice by remember { mutableStateOf(false) }
var aboutAnalytics by remember { mutableStateOf(false) }
- LaunchedEffect(state.contextId) { store.refreshCloud() }
- Column(Modifier.fillMaxSize().background(Palette.background).then(if (embedded) Modifier.statusBarsPadding() else Modifier)) {
- if (!embedded) PageHeader("Computer management", pop, icon = "gearshape")
- PullToRefresh(store::refreshComputers, Modifier.weight(1f)) {
- CardForm(padding = PaddingValues(start = 20.dp, top = if (embedded) 12.dp else 20.dp, end = 20.dp, bottom = if (embedded) bottomInset else 20.dp)) {
- if (embedded) {
- Text(tr("Settings"), Modifier.semantics { heading() }, style = Type.largeTitle.bold, color = Palette.text)
- }
- if (!embedded) CardSection(footer = if (signedIn) "Computers in your account need your OK on the computer before this phone can use them."
- else "Each bot runs on its own computer. Sign in to see the computers in your account.") {
- if (paired != null) row {
- val inAccount = state.cloudComputers.firstOrNull { it.computerId == paired.id }
- ComputerRow(state, store, inAccount != null, ComputerActions(extensions, store::openScreen, voice = { voice = true }, color = { coloring = true },
- ask = inAccount?.let { c -> { ask(c) } },
- revoke = inAccount?.takeIf { it.isGranted }?.let { c -> { confirmRevoke = c } }) { confirmForget = true })
- }
- for (computer in state.cloudComputers.filter { it.computerId != paired?.id }) row {
- if (state.isOlderCopy(computer)) OlderCopyRow(computer)
- else AccountComputerRow(computer, state.access?.takeIf { it.computerId == computer.computerId }?.code,
- askingAnother = state.askingAccess.let { it != null && it != computer.computerId },
- ask = { ask(computer) }, revoke = { confirmRevoke = computer })
- }
- row {
- Row(Modifier.fillMaxWidth().plainButton(action = pair), verticalAlignment = Alignment.CenterVertically,
- horizontalArrangement = Arrangement.spacedBy(10.dp)) {
- Symbol("qrcode.viewfinder", size = 20.dp, tint = Palette.text)
- Text(tr("Pair a computer"), style = Type.body, color = Palette.text)
- }
- }
- }
- if (embedded) {
- AppearanceSettings()
- if (state.actualConnection is LinkState.Ready) CardSection("Voice chat", "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.") {
- row {
- Row(Modifier.fillMaxWidth().plainButton { voice = true }, verticalAlignment = Alignment.CenterVertically,
- horizontalArrangement = Arrangement.spacedBy(10.dp)) {
- Symbol("waveform", size = 20.dp, tint = Palette.text)
- Text(tr("Voice and API keys"), Modifier.weight(1f), style = Type.body, color = Palette.text)
- Symbol("chevron.right", size = 13.dp, tint = Palette.tertiary)
- }
+ CardForm(Modifier.background(Palette.background).statusBarsPadding(), PaddingValues(start = 20.dp, top = 12.dp, end = 20.dp, bottom = bottomInset)) {
+ Text(tr("Settings"), Modifier.semantics { heading() }, style = Type.largeTitle.bold, color = Palette.text)
+ AppearanceSettings()
+ val appLanguage = LocalAppLanguage.current
+ val setAppLanguage = LocalSetAppLanguage.current
+ val systemChinese = LocalSystemChinese.current
+ val phrases = LocalPhrases.current
+ CardSection("Language", footer = "Choose the language for this device. Unsupported system languages use English.") {
+ row {
+ ValueRow("App language") {
+ ChoicePicker(appLanguage, AppLanguage.entries.map {
+ it to AppLanguage.menuTitle(it, appLanguage, systemChinese, phrases)
+ }, setAppLanguage)
}
}
- val appLanguage = LocalAppLanguage.current
- val setAppLanguage = LocalSetAppLanguage.current
- val systemChinese = LocalSystemChinese.current
- val phrases = LocalPhrases.current
- CardSection("Language", footer = "Choose the language for this device. Unsupported system languages use English.") {
- row {
- ValueRow("App language") {
- ChoicePicker(appLanguage, AppLanguage.entries.map {
- it to AppLanguage.menuTitle(it, appLanguage, systemChinese, phrases)
- }, setAppLanguage)
- }
- }
- }
- ThinkingDetailsSettings()
- NotificationsSection(state, store)
- CardSection(footer = "Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.") {
- row {
- val analyticsLabel = tr("Share usage analytics")
- Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp)) {
- Text(analyticsLabel, style = Type.body, color = Palette.text, maxLines = 1, overflow = TextOverflow.Ellipsis)
- IconButton("About usage analytics", "info.circle") { aboutAnalytics = true }
- Box(Modifier.weight(1f))
- CodyncSwitch(Analytics.enabled, Analytics::setEnabled, Modifier.width(34.dp)
- .semantics { contentDescription = analyticsLabel }) {}
- }
+ }
+ ThinkingDetailsSettings()
+ NotificationsSection()
+ CardSection(footer = "Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.") {
+ row {
+ val analyticsLabel = tr("Share usage analytics")
+ Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp)) {
+ Text(analyticsLabel, style = Type.body, color = Palette.text, maxLines = 1, overflow = TextOverflow.Ellipsis)
+ IconButton("About usage analytics", "info.circle") { aboutAnalytics = true }
+ Box(Modifier.weight(1f))
+ CodyncSwitch(Analytics.enabled, Analytics::setEnabled, Modifier.width(34.dp)
+ .semantics { contentDescription = analyticsLabel }) {}
}
}
- val hidden = state.bots.filter { it.hidden && !it.deleted }
- if (hidden.isNotEmpty()) CardSection("Hidden bots") {
- for (bot in hidden) row { HiddenBotRow(state, store, bot) }
- }
- CardSection {
- row { ValueRow("App version", BuildConfig.VERSION_NAME) }
- row { LinkButton("Source code") { uri.open("https://github.com/leepokai/Codync", OutboundLink.Github) } }
- }
- CardSection {
- row {
- Row(Modifier.fillMaxWidth().plainButton(enabled = "session" !in state.busy) { confirmStartOver = true },
- verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
- Symbol("arrow.counterclockwise", size = 20.dp, tint = Palette.danger)
- Text(tr("Start over"), style = Type.body, color = Palette.danger)
- }
+ }
+ CardSection {
+ row { ValueRow("App version", BuildConfig.VERSION_NAME) }
+ row { LinkButton("Source code") { uri.open("https://github.com/leepokai/Codync", OutboundLink.Github) } }
+ }
+ CardSection {
+ row {
+ Row(Modifier.fillMaxWidth().plainButton(enabled = "session" !in state.busy) { confirmStartOver = true },
+ verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
+ Symbol("arrow.counterclockwise", size = 20.dp, tint = Palette.danger)
+ Text(tr("Start over"), style = Type.body, color = Palette.danger)
}
}
- }
- } }
+ }
}
- CodyncSheet(voice, { voice = false }) { VoiceChatSettings(state, store) }
- SwatchPanel(coloring, paired?.color, { coloring = false }, store::setColor)
CodyncSheet(aboutAnalytics, { aboutAnalytics = false }) { AnalyticsSheet() }
CodyncDialog("Start over?", confirmStartOver, { confirmStartOver = false },
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.") {
listOf(DialogAction("Start over", destructive = true, action = store::startOver))
}
- CodyncDialog(tr("Remove {name}?").replace("{name}", paired?.name ?: "computer"), confirmForget, { confirmForget = false },
- "Its bots and conversations stay on that computer. You can pair again any time.") {
- listOf(DialogAction("Remove", destructive = true, action = store::removeComputer))
- }
- CodyncDialog("Revoke this phone's access to ${confirmRevoke?.name ?: "the computer"}?", confirmRevoke != null, { confirmRevoke = null },
- "You can ask for access again; the computer will show a new code to confirm.") {
- listOfNotNull(confirmRevoke?.let { target -> DialogAction("Revoke", destructive = true) { store.revokeAccess(target.computerId) } })
- }
}
-/** Push on or off for this phone, and whether Android lets Codync show notifications at all. */
-@Composable private fun NotificationsSection(state: AppState, store: AppStore) {
+/** Whether Android lets Codync show notifications at all; each computer's push switch is on its card. */
+@Composable private fun NotificationsSection() {
val context = LocalContext.current
var asked by remember { mutableStateOf(false) }
val request = rememberLauncherForActivityResult(ActivityResultContracts.RequestPermission()) { granted ->
@@ -187,8 +99,7 @@ import kotlinx.serialization.json.put
}
val allowed = rememberOnResume { notificationsAllowed(context) } || asked && notificationsAllowed(context)
CardSection("Notifications", "Get a result summary, a request for input, or a failure notice. Notification previews follow your Android settings.") {
- if (BuildConfig.PUSH_CONFIGURED) row { SwitchRow("Push notifications", isOn = state.notifications, onChange = store::notifications) }
- else row { Text("Push isn't set up in this build. Bots and chats still update while Codync is open.", style = Type.subheadline, color = Palette.secondary) }
+ if (!BuildConfig.PUSH_CONFIGURED) row { Text("Push isn't set up in this build. Bots and chats still update while Codync is open.", style = Type.subheadline, color = Palette.secondary) }
row {
ValueRow("Notifications", if (allowed) "On" else if (asked) "Off in Settings" else "Turn on", Modifier.plainButton {
if (!allowed && !asked && Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) request.launch(Manifest.permission.POST_NOTIFICATIONS)
@@ -197,165 +108,3 @@ import kotlinx.serialization.json.put
}
}
}
-
-/** What the paired computer's row and its menu open; `revoke` is set when this phone's account access can be revoked. */
-private class ComputerActions(val extensions: () -> Unit, val screen: () -> Unit, val voice: () -> Unit, val color: () -> Unit,
- val ask: (() -> Unit)?, val revoke: (() -> Unit)?, val remove: () -> Unit)
-
-/** The paired computer: its connection, how it's reached, and whether it's in the account. */
-@Composable private fun ComputerRow(state: AppState, store: AppStore, inAccount: Boolean, actions: ComputerActions) {
- val computer = state.computers.first()
- val link = state.connection
- val online = link is LinkState.Ready
- val viewable = online && state.screen != null
- val detail = if (link is LinkState.Ready) {
- val count = state.bots.count { !it.deleted && it.kind != "group" }
- "$count bot${if (count == 1) "" else "s"} · ${routeLabel(link.route, computer.cloud)}"
- } else computerStatusText(state)
- Column(Modifier.fillMaxWidth()) {
- Column(Modifier.fillMaxWidth().contextActions(items = {
- listOfNotNull(
- MenuItem("Color", icon = "paintpalette", action = actions.color),
- if (online) MenuItem("Extensions", icon = "square.grid.2x2", action = actions.extensions) else null,
- if (online) MenuItem("Voice chat", icon = "waveform", action = actions.voice) else null,
- if (viewable) MenuItem("Screen", icon = "display", action = actions.screen) else null,
- actions.revoke?.let { MenuItem("Revoke this phone's access", icon = "lock.slash", destructive = true, divider = true, action = it) },
- if (!inAccount) MenuItem("Remove", icon = "trash", destructive = true, divider = actions.revoke == null, action = actions.remove) else null,
- )
- }), verticalArrangement = Arrangement.spacedBy(6.dp)) {
- Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
- ComputerBadge(state.hello?.text("device"), 32.dp, computer.color)
- Text(state.hello?.text("name") ?: computer.name, Modifier.weight(1f), style = Type.body.semibold, color = Palette.text)
- if (inAccount) Symbol("person.crop.circle.badge.checkmark", size = 20.dp, tint = Palette.tertiary, contentDescription = "In your account")
- }
- val ink = if (link is LinkState.ComputerOffline || link is LinkState.Failed) Palette.warning else Palette.secondary
- Text(detail, style = Type.footnote, color = if (online) Palette.secondary else ink)
- if (!online && (link is LinkState.Failed || link is LinkState.ComputerOffline) && actions.ask != null) {
- SecondaryButton(if (state.access?.computerId == computer.id) "Show code" else "Ask for access", action = actions.ask)
- }
- }
- if (online) {
- ComputerActionRow("Extensions", "square.grid.2x2", actions.extensions)
- if (state.screen != null) ComputerActionRow("Screen", "display", actions.screen)
- }
- Hairline(Modifier.padding(top = 14.dp))
- DropdownMenu({ ConnectionRoute.entries.map { route -> MenuItem(routeTitle(route, computer.cloud), icon = route.icon, selected = route == computer.route) { store.setRoute(route) } } },
- Modifier.fillMaxWidth().padding(top = 14.dp), label = "Connection") {
- Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
- Box(Modifier.width(26.dp), contentAlignment = Alignment.Center) { Symbol(computer.route.icon, size = 20.dp, tint = Palette.text) }
- Text(tr("Connection"), style = Type.body, color = Palette.text)
- Text(tr(routeTitle(computer.route, computer.cloud)), Modifier.weight(1f), style = Type.subheadline,
- color = Palette.secondary, textAlign = TextAlign.End)
- Symbol("chevron.down", size = 13.dp, tint = Palette.tertiary)
- }
- }
- if (state.isStale && !inAccount) {
- Hairline(Modifier.padding(top = 14.dp))
- RowLabel("Remove", "trash", Palette.danger, modifier = Modifier.padding(top = 14.dp).plainButton(action = actions.remove))
- }
- }
-}
-
-/** One computer action on its own row, under a hairline. */
-@Composable private fun ComputerActionRow(title: String, systemImage: String, action: () -> Unit) {
- Hairline(Modifier.padding(top = 14.dp))
- RowLabel(title, systemImage, chevron = true, modifier = Modifier.padding(top = 14.dp).plainButton(action = action))
-}
-
-/** A computer in the account that this phone can't use yet; `askingAnother` while this phone asks a different one. */
-@Composable private fun AccountComputerRow(computer: CloudComputer, code: String?, askingAnother: Boolean, ask: () -> Unit,
- revoke: () -> Unit) {
- val online = if (computer.online == true) "Online" else "Offline"
- val detail = when {
- code != null -> "Waiting for your OK on the computer · $code"
- computer.isGranted -> "Approved for an earlier install of Codync. Revoke it, then ask again."
- computer.access == "pending" -> "$online · A request is waiting"
- else -> "$online · In your account"
- }
- Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
- Box(Modifier.graphicsLayer { alpha = 0.5f }) { ComputerBadge(computer.device, 40.dp) }
- Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
- Text(computer.name, style = Type.body.semibold, color = Palette.text, maxLines = 1, overflow = TextOverflow.Ellipsis)
- Text(detail, style = Type.subheadline, color = Palette.secondary, maxLines = 2, overflow = TextOverflow.Ellipsis)
- }
- when {
- code != null -> SecondaryButton("Code", action = ask)
- computer.isGranted -> SecondaryButton("Revoke", action = revoke)
- else -> SecondaryButton("Ask for access", enabled = !askingAnother, action = ask)
- }
- }
-}
-
-/** An older account identity stays visible; only account management can remove it. */
-@Composable private fun OlderCopyRow(computer: CloudComputer) {
- val seen = computer.lastSeenAt?.let { " · last seen ${RelativeTime.day(it)}" }.orEmpty()
- Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
- Box(Modifier.graphicsLayer { alpha = 0.35f }) { ComputerBadge(computer.device, 40.dp) }
- Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
- Text(computer.name, style = Type.body.semibold, color = Palette.secondary, maxLines = 1, overflow = TextOverflow.Ellipsis)
- Text("Older copy of this computer$seen", style = Type.subheadline, color = Palette.tertiary, maxLines = 2, overflow = TextOverflow.Ellipsis)
- }
- }
-}
-
-@Composable private fun HiddenBotRow(state: AppState, store: AppStore, bot: Bot) {
- Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
- BotAvatar(bot, state.bots, 28.dp)
- Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(1.dp)) {
- Text(bot.name, style = Type.body, color = Palette.text, maxLines = 1, overflow = TextOverflow.Ellipsis)
- Text(state.hello?.text("name") ?: state.computers.firstOrNull()?.name.orEmpty(), style = Type.caption, color = Palette.tertiary)
- }
- IconButton("Unhide", "eye") {
- store.command("updateBot", buildJsonObject { put("id", bot.id); put("hidden", false) }, "roster:" + bot.id)
- }
- }
-}
-
-/** A computer's icon showing what it is (laptop, Mac mini, Linux…) in the color picked for it, as CodyncUI `ComputerBadge`. */
-@Composable internal fun ComputerBadge(device: String?, size: Dp, color: String? = null) {
- val tint = color?.let(AvatarPalette::tint) ?: Palette.text
- Box(Modifier.size(size), contentAlignment = Alignment.Center) {
- if (device == "linux") Symbol("computer.linux", size = size * 0.55f, tint = tint)
- else Symbol(when (device) {
- "laptop" -> "laptopcomputer"
- "macmini" -> "macmini"
- "macstudio" -> "macstudio"
- "macpro" -> "macpro.gen3"
- else -> "desktopcomputer"
- }, size = size * 0.6f, tint = tint)
- }
-}
-
-/** The computer color choices over the dimmed app: a grid of colored dots, the current one checked. */
-@Composable private fun SwatchPanel(isPresented: Boolean, selected: String?, close: () -> Unit, pick: (String) -> Unit) {
- val visible = remember { MutableTransitionState(false) }
- visible.targetState = isPresented
- if (!visible.currentState && !visible.targetState) return
- BackHandler(isPresented, close)
- Overlay {
- AnimatedVisibility(visible, enter = fadeIn(Motion.layout()), exit = fadeOut(Motion.fade())) {
- Box(Modifier.fillMaxSize().background(Color.Black.copy(alpha = 0.35f)).clickable(remember { MutableInteractionSource() }, null, onClick = close),
- contentAlignment = Alignment.Center) {
- Column(Modifier.graphicsLayer { shadowElevation = 24f; shape = RoundedRectangle(22.dp); clip = true }.background(Palette.bubbleAgent)
- .clickable(remember { MutableInteractionSource() }, null) {}.semantics { paneTitle = "Color" }.padding(14.dp),
- verticalArrangement = Arrangement.spacedBy(10.dp)) {
- for (swatches in AvatarPalette.colors.entries.chunked(6)) Row(horizontalArrangement = Arrangement.spacedBy(10.dp)) {
- for ((id, hex) in swatches) Box(Modifier.size(36.dp), contentAlignment = Alignment.Center) {
- Box(Modifier.size(32.dp).clip(Capsule()).background(Color(hex)).clickable(role = Role.RadioButton) { close(); pick(id) }
- .semantics { contentDescription = id.replaceFirstChar(Char::uppercase); this.selected = id == selected },
- contentAlignment = Alignment.Center) {
- if (id == selected) Symbol("checkmark", size = 13.dp, tint = Color.White)
- }
- }
- }
- }
- }
- }
- }
-}
-
-private val ConnectionRoute.icon get() = when (this) {
- ConnectionRoute.Automatic -> "arrow.triangle.branch"
- ConnectionRoute.CloudflareFirst -> "cloud"
- ConnectionRoute.DirectOnly -> "wifi"
-}
diff --git a/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt b/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt
index 67219a80..8e335001 100644
--- a/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt
+++ b/apps/android/app/src/test/kotlin/com/codync/android/ConnectionPresentationTest.kt
@@ -42,6 +42,8 @@ class ConnectionPresentationTest {
assertEquals("Private relay (relay.example.com)", routeLabel(HostRoute.Relay, "https://relay.example.com"))
assertEquals("Cloudflare", routeLabel(HostRoute.Relay, "https://api.codync.dev"))
assertEquals("Wi-Fi/Tailscale", routeLabel(HostRoute.Direct, "https://relay.example.com"))
+ assertEquals("Private relay first", routeShortTitle(ConnectionRoute.CloudflareFirst, "https://relay.example.com"))
+ assertEquals("Cloudflare first", routeShortTitle(ConnectionRoute.CloudflareFirst, "https://api.codync.dev"))
}
@Test fun anOfflineComputerSaysWhenItWasLastSeen() {
diff --git a/apps/android/design/src/main/kotlin/com/codync/android/design/Chrome.kt b/apps/android/design/src/main/kotlin/com/codync/android/design/Chrome.kt
index 61dd5def..d3f09051 100644
--- a/apps/android/design/src/main/kotlin/com/codync/android/design/Chrome.kt
+++ b/apps/android/design/src/main/kotlin/com/codync/android/design/Chrome.kt
@@ -3,7 +3,6 @@ package com.codync.android.design
import androidx.activity.compose.PredictiveBackHandler
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.animateDpAsState
-import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
@@ -19,12 +18,12 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.width
import androidx.compose.foundation.selection.selectable
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveableStateHolder
@@ -97,13 +96,10 @@ class TabItem<T>(val value: T, val title: String, val systemImage: String, val i
/** The iOS 26 tab bar: a floating glass capsule whose selection pill slides between tabs. */
@Composable fun <T> GlassTabBar(selection: T, tabs: List<TabItem<T>>, select: (T) -> Unit, modifier: Modifier = Modifier) {
- val match = tabs.indexOfFirst { it.value == selection }
- var resting by remember { mutableIntStateOf(0) }
- if (match >= 0) resting = match
- val pill by animateDpAsState(TAB_WIDTH * resting, Motion.layout(), label = "Tab selection")
- val shown by animateFloatAsState(if (match >= 0) 1f else 0f, Motion.fade(), label = "Tab selection visibility")
+ val index = tabs.indexOfFirst { it.value == selection }.coerceAtLeast(0)
+ val pill by animateDpAsState(TAB_WIDTH * index, Motion.layout(), label = "Tab selection")
Box(modifier.glass(Capsule()).padding(4.dp)) {
- Box(Modifier.offset(x = pill).graphicsLayer { alpha = shown }.size(TAB_WIDTH, 54.dp).clip(Capsule()).background(Palette.text.copy(alpha = 0.07f)))
+ Box(Modifier.offset(x = pill).size(TAB_WIDTH, 54.dp).clip(Capsule()).background(Palette.text.copy(alpha = 0.07f)))
Row {
for (tab in tabs) {
val on = tab.value == selection
diff --git a/apps/ios/App/CodyncApp.swift b/apps/ios/App/CodyncApp.swift
index 41a30303..ce0ff9e1 100644
--- a/apps/ios/App/CodyncApp.swift
+++ b/apps/ios/App/CodyncApp.swift
@@ -105,7 +105,7 @@ struct CodyncApp: App {
}
}
-enum AppTab: Hashable { case bots, state, more }
+enum AppTab: Hashable { case bots, state, settings }
/// One `AccountStore` per account context: switching accounts retires the old one so
/// in-flight work can't land on another user's screen or storage.
diff --git a/apps/ios/App/Push.swift b/apps/ios/App/Push.swift
index ca96fd66..c1f6d2fc 100644
--- a/apps/ios/App/Push.swift
+++ b/apps/ios/App/Push.swift
@@ -111,19 +111,17 @@ final class PushRegistrar {
resync()
}
- /// The in-app switch; off asks every computer to stop alerting this phone.
- static var enabled: Bool { UserDefaults.standard.object(forKey: "notificationsEnabled") as? Bool ?? true }
-
func resync() {
for entry in stores.values { if let store = entry.store { syncDevice(with: store) } }
}
- /// Sends our ticket to a computer whenever we have both a token and a connection to it.
+ /// Sends our ticket to a computer whenever we have both a token and a connection to it; a computer
+ /// whose switch is off in Computer management is asked to stop alerting this phone.
func syncDevice(with store: BotStore) {
let id = store.computer.id
stores[id] = WeakStore(store: store)
LiveActivities.shared.resume(with: store)
- guard Self.enabled else {
+ guard store.computer.notifications ?? true else {
registrations[id]?.cancel()
registrations[id] = Task { [weak store] in
do { try await store?.client?.unregisterDevice() } catch {
diff --git a/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift b/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift
index f0b71449..bfbaeb56 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift
+++ b/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift
@@ -42,7 +42,7 @@ public enum AnalyticsEvent: Equatable, Sendable {
public enum VoiceStuck: String, Sendable { case none, connecting, reconnecting, speaking }
public enum VoiceFailure: String, Sendable { case none, microphone, connection, provider }
public enum Screen: String, Sendable {
- case bots, state, more, chat, trace, botDetails = "bot_details", memory, routines, marketplace
+ case bots, state, chat, trace, botDetails = "bot_details", memory, routines, marketplace
case settings, computers, usage, account, pairing, voiceSettings = "voice_settings", remoteScreen = "remote_screen"
case library, artifact
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/Computer.swift b/apps/ios/Kit/Sources/CodyncKit/Models/Computer.swift
index 2b59d83f..479000dd 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Models/Computer.swift
+++ b/apps/ios/Kit/Sources/CodyncKit/Models/Computer.swift
@@ -21,6 +21,8 @@ public struct Computer: Codable, Hashable, Sendable, Identifiable {
public var color: String?
/// How this device reaches the computer, picked per computer; nil = `.automatic`.
public var route: ConnectionRoute?
+ /// Whether the computer sends push alerts to this device, picked per computer; nil = on.
+ public var notifications: Bool?
public init(id: ComputerID, name: String, signKey: String, boxKey: String? = nil, urls: [String] = [],
cloud: URL? = nil, device: String? = nil, color: String? = nil) {
diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/RelayCopy.swift b/apps/ios/Kit/Sources/CodyncKit/Models/RelayCopy.swift
index e4510de6..95d80e3b 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Models/RelayCopy.swift
+++ b/apps/ios/Kit/Sources/CodyncKit/Models/RelayCopy.swift
@@ -31,6 +31,15 @@ public enum RelayCopy {
}
}
+ /// The route's short name, shown on the Connection row; the menu keeps `routeTitle`.
+ public static func routeShortTitle(_ route: ConnectionRoute, cloud: URL?) -> String {
+ switch route {
+ case .automatic: "Auto"
+ case .cloudflareFirst: host(of: cloud) == nil ? "Cloudflare first" : "Private relay first"
+ case .directOnly: "Wi-Fi/Tailscale only"
+ }
+ }
+
/// The short suffix after a bot count: ` · Cloudflare` or ` · Private relay (host)`.
public static func detailSuffix(route: HostRoute?, cloud: URL?) -> String {
switch route {
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
index 51fd1514..99dc375f 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
@@ -11,7 +11,6 @@
"App language…": "App-Sprache…",
"App version": "App-Version",
"Apple": "Apple",
- "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.": "Apple Rede auf diesem iPhone, oder OpenAI und Gemini auf Ihrem eigenen API-Schlüssel, gehalten auf dem Computer.",
"Applies to Usage in the app and in widgets.": "Gilt für die Nutzung in der App und in Widgets.",
"Approved for an earlier install of Codync. Revoke it, then ask again.": "Zugelassen für eine frühere Installation von Codync. Widerrufen Sie es und fragen Sie dann erneut.",
"Ask again": "Erneut anfragen",
@@ -293,7 +292,6 @@
"Usage icons": "Nutzungssymbole",
"Usage limits": "Nutzungslimits",
"Usage shows up once a computer is connected.": "Die Nutzung wird angezeigt, sobald ein Computer verbunden ist.",
- "Voice and API keys": "Sprachchat und API-Schlüssel",
"Voice chat": "Sprachchat",
"Voice keys are kept by This Mac's host, which isn't running.": "Sprachschlüssel werden vom Host dieses Macs verwaltet, der gerade nicht läuft.",
"Waiting for approval…": "Warten auf Genehmigung…",
@@ -302,6 +300,10 @@
"Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.": "Welche Funktionen du nutzt, niemals deine Nachrichten, deinen Code oder deine Dateien. So finden wir Fehler früher und verbessern Codync für dich.",
"Wi-Fi or Tailscale": "WLAN oder Tailscale",
"Wi-Fi or Tailscale only, never Cloudflare": "Nur WLAN oder Tailscale, niemals Cloudflare",
+ "Auto": "Auto",
+ "Cloudflare first": "Cloudflare zuerst",
+ "Private relay first": "Privates Relay zuerst",
+ "Wi-Fi/Tailscale only": "Nur WLAN/Tailscale",
"Widget": "Widget",
"Working": "In Arbeit",
"Working…": "In Arbeit…",
@@ -326,7 +328,6 @@
"or install with Homebrew": "oder installiere mit Homebrew",
"search bots": "Bots suchen",
"ACTIONS": "AKTIONEN",
- "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.": "Android-Spracherkennung auf diesem Telefon oder OpenAI und Gemini mit deinem eigenen, auf dem Computer gespeicherten API-Schlüssel.",
"It's this computer under an earlier identity and can't be reached anymore. Removing it only cleans up your account.": "Dies ist eine frühere Identität dieses Computers, die nicht mehr erreichbar ist. Durch Entfernen wird nur dein Konto aufgeräumt.",
"Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "Meldet alle Konten ab und vergisst alle Computer auf diesem iPhone. Anschließend erscheint die Begrüßung. Deine Computer behalten ihre Bots und Chats; kopple sie erneut, um sie zu nutzen.",
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "Meldet alle Konten ab und vergisst alle Computer auf diesem Telefon. Anschließend erscheint die Begrüßung. Deine Computer behalten ihre Bots und Chats; kopple sie erneut, um sie zu nutzen.",
@@ -1212,7 +1213,6 @@
"This week": "Diese Woche",
"Earlier": "Früher",
"Open": "Öffnen",
- "More": "Mehr",
"More actions": "Weitere Aktionen",
"Library": "Mediathek",
"Library is empty": "Die Mediathek ist leer",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
index 083d3dae..3d9ad88d 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
@@ -11,7 +11,6 @@
"App language…": "Idioma de la aplicación...",
"App version": "Versión de la aplicación",
"Apple": "Apple",
- "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.": "Apple habla de este iPhone, o OpenAI y Gemini en su propia clave API, guardada en la computadora.",
"Applies to Usage in the app and in widgets.": "Se aplica al uso en la aplicación y en los widgets.",
"Approved for an earlier install of Codync. Revoke it, then ask again.": "Aprobado para una instalación anterior de Codync. Revocarlo y luego volver a preguntar.",
"Ask again": "Preguntar de nuevo",
@@ -293,7 +292,6 @@
"Usage icons": "Iconos de uso",
"Usage limits": "Límites de uso",
"Usage shows up once a computer is connected.": "El uso aparece una vez que se conecta una computadora.",
- "Voice and API keys": "Voz y claves API",
"Voice chat": "Conversación de voz",
"Voice keys are kept by This Mac's host, which isn't running.": "Las claves de voz las guarda el host de esta Mac, que no se está ejecutando.",
"Waiting for approval…": "Esperando aprobación...",
@@ -302,6 +300,10 @@
"Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.": "Solo qué funciones utilizas, nunca tus mensajes, código ni archivos. Nos ayuda a detectar errores antes y mejorar Codync para ti.",
"Wi-Fi or Tailscale": "Wi-Fi o Tailscale",
"Wi-Fi or Tailscale only, never Cloudflare": "Solo Wi-Fi o Tailscale, nunca Cloudflare",
+ "Auto": "Automático",
+ "Cloudflare first": "Cloudflare primero",
+ "Private relay first": "Relé privado primero",
+ "Wi-Fi/Tailscale only": "Solo Wi-Fi/Tailscale",
"Widget": "Widget",
"Working": "Trabajando",
"Working…": "Trabajando…",
@@ -326,7 +328,6 @@
"or install with Homebrew": "o instala con Homebrew",
"search bots": "buscar bots",
"ACTIONS": "ACCIONES",
- "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.": "Reconocimiento de voz de Android en este teléfono, u OpenAI y Gemini con tu propia clave API guardada en la computadora.",
"It's this computer under an earlier identity and can't be reached anymore. Removing it only cleans up your account.": "Es una identidad anterior de esta computadora que ya no está accesible. Eliminarla solo limpia tu cuenta.",
"Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "Cierra sesión en todas las cuentas y olvida todas las computadoras de este iPhone; después vuelve a la bienvenida. Tus computadoras conservan sus bots y chats; vuelve a vincularlas para usarlas.",
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "Cierra sesión en todas las cuentas y olvida todas las computadoras de este teléfono; después vuelve a la bienvenida. Tus computadoras conservan sus bots y chats; vuelve a vincularlas para usarlas.",
@@ -1212,7 +1213,6 @@
"This week": "Esta semana",
"Earlier": "Anteriores",
"Open": "Abrir",
- "More": "Más",
"More actions": "Más acciones",
"Library": "Biblioteca",
"Library is empty": "La biblioteca está vacía",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
index 0d1e2867..fb5e4b60 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
@@ -11,7 +11,6 @@
"App language…": "Langue de l'application…",
"App version": "Version de l'application",
"Apple": "Apple",
- "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.": "Discours Apple sur ce iPhone, ou OpenAI et Gemini sur votre propre clé API, conservée sur l'ordinateur.",
"Applies to Usage in the app and in widgets.": "S'applique à l'utilisation dans l'application et dans les widgets.",
"Approved for an earlier install of Codync. Revoke it, then ask again.": "Approuvé pour une installation antérieure de Codync. Révoquez-le, puis demandez à nouveau.",
"Ask again": "Demander à nouveau",
@@ -293,7 +292,6 @@
"Usage icons": "Icônes d’utilisation",
"Usage limits": "Limites d’utilisation",
"Usage shows up once a computer is connected.": "L’utilisation apparaît dès qu’un ordinateur est connecté.",
- "Voice and API keys": "Conversation vocale et clés API",
"Voice chat": "Conversation vocale",
"Voice keys are kept by This Mac's host, which isn't running.": "Les clés vocales sont conservées par l’hôte de ce Mac, qui n’est pas en cours d’exécution.",
"Waiting for approval…": "En attente d’approbation…",
@@ -302,6 +300,10 @@
"Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.": "Les fonctionnalités que vous utilisez, jamais vos messages, votre code ni vos fichiers. Cela nous aide à repérer les bugs et à améliorer Codync.",
"Wi-Fi or Tailscale": "Wi-Fi ou Tailscale",
"Wi-Fi or Tailscale only, never Cloudflare": "Wi-Fi ou Tailscale uniquement, jamais Cloudflare",
+ "Auto": "Auto",
+ "Cloudflare first": "Cloudflare d'abord",
+ "Private relay first": "Relais privé d'abord",
+ "Wi-Fi/Tailscale only": "Wi-Fi/Tailscale uniquement",
"Widget": "Widget",
"Working": "Au travail",
"Working…": "Au travail…",
@@ -326,7 +328,6 @@
"or install with Homebrew": "ou installez avec Homebrew",
"search bots": "rechercher des bots",
"ACTIONS": "ACTIONS",
- "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.": "La reconnaissance vocale Android sur ce téléphone, ou OpenAI et Gemini avec votre propre clé API conservée sur l’ordinateur.",
"It's this computer under an earlier identity and can't be reached anymore. Removing it only cleans up your account.": "Il s’agit d’une ancienne identité de cet ordinateur, désormais inaccessible. La supprimer ne fait que nettoyer votre compte.",
"Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "Déconnecte tous les comptes et oublie tous les ordinateurs sur cet iPhone, puis affiche l’accueil. Vos ordinateurs conservent leurs bots et discussions ; associez-les à nouveau pour les utiliser.",
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "Déconnecte tous les comptes et oublie tous les ordinateurs sur ce téléphone, puis affiche l’accueil. Vos ordinateurs conservent leurs bots et discussions ; associez-les à nouveau pour les utiliser.",
@@ -1212,7 +1213,6 @@
"This week": "Cette semaine",
"Earlier": "Plus tôt",
"Open": "Ouvrir",
- "More": "Plus",
"More actions": "Autres actions",
"Library": "Bibliothèque",
"Library is empty": "La bibliothèque est vide",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
index 4bee7ef3..17ee6984 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
@@ -11,7 +11,6 @@
"App language…": "アプリの言語…",
"App version": "アプリのバージョン",
"Apple": "Apple",
- "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.": "この iPhone 上の Apple のスピーチ、または独自の API キー上の OpenAI および Gemini のスピーチは、コンピュータ上に保存されます。",
"Applies to Usage in the app and in widgets.": "アプリとウィジェットでの使用に適用されます。",
"Approved for an earlier install of Codync. Revoke it, then ask again.": "Codync の以前のインストールが承認されました。取り消してから、もう一度質問してください。",
"Ask again": "もう一度質問してください",
@@ -293,7 +292,6 @@
"Usage icons": "使用状況アイコン",
"Usage limits": "使用制限",
"Usage shows up once a computer is connected.": "コンピュータが接続されると使用状況が表示されます。",
- "Voice and API keys": "音声キーとAPIキー",
"Voice chat": "ボイスチャット",
"Voice keys are kept by This Mac's host, which isn't running.": "音声キーは、この Mac のホストによって保持されますが、ホストは実行されていません。",
"Waiting for approval…": "承認を待っています…",
@@ -302,6 +300,10 @@
"Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.": "利用する機能だけを共有します。メッセージ、コード、ファイルは共有されません。不具合の早期発見と Codync の改善に役立ちます。",
"Wi-Fi or Tailscale": "Wi-FiまたはTailscale",
"Wi-Fi or Tailscale only, never Cloudflare": "Wi-Fi または Tailscale のみ、Cloudflare は不可",
+ "Auto": "自動",
+ "Cloudflare first": "Cloudflare 優先",
+ "Private relay first": "プライベートリレー優先",
+ "Wi-Fi/Tailscale only": "Wi-Fi/Tailscale のみ",
"Widget": "ウィジェット",
"Working": "作業中",
"Working…": "作業中…",
@@ -326,7 +328,6 @@
"or install with Homebrew": "またはHomebrewでインストールする",
"search bots": "ボットを検索",
"ACTIONS": "アクション",
- "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.": "この携帯電話での Android 音声、またはコンピューター上に保存された独自の API キーでの OpenAI および Gemini の音声。",
"It's this computer under an earlier identity and can't be reached anymore. Removing it only cleans up your account.": "このコンピュータは以前の ID で使用されており、もうアクセスできません。削除してもアカウントがクリーンアップされるだけです。",
"Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "すべてのアカウントからサインアウトし、この iPhone 上のすべてのコンピューターを忘れてから、再びようこそを表示します。コンピューターにはボットとチャットが保存されています。再度ペアリングして使用してください。",
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "すべてのアカウントからサインアウトし、この電話上のすべてのコンピュータを忘れてから、再びようこそを表示します。コンピューターにはボットとチャットが保存されています。再度ペアリングして使用してください。",
@@ -1212,7 +1213,6 @@
"This week": "今週",
"Earlier": "それ以前",
"Open": "開く",
- "More": "その他",
"More actions": "その他の操作",
"Library": "ライブラリ",
"Library is empty": "ライブラリは空です",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
index 4cb7a18b..25c8de48 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
@@ -11,7 +11,6 @@
"App language…": "앱 언어…",
"App version": "앱 버전",
"Apple": "Apple",
- "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.": "이 iPhone에 대한 Apple 연설 또는 OpenAI 및 Gemini의 API 키는 컴퓨터에 보관됩니다.",
"Applies to Usage in the app and in widgets.": "앱 및 위젯의 사용량에 적용됩니다.",
"Approved for an earlier install of Codync. Revoke it, then ask again.": "Codync의 이전 설치에 대해 승인되었습니다. 취소한 후 다시 요청하세요.",
"Ask again": "다시 요청",
@@ -293,7 +292,6 @@
"Usage icons": "사용량 아이콘",
"Usage limits": "사용량 한도",
"Usage shows up once a computer is connected.": "컴퓨터가 연결되면 사용량이 표시됩니다.",
- "Voice and API keys": "음성 및 API 키",
"Voice chat": "음성채팅",
"Voice keys are kept by This Mac's host, which isn't running.": "음성 키는 실행되고 있지 않은 이 Mac의 호스트에 보관됩니다.",
"Waiting for approval…": "승인을 기다리는 중…",
@@ -302,6 +300,10 @@
"Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.": "사용하는 기능만 공유하며 메시지, 코드, 파일은 공유하지 않습니다. 버그를 더 빨리 발견하고 Codync를 개선하는 데 도움이 됩니다.",
"Wi-Fi or Tailscale": "Wi-Fi 또는 Tailscale",
"Wi-Fi or Tailscale only, never Cloudflare": "Wi-Fi 또는 Tailscale만 가능, Cloudflare 불가",
+ "Auto": "자동",
+ "Cloudflare first": "Cloudflare 우선",
+ "Private relay first": "프라이빗 릴레이 우선",
+ "Wi-Fi/Tailscale only": "Wi-Fi/Tailscale만",
"Widget": "위젯",
"Working": "작업 중",
"Working…": "작업 중…",
@@ -326,7 +328,6 @@
"or install with Homebrew": "또는 Homebrew로 설치",
"search bots": "검색 봇",
"ACTIONS": "행위",
- "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.": "이 전화기의 Android 음성 또는 OpenAI 및 Gemini의 API 키가 컴퓨터에 보관됩니다.",
"It's this computer under an earlier identity and can't be reached anymore. Removing it only cleans up your account.": "이전 ID를 사용하는 이 컴퓨터이므로 더 이상 연결할 수 없습니다. 삭제하면 계정만 정리됩니다.",
"Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "모든 계정에서 로그아웃하고 이 iPhone의 모든 컴퓨터를 삭제한 다음 다시 환영 메시지를 표시합니다. 귀하의 컴퓨터는 봇과 채팅을 유지합니다. 사용하려면 다시 페어링하세요.",
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "모든 계정에서 로그아웃하고 이 휴대전화의 모든 컴퓨터를 삭제한 다음 다시 환영 메시지를 표시합니다. 귀하의 컴퓨터는 봇과 채팅을 유지합니다. 사용하려면 다시 페어링하세요.",
@@ -1212,7 +1213,6 @@
"This week": "이번 주",
"Earlier": "이전",
"Open": "열기",
- "More": "더보기",
"More actions": "작업 더 보기",
"Library": "라이브러리",
"Library is empty": "라이브러리가 비어 있습니다",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
index 2b13929e..c2812ead 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
@@ -11,7 +11,6 @@
"App language…": "应用语言…",
"App version": "应用版本",
"Apple": "Apple",
- "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.": "用这台 iPhone 上的苹果语音,或你自己的 OpenAI、Gemini 密钥。密钥留在电脑上。",
"Applies to Usage in the app and in widgets.": "应用内的用量和小组件都会跟着变。",
"Approved for an earlier install of Codync. Revoke it, then ask again.": "这是更早一次安装的授权。先撤销,再重新申请。",
"Ask again": "再申请一次",
@@ -293,7 +292,6 @@
"Usage icons": "用量图标",
"Usage limits": "用量上限",
"Usage shows up once a computer is connected.": "连上电脑后会显示用量。",
- "Voice and API keys": "语音和 API 密钥",
"Voice chat": "语音",
"Voice keys are kept by This Mac's host, which isn't running.": "语音密钥由这台 Mac 的 host 保存,而 host 没在运行。",
"Waiting for approval…": "等待电脑同意…",
@@ -302,6 +300,10 @@
"Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.": "只记录你用了哪些功能,不包括消息、代码或文件。便于更快发现 bug,把 Codync 做得更好。",
"Wi-Fi or Tailscale": "Wi-Fi 或 Tailscale",
"Wi-Fi or Tailscale only, never Cloudflare": "只用 Wi-Fi 或 Tailscale,不走 Cloudflare",
+ "Auto": "自动",
+ "Cloudflare first": "Cloudflare 优先",
+ "Private relay first": "私人中继优先",
+ "Wi-Fi/Tailscale only": "只用 Wi-Fi/Tailscale",
"Widget": "小组件",
"Working": "正在工作",
"Working…": "正在工作…",
@@ -326,7 +328,6 @@
"or install with Homebrew": "或用 Homebrew 安装",
"search bots": "搜索 Bot",
"ACTIONS": "操作",
- "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.": "用这台手机上的 Android 语音,或你自己的 OpenAI、Gemini 密钥。密钥留在电脑上。",
"It's this computer under an earlier identity and can't be reached anymore. Removing it only cleans up your account.": "这是同一台电脑更早的身份,已经连不上了。移除只会清理你的账户。",
"Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "会退出所有账户,并忘掉这台 iPhone 上的每台电脑,然后重新显示欢迎页。电脑上的 Bot 和对话都还在,配对后可以继续用。",
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "会退出所有账户,并忘掉这台手机上的每台电脑,然后重新显示欢迎页。电脑上的 Bot 和对话都还在,配对后可以继续用。",
@@ -1212,7 +1213,6 @@
"This week": "本周",
"Earlier": "更早",
"Open": "打开",
- "More": "更多",
"More actions": "更多操作",
"Library": "资料库",
"Library is empty": "资料库还是空的",
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
index 3aa60d87..7732b44f 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
@@ -11,7 +11,6 @@
"App language…": "應用語言…",
"App version": "應用版本",
"Apple": "Apple",
- "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.": "用這臺 iPhone 上的蘋果語音,或你自己的 OpenAI、Gemini 金鑰。金鑰留在電腦上。",
"Applies to Usage in the app and in widgets.": "應用內的用量和小元件都會跟著變。",
"Approved for an earlier install of Codync. Revoke it, then ask again.": "這是更早一次安裝的授權。先撤銷,再重新申請。",
"Ask again": "再申請一次",
@@ -293,7 +292,6 @@
"Usage icons": "用量圖示",
"Usage limits": "用量上限",
"Usage shows up once a computer is connected.": "連上電腦後會顯示用量。",
- "Voice and API keys": "語音和 API 金鑰",
"Voice chat": "語音",
"Voice keys are kept by This Mac's host, which isn't running.": "語音金鑰由這臺 Mac 的 host 儲存,而 host 沒在執行。",
"Waiting for approval…": "等待電腦同意…",
@@ -302,6 +300,10 @@
"Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.": "只記錄你用了哪些功能,不包括訊息、程式碼或檔案。便於更快發現 bug,把 Codync 做得更好。",
"Wi-Fi or Tailscale": "Wi-Fi 或 Tailscale",
"Wi-Fi or Tailscale only, never Cloudflare": "只用 Wi-Fi 或 Tailscale,不走 Cloudflare",
+ "Auto": "自動",
+ "Cloudflare first": "Cloudflare 優先",
+ "Private relay first": "私人中繼優先",
+ "Wi-Fi/Tailscale only": "只用 Wi-Fi/Tailscale",
"Widget": "小元件",
"Working": "正在工作",
"Working…": "正在工作…",
@@ -326,7 +328,6 @@
"or install with Homebrew": "或用 Homebrew 安裝",
"search bots": "搜尋 Bot",
"ACTIONS": "操作",
- "Android speech on this phone, or OpenAI and Gemini on your own API key, kept on the computer.": "用這臺手機上的 Android 語音,或你自己的 OpenAI、Gemini 金鑰。金鑰留在電腦上。",
"It's this computer under an earlier identity and can't be reached anymore. Removing it only cleans up your account.": "這是同一臺電腦更早的身份,已經連不上了。移除只會清理你的賬戶。",
"Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "會退出所有賬戶,並忘掉這臺 iPhone 上的每臺電腦,然後重新顯示歡迎頁。電腦上的 Bot 和對話都還在,配對後可以繼續用。",
"Signs out of every account and forgets every computer on this phone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.": "會退出所有賬戶,並忘掉這臺手機上的每臺電腦,然後重新顯示歡迎頁。電腦上的 Bot 和對話都還在,配對後可以繼續用。",
@@ -1212,7 +1213,6 @@
"This week": "本週",
"Earlier": "更早",
"Open": "開啟",
- "More": "更多",
"More actions": "更多操作",
"Library": "資料庫",
"Library is empty": "資料庫還是空的",
diff --git a/apps/ios/Kit/Sources/CodyncUI/Controls.swift b/apps/ios/Kit/Sources/CodyncUI/Controls.swift
index c6e596a2..3fdd1e7b 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Controls.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Controls.swift
@@ -206,27 +206,15 @@ private struct ContextActions: ViewModifier {
}
@ViewBuilder private func menuLabel(_ item: MenuItem) -> some View {
- let title = menuTitle(item.title)
if let image = item.image {
- SwiftUI.Label { title } icon: { image }
+ SwiftUI.Label { Text(L10n.tr(item.title)) } icon: { image }
} else if let icon = item.icon {
- SwiftUI.Label { title } icon: { Image(systemName: icon) }
+ SwiftUI.Label(L10n.tr(item.title), systemImage: icon)
} else {
- title
+ Text(L10n.tr(item.title))
}
}
-/// A menu title wraps instead of ending in an ellipsis. A long choice, such as a connection route,
-/// asks for enough width to show the host at the end.
-private func menuTitle(_ title: String) -> some View {
- let text = L10n.tr(title)
- return Text(text)
- .lineLimit(6)
- .multilineTextAlignment(.leading)
- .fixedSize(horizontal: false, vertical: true)
- .frame(minWidth: text.count > 36 ? 280 : 0, alignment: .leading)
-}
-
/// A button that opens the system menu.
public struct DropdownMenu<Label: View>: View {
let items: () -> [MenuItem]
diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift
index 5015a322..3886f8fb 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift
@@ -106,6 +106,7 @@ public final class AccountStore {
if let previous = saved.first(where: { $0.id == computer.id }) {
computer.color = previous.color
computer.route = previous.route
+ computer.notifications = previous.notifications
}
save(computer)
open(computer)
@@ -143,6 +144,17 @@ public final class AccountStore {
refreshList()
}
+ /// Saved with the computer on this device; the caller then registers or unregisters this device's push.
+ public func setNotifications(_ id: ComputerID, _ on: Bool) {
+ let value: Bool? = on ? nil : false
+ if let i = saved.firstIndex(where: { $0.id == id }) {
+ saved[i].notifications = value
+ persist()
+ }
+ stores[id]?.updateComputer { $0.notifications = value }
+ refreshList()
+ }
+
/// Moves a computer section on this device only.
public func move(_ id: ComputerID, to target: ComputerID) {
computerOrder.move(id, to: target, available: computers.map(\.id))
@@ -304,6 +316,7 @@ public final class AccountStore {
computer.boxKey = previous.boxKey
computer.color = previous.color
computer.route = previous.route
+ computer.notifications = previous.notifications
}
save(computer)
open(computer)
diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swift
index 4fbb4841..cb5a37e2 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swift
@@ -216,12 +216,13 @@ extension BotStore {
Task { [weak self] in
for await computer in updates {
guard let self, !self.retired else { return }
- // The color and route are picked on this device; the transport's copy may be older.
+ // The color, route and notifications are picked on this device; the transport's copy may be older.
self.updateComputer { current in
- let (color, route) = (current.color, current.route)
+ let (color, route, notifications) = (current.color, current.route, current.notifications)
current = computer
current.color = color
current.route = route
+ current.notifications = notifications
}
}
}
diff --git a/apps/ios/Kit/Tests/CodyncKitTests/RelayCopyTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/RelayCopyTests.swift
index b9c17ba9..2c910c8b 100644
--- a/apps/ios/Kit/Tests/CodyncKitTests/RelayCopyTests.swift
+++ b/apps/ios/Kit/Tests/CodyncKitTests/RelayCopyTests.swift
@@ -9,6 +9,7 @@ struct RelayCopyTests {
#expect(RelayCopy.host(of: nil) == nil)
#expect(RelayCopy.connected(cloud: URL(string: "https://api.codync.dev")) == "Connected through Cloudflare")
#expect(RelayCopy.routeTitle(.automatic, cloud: nil) == "Auto: Wi-Fi or Tailscale, then Cloudflare")
+ #expect(RelayCopy.routeShortTitle(.cloudflareFirst, cloud: nil) == "Cloudflare first")
}
@Test func anotherHostIsNamedInTheSentence() {
@@ -20,6 +21,7 @@ struct RelayCopyTests {
#expect(RelayCopy.connected(cloud: cloud) == "Connected through Private relay (relay.example.com)")
#expect(RelayCopy.through(cloud: cloud) == "Through Private relay (relay.example.com)")
#expect(RelayCopy.routeTitle(.cloudflareFirst, cloud: cloud) == "Private relay (relay.example.com), then Wi-Fi or Tailscale")
+ #expect(RelayCopy.routeShortTitle(.cloudflareFirst, cloud: cloud) == "Private relay first")
#expect(RelayCopy.detailSuffix(route: .relay, cloud: cloud) == " · Private relay (relay.example.com)")
#expect(RelayCopy.pairing(cloud: cloud).contains("Private relay (relay.example.com)"))
}
diff --git a/apps/ios/Views/AccountSwitcherView.swift b/apps/ios/Views/AccountSwitcherView.swift
index de4f173f..365d20ee 100644
--- a/apps/ios/Views/AccountSwitcherView.swift
+++ b/apps/ios/Views/AccountSwitcherView.swift
@@ -84,7 +84,6 @@ struct AccountSwitcherView: View {
.animation(Motion.fade, value: account.errorMessage)
.tracked(.screenViewed(.account))
.onChange(of: account.userID) { _, _ in withAnimation(Motion.layout) { addingAccount = false } }
- .hidesSystemNavigationBar()
.codyncSheet(isPresented: $pairing) { PairingView(inModal: true) }
.codyncDialog("Sign out of \(account.email ?? "this account")?", isPresented: $confirmSignOut,
message: "This iPhone forgets the account's computers. Your bots stay on them.") {
diff --git a/apps/ios/Views/ComputerRows.swift b/apps/ios/Views/ComputerRows.swift
deleted file mode 100644
index d982152b..00000000
--- a/apps/ios/Views/ComputerRows.swift
+++ /dev/null
@@ -1,272 +0,0 @@
-import CodyncKit
-import CodyncUI
-import SwiftUI
-
-/// A computer this iPhone can use: its connection, how it's reached, and whether it's in the account.
-struct ComputerRow: View {
- let store: BotStore
- let inAccount: CloudComputer?
- let openScreen: () -> Void
- /// Agents, connectors and skills installed on this computer.
- let openMarketplace: () -> Void
- let ask: (() -> Void)?
- /// Set when this iPhone's access to the computer can be revoked.
- let revoke: (() -> Void)?
- let remove: () -> Void
- @Environment(AccountStore.self) private var accounts
- @State private var coloring = false
- @State private var voiceSettings = false
-
- var body: some View {
- VStack(alignment: .leading, spacing: 0) {
- summary
- ForEach(actions) { action in
- Hairline().padding(.top, 14)
- actionControl(action)
- .frame(maxWidth: .infinity, alignment: .leading)
- .padding(.top, 14)
- }
- }
- .padding(.vertical, 2)
- }
-
- /// Name, connection, and an access request when this iPhone can't reach the computer.
- private var summary: some View {
- VStack(alignment: .leading, spacing: 6) {
- HStack(spacing: 10) {
- ComputerBadge(store.computer, size: 32)
- Text(store.hostName).font(.body.weight(.semibold)).foregroundStyle(Palette.text)
- .frame(maxWidth: .infinity, alignment: .leading)
- if inAccount != nil {
- Image(systemName: "person.crop.circle.badge.checkmark")
- .foregroundStyle(Palette.tertiary)
- .accessibilityLabel(L10n.tr("In your account"))
- }
- }
- connectionDetail
- if store.isOffline, let ask {
- Button(accounts.pendingAccess[store.computer.id] == nil ? "Ask for access" : "Show code", action: ask)
- .buttonStyle(.secondary)
- }
- }
- .contentShape(Rectangle())
- .contextActions {
- var items = [
- MenuItem("Color", icon: "paintpalette") { coloring = true },
- ]
- if store.connection == .online {
- items.append(MenuItem("Extensions", icon: "square.grid.2x2", action: openMarketplace))
- items.append(MenuItem("Voice chat", icon: "waveform") { voiceSettings = true })
- }
- if store.screen != nil, store.connection == .online {
- items.append(MenuItem("Screen", icon: "display", action: openScreen))
- }
- if let revoke {
- items.append(MenuItem("Revoke this iPhone's access", icon: "lock.slash", destructive: true, divider: true, action: revoke))
- }
- if inAccount == nil {
- items.append(MenuItem("Remove", icon: "trash", destructive: true, divider: revoke == nil, action: remove))
- }
- return items
- }
- .codyncSheet(isPresented: $voiceSettings) { VoiceChatSettingsView().environment(store) }
- .codyncOverlay(isPresented: $coloring) { close in
- ZStack {
- Color.black.opacity(0.35).ignoresSafeArea().onTapGesture(perform: close)
- SwatchPanel(selected: store.computer.color) { id in
- close()
- accounts.setColor(store.computer.id, id)
- }
- .background(Palette.bubbleAgent, in: RoundedRectangle(cornerRadius: 22, style: .continuous))
- .shadow(color: .black.opacity(0.25), radius: 24, y: 10)
- }
- .accessibilityAddTraits(.isModal)
- }
- }
-
- private enum Action: String, Identifiable {
- case extensions, screen, connection, remove
- var id: String { rawValue }
- }
-
- /// Extensions, Screen and Connection each take their own row under the computer.
- private var actions: [Action] {
- var rows: [Action] = []
- if store.connection == .online {
- rows.append(.extensions)
- if store.screen != nil { rows.append(.screen) }
- }
- rows.append(.connection)
- if stale, inAccount == nil { rows.append(.remove) }
- return rows
- }
-
- @ViewBuilder private func actionControl(_ action: Action) -> some View {
- switch action {
- case .extensions:
- Button(action: openMarketplace) {
- RowLabel("Extensions", systemImage: "square.grid.2x2", chevron: true)
- }
- .buttonStyle(.plain)
- case .screen:
- Button(action: openScreen) {
- RowLabel("Screen", systemImage: "display", chevron: true)
- }
- .buttonStyle(.plain)
- case .connection:
- DropdownMenu {
- ConnectionRoute.allCases.map { route in
- MenuItem(RelayCopy.routeTitle(route, cloud: store.computer.cloud), icon: route.icon, selected: route == preference) {
- accounts.setRoute(store.computer.id, route)
- }
- }
- } label: {
- HStack(alignment: .center, spacing: 12) {
- Image(systemName: preference.icon).font(.system(size: 17)).frame(width: 26)
- Text(L10n.tr("Connection"))
- Text(L10n.tr(RelayCopy.routeTitle(preference, cloud: store.computer.cloud)))
- .font(.subheadline)
- .foregroundStyle(Palette.secondary)
- .multilineTextAlignment(.trailing)
- .frame(maxWidth: .infinity, alignment: .trailing)
- Image(systemName: "chevron.up.chevron.down").font(.caption.weight(.semibold)).foregroundStyle(Palette.tertiary)
- }
- .foregroundStyle(Palette.text)
- .contentShape(Rectangle())
- }
- case .remove:
- Button(action: remove) {
- RowLabel("Remove", systemImage: "trash", tint: Palette.danger)
- }
- .buttonStyle(.plain)
- }
- }
-
- private var connectionDetail: some View {
- Text(L10n.tr(detail)).font(.footnote)
- .foregroundStyle(store.isOffline ? Palette.warning : Palette.secondary)
- .fixedSize(horizontal: false, vertical: true)
- }
-
- private var preference: ConnectionRoute { store.computer.route ?? .automatic }
-
- private var stale: Bool { accounts.isStale(store.computer.id) }
-
- private var detail: String {
- guard store.connection == .online else { return accounts.statusText(store) }
- let count = store.roster.count
- let route = RelayCopy.detailSuffix(route: store.hostRoute, cloud: store.computer.cloud)
- return "\(count) bot\(count == 1 ? "" : "s")\(route)"
- }
-}
-
-/// A computer in the account that this iPhone can't use yet.
-struct AccountComputerRow: View {
- let computer: CloudComputer
- let ticket: AccessTicket?
- let ask: () -> Void
- let revoke: () -> Void
-
- var body: some View {
- HStack(spacing: 12) {
- ComputerBadge(Computer(id: computer.computerId, name: computer.name, signKey: computer.signKey, device: computer.device), size: 40)
- .opacity(0.5)
- VStack(alignment: .leading, spacing: 2) {
- Text(computer.name).font(.body.weight(.semibold)).foregroundStyle(Palette.text)
- Text(L10n.tr(detail)).font(.subheadline).foregroundStyle(Palette.secondary).lineLimit(2)
- }
- Spacer()
- if ticket != nil {
- Button(L10n.tr("Code"), action: ask).buttonStyle(.secondary)
- } else if computer.isGranted {
- Button(L10n.tr("Revoke"), role: .destructive, action: revoke).buttonStyle(.secondary)
- } else {
- Button(L10n.tr("Ask for access"), action: ask).buttonStyle(.secondary)
- }
- }
- .padding(.vertical, 2)
- }
-
- private var detail: String {
- let online = computer.isOnline ? "Online" : "Offline"
- if let ticket { return "Waiting for your OK on the computer · \(ticket.code)" }
- return switch computer.access {
- case "granted": "Approved for an earlier install of Codync. Revoke it, then ask again."
- case "pending": "\(online) · A request is waiting"
- default: "\(online) · In your account"
- }
- }
-}
-
-/// An older account identity stays visible; only account management can remove it.
-struct OlderCopyRow: View {
- let computer: CloudComputer
-
- var body: some View {
- HStack(spacing: 12) {
- ComputerBadge(Computer(id: computer.computerId, name: computer.name, signKey: computer.signKey, device: computer.device), size: 40)
- .opacity(0.35)
- VStack(alignment: .leading, spacing: 2) {
- Text(computer.name).font(.body.weight(.semibold)).foregroundStyle(Palette.secondary)
- Text(L10n.tr(detail)).font(.subheadline).foregroundStyle(Palette.tertiary).lineLimit(2)
- }
- Spacer()
- }
- .padding(.vertical, 2)
- }
-
- private var detail: String {
- let seen = computer.lastSeenAt.map { " · last seen \(RelativeTime.day(Date(milliseconds: $0)))" } ?? ""
- return "Older copy of this computer\(seen)"
- }
-}
-
-/// A navigation row label with a trailing chevron.
-struct LinkRow<Content: View>: View {
- @ViewBuilder let content: Content
-
- var body: some View {
- HStack {
- content.foregroundStyle(Palette.text)
- Spacer(minLength: 8)
- Image(systemName: "chevron.right").font(.caption.weight(.semibold)).foregroundStyle(Palette.tertiary)
- }
- .contentShape(Rectangle())
- }
-}
-
-/// The computer color choices: a grid of colored dots, the current one checked.
-private struct SwatchPanel: View {
- let selected: String?
- let pick: (String) -> Void
-
- var body: some View {
- LazyVGrid(columns: Array(repeating: GridItem(.fixed(36), spacing: 10), count: 6), spacing: 10) {
- ForEach(AvatarPalette.colors) { swatch in
- Button { pick(swatch.id) } label: {
- Circle().fill(swatch.color)
- .frame(width: 32, height: 32)
- .overlay {
- if selected == swatch.id {
- Image(systemName: "checkmark").font(.caption.weight(.bold)).foregroundStyle(.white)
- }
- }
- }
- .buttonStyle(.plain)
- .accessibilityLabel(swatch.label)
- .accessibilityAddTraits(selected == swatch.id ? .isSelected : [])
- }
- }
- .padding(14)
- }
-}
-
-private extension ConnectionRoute {
- var icon: String {
- switch self {
- case .automatic: "arrow.triangle.branch"
- case .cloudflareFirst: "cloud"
- case .directOnly: "wifi"
- }
- }
-}
diff --git a/apps/ios/Views/ComputersView.swift b/apps/ios/Views/ComputersView.swift
new file mode 100644
index 00000000..995f7503
--- /dev/null
+++ b/apps/ios/Views/ComputersView.swift
@@ -0,0 +1,380 @@
+import CodyncKit
+import CodyncUI
+import SwiftUI
+
+/// Computer management: every computer this iPhone can use or ask for — paired here and in the
+/// account, merged by computer ID — and the way to pair another.
+struct ComputersView: View {
+ @Environment(AppStore.self) private var app
+ @Environment(AccountStore.self) private var accounts
+ @Environment(\.dismissModal) private var dismissModal
+ @State private var addingComputer = false
+ @State private var confirmForget: Computer?
+ @State private var confirmRevoke: CloudComputer?
+ @State private var access: AccessTarget?
+
+ var body: some View {
+ // One card per computer, so each one's rows read as its own.
+ CardForm {
+ ForEach(accounts.computers) { computer in
+ if let store = accounts.store(for: computer.id) {
+ CardSection {
+ ComputerRows(store: store, inAccount: cloudComputer(computer.id),
+ openScreen: { closeSheet { store.screenRequest = ScreenRequest() } },
+ openMarketplace: { closeSheet { app.marketplace = store.computer.id } },
+ ask: cloudComputer(computer.id).map { c in { access = AccessTarget(computer: c) } },
+ revoke: cloudComputer(computer.id).flatMap { c in c.isGranted ? { confirmRevoke = c } : nil },
+ remove: { confirmForget = computer })
+ }
+ }
+ }
+ ForEach(accountOnly) { computer in
+ CardSection {
+ if accounts.isOlderCopy(computer) {
+ OlderCopyRow(computer: computer)
+ } else {
+ AccountComputerRow(computer: computer, ticket: accounts.pendingAccess[computer.computerId],
+ ask: { access = AccessTarget(computer: computer) },
+ revoke: { confirmRevoke = computer })
+ }
+ }
+ }
+ if !hiddenBots.isEmpty {
+ CardSection("Hidden bots") {
+ ForEach(hiddenBots) { item in
+ let store = item.store, bot = item.bot
+ HStack {
+ CharacterAvatar(bot: bot, size: 28, animated: false)
+ VStack(alignment: .leading, spacing: 1) {
+ Text(bot.name)
+ Text(store.hostName).font(.caption).foregroundStyle(Palette.tertiary)
+ }
+ Spacer()
+ IconButton("Unhide", systemImage: "eye") {
+ withAnimation(Motion.layout) { store.setHidden(bot, false) }
+ }
+ }
+ }
+ }
+ }
+ CardSection(footer: app.account.isSignedIn
+ ? "Computers in your account need your OK on the computer before this iPhone can use them."
+ : "Each bot runs on its own computer. Sign in to see the computers in your account.") {
+ Button {
+ addingComputer = true
+ } label: {
+ Label(L10n.tr("Pair a computer"), systemImage: "qrcode.viewfinder")
+ .foregroundStyle(Palette.text)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
+ }
+ }
+ .refreshable { await accounts.refreshCloud() }
+ .page("Computer management", icon: "gearshape")
+ .tracked(.screenViewed(.computers))
+ .task { await accounts.refreshCloud() }
+ .codyncSheet(isPresented: $addingComputer) {
+ PairingView(inModal: true)
+ }
+ .codyncSheet(item: $access) { target in
+ AccessRequestView(computer: target.computer, pending: accounts.pendingAccess[target.id])
+ }
+ .codyncDialog(L10n.tr("Remove {name}?").replacingOccurrences(of: "{name}", with: confirmForget?.name ?? "computer"),
+ isPresented: Binding(get: { confirmForget != nil }, set: { if !$0 { confirmForget = nil } }),
+ message: "Its bots and conversations stay on that computer. You can pair again any time.") {
+ [DialogAction("Remove", destructive: true) {
+ if let c = confirmForget { Task { await app.removeComputer(c.id) } }
+ }]
+ }
+ .codyncDialog("Revoke this iPhone's access to \(confirmRevoke?.name ?? "the computer")?",
+ isPresented: Binding(get: { confirmRevoke != nil }, set: { if !$0 { confirmRevoke = nil } }),
+ message: "You can ask for access again; the computer will show a new code to confirm.") {
+ [DialogAction("Revoke", destructive: true) {
+ if let c = confirmRevoke { Task { await app.revokeAccess(c.computerId) } }
+ }]
+ }
+ // What failed here (removing, revoking, refreshing) shows over this sheet, not under it at the root,
+ // where the same error clears with this one. In place: a failure right after a confirmation comes
+ // while that dialog's cover is still fading out, and a second cover can't present over it.
+ .codyncDialog("Something went wrong", isPresented: Binding(
+ get: { accounts.lastError != nil }, set: { if !$0 { accounts.lastError = nil } }
+ ), message: accounts.lastError, cancel: "OK", inPlace: true) { [] }
+ }
+
+ private struct AccessTarget: Identifiable {
+ let computer: CloudComputer
+ var id: ComputerID { computer.computerId }
+ }
+
+ private func cloudComputer(_ id: ComputerID) -> CloudComputer? {
+ accounts.cloudComputers.first { $0.computerId == id }
+ }
+
+ /// Account computers this iPhone isn't set up for yet.
+ private var accountOnly: [CloudComputer] {
+ accounts.cloudComputers.filter { c in !accounts.computers.contains { $0.id == c.computerId } }
+ }
+
+ private struct HiddenBot: Identifiable {
+ let store: BotStore
+ let bot: Bot
+ let id: String
+ }
+
+ private var hiddenBots: [HiddenBot] {
+ accounts.computers.compactMap { accounts.store(for: $0.id) }.flatMap { store in
+ store.hiddenBots.map { HiddenBot(store: store, bot: $0, id: "\(store.computer.id)/\($0.id)") }
+ }
+ }
+
+ /// The marketplace and screen open over the app, once this sheet has slid away.
+ private func closeSheet(then open: @escaping @MainActor () -> Void) {
+ dismissModal()
+ Task {
+ try? await Task.sleep(for: .milliseconds(450))
+ open()
+ }
+ }
+}
+
+/// A computer this iPhone can use, as the rows of its card: its connection and whether it's in the account,
+/// then Extensions, Voice chat (its keys live on the computer), Screen, whether it sends push alerts here,
+/// how it's reached and, for a stale pairing, Remove.
+private struct ComputerRows: View {
+ let store: BotStore
+ let inAccount: CloudComputer?
+ let openScreen: () -> Void
+ /// Agents, connectors and skills installed on this computer.
+ let openMarketplace: () -> Void
+ let ask: (() -> Void)?
+ /// Set when this iPhone's access to the computer can be revoked.
+ let revoke: (() -> Void)?
+ let remove: () -> Void
+ @Environment(AccountStore.self) private var accounts
+ @State private var coloring = false
+ @State private var voiceSettings = false
+
+ var body: some View {
+ summary
+ if store.connection == .online {
+ Button(action: openMarketplace) { RowLabel("Extensions", systemImage: "square.grid.2x2", chevron: true) }
+ .buttonStyle(.plain)
+ Button { voiceSettings = true } label: { RowLabel("Voice chat", systemImage: "waveform", chevron: true) }
+ .buttonStyle(.plain)
+ if store.screen != nil {
+ Button(action: openScreen) { RowLabel("Screen", systemImage: "display", chevron: true) }
+ .buttonStyle(.plain)
+ }
+ }
+ Toggle(isOn: Binding(get: { store.computer.notifications ?? true }, set: setNotifications)) {
+ HStack(spacing: 12) {
+ Image(systemName: "bell").font(.system(size: 17)).frame(width: 26)
+ Text(L10n.tr("Push notifications"))
+ }
+ }
+ .toggleStyle(.codync)
+ connection
+ if accounts.isStale(store.computer.id), inAccount == nil {
+ Button(action: remove) { RowLabel("Remove", systemImage: "trash", tint: Palette.danger) }
+ .buttonStyle(.plain)
+ }
+ }
+
+ /// Name, connection, and an access request when this iPhone can't reach the computer.
+ private var summary: some View {
+ VStack(alignment: .leading, spacing: 6) {
+ HStack(spacing: 10) {
+ ComputerBadge(store.computer, size: 32)
+ Text(store.hostName).font(.body.weight(.semibold)).foregroundStyle(Palette.text)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ if inAccount != nil {
+ Image(systemName: "person.crop.circle.badge.checkmark")
+ .foregroundStyle(Palette.tertiary)
+ .accessibilityLabel(L10n.tr("In your account"))
+ }
+ }
+ connectionDetail
+ if store.isOffline, let ask {
+ Button(accounts.pendingAccess[store.computer.id] == nil ? "Ask for access" : "Show code", action: ask)
+ .buttonStyle(.secondary)
+ }
+ }
+ .contentShape(Rectangle())
+ .contextActions {
+ var items = [
+ MenuItem("Color", icon: "paintpalette") { coloring = true },
+ ]
+ if store.connection == .online {
+ items.append(MenuItem("Extensions", icon: "square.grid.2x2", action: openMarketplace))
+ items.append(MenuItem("Voice chat", icon: "waveform") { voiceSettings = true })
+ }
+ if store.screen != nil, store.connection == .online {
+ items.append(MenuItem("Screen", icon: "display", action: openScreen))
+ }
+ if let revoke {
+ items.append(MenuItem("Revoke this iPhone's access", icon: "lock.slash", destructive: true, divider: true, action: revoke))
+ }
+ if inAccount == nil {
+ items.append(MenuItem("Remove", icon: "trash", destructive: true, divider: revoke == nil, action: remove))
+ }
+ return items
+ }
+ .codyncSheet(isPresented: $voiceSettings) { VoiceChatSettingsView().environment(store) }
+ .codyncOverlay(isPresented: $coloring) { close in
+ ZStack {
+ Color.black.opacity(0.35).ignoresSafeArea().onTapGesture(perform: close)
+ SwatchPanel(selected: store.computer.color) { id in
+ close()
+ accounts.setColor(store.computer.id, id)
+ }
+ .background(Palette.bubbleAgent, in: RoundedRectangle(cornerRadius: 22, style: .continuous))
+ .shadow(color: .black.opacity(0.25), radius: 24, y: 10)
+ }
+ .accessibilityAddTraits(.isModal)
+ }
+ }
+
+ /// This computer's push switch: saved here, then the computer is told to alert this iPhone or to stop.
+ private func setNotifications(_ on: Bool) {
+ accounts.setNotifications(store.computer.id, on)
+ PushRegistrar.shared.syncDevice(with: store)
+ Analytics.shared.capture(.settingChanged(.push, on: on))
+ }
+
+ /// How this iPhone reaches the computer: the short name on the row, the whole route in the menu.
+ private var connection: some View {
+ DropdownMenu {
+ ConnectionRoute.allCases.map { route in
+ MenuItem(RelayCopy.routeTitle(route, cloud: store.computer.cloud), icon: route.icon, selected: route == preference) {
+ accounts.setRoute(store.computer.id, route)
+ }
+ }
+ } label: {
+ HStack(spacing: 12) {
+ Image(systemName: preference.icon).font(.system(size: 17)).frame(width: 26)
+ Text(L10n.tr("Connection"))
+ Spacer(minLength: 8)
+ Text(L10n.tr(RelayCopy.routeShortTitle(preference, cloud: store.computer.cloud)))
+ .foregroundStyle(Palette.secondary)
+ .lineLimit(1)
+ Image(systemName: "chevron.up.chevron.down").font(.caption.weight(.semibold)).foregroundStyle(Palette.tertiary)
+ }
+ .foregroundStyle(Palette.text)
+ .contentShape(Rectangle())
+ }
+ }
+
+ private var connectionDetail: some View {
+ Text(L10n.tr(detail)).font(.footnote)
+ .foregroundStyle(store.isOffline ? Palette.warning : Palette.secondary)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+
+ private var preference: ConnectionRoute { store.computer.route ?? .automatic }
+
+ private var detail: String {
+ guard store.connection == .online else { return accounts.statusText(store) }
+ let count = store.roster.count
+ let route = RelayCopy.detailSuffix(route: store.hostRoute, cloud: store.computer.cloud)
+ return "\(count) bot\(count == 1 ? "" : "s")\(route)"
+ }
+}
+
+/// A computer in the account that this iPhone can't use yet.
+private struct AccountComputerRow: View {
+ let computer: CloudComputer
+ let ticket: AccessTicket?
+ let ask: () -> Void
+ let revoke: () -> Void
+
+ var body: some View {
+ HStack(spacing: 12) {
+ ComputerBadge(Computer(id: computer.computerId, name: computer.name, signKey: computer.signKey, device: computer.device), size: 40)
+ .opacity(0.5)
+ VStack(alignment: .leading, spacing: 2) {
+ Text(computer.name).font(.body.weight(.semibold)).foregroundStyle(Palette.text)
+ Text(L10n.tr(detail)).font(.subheadline).foregroundStyle(Palette.secondary).lineLimit(2)
+ }
+ Spacer()
+ if ticket != nil {
+ Button(L10n.tr("Code"), action: ask).buttonStyle(.secondary)
+ } else if computer.isGranted {
+ Button(L10n.tr("Revoke"), role: .destructive, action: revoke).buttonStyle(.secondary)
+ } else {
+ Button(L10n.tr("Ask for access"), action: ask).buttonStyle(.secondary)
+ }
+ }
+ .padding(.vertical, 2)
+ }
+
+ private var detail: String {
+ let online = computer.isOnline ? "Online" : "Offline"
+ if let ticket { return "Waiting for your OK on the computer · \(ticket.code)" }
+ return switch computer.access {
+ case "granted": "Approved for an earlier install of Codync. Revoke it, then ask again."
+ case "pending": "\(online) · A request is waiting"
+ default: "\(online) · In your account"
+ }
+ }
+}
+
+/// An older account identity stays visible; only account management can remove it.
+private struct OlderCopyRow: View {
+ let computer: CloudComputer
+
+ var body: some View {
+ HStack(spacing: 12) {
+ ComputerBadge(Computer(id: computer.computerId, name: computer.name, signKey: computer.signKey, device: computer.device), size: 40)
+ .opacity(0.35)
+ VStack(alignment: .leading, spacing: 2) {
+ Text(computer.name).font(.body.weight(.semibold)).foregroundStyle(Palette.secondary)
+ Text(L10n.tr(detail)).font(.subheadline).foregroundStyle(Palette.tertiary).lineLimit(2)
+ }
+ Spacer()
+ }
+ .padding(.vertical, 2)
+ }
+
+ private var detail: String {
+ let seen = computer.lastSeenAt.map { " · last seen \(RelativeTime.day(Date(milliseconds: $0)))" } ?? ""
+ return "Older copy of this computer\(seen)"
+ }
+}
+
+/// The computer color choices: a grid of colored dots, the current one checked.
+private struct SwatchPanel: View {
+ let selected: String?
+ let pick: (String) -> Void
+
+ var body: some View {
+ LazyVGrid(columns: Array(repeating: GridItem(.fixed(36), spacing: 10), count: 6), spacing: 10) {
+ ForEach(AvatarPalette.colors) { swatch in
+ Button { pick(swatch.id) } label: {
+ Circle().fill(swatch.color)
+ .frame(width: 32, height: 32)
+ .overlay {
+ if selected == swatch.id {
+ Image(systemName: "checkmark").font(.caption.weight(.bold)).foregroundStyle(.white)
+ }
+ }
+ }
+ .buttonStyle(.plain)
+ .accessibilityLabel(swatch.label)
+ .accessibilityAddTraits(selected == swatch.id ? .isSelected : [])
+ }
+ }
+ .padding(14)
+ }
+}
+
+private extension ConnectionRoute {
+ var icon: String {
+ switch self {
+ case .automatic: "arrow.triangle.branch"
+ case .cloudflareFirst: "cloud"
+ case .directOnly: "wifi"
+ }
+ }
+}
diff --git a/apps/ios/Views/RootView.swift b/apps/ios/Views/RootView.swift
index 5dfe25ce..66726448 100644
--- a/apps/ios/Views/RootView.swift
+++ b/apps/ios/Views/RootView.swift
@@ -51,10 +51,7 @@ struct RootView: View {
.id(target.id)
}
}
- .codyncSheet(isPresented: Bindable(app).showComputers) {
- // Holds the pushes inside the sheet (Widgets, Live Activity); no bar shows.
- NavigationStack { SettingsView() }
- }
+ .codyncSheet(isPresented: Bindable(app).showComputers) { ComputersView() }
.codyncSheet(item: Binding(get: { app.marketplace.map(MarketplaceTarget.init) }, set: { app.marketplace = $0?.computerId })) { target in
// Each computer has its own; it's opened from that computer's heading or row.
if let store = accounts.store(for: target.computerId) {
@@ -64,8 +61,8 @@ struct RootView: View {
}
}
- /// The system tab bar. Bots, State and Settings stay in one bar (scroll position and the open thread
- /// stay alive). The bar hides while a thread is open.
+ /// The system tab bar; every tab stays alive (scroll position, open thread) and the bar hides while a
+ /// thread is open.
private var tabs: some View {
TabView(selection: Bindable(app).tab) {
Tab(L10n.tr("Bots"), systemImage: "bubble.left.and.bubble.right.fill", value: AppTab.bots) {
@@ -81,8 +78,8 @@ struct RootView: View {
StateTab()
.safeAreaInset(edge: .bottom, spacing: 0) { AccessBanners() }
}
- Tab(L10n.tr("Settings"), systemImage: "gearshape", value: AppTab.more) {
- SettingsView(embedded: true)
+ Tab(L10n.tr("Settings"), systemImage: "gearshape", value: AppTab.settings) {
+ SettingsView()
.safeAreaInset(edge: .bottom, spacing: 0) { AccessBanners() }
}
}
@@ -96,7 +93,7 @@ struct RootView: View {
switch app.tab {
case .bots: .bots
case .state: .state
- case .more: .more
+ case .settings: .settings
}
}
diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swift
index 065f7400..933e66e9 100644
--- a/apps/ios/Views/SettingsView.swift
+++ b/apps/ios/Views/SettingsView.swift
@@ -2,119 +2,23 @@ import CodyncKit
import CodyncUI
import SwiftUI
-/// Every computer this iPhone can use or ask for — paired here and in the account, merged by
-/// computer ID — plus settings for the selected account.
+/// The Settings tab: what belongs to this iPhone alone (appearance, language, notification permission,
+/// analytics, Start over). Each computer's own settings (voice chat, push, connection, hidden bots) are in
+/// Computer management (`ComputersView`).
struct SettingsView: View {
- /// Pushed on top of another screen rather than opened as its own sheet.
- var pushed = false
- /// The More tab: voice, appearance and the other device settings. The sheet is computers only.
- var embedded = false
@Environment(AppStore.self) private var app
- @Environment(AccountStore.self) private var accounts
- @Environment(\.dismissModal) private var dismissModal
@Environment(\.openURL) private var openURL
@State private var notificationsAllowed: Bool?
- @AppStorage("notificationsEnabled") private var notificationsEnabled = true
@AppStorage(Analytics.enabledKey) private var analyticsEnabled = true
- @State private var addingComputer = false
- @State private var confirmForget: Computer?
- @State private var confirmRevoke: CloudComputer?
- @State private var access: AccessTarget?
@State private var confirmStartOver = false
- @State private var voice: VoiceTarget?
@State private var aboutAnalytics = false
var body: some View {
- cards
- .refreshable { await accounts.refreshCloud() }
- .task { await accounts.refreshCloud() }
- .task { notificationsAllowed = await PushRegistrar.shared.isAllowed() }
- .codyncSheet(isPresented: $addingComputer) {
- PairingView(inModal: true)
- }
- .codyncSheet(item: $voice) { target in VoiceChatSettingsView().environment(target.store) }
- .codyncSheet(isPresented: $aboutAnalytics) { AnalyticsSheet() }
- .codyncSheet(item: $access) { target in
- AccessRequestView(computer: target.computer, pending: accounts.pendingAccess[target.id])
- }
- .codyncDialog(L10n.tr("Remove {name}?").replacingOccurrences(of: "{name}", with: confirmForget?.name ?? "computer"),
- isPresented: Binding(get: { confirmForget != nil }, set: { if !$0 { confirmForget = nil } }),
- message: "Its bots and conversations stay on that computer. You can pair again any time.") {
- [DialogAction("Remove", destructive: true) {
- if let c = confirmForget { Task { await app.removeComputer(c.id) } }
- }]
- }
- .codyncDialog("Revoke this iPhone's access to \(confirmRevoke?.name ?? "the computer")?",
- isPresented: Binding(get: { confirmRevoke != nil }, set: { if !$0 { confirmRevoke = nil } }),
- message: "You can ask for access again; the computer will show a new code to confirm.") {
- [DialogAction("Revoke", destructive: true) {
- if let c = confirmRevoke { Task { await app.revokeAccess(c.computerId) } }
- }]
- }
- // What failed here (removing, revoking, refreshing) shows over this sheet, not under it at the root,
- // where the same error clears with this one. In place: a failure right after a confirmation comes
- // while that dialog's cover is still fading out, and a second cover can't present over it.
- .codyncDialog("Something went wrong", isPresented: Binding(
- get: { accounts.lastError != nil }, set: { if !$0 { accounts.lastError = nil } }
- ), message: accounts.lastError, cancel: "OK", inPlace: true) { [] }
- }
-
- private var cards: some View {
- let form = CardForm {
- if embedded {
- Text(L10n.tr("Settings"))
- .font(.largeTitle.bold())
- .foregroundStyle(Palette.text)
- .accessibilityAddTraits(.isHeader)
- } else {
- CardSection(footer: app.account.isSignedIn
- ? "Computers in your account need your OK on the computer before this iPhone can use them."
- : "Each bot runs on its own computer. Sign in to see the computers in your account.") {
- ForEach(accounts.computers) { computer in
- if let store = accounts.store(for: computer.id) {
- ComputerRow(store: store, inAccount: cloudComputer(computer.id),
- openScreen: { openScreen(store) },
- openMarketplace: { closeSheets { app.marketplace = store.computer.id } },
- ask: cloudComputer(computer.id).map { c in { access = AccessTarget(computer: c) } },
- revoke: cloudComputer(computer.id).flatMap { c in c.isGranted ? { confirmRevoke = c } : nil },
- remove: { confirmForget = computer })
- }
- }
- ForEach(accountOnly) { computer in
- if accounts.isOlderCopy(computer) {
- OlderCopyRow(computer: computer)
- } else {
- AccountComputerRow(computer: computer, ticket: accounts.pendingAccess[computer.computerId],
- ask: { access = AccessTarget(computer: computer) },
- revoke: { confirmRevoke = computer })
- }
- }
- Button {
- addingComputer = true
- } label: {
- Label(L10n.tr("Pair a computer"), systemImage: "qrcode.viewfinder")
- .foregroundStyle(Palette.text)
- .frame(maxWidth: .infinity, alignment: .leading)
- .contentShape(Rectangle())
- }
- .buttonStyle(.plain)
- }
- }
-
- if embedded {
- let online = accounts.computers.compactMap { accounts.store(for: $0.id) }.filter { $0.connection == .online }
- if !online.isEmpty {
- CardSection("Voice chat", footer: "Apple speech on this iPhone, or OpenAI and Gemini on your own API key, kept on the computer.") {
- ForEach(online, id: \.computer.id) { store in
- Button { voice = VoiceTarget(store: store) } label: {
- LinkRow {
- Label(online.count > 1 ? "Voice chat on \(store.hostName)" : L10n.tr("Voice and API keys"), systemImage: "waveform")
- }
- }
- .buttonStyle(.plain)
- }
- }
- }
+ CardForm {
+ Text(L10n.tr("Settings"))
+ .font(.largeTitle.bold())
+ .foregroundStyle(Palette.text)
+ .accessibilityAddTraits(.isHeader)
AppearanceSettings()
@@ -123,12 +27,6 @@ struct SettingsView: View {
ThinkingDetailsSettings()
CardSection("Notifications", footer: "Get a result summary, a request for input, or a failure notice. Notification previews follow your iOS settings.") {
- Toggle(isOn: $notificationsEnabled) { Text(L10n.tr("Push notifications")) }
- .toggleStyle(.codync)
- .onChange(of: notificationsEnabled) { _, on in
- PushRegistrar.shared.resync()
- Analytics.shared.capture(.settingChanged(.push, on: on))
- }
notificationsRow
}
@@ -142,25 +40,6 @@ struct SettingsView: View {
}
}
- if !hiddenBots.isEmpty {
- CardSection("Hidden bots") {
- ForEach(hiddenBots) { item in
- let store = item.store, bot = item.bot
- HStack {
- CharacterAvatar(bot: bot, size: 28, animated: false)
- VStack(alignment: .leading, spacing: 1) {
- Text(bot.name)
- Text(store.hostName).font(.caption).foregroundStyle(Palette.tertiary)
- }
- Spacer()
- IconButton("Unhide", systemImage: "eye") {
- withAnimation(Motion.layout) { store.setHidden(bot, false) }
- }
- }
- }
- }
- }
-
CardSection {
ValueRow("App version", value: Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "")
Button {
@@ -182,83 +61,13 @@ struct SettingsView: View {
}
.buttonStyle(.plain)
}
- }
}
.codyncDialog("Start over?", isPresented: $confirmStartOver,
message: "Signs out of every account and forgets every computer on this iPhone, then shows the welcome again. Your computers keep their bots and chats; pair again to use them.") {
[DialogAction("Start over", destructive: true) { Task { await app.startOver() } }]
}
- return PresentedSettings(embedded: embedded, pushed: pushed) { form }
- }
-
- /// More shows device settings. The sheet and a push add the Computers & settings header.
-private struct PresentedSettings<Content: View>: View {
- let embedded: Bool
- let pushed: Bool
- @ViewBuilder let content: Content
-
- var body: some View {
- if embedded {
- content
- } else {
- content
- .page("Computer management", pushed: pushed, icon: "gearshape")
- // A push → settings, the Computers sheet → computers. The More tab tracks itself.
- .tracked(.screenViewed(pushed ? .settings : .computers))
- }
- }
-}
-
-
- private struct VoiceTarget: Identifiable {
- let store: BotStore
- let id: String
-
- @MainActor init(store: BotStore) {
- self.store = store
- id = store.computer.id
- }
- }
-
- private struct AccessTarget: Identifiable {
- let computer: CloudComputer
- var id: ComputerID { computer.computerId }
- }
-
- private func cloudComputer(_ id: ComputerID) -> CloudComputer? {
- accounts.cloudComputers.first { $0.computerId == id }
- }
-
- /// Account computers this iPhone isn't set up for yet.
- private var accountOnly: [CloudComputer] {
- accounts.cloudComputers.filter { c in !accounts.computers.contains { $0.id == c.computerId } }
- }
-
- private struct HiddenBot: Identifiable {
- let store: BotStore
- let bot: Bot
- let id: String
- }
-
- private var hiddenBots: [HiddenBot] {
- accounts.computers.compactMap { accounts.store(for: $0.id) }.flatMap { store in
- store.hiddenBots.map { HiddenBot(store: store, bot: $0, id: "\(store.computer.id)/\($0.id)") }
- }
- }
-
- /// The Computers sheet slides away before the marketplace or screen opens over the app. On the More
- /// tab those open immediately.
- private func closeSheets(then open: @escaping @MainActor () -> Void) {
- guard !embedded else { open(); return }
- dismissModal()
- Task {
- try? await Task.sleep(for: .milliseconds(450))
- open()
- }
- }
-
- private func openScreen(_ store: BotStore) {
- closeSheets { store.screenRequest = ScreenRequest() }
+ .task { notificationsAllowed = await PushRegistrar.shared.isAllowed() }
+ .codyncSheet(isPresented: $aboutAnalytics) { AnalyticsSheet() }
}
private var notificationsRow: some View {
diff --git a/docs/architecture/file-structure.md b/docs/architecture/file-structure.md
index ee858a72..1f3d15b9 100644
--- a/docs/architecture/file-structure.md
+++ b/docs/architecture/file-structure.md
@@ -108,7 +108,7 @@ Codync/
| Account aggregation / one host mirror | `apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift` / `BotStore.swift` (+ `BotStore+Connection`, `+Sync`, `+Sending`, `+Actions`, `+Plugins`, `+Cache`, `+Shortcuts`) |
| iPhone chat, replies, composer and trace | `apps/ios/Kit/Sources/CodyncUI/Thread/` |
| Reusable iPhone UI chrome | `apps/ios/Kit/Sources/CodyncUI/Chrome.swift`, `Controls.swift`, `Platform.swift` |
-| iOS navigation, pairing, account settings | `apps/ios/Views/RootView.swift`, `BotListView.swift`, `PairingView.swift`, `AccountSwitcherView.swift`, `SettingsView.swift` |
+| iOS navigation, pairing, account, settings, computer management | `apps/ios/Views/RootView.swift`, `BotListView.swift`, `PairingView.swift`, `AccountSwitcherView.swift`, `SettingsView.swift`, `ComputersView.swift` |
| Apple account sessions / public environment config | `apps/ios/App/AccountSession.swift`, `apps/shared/Config/` |
| Desktop local host / SSH lifecycle | `apps/desktop/src/main/host-controller.ts`, `ssh.ts` |
| Desktop store, chat and controls | `apps/desktop/src/renderer/store/bot-store.ts` (actions; state in `bot-mirror.ts`, events stream in `bot-sync.ts`), `views/thread/`, `components/` |
@@ -116,7 +116,7 @@ Codync/
| Cloud assistants (the MCP connector at mcp.codync.dev) | `cloud/src/routes/assistant.ts` (MCP, OAuth metadata, routing to computers), `host-calls.ts` (the relay DO's calls to its host); `host/src/chat/team/assistant.rs` (the switch, the tools, the replies) |
| Push encryption / APNs delivery / decryption | `host/src/remote/push.rs`, `relay/src/`, `apps/ios/NotificationService/` |
| Widget and activity rendering | `apps/ios/Kit/Sources/CodyncKit/Design/`, `apps/ios/Widgets/` |
-| Android screens (one file per iOS view: `BotListView.kt`, `ChatScreen.kt`, `BotDetailsView.kt` (+ `BotSettingsForm.kt`, `BotTemplateView.kt`), `PairingView.kt`, `SettingsView.kt`, …) | `apps/android/app/src/main/kotlin/com/codync/android/` |
+| Android screens (one file per iOS view: `BotListView.kt`, `ChatScreen.kt`, `BotDetailsView.kt` (+ `BotSettingsForm.kt`, `BotTemplateView.kt`), `PairingView.kt`, `SettingsView.kt`, `ComputersView.kt`, …) | `apps/android/app/src/main/kotlin/com/codync/android/` |
| Android components and glass | `apps/android/design/` (`Controls.kt`, `Chrome.kt`, `Sheet.kt`, `Menus.kt`, `Dialog.kt`, `Glass.kt`) |
| Android transport, pairing and wire models | `apps/android/core/` (`EncryptedChannel.kt`, `HostConnector.kt`, `Pairing.kt`, `Compatibility.kt`) |
| Android widgets, Live updates, push | `apps/android/app/` (`CodyncWidgets.kt`, `WidgetCards.kt`, `LiveUpdateGallery.kt`, `PushService.kt`) |
diff --git a/docs/design/mobile-widgets.md b/docs/design/mobile-widgets.md
index 2924a062..8f6e1aa5 100644
--- a/docs/design/mobile-widgets.md
+++ b/docs/design/mobile-widgets.md
@@ -37,7 +37,7 @@ Widget 與 Live Activity 的頭像用 `CharacterAvatar(… still: true)`:畫
- Claude 使用既有暖色;Codex 使用藍色;其他 provider 用 accent 墨色;90% 以上顯示警示色。
- 採平面深淺色表面、小型圖示、11–13 pt 標籤;大字只用於主要數值。
- App 的 Usage 卡片同步縮小字級、圖示、內距,並使用同一款刻度條。
-- 底部的 State 分頁以頂部切換呈現 Widget/Live Activity/Dynamic Island 三頁;用量上限從右上角圖示開成 sheet。Computers & settings 不再放這些入口。
+- 底部的 State 分頁以頂部切換呈現 Widget/Live Activity/Dynamic Island 三頁;用量上限從右上角圖示開成 sheet。設定分頁與電腦管理都不放這些入口。
- Widget 頁提供類型/provider/大小切換、三種主畫面尺寸預覽與設定教學。加入 widget 的教學(`WidgetSetupDemo.swift`)用 SwiftUI 畫出一支 iPhone,手指實際演出長按、Edit、Add Widget、找到 Codync、Add Widget、Done;整段由單一時鐘驅動,會循環,可暫停/播放,也可以拖曳進度條。
- 「Lock Screen widgets」頁可切換 Bots/Usage limits,預覽圓形、矩形與行內形式。正式 widget 與預覽共用 `AccessoryWidgetCard`。
- 設定清單讀取實際電腦配對狀態與 `WidgetCenter` 的已安裝配置;不以點過教學當作完成。
diff --git a/docs/design/push-and-live-activity.md b/docs/design/push-and-live-activity.md
index cda4177b..4749fb10 100644
--- a/docs/design/push-and-live-activity.md
+++ b/docs/design/push-and-live-activity.md
@@ -19,7 +19,7 @@ The encrypted title is limited to 80 characters and the body to 400 characters.
Notification actions open the scoped conversation. Permission approval still requires the normal in-app permission card. An account mismatch does not navigate into another account. Notifications are grouped by computer plus bot. Muted and hidden bots do not alert. The existing host-wide suppression while an iOS event connection is open remains in place; independent foreground suppression for multiple phones is not implemented.
-Use Settings → Notifications to switch push notifications off for this iPhone (the app calls `unregisterDevice`, so every computer drops its alert ticket; Live Activities are unaffected), and to request access or open the iOS notification settings. Per-bot notification preferences remain in the bot editor. State → Live Activity controls automatic activity creation and shows system authorization. Turning it off ends this phone's activities. State → Dynamic Island shows the same switch: iOS renders one activity in both places and offers no island-only opt-out. Under the bot's row (above Review when the bot needs you), the Lock Screen card shows a progress line, four segments in the state's color that fill as the task moves (one while sending or queued, two while working, three when the bot needs you, four once it ends), the same line as Android's Live update. The expanded island centers the bot name and current step under the camera, between the avatar and the orb (both vertically centered), so no text reaches the island's 44 pt corners. Its bottom row shows the elapsed time (from `startedAt`, counted by the system) or, when the bot needs you, a Review button that opens the conversation.
+Each computer's card in Computer management has a Push notifications switch: off saves it with that computer on this phone and calls `unregisterDevice` on that computer only, so it drops its alert ticket while the others keep theirs (Live Activities are unaffected; Android pairs one computer, so its switch stays a phone preference). Settings → Notifications requests access or opens the system notification settings. Per-bot notification preferences remain in the bot editor. State → Live Activity controls automatic activity creation and shows system authorization. Turning it off ends this phone's activities. State → Dynamic Island shows the same switch: iOS renders one activity in both places and offers no island-only opt-out. Under the bot's row (above Review when the bot needs you), the Lock Screen card shows a progress line, four segments in the state's color that fill as the task moves (one while sending or queued, two while working, three when the bot needs you, four once it ends), the same line as Android's Live update. The expanded island centers the bot name and current step under the camera, between the avatar and the orb (both vertically centered), so no text reaches the island's 44 pt corners. Its bottom row shows the elapsed time (from `startedAt`, counted by the system) or, when the bot needs you, a Review button that opens the conversation.
## Responsibilities and privacy
diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.md
index 2b54b9db..07a163b8 100644
--- a/docs/design/ui-conventions.md
+++ b/docs/design/ui-conventions.md
@@ -48,7 +48,7 @@ Usage row shows no number; it opens Settings' Usage page with the same per-provi
## Account menu and Settings (desktop)
-The chat window's account menu copies Grok Bot's: Usage, Get Codync for mobile, Support, Settings, then the signed-in account and Sign out. Everything else is a page of **Settings**, laid out like ChatGPT's desktop settings (references in `reference/chatgpt-settings-*.png`): a sidebar of pages under small group labels (Personal: General, Voice chat, Usage; This Mac, or This computer on Linux: Computers, Updates) and a large page title over the page's sections. Manage computers and approval badges lead to the Computers page. The iPhone's Settings tab, to the right of State in the same bar, shows voice, appearance and the other device settings. Manage computers, and links, open a sheet titled Computer management that lists only the computers. Source: `apps/desktop/src/renderer/views/settings/SettingsView.tsx`, account menu in `apps/desktop/src/renderer/views/PanelMenus.tsx`.
+The chat window's account menu copies Grok Bot's: Usage, Get Codync for mobile, Support, Settings, then the signed-in account and Sign out. Everything else is a page of **Settings**, laid out like ChatGPT's desktop settings (references in `reference/chatgpt-settings-*.png`): a sidebar of pages under small group labels (Personal: General, Voice chat, Usage; This Mac, or This computer on Linux: Computers, Updates) and a large page title over the page's sections. Manage computers and approval badges lead to the Computers page. The phone apps' Settings tab (iPhone and Android), to the right of State in the same bar, holds only what belongs to the phone itself: appearance, language, thinking details, notification permission, usage analytics and Start over. Anything that belongs to one computer lives in Computer management, the sheet Manage computers and links open: one card per computer with its name and status, then Extensions, Voice chat (its keys live on that computer), Screen, Push notifications (whether that computer alerts this phone) and Connection as rows (Connection shows the route's short name; its menu has the whole route), then Hidden bots, and Pair a computer in a card of its own. Source: `apps/desktop/src/renderer/views/settings/SettingsView.tsx`, account menu in `apps/desktop/src/renderer/views/PanelMenus.tsx`.
## iPhone and desktop code
diff --git a/docs/features/voice-call.md b/docs/features/voice-call.md
index 45b98aad..7d035515 100644
--- a/docs/features/voice-call.md
+++ b/docs/features/voice-call.md
@@ -205,7 +205,7 @@ built into the host and the app (today `gpt-realtime-2.1`, `gpt-transcribe`, `gp
list arrives.
Voice settings (`VoiceChatSettingsView`) open from the call bar's gear and from settings: on the
-iPhone and Android, **Settings → Voice chat** (Android’s row reads **Voice and API keys**); on the desktop, **Settings → Voice chat** (this
+iPhone and Android, **Voice chat** on the computer's card in **Manage computers**; on the desktop, **Settings → Voice chat** (this
computer) or the waveform button on a computer's card in **Computers & devices**. Keys are entered
on the computer only: the host takes `setVoiceKey` from loopback, and the iPhone shows whether a key
is there and can test it. Picking a cloud engine shows its key form instead of the on-device settings: a secure field, a link
diff --git a/docs/guides/accounts-and-ssh.md b/docs/guides/accounts-and-ssh.md
index 1e661bbb..fffe1410 100644
--- a/docs/guides/accounts-and-ssh.md
+++ b/docs/guides/accounts-and-ssh.md
@@ -176,8 +176,8 @@ References:
The iOS app now uses the same ClerkKit dependency and shared AccountSession.
Its top-left button opens Accounts. Settings, the tab to the right of State,
-shows voice, appearance and the other device settings. Manage computers
-opens Computer management, which lists only the computers. The iOS native application must be registered in the same Clerk
+holds the phone's own settings. Manage computers opens Computer management,
+which holds each computer's settings. The iOS native application must be registered in the same Clerk
instance with bundle ID `com.pokai.Codync.ios` and its own callback
`com.pokai.Codync.ios://callback`. The iOS public configuration is in
`apps/shared/Config/<env>.plist`. The repository configuration does not prove
diff --git a/docs/plans/android-app.md b/docs/plans/android-app.md
index 5e6c2c5a..19024ae2 100644
--- a/docs/plans/android-app.md
+++ b/docs/plans/android-app.md
@@ -15,8 +15,8 @@ emulator against a real host; device acceptance is listed separately.
| Area | Android | Remaining |
| --- | --- | --- |
| Welcome/pairing | Ported: welcome crew and chat glimpse, Install (Mac/Linux) and Scan pages with the camera on the page, paste link, Tailscale note, sign-in | Physical optical scan, camera permission denial |
-| Accounts/access | Ported: account sheet and switcher, Computers & settings (connection status, badge color, Revoke this phone's access, older copies removed from the account), account computer access with its code, access banner, `codync-dev://computers` and `codync-dev://plugins` | Provider browser round trip on a device; Revoke and older copies against a signed-in account (covered by cloud request tests only); one computer per phone ([multiple computers are future work](../architecture/overview.md)) |
-| Roster | Ported: rows, menus, pin/hide/delete, New session (bots only), groups, drag to reorder (host-synced order) and TalkBack Move up/down, computer header, pull to refresh (also in Computers & settings) | Multiple computers |
+| Accounts/access | Ported: account sheet and switcher, Computer management (connection status, badge color, Revoke this phone's access, older copies removed from the account), account computer access with its code, access banner, `codync-dev://computers` and `codync-dev://plugins` | Provider browser round trip on a device; Revoke and older copies against a signed-in account (covered by cloud request tests only); one computer per phone ([multiple computers are future work](../architecture/overview.md)) |
+| Roster | Ported: rows, menus, pin/hide/delete, New session (bots only), groups, drag to reorder (host-synced order) and TalkBack Move up/down, computer header, pull to refresh (also in Computer management) | Multiple computers |
| Conversation | Ported: bubbles, Markdown/code, permissions, reactions, quote replies, Full conversation, bot-to-bot exchange lines and their conversation, routine notices that open their routine, files a bot shares (verified download, then the share sheet), sent images full size, pull down to reconnect, jump to latest, read receipts for every conversation on screen | Physical keyboard and TalkBack |
| Composer | Ported: files/photos/paste (groups too, image thumbnails, Paste only when the clipboard holds files), `/` commands (Fast mode, skills listed fresh on `/`), @mentions in groups, call/send/stop/interrupt button | Dictation ([voice call](../features/voice-call.md)): the mic, its recording pill, the engine menu beside it (On device, or OpenAI / Gemini transcribed on the user's key with *Transcribing…*) and the *Couldn't dictate* dialog |
| Bot and group editors | Ported: avatar, profile, agent and model options, Fast mode, workspace folder picker, permissions, activity, connectors, skills (with their details); the bot details sheet (`BotDetailsView`, from the chat's title, a routine notice or Add a fallback): Details (instructions, agent, Use the computer, Routines), Library and Settings tabs saved as you edit, Create template; a group's title opens its editor | The details' Memory tab (see Memory) |
@@ -59,7 +59,7 @@ was walked through on an emulator against a real host.
| What | Code | What it needs |
| --- | --- | --- |
-| Revoke this phone's access (also on Remove of a computer approved through the account); removing older copies of the computer from the account | `core/.../CloudClient.kt` (`revokeAccess`, `removeComputer`), `AppStoreAccount.kt`, `SettingsView.kt` | A signed-in account on the emulator or a phone; only request tests cover it |
+| Revoke this phone's access (also on Remove of a computer approved through the account); removing older copies of the computer from the account | `core/.../CloudClient.kt` (`revokeAccess`, `removeComputer`), `AppStoreAccount.kt`, `ComputersView.kt` | A signed-in account on the emulator or a phone; only request tests cover it |
| Push delivery (alerts, background Live update refresh) | `PushService.kt`, `AppStoreNotifications.kt` | A device with Google Play services running the official build (Firebase and the relay's FCM secret are set up since 2026-10-24). The notification look is covered by `AlertNotificationTest` |
| OpenAI Realtime, Gemini Live and Speech mode with a real key | `WebRtcPeer.kt`, `core/.../OpenAIRealtimeEngine.kt`, `GeminiLiveEngine.kt`, `CloudSpeechEngine.kt` | A provider key on the paired computer; the fallback to on-device voice is verified |
| Remote screen: Chinese IME composition, a hardware keyboard, the TURN relay path and its credential renewal | `ScreenKeys.kt`, `ScreenSession.kt`, `ScreenView.kt` | A computer it's safe to type into, and a signed-in host for the relay; viewing, trackpad and pinch zoom are verified |
diff --git a/docs/reference/analytics-events.md b/docs/reference/analytics-events.md
index e0ad0a60..9806ffda 100644
--- a/docs/reference/analytics-events.md
+++ b/docs/reference/analytics-events.md
@@ -108,15 +108,14 @@ host answers and sends it once the host is up.
|---|---|---|---|
| `bots` | Bots tab | — (always shown) | — |
| `state` | State tab | — | — |
-| `more` | Settings tab | — | — |
| `chat` | a conversation opened | a conversation opened | a conversation opened |
| `trace` | full conversation | full conversation | full trace |
| `bot_details` | bot details | details panel | settings page |
| `memory` | bot memory (Android: the card in bot details, once it scrolls into sight) | memory tab | memory overlay |
| `routines` | routines (iPhone: a routine's editor, the list being part of bot details) | a routine's editor | routines overlay |
| `marketplace` | extensions | extensions | marketplace overlay |
-| `settings` | — | settings | — |
-| `computers` | Computers sheet, from Manage computers or a link | computers & devices | — |
+| `settings` | Settings tab | settings | — |
+| `computers` | Computer management, from Manage computers or a link | computers & devices | — |
| `usage` | usage | usage | usage overlay |
| `account` | account sheet | account panel | — |
| `pairing` | pair a computer after setup (first run: `onboarding_step_viewed`) | pair a phone | pair overlay |
diff --git a/web/content/docs/bots.mdx b/web/content/docs/bots.mdx
index 407643a2..6844ee68 100644
--- a/web/content/docs/bots.mdx
+++ b/web/content/docs/bots.mdx
@@ -85,7 +85,7 @@ Each bot keeps a long-term memory across sessions, which you can read on its **M
- **Order:** drag bots into the order you want. The computer keeps the order, so it's the same on every device. iPhone: touch and hold a bot, then drag it. Desktop: drag it, or select it and press Alt+Up or Alt+Down. Terminal UI: `J` and `K`.
- **Computers:** with more than one computer, each has a heading above its bots. Drag a heading (iPhone: touch and hold it first) to move that computer and its bots up or down; this order stays on the device. Click or tap a heading to fold its bots away.
- **Hide:** iPhone: touch and hold the bot, then **Hide from list**. Desktop: right-click it, then **Hide from sidebar**. A hidden bot sends no notifications. To bring it back:
- - **iPhone:** open **Settings** and tap the eye button (**Unhide**) beside the bot under **Hidden bots**.
+ - **iPhone:** open the computer menu, choose **Manage computers**, and tap the eye button (**Unhide**) beside the bot under **Hidden bots**.
- **Desktop:** open **Settings → General** and click the eye button (**Unhide**) beside the bot under **Hidden bots**.
- **Terminal UI:** press Ctrl+K, type `unhide`, and pick **Unhide** followed by the bot's name.
- **Mark as read:** clears a bot's unread badge, from the same menus.
diff --git a/web/content/docs/conversations.mdx b/web/content/docs/conversations.mdx
index 53c97e1e..72eeb869 100644
--- a/web/content/docs/conversations.mdx
+++ b/web/content/docs/conversations.mdx
@@ -140,7 +140,7 @@ You don't get one when:
Routine runs notify you too. A group chat sends one "done" once its bots have finished answering your message.
-To turn notifications off on the iPhone, open **Settings** and switch off **Push notifications**. Previews, sounds and Focus follow your iOS settings. The push relay and Apple see only a generic line ("Your task is complete. Open Codync to read the result.") plus routing IDs. The bot's name and the message text are encrypted to your iPhone's key and decrypted on the phone. See [Privacy](/docs/privacy).
+To turn notifications off on the iPhone, open the computer menu, choose **Manage computers**, and switch off **Push notifications** on the computer whose alerts you don't want; each computer has its own switch. Previews, sounds and Focus follow your iOS settings. The push relay and Apple see only a generic line ("Your task is complete. Open Codync to read the result.") plus routing IDs. The bot's name and the message text are encrypted to your iPhone's key and decrypted on the phone. See [Privacy](/docs/privacy).
### Live Activities
diff --git a/web/content/docs/privacy.mdx b/web/content/docs/privacy.mdx
index bee3e2e3..62d9d089 100644
--- a/web/content/docs/privacy.mdx
+++ b/web/content/docs/privacy.mdx
@@ -41,7 +41,7 @@ On the iPhone, a bot can notify you when it needs you, when it's done, or when i
- Live Activities on the Lock Screen and in the Dynamic Island get only the bot's status from the computer, never message text.
- No notification is sent while the iPhone app is connected to the computer. Muted and hidden bots don't notify.
-To turn notifications off on an iPhone, open **Settings** and turn off **Push notifications**. Each bot's settings have their own notification options.
+To turn notifications off on an iPhone, open the computer menu, choose **Manage computers**, and turn off **Push notifications** on that computer. Each bot's settings have their own notification options.
## Voice
diff --git a/web/content/docs/voice.mdx b/web/content/docs/voice.mdx
index aaefdbac..f1d73649 100644
--- a/web/content/docs/voice.mdx
+++ b/web/content/docs/voice.mdx
@@ -36,7 +36,7 @@ In the Shortcuts app, add Codync's **Open Live Mode** action and pick a **Bot**,
Open **Voice chat** settings from the call bar's gear, or:
-- **iPhone:** **Settings → Voice and API keys**.
+- **iPhone and Android:** open the computer menu, choose **Manage computers**, and tap **Voice chat** on the computer.
- **Desktop app:** **Settings → Voice chat**.
Under **Engine**, pick one. The choice is kept on this device. Changed during a call, it takes over that call once you close the settings; the call goes on, still muted if it was.