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.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(apps): let phone setup choose an account computer or a new one
leepokai2d311ad29621
diff --git a/apps/Codync.xcodeproj/project.pbxproj b/apps/Codync.xcodeproj/project.pbxprojindex bd641ed2..8e9bfca4 100644--- a/apps/Codync.xcodeproj/project.pbxproj+++ b/apps/Codync.xcodeproj/project.pbxproj@@ -71,6 +71,7 @@B1815C13D0D78E99415C2DC2 /* CodyncBot-cloud-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5A21538E748C62E82DF7B139 /* CodyncBot-cloud-Ink.ttf */; };B3450CFD87D4096B3BCA7885 /* CodyncBot-wedge-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C6B96EE690FC5355C9E3D1B5 /* CodyncBot-wedge-Ink.ttf */; };B3554D38F39916698E961A37 /* WidgetGalleryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B22589689593E0089118FDB /* WidgetGalleryView.swift */; };+ B526FFD824131DC9A8BF1499 /* ChooseComputerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A185663BBFC511BF4B4863D3 /* ChooseComputerView.swift */; };B6ECB0743C67903DA1956B29 /* CallControlIntents.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1162D95B42A1BF2EB5EC0E9 /* CallControlIntents.swift */; };BA978F06CB1E58511FFB541B /* WidgetSetupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D8961FADA8810B6CC479705 /* WidgetSetupDemo.swift */; };BCB60463C96AF5725EC4A2C7 /* CodyncBot-hex-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D827E43025A592B41CB68EFD /* CodyncBot-hex-Tint.ttf */; };@@ -174,6 +175,7 @@8D16AD9979C77D976BC832D1 /* Driver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Driver.swift; sourceTree = "<group>"; };8E783FFF5EC2697C16FA2E1B /* CodyncOrb-Ghost.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncOrb-Ghost.ttf"; sourceTree = "<group>"; };9AD0BD16672E128A4F26272B /* SignInButtons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInButtons.swift; sourceTree = "<group>"; };+ A185663BBFC511BF4B4863D3 /* ChooseComputerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChooseComputerView.swift; sourceTree = "<group>"; };A65FE0504B741D0B44DB2516 /* CodyncApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodyncApp.swift; sourceTree = "<group>"; };AAD970B8394F4EDFB85A8936 /* CodyncBot-cloud-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-cloud-Tint.ttf"; sourceTree = "<group>"; };AD18A04CD014230F1B7B0535 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };@@ -331,6 +333,7 @@0814BD0C30F01A163FBDF896 /* AppearanceSettings.swift */,0582B6169BFC36E4BCD51C0D /* BotListView.swift */,70093609851E57B883D23DB9 /* BotRosterLine.swift */,+ A185663BBFC511BF4B4863D3 /* ChooseComputerView.swift */,1FB8080D4CB79347C36A7E75 /* ComputerSection.swift */,6BC00039A6C2C0D3F39A5F67 /* ComputerStatus.swift */,E3E35BCE6E7037B78D22F927 /* ComputersView.swift */,@@ -733,6 +736,7 @@518BD325D0FE6D7AAE973588 /* BotRosterLine.swift in Sources */,E0D116BF893B81AEC0D2135A /* BotShortcuts.swift in Sources */,AF04355DFF3452C3ED0CA641 /* CallControlIntents.swift in Sources */,+ B526FFD824131DC9A8BF1499 /* ChooseComputerView.swift in Sources */,7C20764DC05D499075BC5E8C /* CodyncApp.swift in Sources */,9E1D40B1216F6D46A615277E /* ComputerSection.swift in Sources */,2002C16E427B4E4E7279E1C4 /* ComputerStatus.swift in Sources */,diff --git a/apps/android/WhatsNew.md b/apps/android/WhatsNew.mdindex bd760815..dca07497 100644--- a/apps/android/WhatsNew.md+++ b/apps/android/WhatsNew.md@@ -9,6 +9,7 @@ else a generic "Bug fixes and improvements" line. Delete old sections.## 2.38.1### zh-Hant+- 第一次設定時,如果帳號裡已有電腦,可以向它申請訪問,或配對一臺新電腦(例如 VPS)。安裝頁也能直接複製或分享下載連結到電腦。- bot 用了不只一種智慧體時,列表會在頭像左下角標出各自的智慧體標誌,可在「設定 › 外觀」關閉。- 修正與電腦的連線中斷時,app 可能閃退的問題。- 語音通話中語音辨識偶爾出錯時,會送出已聽到的內容並繼續聆聽,不再直接結束通話。@@ -21,10 +22,10 @@ else a generic "Bug fixes and improvements" line. Delete old sections.- 擴充功能的「已安裝」提示也會顯示技能的圖示。### en-US+- First-time setup offers your account's computers or a new one, plus a download link to share.- When bots use different agents, the bot list shows each one's logo (off in Settings › Appearance).- Fixed a crash when the connection dropped.- A one-off speech error no longer ends a voice call.- Choose Português (Brasil), Русский or Italiano in Settings, or follow your system language.- A QR-paired computer joins your account when it next connects.-- Calls read more clearly, and the call bar shows still dots while the bot is quiet.-- Routine and trace labels follow your language.+- Calls read more clearly.diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/CloudRefreshTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/CloudRefreshTest.ktnew file mode 100644index 00000000..50d70f8d--- /dev/null+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/CloudRefreshTest.kt@@ -0,0 +1,42 @@+package com.codync.android++import androidx.activity.ComponentActivity+import androidx.compose.ui.test.junit4.createAndroidComposeRule+import com.codync.android.core.CloudClient+import com.codync.android.core.CloudError+import com.codync.android.core.DeviceIdentity+import java.io.IOException+import kotlinx.coroutines.Dispatchers+import kotlinx.coroutines.flow.first+import kotlinx.coroutines.flow.update+import kotlinx.coroutines.runBlocking+import kotlinx.coroutines.withTimeout+import org.junit.Assert.*+import org.junit.Rule+import org.junit.Test++/** First-run setup waits on the account's answer: a failed one ends the wait too, or setup stays on its spinner (iOS `aFailedRefreshEndsSetupsWait`). */+class CloudRefreshTest {+ @get:Rule val compose = createAndroidComposeRule<ComponentActivity>()++ private fun client(failure: IOException) =+ CloudClient("https://cloud.invalid", DeviceIdentity(ByteArray(32) { 1 }, ByteArray(32) { 2 })) { throw failure }++ private fun refresh(accounts: AccountStore, client: CloudClient?) = runBlocking(Dispatchers.Main) {+ withTimeout(10_000) { accounts.state.first { "cloud" !in it.busy } }+ accounts.cloud = client+ accounts.mutableState.update { it.copy(cloudLoaded = false) }+ accounts.refreshCloud()+ withTimeout(10_000) { accounts.state.first { it.cloudLoaded && "cloud" !in it.busy } }+ }++ @Test fun theWaitEndsWithoutACloudAndWhenTheRefreshFails() = compose.withPreviewAccounts { accounts ->+ assertTrue(refresh(accounts, null).cloudComputers.isEmpty())+ // A dropped connection passes quietly.+ assertNull(refresh(accounts, client(IOException("offline"))).error)+ // An answer that stays reaches the dialog.+ val refused = refresh(accounts, client(CloudError(403, "forbidden", "Refused")))+ assertEquals("Refused", refused.error)+ assertTrue(refused.cloudComputers.isEmpty())+ }+}diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/OnboardingTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/OnboardingTest.ktindex d1129daa..886731e6 100644--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/OnboardingTest.kt+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/OnboardingTest.kt@@ -1,8 +1,10 @@package com.codync.android+import androidx.compose.runtime.mutableStateOfimport androidx.compose.ui.test.*import androidx.compose.ui.test.junit4.createComposeRuleimport androidx.lifecycle.viewmodel.compose.viewModel+import com.codync.android.core.CloudComputerimport com.codync.android.core.Computerimport org.junit.Assert.assertTrueimport org.junit.Rule@@ -54,6 +56,67 @@ class OnboardingTest {private fun step() = compose.mainClock.advanceTimeBy(1_000)+ /** Signed in, past the account's answer unless [loaded] says otherwise. */+ private fun signedIn(vararg computers: CloudComputer, loaded: Boolean = true) = AccountContext(loading = false, cloudLoaded = loaded,+ cloudComputers = computers.toList(), account = AccountState(ready = true, configured = true, userId = "user",+ accounts = listOf(SavedAccount("user", "session", "[email protected]", null))))++ @Test fun anAccountWithAComputerChoosesBetweenAskingItAndPairingANewOne() {+ val computer = CloudComputer("account-computer", "Desk", "account-key", online = true)+ compose.setContent { Hosted { CodyncApp(signedIn(computer), emptyMap(), viewModel()) } }+ compose.onNodeWithText("Connect a computer").assertIsDisplayed()+ compose.onNodeWithText("Desk").assertIsDisplayed()+ compose.onNodeWithText("Online · In your account").assertIsDisplayed()+ compose.onNodeWithText("Ask for access").assertIsEnabled()+ compose.onNodeWithText("Skip").assertIsDisplayed()+ compose.onNodeWithText("Install Codync\non your computer").assertDoesNotExist()+ compose.onNodeWithText("Pair a new computer").performClick()+ compose.onNodeWithText("Install Codync\non your computer").assertIsDisplayed()+ compose.onNodeWithContentDescription("Back").performClick()+ compose.onNodeWithText("Connect a computer").assertIsDisplayed()+ }++ @Test fun anEarlierApprovalIsReplacedByAskingNotRevokedFirst() {+ val computer = CloudComputer("account-computer", "Desk", "account-key", online = true, access = "granted")+ compose.setContent { Hosted { CodyncApp(signedIn(computer), emptyMap(), viewModel()) } }+ compose.onNodeWithText("Ask for access").assertIsDisplayed()+ compose.onNodeWithText("Revoke").assertDoesNotExist()+ }++ @Test fun anAccountWithNoComputerGoesStraightToInstallWithTheLinkToSend() {+ compose.setContent { Hosted { CodyncApp(signedIn(), emptyMap(), viewModel()) } }+ compose.onNodeWithText("Install Codync\non your computer").assertIsDisplayed()+ compose.onNodeWithText("Connect a computer").assertDoesNotExist()+ compose.onNodeWithText("https://www.codync.dev/#install").performScrollTo().assertIsDisplayed()+ compose.onNodeWithContentDescription("Share link").assertIsDisplayed()+ compose.onNodeWithText("Sign in there with [email protected] and it shows up here.").assertIsDisplayed()+ }++ @Test fun setupWaitsForTheAccountsAnswerBeforeChoosingAPage() {+ compose.setContent { Hosted { CodyncApp(signedIn(loaded = false), emptyMap(), viewModel()) } }+ compose.onNodeWithText("Install Codync\non your computer").assertDoesNotExist()+ compose.onNodeWithText("Connect a computer").assertDoesNotExist()+ }++ @Test fun aComputerJoiningTheAccountDoesNotPullPairingBackToTheChoice() {+ val context = mutableStateOf(signedIn())+ compose.setContent { Hosted { CodyncApp(context.value, emptyMap(), viewModel()) } }+ compose.onNodeWithText("Continue").performClick()+ compose.onNodeWithText("Scan the pairing code").assertIsDisplayed()+ compose.runOnUiThread { context.value = signedIn(CloudComputer("account-computer", "Desk", "account-key", online = true)) }+ compose.waitForIdle()+ compose.onNodeWithText("Connect a computer").assertDoesNotExist()+ compose.onNodeWithText("Scan the pairing code").assertIsDisplayed()+ }++ @Test fun theChoicePageSkipsSetup() {+ val computer = CloudComputer("account-computer", "Desk", "account-key", online = true)+ var skipped = false+ compose.setContent { Hosted { ChooseComputerView(signedIn(computer), listOf(computer), {}, {}, { skipped = true }) {} } }+ compose.onNodeWithText("Skip").performClick()+ assertTrue(skipped)+ }+@Test fun installStepsFollowTheComputerAndScanKeepsTheChoice() {var skipped = falsecompose.setContent { Hosted { PairingView(AccountContext(loading = false), viewModel(), onSkip = { skipped = true }) } }diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AccessRequestView.kt b/apps/android/app/src/main/kotlin/com/codync/android/AccessRequestView.ktindex 52f9990f..1be46396 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AccessRequestView.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AccessRequestView.kt@@ -80,42 +80,43 @@ private enum class AccessPhase { Renew, Asking, Code, Approved, Failed, Ended }Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(24.dp)) {when (shown) {AccessPhase.Renew -> {- Text("This phone already has approval. If access no longer works, request a new approval on the computer.",+ Text(tr("This phone already has approval. If access no longer works, request a new approval on the computer."),style = Type.body, color = Palette.secondary, textAlign = TextAlign.Center)- Text("This replaces this phone's current approval. The computer must be online to show the new code.",+ Text(tr("This replaces this phone's current approval. The computer must be online to show the new code."),style = Type.footnote, color = Palette.secondary, textAlign = TextAlign.Center)SecondaryButton("Request new approval") { confirmRenewal = false; renewRequest = true; store.requestAccess(computer, renew = true) }}AccessPhase.Approved -> IconLabel("${computer.name} approved this phone", "checkmark.circle.fill", Palette.added, style = Type.headline)AccessPhase.Code -> {val code = ticket?.code.orEmpty()+ val spoken = "${tr("Code")} ${code.toList().joinToString(" ")}"Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(10.dp)) {- Text("Check the code on ${computer.name}", style = Type.headline, color = Palette.text)+ Text(tr("Check the code on ${computer.name}"), style = Type.headline, color = Palette.text)SelectionContainer {Text(if (code.length == 6) "${code.take(3)} ${code.takeLast(3)}" else code,- Modifier.semantics { contentDescription = "Code ${code.toList().joinToString(" ")}" },+ Modifier.semantics { contentDescription = spoken },style = Type.system(52f, FontWeight.SemiBold).copy(fontFamily = FontFamily.Monospace), color = Palette.text)}- Text("Approve only if the computer shows exactly this code. If it doesn't, deny it there: someone may be trying to get in.",+ Text(tr("Approve only if the computer shows exactly this code. If it doesn't, deny it there: someone may be trying to get in."),style = Type.subheadline, color = Palette.secondary, textAlign = TextAlign.Center)}Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {Spinner()- Text("Waiting for approval…", style = Type.subheadline, color = Palette.secondary)+ Text(tr("Waiting for approval…"), style = Type.subheadline, color = Palette.secondary)IconButton("Cancel request", "xmark.circle.fill") { store.cancelAccess(computer.computerId); dismiss() }}}AccessPhase.Failed -> {- Text(failed.orEmpty(), style = Type.body, color = Palette.danger, textAlign = TextAlign.Center)+ Text(tr(failed.orEmpty()), style = Type.body, color = Palette.danger, textAlign = TextAlign.Center)SecondaryButton("Try again") { failed = null; store.requestAccess(computer, renew = renewRequest) }}AccessPhase.Ended -> {- Text(ended.orEmpty(), style = Type.body, color = Palette.secondary, textAlign = TextAlign.Center)+ Text(tr(ended.orEmpty()), style = Type.body, color = Palette.secondary, textAlign = TextAlign.Center)SecondaryButton("Ask again") { ended = null; sawTicket = false; store.requestAccess(computer, renew = renewRequest) }}AccessPhase.Asking -> Column(horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(10.dp)) {Spinner()- Text(if (computer.online != false) "Asking ${computer.name}…" else "${computer.name} is offline. Turn it on to continue.",+ Text(tr(if (computer.online != false) "Asking ${computer.name}…" else "${computer.name} is offline. Turn it on to continue."),style = Type.subheadline, color = Palette.secondary, textAlign = TextAlign.Center)}}@@ -132,8 +133,8 @@ private enum class AccessPhase { Renew, Asking, Code, Approved, Failed, Ended }horizontalArrangement = Arrangement.spacedBy(12.dp)) {Spinner(16.dp)Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(1.dp)) {- Text("Approve on $name", style = Type.subheadline.medium, color = Palette.text)- Text("Code ${ticket.code.take(3)} ${ticket.code.takeLast(3)}", style = Type.footnote.monospacedDigit, color = Palette.secondary)+ Text(tr("Approve on $name"), style = Type.subheadline.medium, color = Palette.text)+ Text("${tr("Code")} ${ticket.code.take(3)} ${ticket.code.takeLast(3)}", style = Type.footnote.monospacedDigit, color = Palette.secondary)}IconButton("Cancel request", "xmark", action = cancel)}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.kt b/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.ktindex c5964d95..af9aaaa0 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.kt@@ -89,7 +89,7 @@ class AccountStore(application: Application) : AndroidViewModel(application) {val lead = withContext(Dispatchers.IO) { local.shortcutLead() }mutableState.update { AccountContext(contextId = local.referenceId, generation = it.generation + 1, account = it.account,computers = computers, lastComputerId = last, shortcutLeadComputer = lead, tasks = PushPreferences.tasks(getApplication()),- setupComplete = complete || computers.isNotEmpty()) }+ setupComplete = complete || computers.isNotEmpty() || Analytics.onboarded) }// A computer that can't open (damaged drafts) is reported; the others, the cloud and the widgets go on.for (computer in computers) try { open(computer) }catch (error: CancellationException) { throw error }@@ -102,7 +102,11 @@ class AccountStore(application: Application) : AndroidViewModel(application) {observeShortcut()refreshCloud()} catch (error: CancellationException) { throw error }- catch (error: Exception) { showError(error) }+ catch (error: Exception) {+ showError(error)+ // No refresh follows: setup would wait on it forever.+ mutableState.update { it.copy(cloudLoaded = true) }+ }}/**diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreAccount.kt b/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreAccount.ktindex 8c5c84b3..beae2e36 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreAccount.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreAccount.kt@@ -31,7 +31,7 @@ fun AccountStore.retryAccounts() { NativeAccounts.retry() }* one connected (`AppStore.retire`), and the account tells the others (iOS `signOut`; connections.md, accounts on a phone).*/fun AccountStore.signOut() = sessionAction {- val old = state.value.account.accounts.firstOrNull { it.userId == state.value.account.userId } ?: return@sessionAction+ val old = state.value.account.current ?: return@sessionAction// Sent first so it still counts toward the account.Analytics.capture(AnalyticsEvent.SignedOut)// The cloud call goes out after Clerk signed out, on a token taken now (it outlives the session).@@ -99,23 +99,17 @@ private suspend fun AccountStore.forget(userId: String) {}fun AccountStore.refreshCloud() = action("cloud") {- val client = cloud ?: return@actiontry {+ val client = cloud ?: return@actionclient.registerDevice(Build.MODEL.take(100))val computers = client.computers()mutableState.update { it.copy(cloudComputers = computers) }- // Signed in to an account with computers, before pairing any (iOS: the same moment): setup is done.- if (computers.isNotEmpty() && !state.value.setupComplete) {- withContext(Dispatchers.IO) { local.completeSetup() }- mutableState.update { it.copy(setupComplete = true) }- }- if (computers.isNotEmpty() && state.value.computers.isEmpty()) Analytics.completeOnboarding(OnboardingVia.Account)} catch (error: IOException) {if (error is CloudError && !error.isTransient) throw error// Runs on every launch and foreground: a dropped connection, a busy cloud or a token not ready// yet fixes itself on the next refresh, so only answers that stay reach the dialog (as on iOS).android.util.Log.i("Codync", "Cloud refresh failed: ${error.message}")- }+ } finally { mutableState.update { it.copy(cloudLoaded = true) } }}/** A pull to refresh: the account's computers, joining a refresh already under way. */@@ -199,6 +193,7 @@ private suspend fun AccountStore.useApprovedComputer(computer: Computer, requesttransitions.withLock { addComputer(computer) }withContext(Dispatchers.IO) { local.completeSetup() }mutableState.update { it.copy(setupComplete = true) }+ Analytics.completeOnboarding(OnboardingVia.Account)refreshCloud()}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/Analytics.kt b/apps/android/app/src/main/kotlin/com/codync/android/Analytics.ktindex c0a038fa..7e1839b4 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/Analytics.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/Analytics.kt@@ -97,7 +97,10 @@ internal object Analytics {} else enqueue(name, installId(stored), extra)}- /** `onboarding_completed`, once per phone until Start over (iOS: its `onboardingCompleted` default), whichever account. */+ /** Setup finished on this phone, in whichever account, until Start over (iOS: its `onboardingCompleted` default). */+ val onboarded: Boolean get() = prefs?.getBoolean("onboarded", false) == true++ /** `onboarding_completed`, once per phone until Start over, whichever account. */fun completeOnboarding(via: OnboardingVia) {val stored = prefs ?: returnif (stored.getBoolean("onboarded", false)) returndiff --git a/apps/android/app/src/main/kotlin/com/codync/android/AnalyticsEvent.kt b/apps/android/app/src/main/kotlin/com/codync/android/AnalyticsEvent.ktindex ad4eaefe..5a5d4cb6 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@@ -106,7 +106,7 @@ internal enum class NotificationAccess(override val wire: String) : CatalogValue}}-internal enum class OnboardingStep(override val wire: String) : CatalogValue { Welcome("welcome"), Install("install"), Scan("scan") }+internal enum class OnboardingStep(override val wire: String) : CatalogValue { Welcome("welcome"), Choose("choose"), Install("install"), Scan("scan") }internal enum class OnboardingVia(override val wire: String) : CatalogValue { Paired("paired"), Account("account"), Skipped("skipped") }@@ -170,9 +170,10 @@ internal enum class NotificationKind(override val wire: String, val category: Stinternal enum class PhoneSetting(override val wire: String) : CatalogValue { Push("push"), LiveActivities("live_activities") }-/** What an outbound link leads to (`install_command`: an install command copied). */+/** What an outbound link leads to (`install_command`: an install command copied; `install_link`: the download link copied or shared). */internal enum class OutboundLink(override val wire: String) : CatalogValue {Github("github"), Issues("issues"), AppStore("app_store"), Demo("demo"), Tailscale("tailscale"), Privacy("privacy"), InstallCommand("install_command"),+ InstallLink("install_link"),}internal enum class VoiceEngineKind(override val wire: String) : CatalogValue {diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppState.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppState.ktindex c181bb2e..d1a44a8a 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AppState.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppState.kt@@ -17,6 +17,8 @@ data class AccountContext(val generation: Int = 0,val account: AccountState = AccountState(),val cloudComputers: List<CloudComputer> = emptyList(),+ /** The account answered (or failed to) at least once, so an empty [cloudComputers] means what it says. */+ val cloudLoaded: Boolean = false,/** Access requests waiting for approval on the computer, with the code to check, by computer ID. */val access: Map<String, AccessTicket> = emptyMap(),/** The request each computer was approved through most recently. */diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ChooseComputerView.kt b/apps/android/app/src/main/kotlin/com/codync/android/ChooseComputerView.ktnew file mode 100644index 00000000..166b0577--- /dev/null+++ b/apps/android/app/src/main/kotlin/com/codync/android/ChooseComputerView.kt@@ -0,0 +1,59 @@+package com.codync.android++import androidx.compose.foundation.background+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.RowScope+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.rememberScrollState+import androidx.compose.foundation.verticalScroll+import androidx.compose.material3.Text+import androidx.compose.runtime.Composable+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.unit.dp+import com.codync.android.core.CloudComputer+import com.codync.android.design.*++/**+ * First run, signed in to an account that already has computers: ask one of them for access, or pair a new+ * one, like a VPS (iOS `ChooseComputerView`). Nothing is asked until a tap. An account with none goes straight to `PairingView`.+ */+@Composable internal fun ChooseComputerView(state: AccountContext, computers: List<CloudComputer>, ask: (CloudComputer) -> Unit,+ pairNew: () -> Unit, skip: () -> Unit, leading: @Composable RowScope.() -> Unit) {+ AnalyticsOnAppear(AnalyticsEvent.OnboardingStepViewed(OnboardingStep.Choose))+ Column(Modifier.fillMaxSize().background(Palette.background)) {+ ScreenHeader(leading)+ Column(Modifier.weight(1f).verticalScroll(rememberScrollState()).padding(horizontal = 24.dp).padding(bottom = 16.dp),+ verticalArrangement = Arrangement.spacedBy(24.dp)) {+ Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {+ Text(tr("Connect a computer"), style = PAGE_TITLE, color = Palette.text)+ Text(tr("Ask a computer in your account for access, or pair a new one, like a VPS."), style = Type.body, color = Palette.secondary)+ }+ CardSection("In your account") {+ for (computer in computers) row {+ AccountComputerRow(computer, state.access[computer.computerId]?.code, asking = computer.computerId in state.asking, ask = { ask(computer) })+ }+ }+ CardSection {+ row {+ Row(Modifier.fillMaxWidth().plainButton(action = pairNew), verticalAlignment = Alignment.CenterVertically,+ horizontalArrangement = Arrangement.spacedBy(12.dp)) {+ Box(Modifier.size(40.dp), contentAlignment = Alignment.Center) { Symbol("plus", size = 22.dp, tint = Palette.text) }+ Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {+ Text(tr("Pair a new computer"), style = Type.body.semibold, color = Palette.text)+ Text(tr("Install Codync on a VPS or another machine."), style = Type.subheadline, color = Palette.secondary)+ }+ Symbol("chevron.right", size = 14.dp, tint = Palette.tertiary)+ }+ }+ }+ }+ Box(Modifier.padding(horizontal = 24.dp).padding(bottom = 12.dp)) { WideButton("Skip", primary = false, action = skip) }+ }+}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.ktindex 3bf28e70..e63becdb 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@@ -24,6 +24,7 @@ import androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.runtime.saveable.rememberSaveableimport androidx.compose.runtime.setValue+import androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.unit.dpimport com.codync.android.core.Bot@@ -33,7 +34,7 @@ import com.codync.android.core.GroupDraftimport com.codync.android.core.LinkStateimport com.codync.android.design.*-private enum class Root { Loading, Welcome, Pairing, Tabs }+private enum class Root { Loading, AwaitingAccount, Welcome, Choose, Pairing, Tabs }/** A new bot or group chat, on the computer it's made on. */private data class NewTarget(val group: Boolean, val computerId: String)@@ -47,6 +48,8 @@ private data class Editing<T>(val computerId: String, val draft: T)*/@Composable fun CodyncApp(app: AccountContext, computers: Map<String, AppState>, accounts: AccountStore) {var welcomed by rememberSaveable { mutableStateOf(false) }+ // In the pairing flow by choice: a computer turning up in the account doesn't pull it back to the choice.+ var pairingNew by rememberSaveable { mutableStateOf(false) }var showAccount by rememberSaveable { mutableStateOf(false) }var showComputers by rememberSaveable { mutableStateOf(false) }var showPairing by rememberSaveable { mutableStateOf(false) }@@ -65,7 +68,7 @@ private data class Editing<T>(val computerId: String, val draft: T)creating = null; access = null; editor = null; groupEditor = null}// A new account or a fresh start drops whatever was open for the old one.- LaunchedEffect(app.generation) { if (handledGeneration != app.generation) { closeAll(); showUsage = false; handledGeneration = app.generation } }+ LaunchedEffect(app.generation) { if (handledGeneration != app.generation) { closeAll(); showUsage = false; pairingNew = false; handledGeneration = app.generation } }// A notification, widget or link: close everything, then pick the tab as the iPhone does (usage on State, the rest over Bots)// and maybe show usage, the computers or extensions.LaunchedEffect(app.navigationRequest) {@@ -82,15 +85,21 @@ private data class Editing<T>(val computerId: String, val draft: T)val signedIn = app.account.userId != null// Every build with accounts requires sign-in (iOS `mustSignIn`); only builds without them pair signed out.val required = app.account.configured- val onboarding = !app.setupComplete && app.computers.isEmpty() && app.cloudComputers.isEmpty()+ val onboarding = !app.setupComplete && app.computers.isEmpty()+ // What the choice page offers: an older copy of a computer doesn't count as one more.+ val askable = app.cloudComputers.filterNot(app::isOlderCopy)val root = when {app.loading || app.account.restoring -> Root.Loadingrequired && !signedIn -> Root.Welcomeonboarding && !welcomed && !signedIn -> Root.Welcome+ // Whether the account has computers decides the first page: none flashes by before that's known.+ onboarding && signedIn && !app.cloudLoaded -> Root.AwaitingAccount+ onboarding && !pairingNew && askable.isNotEmpty() -> Root.Chooseonboarding -> Root.Pairingelse -> Root.Tabs}BackHandler(root == Root.Pairing && !signedIn) { welcomed = false }+ BackHandler(root == Root.Pairing && askable.isNotEmpty()) { pairingNew = false }val states = app.computers.mapNotNull { computers[it.id] }val edit = { computerId: String, bot: Bot ->if (bot.kind == "group") groupEditor = Editing(computerId, GroupDraft.from(bot)) else editor = Editing(computerId, BotDraft.from(bot))@@ -100,19 +109,29 @@ private data class Editing<T>(val computerId: String, val draft: T)CompositionLocalProvider(LocalAccounts provides accounts) {Box(Modifier.fillMaxSize().background(Palette.background)) {AnimatedContent(root, transitionSpec = {- if (initialState == Root.Welcome && targetState == Root.Pairing)+ if ((initialState == Root.Welcome || initialState == Root.Choose) && targetState == Root.Pairing)(slideInHorizontally(Motion.layoutOffset) { it } + fadeIn(Motion.fade())) togetherWith (slideOutHorizontally(Motion.layoutOffset) { -it } + fadeOut(Motion.fade()))- else if (initialState == Root.Pairing && targetState == Root.Welcome)+ else if (initialState == Root.Pairing && (targetState == Root.Welcome || targetState == Root.Choose))(slideInHorizontally(Motion.layoutOffset) { -it } + fadeIn(Motion.fade())) togetherWith (slideOutHorizontally(Motion.layoutOffset) { it } + fadeOut(Motion.fade()))else fadeIn(Motion.fade()) togetherWith fadeOut(Motion.fade())}, label = "Root") { shown ->when (shown) {Root.Loading -> Box(Modifier.fillMaxSize())+ Root.AwaitingAccount -> Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Spinner(28.dp) }// Computers paired before sign-in was required wait in the signed-out context; signing in moves them.Root.Welcome -> WelcomeView(app, accounts, signedOutComputers = if (required) app.computers.size else 0) { welcomed = true }+ Root.Choose -> Box(Modifier.fillMaxSize().safeDrawingPadding()) {+ ChooseComputerView(app, askable, { access = it }, { pairingNew = true }, accounts::skipSetup) {+ AccountSwitcherButton(app) { showAccount = true }+ }+ }Root.Pairing -> Box(Modifier.fillMaxSize().safeDrawingPadding()) {- PairingView(app, accounts, onSkip = accounts::skipSetup) {- if (signedIn) AccountSwitcherButton(app) { showAccount = true } else BackButton { welcomed = false }+ PairingView(app, accounts, onSkip = accounts::skipSetup, onContinue = { pairingNew = true }) {+ when {+ askable.isNotEmpty() -> BackButton { pairingNew = false }+ signedIn -> AccountSwitcherButton(app) { showAccount = true }+ else -> BackButton { welcomed = false }+ }}}Root.Tabs -> MainTabs(app, states, accounts, account = { showAccount = true }, manage = { showComputers = true }, usage = { showUsage = true },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.ktindex 00d681b8..c2ec4760 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt@@ -217,13 +217,16 @@ private const val NETWORK_ICON = "codync.network"}}-/** A computer in the account that this phone can't use yet; [asking] while this phone's request is on its way to it. */-@Composable private fun AccountComputerRow(computer: CloudComputer, code: String?, asking: Boolean, ask: () -> Unit,- revoke: () -> Unit) {+/**+ * A computer in the account that this phone can't use yet; [asking] while this phone's request is on its way to it.+ * [revoke] takes back an earlier install's approval first; without it, asking offers to replace that approval.+ */+@Composable internal fun AccountComputerRow(computer: CloudComputer, code: String?, asking: Boolean, ask: () -> Unit,+ revoke: (() -> Unit)? = null) {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.isGranted && revoke != null -> "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"}@@ -231,11 +234,11 @@ private const val NETWORK_ICON = "codync.network"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)+ Text(tr(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)+ computer.isGranted && revoke != null -> SecondaryButton("Revoke", action = revoke)else -> SecondaryButton("Ask for access", enabled = !asking, action = ask)}}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/PairingView.kt b/apps/android/app/src/main/kotlin/com/codync/android/PairingView.ktindex 5bd8f50e..1b0e0e48 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/PairingView.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/PairingView.kt@@ -1,6 +1,8 @@package com.codync.androidimport android.content.ClipData+import android.content.Context+import android.content.Intentimport androidx.activity.compose.BackHandlerimport androidx.compose.animation.AnimatedContentimport androidx.compose.animation.AnimatedVisibility@@ -51,6 +53,7 @@ import androidx.compose.ui.draw.clipimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.platform.ClipEntryimport androidx.compose.ui.platform.LocalClipboard+import androidx.compose.ui.platform.LocalContextimport androidx.compose.ui.platform.LocalUriHandlerimport androidx.compose.ui.semantics.contentDescriptionimport androidx.compose.ui.semantics.semantics@@ -77,7 +80,7 @@ private enum class ComputerOS { Mac, Linux }* (iOS `PairingView`). In a sheet it has a close button and closes once paired.*/@Composable internal fun PairingView(state: AccountContext, store: AccountStore, inModal: Boolean = false, onSkip: () -> Unit = {},- leading: @Composable RowScope.() -> Unit = {}) {+ onContinue: () -> Unit = {}, leading: @Composable RowScope.() -> Unit = {}) {var step by rememberSaveable { mutableStateOf(Step.Install) }var os by rememberSaveable { mutableStateOf(ComputerOS.Mac) }val dismiss = LocalDismissModal.current@@ -98,7 +101,9 @@ private enum class ComputerOS { Mac, Linux }(slideOutHorizontally(Motion.spring(0.45f)) { if (forward) -it else it } + fadeOut(Motion.spring(0.45f)))}, label = "Pairing step") { shown ->when (shown) {- Step.Install -> InstallPage(os, { os = it }) { step = Step.Scan }+ Step.Install -> InstallPage(os, { os = it }, state.account.current?.address) {+ onContinue(); step = Step.Scan+ }Step.Scan -> ScanPage(state, store, os) { if (inModal) dismiss() }}}@@ -112,7 +117,7 @@ private enum class ComputerOS { Mac, Linux }// MARK: - Install-@Composable private fun InstallPage(os: ComputerOS, choose: (ComputerOS) -> Unit, next: () -> Unit) {+@Composable private fun InstallPage(os: ComputerOS, choose: (ComputerOS) -> Unit, email: String?, next: () -> Unit) {Column(Modifier.fillMaxSize()) {Column(Modifier.weight(1f).verticalScroll(rememberScrollState()).padding(horizontal = 24.dp).padding(bottom = 16.dp),verticalArrangement = Arrangement.spacedBy(24.dp)) {@@ -125,6 +130,13 @@ private enum class ComputerOS { Mac, Linux }Text(tr("Install Codync\non your computer"), style = PAGE_TITLE, color = Palette.text)Text(tr("Your bots run there. This phone is how you talk to them."), style = Type.body, color = Palette.secondary)}+ Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {+ Hint("Send this link to your computer")+ CommandBlock(DOWNLOAD_LINK, records = OutboundLink.InstallLink, share = true)+ // The same account is what lets this phone find the computer afterwards.+ if (email != null) Text(tr("Sign in there with {email} and it shows up here.").replace("{email}", email),+ style = Type.subheadline, color = Palette.secondary)+ }SegmentedChoice(os, listOf(ComputerOS.Mac to "Mac", ComputerOS.Linux to "Linux"), choose)// Copied here, pasted on the computer (a message to yourself, a shared clipboard).Crossfade(os, animationSpec = Motion.fade(), label = "Install steps") { shown ->@@ -142,8 +154,6 @@ private enum class ComputerOS { Mac, Linux }}Text(tr(if (shown == ComputerOS.Mac) "Open Codync and it sets up the host on its own."else "codync-host install keeps it running in the background."), style = Type.subheadline, color = Palette.secondary)- Hint("Every install option")- CommandBlock("https://www.codync.dev/#install", records = OutboundLink.InstallCommand)}}DemoButton()@@ -169,9 +179,10 @@ private enum class ComputerOS { Mac, Linux }/** A small label above a `CommandBlock`. */@Composable private fun Hint(text: String) = Text(tr(text), style = Type.footnote, color = Palette.secondary)-/** A terminal command with a copy button; copying it counts as opening `records`. */-@Composable private fun CommandBlock(command: String, records: OutboundLink? = null) {+/** A terminal command or link with a copy button (and with `share`, the share sheet); either counts as opening `records`. */+@Composable private fun CommandBlock(command: String, records: OutboundLink? = null, share: Boolean = false) {val clipboard = LocalClipboard.current+ val context = LocalContext.currentval scope = rememberCoroutineScope()var copied by remember { mutableStateOf(false) }Row(Modifier.fillMaxWidth().clip(RoundedRectangle(12.dp)).background(Palette.codeBackground).padding(start = 14.dp, end = 4.dp, top = 4.dp, bottom = 4.dp),@@ -188,9 +199,16 @@ private enum class ComputerOS { Mac, Linux }}}}+ if (share) IconButton("Share link", "square.and.arrow.up") {+ records?.let { Analytics.capture(AnalyticsEvent.LinkOpened(it)) }+ context.shareText(command)+ }}}+private fun Context.shareText(text: String) =+ startActivity(Intent.createChooser(Intent(Intent.ACTION_SEND).setType("text/plain").putExtra(Intent.EXTRA_TEXT, text), null))+// MARK: - Scan@Composable private fun ScanPage(state: AccountContext, store: AccountStore, os: ComputerOS, paired: () -> Unit) {@@ -270,7 +288,10 @@ private enum class ComputerOS { Mac, Linux }}}-private val PAGE_TITLE = Type.system(30f, FontWeight.SemiBold).copy(letterSpacing = (-0.5).sp)+internal val PAGE_TITLE = Type.system(30f, FontWeight.SemiBold).copy(letterSpacing = (-0.5).sp)++/** The website's downloads, for whatever the computer runs. */+private const val DOWNLOAD_LINK = "https://www.codync.dev/#install"/** Tailscale gives every device an address in 100.64.0.0/10 on its VPN (`tun`) interface. */private fun tailscaleConnected(): Boolean = try {diff --git a/apps/android/app/src/test/kotlin/com/codync/android/AnalyticsTest.kt b/apps/android/app/src/test/kotlin/com/codync/android/AnalyticsTest.ktindex 2ca96292..6eb4ed47 100644--- a/apps/android/app/src/test/kotlin/com/codync/android/AnalyticsTest.kt+++ b/apps/android/app/src/test/kotlin/com/codync/android/AnalyticsTest.kt@@ -25,6 +25,8 @@ class AnalyticsTest {assertEquals("""{"setting":"live_activities","on":false}""", json(AnalyticsEvent.SettingChanged(PhoneSetting.LiveActivities, false)))assertEquals("""{"via":"link","computer":"fbfcd4f4fe9f876c"}""", json(AnalyticsEvent.ComputerPaired(PairedVia.Link, "tZ1WMzsVltt-fj7mUDwZsg")))assertEquals("{}", json(AnalyticsEvent.SignedOut))+ assertEquals("""{"link":"install_link"}""", json(AnalyticsEvent.LinkOpened(OutboundLink.InstallLink)))+ assertEquals("""{"step":"choose"}""", json(AnalyticsEvent.OnboardingStepViewed(OnboardingStep.Choose)))assertEquals("""{"computers":2,"keys":"moved"}""", json(AnalyticsEvent.SignedOutPairingsMoved(2, MovedKeys.Moved)))assertEquals("""{"computers":1,"keys":"rescan"}""", json(AnalyticsEvent.SignedOutPairingsMoved(1, MovedKeys.Rescan)))assertEquals("""{"engine":"gemini","reconnects":1,"stuck":"none","failure":"connection","ready_ms":1200}""",diff --git a/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift b/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swiftindex b1a5d459..0673261d 100644--- a/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift@@ -35,7 +35,7 @@ public enum AnalyticsEvent: Equatable, Sendable {public enum ReviewCancellation: String, Sendable { case background, interaction, unavailable }public enum Notifications: String, Sendable { case allowed, denied, notAsked = "not_asked" }- public enum OnboardingStep: String, Sendable { case welcome, install, scan }+ public enum OnboardingStep: String, Sendable { case welcome, choose, install, scan }public enum OnboardingVia: String, Sendable { case paired, account, skipped }public enum SignInProvider: String, Sendable { case apple, google, github }public enum SignInFailure: String, Sendable { case cancelled, verification, error }@@ -45,7 +45,7 @@ public enum AnalyticsEvent: Equatable, Sendable {public enum PromptSource: String, Sendable { case settings, widgets }public enum Setting: String, Sendable { case push, liveActivities = "live_activities" }public enum Link: String, Sendable {- case github, issues, appStore = "app_store", demo, tailscale, privacy, installCommand = "install_command"+ case github, issues, appStore = "app_store", demo, tailscale, privacy, installCommand = "install_command", installLink = "install_link"}public enum VoiceEngine: String, Sendable { case onDevice = "on_device", openai, gemini, cloud }public enum VoiceStuck: String, Sendable { case none, connecting, reconnecting, speaking }diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.jsonindex ebd97bd5..722d88bf 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json@@ -71,7 +71,6 @@"Edit profile": "Profil bearbeiten","English": "English","Error": "Fehler",- "Every install option": "Jede Installationsoption","Expand": "Ausklappen","Expanded": "Ausgeklappt","Extensions": "Erweiterungen",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "Routine konnte nicht gestartet werden: {error}","Could not queue routine: {error}": "Routine konnte nicht eingereiht werden: {error}","Retrying at {time}": "Neuer Versuch um {time}",- "Last run {status}": "Letzter Lauf: {status}"+ "Last run {status}": "Letzter Lauf: {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "Frage einen Computer in deinem Konto nach Zugriff an oder kopple einen neuen, etwa einen VPS.",+ "Pair a new computer": "Neuen Computer koppeln",+ "Install Codync on a VPS or another machine.": "Installiere Codync auf einem VPS oder einem anderen Rechner.",+ "Send this link to your computer": "Schicke diesen Link an deinen Computer",+ "Sign in there with {email} and it shows up here.": "Melde dich dort mit {email} an, dann erscheint er hier.",+ "Share link": "Link teilen",+ "Check the code on {name}": "Prüfe den Code auf {name}",+ "Approve on {name}": "Auf {name} genehmigen",+ "Asking {name}…": "{name} wird gefragt…",+ "{name} is offline. Turn it on to continue.": "{name} ist offline. Schalte den Computer ein, um fortzufahren.",+ "{name} didn't approve this request.": "{name} hat diese Anfrage nicht genehmigt.",+ "{name} approved this phone": "{name} hat dieses Telefon genehmigt",+ "{name} approved this iPhone": "{name} hat dieses iPhone genehmigt",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "Dieses Telefon ist bereits genehmigt. Falls der Zugang nicht mehr funktioniert, fordere auf dem Computer eine neue Genehmigung an.",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "Das ersetzt die aktuelle Genehmigung dieses Telefons. Der Computer muss online sein, um den neuen Code anzuzeigen.",+ "Request new approval": "Neue Genehmigung anfordern"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.jsonindex 7087b3b4..6fb50d77 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json@@ -71,7 +71,6 @@"Edit profile": "Editar perfil","English": "English","Error": "Error",- "Every install option": "Cada opción de instalación","Expand": "Expandir","Expanded": "Expandido","Extensions": "Extensiones",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "No se pudo iniciar la rutina: {error}","Could not queue routine: {error}": "No se pudo poner en cola la rutina: {error}","Retrying at {time}": "Reintentando a las {time}",- "Last run {status}": "Última ejecución: {status}"+ "Last run {status}": "Última ejecución: {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "Solicita acceso a una computadora de tu cuenta o vincula una nueva, como un VPS.",+ "Pair a new computer": "Vincular una computadora nueva",+ "Install Codync on a VPS or another machine.": "Instala Codync en un VPS u otra máquina.",+ "Send this link to your computer": "Envía este enlace a tu computadora",+ "Sign in there with {email} and it shows up here.": "Inicia sesión allí con {email} y aparecerá aquí.",+ "Share link": "Compartir enlace",+ "Check the code on {name}": "Comprueba el código en {name}",+ "Approve on {name}": "Aprueba en {name}",+ "Asking {name}…": "Preguntando a {name}…",+ "{name} is offline. Turn it on to continue.": "{name} está sin conexión. Enciéndela para continuar.",+ "{name} didn't approve this request.": "{name} no aprobó esta solicitud.",+ "{name} approved this phone": "{name} aprobó este teléfono",+ "{name} approved this iPhone": "{name} aprobó este iPhone",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "Este teléfono ya tiene aprobación. Si el acceso deja de funcionar, solicita una nueva aprobación en la computadora.",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "Esto reemplaza la aprobación actual de este teléfono. La computadora debe estar en línea para mostrar el nuevo código.",+ "Request new approval": "Solicitar nueva aprobación"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.jsonindex eea978f7..f01e2913 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json@@ -71,7 +71,6 @@"Edit profile": "Modifier le profil","English": "English","Error": "Erreur",- "Every install option": "Chaque option d'installation","Expand": "Développer","Expanded": "Étendu","Extensions": "Extensions",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "Impossible de lancer la routine : {error}","Could not queue routine: {error}": "Impossible de mettre la routine en file d’attente : {error}","Retrying at {time}": "Nouvel essai à {time}",- "Last run {status}": "Dernière exécution : {status}"+ "Last run {status}": "Dernière exécution : {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "Demandez l'accès à un ordinateur de votre compte, ou associez-en un nouveau, comme un VPS.",+ "Pair a new computer": "Associer un nouvel ordinateur",+ "Install Codync on a VPS or another machine.": "Installez Codync sur un VPS ou une autre machine.",+ "Send this link to your computer": "Envoyez ce lien sur votre ordinateur",+ "Sign in there with {email} and it shows up here.": "Connectez-vous-y avec {email} et il apparaîtra ici.",+ "Share link": "Partager le lien",+ "Check the code on {name}": "Vérifiez le code sur {name}",+ "Approve on {name}": "Approuvez sur {name}",+ "Asking {name}…": "Demande à {name}…",+ "{name} is offline. Turn it on to continue.": "{name} est hors ligne. Allumez-le pour continuer.",+ "{name} didn't approve this request.": "{name} n’a pas approuvé cette demande.",+ "{name} approved this phone": "{name} a approuvé ce téléphone",+ "{name} approved this iPhone": "{name} a approuvé cet iPhone",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "Ce téléphone est déjà approuvé. Si l’accès ne fonctionne plus, demandez une nouvelle approbation sur l’ordinateur.",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "Cela remplace l’approbation actuelle de ce téléphone. L’ordinateur doit être en ligne pour afficher le nouveau code.",+ "Request new approval": "Demander une nouvelle approbation"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/it.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/it.jsonindex 2f9c5b23..20b64d93 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/it.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/it.json@@ -427,7 +427,6 @@"Every bot that runs {name} reads and writes the same notes, and so does {name} when you use it outside Codync.": "Ogni bot che esegue {name} legge e scrive le stesse note, e così fa {name} quando lo usi fuori da Codync.","Every device of that account loses access.": "Ogni dispositivo di quell'account perde l'accesso.","Every device of {email}'s account loses access.": "Ogni dispositivo dell'account di {email} perde l'accesso.",- "Every install option": "Ogni opzione di installazione","Everyone answers in turn unless you @mention someone.": "Ognuno risponde a turno, a meno che tu non @menzioni qualcuno.","Everyone answers in turn. @mention a bot to ask just that one.": "Ognuno risponde a turno. @menziona un bot per chiedere solo a lui.","Expand": "Espandi",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "Impossibile avviare la routine: {error}","Could not queue routine: {error}": "Impossibile mettere in coda la routine: {error}","Retrying at {time}": "Nuovo tentativo alle {time}",- "Last run {status}": "Ultima esecuzione: {status}"+ "Last run {status}": "Ultima esecuzione: {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "Richiedi l'accesso a un computer del tuo account o associane uno nuovo, ad esempio un VPS.",+ "Pair a new computer": "Associa un nuovo computer",+ "Install Codync on a VPS or another machine.": "Installa Codync su un VPS o su un'altra macchina.",+ "Send this link to your computer": "Invia questo link al tuo computer",+ "Sign in there with {email} and it shows up here.": "Accedi lì con {email} e comparirà qui.",+ "Share link": "Condividi link",+ "Check the code on {name}": "Controlla il codice su {name}",+ "Approve on {name}": "Approva su {name}",+ "Asking {name}…": "Richiesta a {name}…",+ "{name} is offline. Turn it on to continue.": "{name} è offline. Accendilo per continuare.",+ "{name} didn't approve this request.": "{name} non ha approvato questa richiesta.",+ "{name} approved this phone": "{name} ha approvato questo telefono",+ "{name} approved this iPhone": "{name} ha approvato questo iPhone",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "Questo telefono è già approvato. Se l'accesso non funziona più, richiedi una nuova approvazione sul computer.",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "Sostituisce l'approvazione attuale di questo telefono. Il computer deve essere online per mostrare il nuovo codice.",+ "Request new approval": "Richiedi nuova approvazione"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.jsonindex 62aa1968..3e41eb9f 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json@@ -71,7 +71,6 @@"Edit profile": "プロフィールの編集","English": "English","Error": "エラー",- "Every install option": "すべてのインストール オプション","Expand": "展開","Expanded": "展開済み","Extensions": "拡張機能",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "ルーティンを開始できませんでした:{error}","Could not queue routine: {error}": "ルーティンをキューに追加できませんでした:{error}","Retrying at {time}": "{time} に再試行",- "Last run {status}": "前回の実行: {status}"+ "Last run {status}": "前回の実行: {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "アカウント内のコンピューターにアクセスを要求するか、VPS などの新しいコンピューターをペアリングします。",+ "Pair a new computer": "新しいコンピューターをペアリングする",+ "Install Codync on a VPS or another machine.": "VPS や別のマシンに Codync をインストールします。",+ "Send this link to your computer": "このリンクをコンピューターに送る",+ "Sign in there with {email} and it shows up here.": "そのコンピューターで {email} でサインインすると、ここに表示されます。",+ "Share link": "リンクを共有",+ "Check the code on {name}": "{name} のコードを確認",+ "Approve on {name}": "{name} で承認",+ "Asking {name}…": "{name} に確認しています…",+ "{name} is offline. Turn it on to continue.": "{name} はオフラインです。続けるには電源を入れてください。",+ "{name} didn't approve this request.": "{name} はこのリクエストを承認しませんでした。",+ "{name} approved this phone": "{name} がこの電話を承認しました",+ "{name} approved this iPhone": "{name} がこの iPhone を承認しました",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "この電話はすでに承認されています。アクセスできなくなった場合は、コンピュータで新しい承認をリクエストしてください。",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "この電話の現在の承認が置き換えられます。新しいコードを表示するには、コンピュータがオンラインである必要があります。",+ "Request new approval": "新しい承認をリクエスト"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.jsonindex 16417b93..51d74ee6 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json@@ -71,7 +71,6 @@"Edit profile": "프로필 수정","English": "English","Error": "오류",- "Every install option": "모든 설치 옵션","Expand": "펼치기","Expanded": "펼쳐짐","Extensions": "확장",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "루틴을 시작할 수 없음: {error}","Could not queue routine: {error}": "루틴을 대기열에 넣을 수 없음: {error}","Retrying at {time}": "{time}에 재시도",- "Last run {status}": "마지막 실행: {status}"+ "Last run {status}": "마지막 실행: {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "계정에 있는 컴퓨터에 접근을 요청하거나 VPS 같은 새 컴퓨터를 페어링하세요.",+ "Pair a new computer": "새 컴퓨터 페어링",+ "Install Codync on a VPS or another machine.": "VPS나 다른 컴퓨터에 Codync를 설치합니다.",+ "Send this link to your computer": "이 링크를 컴퓨터로 보내세요",+ "Sign in there with {email} and it shows up here.": "그 컴퓨터에서 {email}(으)로 로그인하면 여기에 표시됩니다.",+ "Share link": "링크 공유",+ "Check the code on {name}": "{name}에서 코드 확인",+ "Approve on {name}": "{name}에서 승인",+ "Asking {name}…": "{name}에 요청하는 중…",+ "{name} is offline. Turn it on to continue.": "{name}이(가) 오프라인입니다. 계속하려면 켜 주세요.",+ "{name} didn't approve this request.": "{name}이(가) 이 요청을 승인하지 않았습니다.",+ "{name} approved this phone": "{name}이(가) 이 휴대폰을 승인했습니다",+ "{name} approved this iPhone": "{name}이(가) 이 iPhone을 승인했습니다",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "이 휴대폰은 이미 승인되었습니다. 접근이 더 이상 되지 않으면 컴퓨터에서 새 승인을 요청하세요.",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "이 휴대폰의 현재 승인을 대체합니다. 새 코드를 표시하려면 컴퓨터가 온라인 상태여야 합니다.",+ "Request new approval": "새 승인 요청"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/pt-BR.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/pt-BR.jsonindex 34c9251d..2660a975 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/pt-BR.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/pt-BR.json@@ -71,7 +71,6 @@"Edit profile": "Editar perfil","English": "English","Error": "Erro",- "Every install option": "Todas as opções de instalação","Expand": "Expandir","Expanded": "Expandido","Extensions": "Extensões",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "Não foi possível iniciar a rotina: {error}","Could not queue routine: {error}": "Não foi possível enfileirar a rotina: {error}","Retrying at {time}": "Nova tentativa às {time}",- "Last run {status}": "Última execução: {status}"+ "Last run {status}": "Última execução: {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "Peça acesso a um computador da sua conta ou pareie um novo, como um VPS.",+ "Pair a new computer": "Parear um novo computador",+ "Install Codync on a VPS or another machine.": "Instale o Codync em um VPS ou outra máquina.",+ "Send this link to your computer": "Envie este link para o seu computador",+ "Sign in there with {email} and it shows up here.": "Entre lá com {email} e ele aparecerá aqui.",+ "Share link": "Compartilhar link",+ "Check the code on {name}": "Confira o código em {name}",+ "Approve on {name}": "Aprove em {name}",+ "Asking {name}…": "Perguntando a {name}…",+ "{name} is offline. Turn it on to continue.": "{name} está offline. Ligue-o para continuar.",+ "{name} didn't approve this request.": "{name} não aprovou esta solicitação.",+ "{name} approved this phone": "{name} aprovou este celular",+ "{name} approved this iPhone": "{name} aprovou este iPhone",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "Este celular já tem aprovação. Se o acesso parar de funcionar, solicite uma nova aprovação no computador.",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "Isso substitui a aprovação atual deste celular. O computador precisa estar online para mostrar o novo código.",+ "Request new approval": "Solicitar nova aprovação"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ru.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ru.jsonindex 46f674a1..f4f0df63 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ru.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ru.json@@ -71,7 +71,6 @@"Edit profile": "Изменить профиль","English": "English","Error": "Ошибка",- "Every install option": "Все варианты установки","Expand": "Развернуть","Expanded": "Развёрнуто","Extensions": "Расширения",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "Не удалось запустить рутину: {error}","Could not queue routine: {error}": "Не удалось поставить рутину в очередь: {error}","Retrying at {time}": "Повтор в {time}",- "Last run {status}": "Последний запуск: {status}"+ "Last run {status}": "Последний запуск: {status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "Запросите доступ к компьютеру из вашего аккаунта или подключите новый, например VPS.",+ "Pair a new computer": "Подключить новый компьютер",+ "Install Codync on a VPS or another machine.": "Установите Codync на VPS или другую машину.",+ "Send this link to your computer": "Отправьте эту ссылку на компьютер",+ "Sign in there with {email} and it shows up here.": "Войдите там как {email}, и он появится здесь.",+ "Share link": "Поделиться ссылкой",+ "Check the code on {name}": "Сверьте код на компьютере {name}",+ "Approve on {name}": "Подтвердите на компьютере {name}",+ "Asking {name}…": "Обращаемся к {name}…",+ "{name} is offline. Turn it on to continue.": "{name} не в сети. Включите компьютер, чтобы продолжить.",+ "{name} didn't approve this request.": "{name}: запрос не подтверждён.",+ "{name} approved this phone": "{name}: этот телефон подтверждён",+ "{name} approved this iPhone": "{name}: этот iPhone подтверждён",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "У этого телефона уже есть подтверждение. Если доступ перестал работать, запросите новое подтверждение на компьютере.",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "Это заменит текущее подтверждение этого телефона. Чтобы показать новый код, компьютер должен быть в сети.",+ "Request new approval": "Запросить новое подтверждение"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.jsonindex 5a588424..285df268 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json@@ -71,7 +71,6 @@"Edit profile": "编辑资料","English": "English","Error": "出错",- "Every install option": "全部安装方式","Expand": "展开","Expanded": "已展开","Extensions": "扩展",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "无法启动例行任务:{error}","Could not queue routine: {error}": "无法将例行任务加入队列:{error}","Retrying at {time}": "将于 {time} 重试",- "Last run {status}": "上次运行:{status}"+ "Last run {status}": "上次运行:{status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "向账户里的电脑申请访问,或配对一台新电脑,例如 VPS。",+ "Pair a new computer": "配对一台新电脑",+ "Install Codync on a VPS or another machine.": "在 VPS 或另一台机器上安装 Codync。",+ "Send this link to your computer": "把这个链接发到你的电脑",+ "Sign in there with {email} and it shows up here.": "在电脑上用 {email} 登录,它就会出现在这里。",+ "Share link": "分享链接",+ "Check the code on {name}": "核对 {name} 上显示的码",+ "Approve on {name}": "在 {name} 上同意",+ "Asking {name}…": "正在询问 {name}…",+ "{name} is offline. Turn it on to continue.": "{name} 已离线。打开它才能继续。",+ "{name} didn't approve this request.": "{name} 没有同意这次申请。",+ "{name} approved this phone": "{name} 已同意这台手机",+ "{name} approved this iPhone": "{name} 已同意这台 iPhone",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "这台手机已获同意。如果访问不再有效,请重新申请,由电脑同意。",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "这会取代这台手机当前的同意。电脑必须在线才能显示新的码。",+ "Request new approval": "重新申请同意"}diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.jsonindex dd3e6357..618e5366 100644--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json@@ -71,7 +71,6 @@"Edit profile": "編輯資料","English": "English","Error": "出錯",- "Every install option": "全部安裝方式","Expand": "展開","Expanded": "已展開","Extensions": "擴充套件",@@ -1782,5 +1781,21 @@"Could not start routine: {error}": "無法啟動例行任務:{error}","Could not queue routine: {error}": "無法將例行任務加入佇列:{error}","Retrying at {time}": "將於 {time} 重試",- "Last run {status}": "上次執行:{status}"+ "Last run {status}": "上次執行:{status}",+ "Ask a computer in your account for access, or pair a new one, like a VPS.": "向賬戶裡的電腦申請訪問,或配對一臺新電腦,例如 VPS。",+ "Pair a new computer": "配對一臺新電腦",+ "Install Codync on a VPS or another machine.": "在 VPS 或另一臺機器上安裝 Codync。",+ "Send this link to your computer": "把這個連結傳到你的電腦",+ "Sign in there with {email} and it shows up here.": "在電腦上用 {email} 登入,它就會出現在這裡。",+ "Share link": "分享連結",+ "Check the code on {name}": "核對 {name} 上顯示的碼",+ "Approve on {name}": "在 {name} 上同意",+ "Asking {name}…": "正在詢問 {name}…",+ "{name} is offline. Turn it on to continue.": "{name} 已離線。開啟它才能繼續。",+ "{name} didn't approve this request.": "{name} 沒有同意這次申請。",+ "{name} approved this phone": "{name} 已同意這臺手機",+ "{name} approved this iPhone": "{name} 已同意這臺 iPhone",+ "This phone already has approval. If access no longer works, request a new approval on the computer.": "這臺手機已獲同意。如果訪問不再有效,請重新申請,由電腦同意。",+ "This replaces this phone's current approval. The computer must be online to show the new code.": "這會取代這臺手機目前的同意。電腦必須在線上才能顯示新的碼。",+ "Request new approval": "重新申請同意"}diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swiftindex 854a5caf..7c453e30 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift@@ -30,6 +30,9 @@ public final class AccountStore {public private(set) var stores: [ComputerID: BotStore] = [:]/// Everything in the account, including computers this device isn't authorized on yet.public private(set) var cloudComputers: [CloudComputer] = []+ /// The account answered (or failed to) at least once, so an empty `cloudComputers` means what it says.+ /// True from the start without a cloud: there's nothing to wait for.+ public private(set) var cloudListLoaded: Bool/// Access requests waiting for approval on the computer, with the SAS to show.public private(set) var pendingAccess: [ComputerID: AccessTicket] = [:]/// The actual request approved most recently, distinct from a previously paired computer.@@ -80,6 +83,7 @@ public final class AccountStore {makeStore: @escaping @MainActor (Computer) -> BotStore) {self.storage = storageself.cloud = cloud+ cloudListLoaded = cloud == nilcomputerOrder = ComputerOrderStore(storage: storage)self.makeStore = makeStoresaved = storage.computers.filter(\.isConsistent)@@ -221,6 +225,7 @@ public final class AccountStore {guard let cloud, !retired else { return }cloudListVersion += 1let version = cloudListVersion+ defer { if version == cloudListVersion { cloudListLoaded = true } }do {// Every refresh, as on Android: signing back in clears the account's signed-out mark, or its computers// drop this iPhone's push tickets again on their next state pull.diff --git a/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swiftindex 59a4a0ab..e332f280 100644--- a/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift+++ b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift@@ -68,6 +68,8 @@ import Testing#expect(try json(.voiceCallQuality(.onDevice, readyMs: nil, reconnects: 0, stuck: .connecting, failure: .none))== #"{"engine":"on_device","failure":"none","reconnects":0,"stuck":"connecting"}"#)#expect(try json(.linkOpened(.installCommand)) == #"{"link":"install_command"}"#)+ #expect(try json(.linkOpened(.installLink)) == #"{"link":"install_link"}"#)+ #expect(try json(.onboardingStepViewed(.choose)) == #"{"step":"choose"}"#)#expect(try json(.signedOutPairingsMoved(computers: 2, keys: .rescan)) == #"{"computers":2,"keys":"rescan"}"#)#expect(AnalyticsEvent.notificationOpened(.needsInput).name == "notification_opened")#expect(AnalyticsEvent.NotificationKind(category: "needsInput") == .needsInput)diff --git a/apps/ios/Kit/Tests/CodyncUITests/AccessRequestTests.swift b/apps/ios/Kit/Tests/CodyncUITests/AccessRequestTests.swiftindex 8506006e..c7b3ccd0 100644--- a/apps/ios/Kit/Tests/CodyncUITests/AccessRequestTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/AccessRequestTests.swift@@ -36,6 +36,43 @@ private final class AccessCloudStub: URLProtocol {}}+/// Answers everything with the status its host starts with: the store's first cloud call fails.+private final class FailingCloudStub: URLProtocol {+ override class func canInit(with request: URLRequest) -> Bool { true }+ override class func canonicalRequest(for request: URLRequest) -> URLRequest { request }+ override func stopLoading() {}++ override func startLoading() {+ let status = Int(request.url?.host?.prefix(3) ?? "") ?? 500+ let response = HTTPURLResponse(url: request.url!, statusCode: status, httpVersion: nil, headerFields: nil)!+ client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed)+ client?.urlProtocolDidFinishLoading(self)+ }+}++/// First-run setup waits on the account's answer: a failed one ends the wait too, or setup stays on its spinner.+/// A busy cloud (503) passes quietly, an answer that stays (403) reaches the dialog; without a cloud there's nothing to wait for.+@MainActor @Test(arguments: [(503, false), (403, true)])+func aFailedRefreshEndsSetupsWait(status: Int, reported: Bool) async {+ let suite = "CloudRefresh.\(UUID().uuidString)"+ defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }+ let config = URLSessionConfiguration.ephemeral+ config.protocolClasses = [FailingCloudStub.self]+ let cloud = CloudClient(baseURL: URL(string: "https://\(status).test")!, identity: DeviceIdentity(signing: .init(), push: .init()),+ session: URLSession(configuration: config)) { "token" }+ let accounts = AccountStore(storage: SharedStore.Context(accountID: "account", suite: suite), cloud: cloud)+ defer { accounts.retire() }+ #expect(!accounts.cloudListLoaded)+ await accounts.refreshCloud()+ #expect(accounts.cloudListLoaded)+ #expect(accounts.cloudComputers.isEmpty)+ #expect((accounts.lastError != nil) == reported)++ let offline = AccountStore(storage: SharedStore.Context(accountID: "account", suite: suite), cloud: nil)+ defer { offline.retire() }+ #expect(offline.cloudListLoaded)+}+/// Signed in with an online computer this device can't use, nothing is asked until the user taps./// Closing the access sheet before the code arrives and opening it again makes one request, which/// goes on in the store and ends with the code in the banner, not pending on the computer unrevealed.@@ -50,7 +87,9 @@ private final class AccessCloudStub: URLProtocol {let storage = SharedStore.Context(accountID: "account", suite: suite)let accounts = AccountStore(storage: storage, cloud: cloud)defer { accounts.retire() }+ #expect(!accounts.cloudListLoaded)await accounts.refreshCloud()+ #expect(accounts.cloudListLoaded)let id = RelayCrypto.computerId(signKey: hostKey)#expect(accounts.cloudComputers.map(\.computerId) == [id])#expect(accounts.pendingAccess.isEmpty)diff --git a/apps/ios/Views/AccessRequestView.swift b/apps/ios/Views/AccessRequestView.swiftindex d04310bb..08f438c4 100644--- a/apps/ios/Views/AccessRequestView.swift+++ b/apps/ios/Views/AccessRequestView.swift@@ -36,21 +36,21 @@ struct AccessRequestView: View {.padding(.top, 32)if confirmRenewal {- Text("This phone already has approval. If access no longer works, request a new approval on the computer.")+ Text(L10n.tr("This phone already has approval. If access no longer works, request a new approval on the computer.")).foregroundStyle(Palette.secondary).multilineTextAlignment(.center)- Text("This replaces this phone's current approval. The computer must be online to show the new code.")+ Text(L10n.tr("This replaces this phone's current approval. The computer must be online to show the new code.")).font(.footnote).foregroundStyle(Palette.secondary).multilineTextAlignment(.center)- Button("Request new approval") {+ Button(L10n.tr("Request new approval")) {withAnimation(Motion.reduced(Motion.layout, reduceMotion)) {renewRequest = trueconfirmRenewal = false}}.buttonStyle(.secondary)} else if approved {- Label("\(computer.name) approved this iPhone", systemImage: "checkmark.circle.fill")+ Label(L10n.tr("\(computer.name) approved this iPhone"), systemImage: "checkmark.circle.fill").font(.headline).foregroundStyle(Palette.added)} else if let ticket {@@ -62,7 +62,7 @@ struct AccessRequestView: View {.font(.system(size: 52, weight: .semibold, design: .monospaced)).foregroundStyle(Palette.text).textSelection(.enabled)- .accessibilityLabel("Code \(ticket.code.map(String.init).joined(separator: " "))")+ .accessibilityLabel("\(L10n.tr("Code")) \(ticket.code.map(String.init).joined(separator: " "))")Text(L10n.tr("Approve only if the computer shows exactly this code. If it doesn't, deny it there: someone may be trying to get in.")).font(.subheadline).foregroundStyle(Palette.secondary)@@ -80,13 +80,13 @@ struct AccessRequestView: View {}.font(.subheadline)} else if let error {- Text(error)+ Text(L10n.tr(error)).foregroundStyle(Palette.danger).multilineTextAlignment(.center)Button(L10n.tr("Try again")) { withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { self.error = nil } }.buttonStyle(.secondary)} else if sawTicket {- Text(outcome ?? "\(computer.name) didn't approve this request.")+ Text(L10n.tr(outcome ?? "\(computer.name) didn't approve this request.")).foregroundStyle(Palette.secondary).multilineTextAlignment(.center)Button(L10n.tr("Ask again")) {@@ -99,7 +99,7 @@ struct AccessRequestView: View {} else {VStack(spacing: 10) {Spinner()- Text(computer.isOnline ? "Asking \(computer.name)…" : "\(computer.name) is offline. Turn it on to continue.")+ Text(L10n.tr(computer.isOnline ? "Asking \(computer.name)…" : "\(computer.name) is offline. Turn it on to continue.")).font(.subheadline).foregroundStyle(Palette.secondary).multilineTextAlignment(.center)diff --git a/apps/ios/Views/ChooseComputerView.swift b/apps/ios/Views/ChooseComputerView.swiftnew file mode 100644index 00000000..afc957a6--- /dev/null+++ b/apps/ios/Views/ChooseComputerView.swift@@ -0,0 +1,63 @@+import CodyncKit+import CodyncUI+import SwiftUI++/// First run, signed in to an account that already has computers: ask one of them for access, or pair a+/// new one (a VPS, say). Nothing is asked until a tap. An account with none goes straight to `PairingView`.+struct ChooseComputerView<Leading: View>: View {+ let computers: [CloudComputer]+ let ask: (CloudComputer) -> Void+ let pairNew: () -> Void+ let skip: () -> Void+ @ViewBuilder var leading: Leading+ @Environment(AccountStore.self) private var accounts++ var body: some View {+ VStack(spacing: 0) {+ ScreenHeader { leading } title: { EmptyView() } trailing: { EmptyView() }++ ScrollView {+ VStack(alignment: .leading, spacing: 24) {+ VStack(alignment: .leading, spacing: 10) {+ Text(L10n.tr("Connect a computer")).pageTitle()+ Text(L10n.tr("Ask a computer in your account for access, or pair a new one, like a VPS."))+ .font(.body)+ .foregroundStyle(Palette.secondary)+ }+ CardSection("In your account") {+ ForEach(computers) { computer in+ AccountComputerRow(computer: computer, ticket: accounts.pendingAccess[computer.computerId]) { ask(computer) }+ }+ }+ CardSection {+ Button(action: pairNew) { pairNewLabel }+ .buttonStyle(.plain)+ }+ }+ .padding(.horizontal, 24)+ .padding(.bottom, 16)+ }++ SkipSetupButton(action: skip)+ }+ .background(Palette.background)+ .tracked(.onboardingStepViewed(.choose))+ }++ private var pairNewLabel: some View {+ HStack(spacing: 12) {+ Image(systemName: "plus")+ .font(.title3)+ .foregroundStyle(Palette.text)+ .frame(width: 40, height: 40)+ VStack(alignment: .leading, spacing: 2) {+ Text(L10n.tr("Pair a new computer")).font(.body.weight(.semibold)).foregroundStyle(Palette.text)+ Text(L10n.tr("Install Codync on a VPS or another machine.")).font(.subheadline).foregroundStyle(Palette.secondary)+ }+ Spacer(minLength: 8)+ Image(systemName: "chevron.right").font(.footnote.weight(.semibold)).foregroundStyle(Palette.tertiary)+ }+ .padding(.vertical, 2)+ .contentShape(Rectangle())+ }+}diff --git a/apps/ios/Views/ComputersView.swift b/apps/ios/Views/ComputersView.swiftindex 7851fba5..13948d7f 100644--- a/apps/ios/Views/ComputersView.swift+++ b/apps/ios/Views/ComputersView.swift@@ -326,11 +326,12 @@ private struct CodyncVersionRow: View {}/// A computer in the account that this iPhone can't use yet.-private struct AccountComputerRow: View {+struct AccountComputerRow: View {let computer: CloudComputerlet ticket: AccessTicket?let ask: () -> Void- let revoke: () -> Void+ /// Takes back an earlier install's approval first; without it, asking offers to replace that approval.+ var revoke: (() -> Void)?var body: some View {HStack(spacing: 12) {@@ -343,7 +344,7 @@ private struct AccountComputerRow: View {Spacer()if ticket != nil {Button(L10n.tr("Code"), action: ask).buttonStyle(.secondary)- } else if computer.isGranted {+ } else if computer.isGranted, let revoke {Button(L10n.tr("Revoke"), role: .destructive, action: revoke).buttonStyle(.secondary)} else {Button(L10n.tr("Ask for access"), action: ask).buttonStyle(.secondary)@@ -356,7 +357,7 @@ private struct AccountComputerRow: View {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 "granted" where revoke != nil: "Approved for an earlier install of Codync. Revoke it, then ask again."case "pending": "\(online) · A request is waiting"default: "\(online) · In your account"}diff --git a/apps/ios/Views/PairingView.swift b/apps/ios/Views/PairingView.swiftindex b79278a8..48186a17 100644--- a/apps/ios/Views/PairingView.swift+++ b/apps/ios/Views/PairingView.swift@@ -9,6 +9,8 @@ struct PairingView<Leading: View>: View {var inModal = false/// Finish onboarding without pairing; modal pairing simply closes when skipped.var onSkip: (() -> Void)? = nil+ /// On past the install page: the user is pairing this way now.+ var onContinue: (() -> Void)? = nil/// Top-left on the first page (back to the welcome, the account switcher).@ViewBuilder var leading: Leading@@ -36,7 +38,7 @@ struct PairingView<Leading: View>: View {ZStack {switch step {case .install:- InstallPage(os: $os) { go(.scan) }+ InstallPage(os: $os) { onContinue?(); go(.scan) }.transition(.move(edge: .leading).combined(with: .opacity))case .scan:ScanPage(os: os) { if inModal { dismissModal() } }@@ -47,18 +49,8 @@ struct PairingView<Leading: View>: View {.clipped()if step == .scan {- Button {- withAnimation(Motion.reduced(Motion.layout, reduceMotion)) {- if inModal { dismissModal() } else { onSkip?() }- }- } label: {- Text(L10n.tr("Skip")).font(.headline).frame(maxWidth: .infinity, minHeight: 50)- }- .buttonStyle(.secondary)- .accessibilityHint("Pair a computer later from Manage computers.")- .padding(.horizontal, 24)- .padding(.bottom, 12)- .transition(.opacity)+ SkipSetupButton { if inModal { dismissModal() } else { onSkip?() } }+ .transition(.opacity)}}.background(Palette.background)@@ -75,13 +67,42 @@ extension PairingView where Leading == EmptyView {init(inModal: Bool) { self.init(inModal: inModal) { EmptyView() } }}+/// Past the setup pages without a computer, at the foot of the page.+struct SkipSetupButton: View {+ let action: () -> Void+ @Environment(\.accessibilityReduceMotion) private var reduceMotion++ var body: some View {+ Button {+ withAnimation(Motion.reduced(Motion.layout, reduceMotion), action)+ } label: {+ Text(L10n.tr("Skip")).font(.headline).frame(maxWidth: .infinity, minHeight: 50)+ }+ .buttonStyle(.secondary)+ .accessibilityHint("Pair a computer later from Manage computers.")+ .padding(.horizontal, 24)+ .padding(.bottom, 12)+ }+}++extension Text {+ /// A setup page's big title.+ func pageTitle() -> some View {+ font(.system(size: 30, weight: .semibold)).tracking(-0.5).foregroundStyle(Palette.text)+ }+}+private enum ComputerOS: Hashable { case mac, linux }// MARK: - Installprivate struct InstallPage: View {+ /// The website's downloads, for whatever the computer runs.+ private static let downloadLink = URL(string: "https://www.codync.dev/#install")!+@Binding var os: ComputerOSlet next: () -> Void+ @Environment(AccountSession.self) private var accountvar body: some View {VStack(alignment: .leading, spacing: 0) {@@ -99,15 +120,23 @@ private struct InstallPage: View {.padding(.top, 8)VStack(alignment: .leading, spacing: 10) {- Text(L10n.tr("Install Codync\non your computer"))- .font(.system(size: 30, weight: .semibold))- .tracking(-0.5)- .foregroundStyle(Palette.text)+ Text(L10n.tr("Install Codync\non your computer")).pageTitle()Text(L10n.tr("Your bots run there. This iPhone is how you talk to them.")).font(.body).foregroundStyle(Palette.secondary)}+ VStack(alignment: .leading, spacing: 10) {+ Hint("Send this link to your computer")+ CommandBlock(Self.downloadLink.absoluteString, records: .installLink, share: Self.downloadLink)+ // The same account is what lets this phone find the computer afterwards.+ if let email = account.email {+ Text(L10n.tr("Sign in there with {email} and it shows up here.").replacingOccurrences(of: "{email}", with: email))+ .font(.subheadline)+ .foregroundStyle(Palette.secondary)+ }+ }+SegmentedChoice(selection: $os, options: [(.mac, "Mac"), (.linux, "Linux")])VStack(alignment: .leading, spacing: 10) {@@ -129,8 +158,6 @@ private struct InstallPage: View {.font(.subheadline).foregroundStyle(Palette.secondary).contentTransition(.opacity)- Hint("Every install option")- CommandBlock("https://www.codync.dev/#install", records: .installCommand)}.animation(Motion.layout, value: os)@@ -160,15 +187,17 @@ private struct Hint: View {}}-/// A terminal command with a copy button; copying it counts as opening `records`.+/// A terminal command or link with a copy button; copying it (or sharing `share`) counts as opening `records`.private struct CommandBlock: View {let command: Stringlet records: AnalyticsEvent.Link?+ let share: URL?@State private var copied = false- init(_ command: String, records: AnalyticsEvent.Link? = nil) {+ init(_ command: String, records: AnalyticsEvent.Link? = nil, share: URL? = nil) {self.command = commandself.records = records+ self.share = share}var body: some View {@@ -190,6 +219,16 @@ private struct CommandBlock: View {}}.contentTransition(.symbolEffect(.replace))+ if let share {+ ShareLink(item: share) {+ Label(L10n.tr("Share link"), systemImage: "square.and.arrow.up")+ }+ .labelStyle(.iconOnly)+ .buttonStyle(IconButtonStyle())+ .simultaneousGesture(TapGesture().onEnded {+ if let records { Analytics.shared.capture(.linkOpened(records)) }+ })+ }}.padding(.leading, 14).padding(.trailing, 4)@@ -222,10 +261,7 @@ private struct ScanPage: View {ScrollView {VStack(alignment: .leading, spacing: 24) {VStack(alignment: .leading, spacing: 10) {- Text(L10n.tr("Scan the pairing code"))- .font(.system(size: 30, weight: .semibold))- .tracking(-0.5)- .foregroundStyle(Palette.text)+ Text(L10n.tr("Scan the pairing code")).pageTitle()Text(os == .mac? L10n.tr("On your Mac, click Codync in the menu bar, then Pair iPhone."): L10n.tr("On your computer, run this in a terminal:"))diff --git a/apps/ios/Views/RootView.swift b/apps/ios/Views/RootView.swiftindex b645ac1a..53090f69 100644--- a/apps/ios/Views/RootView.swift+++ b/apps/ios/Views/RootView.swift@@ -11,6 +11,10 @@ struct RootView: View {@Environment(\.accessibilityReduceMotion) private var reduceMotion/// First launch only: past the welcome, on to setup.@State private var welcomed = false+ /// In the pairing flow by choice: a computer turning up in the account doesn't pull it back to the choice.+ @State private var pairingNew = false+ /// The account computer the choice page is asking for access.+ @State private var asking: CloudComputer?/// The open bot, as a NavigationStack path.private var path: Binding<[BotReference]> {@@ -23,29 +27,17 @@ struct RootView: View {// Computers paired before sign-in was required wait in the signed-out context.WelcomeView(signedOutComputers: accounts.computers.count) {}.transition(.opacity)- } else if !onboardingCompleted && accounts.computers.isEmpty && accounts.cloudComputers.isEmpty {- if !welcomed && !account.isSignedIn {- WelcomeView { withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { welcomed = true } }- .transition(.move(edge: .leading).combined(with: .opacity))- } else {- PairingView(onSkip: { completeOnboarding(via: .skipped) }) {- if account.isSignedIn {- AccountSwitcherButton()- } else {- BackButton { withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { welcomed = false } }- }- }- .transition(.move(edge: .trailing).combined(with: .opacity))- }+ } else if !onboardingCompleted && accounts.computers.isEmpty {+ setup} else {tabs}}.background(Palette.background)- .onChange(of: accounts.computers.isEmpty && accounts.cloudComputers.isEmpty, initial: true) { _, empty in- // Pairing, signing in to an account that has computers, or explicitly skipping completes+ .onChange(of: accounts.computers.isEmpty, initial: true) { _, empty in+ // Reaching a computer (paired, or approved through the account) or explicitly skipping completes// setup. Keep this device-level milestone across account changes and unpairing.- if !empty { completeOnboarding(via: accounts.cloudComputers.isEmpty ? .paired : .account) }+ if !empty { completeOnboarding(via: accounts.approvedAccess.isEmpty ? .paired : .account) }}.codyncDialog("Something went wrong", isPresented: errorShown, message: errorMessage, cancel: "OK", inPlace: true) { [] }.codyncOverlay(isPresented: Binding(get: { screenTarget.wrappedValue != nil }, set: { if !$0 { screenTarget.wrappedValue = nil } })) { close in@@ -56,6 +48,10 @@ struct RootView: View {}}.codyncSheet(isPresented: Bindable(app).showComputers) { ComputersView() }+ // Here, not on the choice page: approval replaces that page while this sheet says so.+ .codyncSheet(item: $asking) { computer in+ AccessRequestView(computer: computer, pending: accounts.pendingAccess[computer.computerId])+ }.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) {@@ -65,6 +61,37 @@ struct RootView: View {}}+ /// First run, until a computer is reached or setup is skipped.+ @ViewBuilder+ private var setup: some View {+ if !welcomed && !account.isSignedIn {+ WelcomeView { animateSetup { welcomed = true } }+ .transition(.move(edge: .leading).combined(with: .opacity))+ } else if account.isSignedIn && !accounts.cloudListLoaded {+ // Whether the account has computers decides the first page: none flashes by before that's known.+ Spinner(size: 28)+ .frame(maxWidth: .infinity, maxHeight: .infinity)+ .transition(.opacity)+ } else if !pairingNew && !askableComputers.isEmpty {+ ChooseComputerView(computers: askableComputers, ask: { asking = $0 },+ pairNew: { animateSetup { pairingNew = true } }, skip: { completeOnboarding(via: .skipped) }) {+ AccountSwitcherButton()+ }+ .transition(.move(edge: .leading).combined(with: .opacity))+ } else {+ PairingView(onSkip: { completeOnboarding(via: .skipped) }, onContinue: { pairingNew = true }) {+ if !askableComputers.isEmpty {+ BackButton { animateSetup { pairingNew = false } }+ } else if account.isSignedIn {+ AccountSwitcherButton()+ } else {+ BackButton { animateSetup { welcomed = false } }+ }+ }+ .transition(.move(edge: .trailing).combined(with: .opacity))+ }+ }+/// 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 {@@ -114,6 +141,15 @@ struct RootView: View {account.isConfigured && !account.isSignedIn && (account.isReady || accounts.accountId == nil)}+ /// What the choice page offers: an older copy of a computer doesn't count as one more.+ private var askableComputers: [CloudComputer] {+ accounts.cloudComputers.filter { !accounts.isOlderCopy($0) }+ }++ private func animateSetup(_ change: () -> Void) {+ withAnimation(Motion.reduced(Motion.layout, reduceMotion), change)+ }+/// Once per setup (Start over begins a new one): the first computer reached, or Skip.private func completeOnboarding(via: AnalyticsEvent.OnboardingVia) {guard !onboardingCompleted else { return }@@ -370,7 +406,7 @@ private struct AccessBanners: View {Spinner(size: 16)VStack(alignment: .leading, spacing: 1) {Text(L10n.tr("Approve on \(name)")).font(.subheadline.weight(.medium)).foregroundStyle(Palette.text)- Text(L10n.tr("Code \(ticket.code.prefix(3)) \(ticket.code.suffix(3))"))+ Text(verbatim: "\(L10n.tr("Code")) \(ticket.code.prefix(3)) \(ticket.code.suffix(3))").font(.footnote.monospacedDigit()).foregroundStyle(Palette.secondary)}Spacer(minLength: 8)diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.mdindex bcc9f68a..e18e57ec 100644--- a/apps/ios/WhatsNew.md+++ b/apps/ios/WhatsNew.md@@ -8,6 +8,7 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o## 2.38.1### zh-Hant+- 第一次設定時,如果帳號裡已有電腦,可以向它申請訪問,或配對一臺新電腦(例如 VPS)。安裝頁也能直接複製或分享下載連結到電腦。- bot 用了不只一種智慧體時,列表會在頭像左下角標出各自的智慧體標誌,可在「設定 › 外觀」關閉。- 修正語音通話中,bot 唸完回覆、要再聽你說話時 app 可能閃退的問題。- 語音通話的對話紀錄更好讀:最上方顯示是跟哪個 bot、什麼時候、通話多久,語音說的話也更清楚。@@ -21,6 +22,7 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o- 擴充功能的「已安裝」提示也會顯示技能的圖示。### en-US+- First-time setup now checks your account: ask a computer already in it for access, or pair a new one, like a VPS. The install page also has a download link to copy or share to your computer.- When your bots use more than one agent, the bot list marks each avatar with its agent's logo. Turn it off in Settings › Appearance.- Fixed a crash in voice calls when the bot finished reading a reply and started listening again.- A call's conversation is easier to read: the bot, when the call ended and how long it lasted sit at the top, and the voice's words are clearer.diff --git a/apps/maestro/agent-logos.yaml b/apps/maestro/agent-logos.yamlindex 4b01b55b..fb1cca9a 100644--- a/apps/maestro/agent-logos.yaml+++ b/apps/maestro/agent-logos.yaml@@ -1,7 +1,8 @@# Settings › Appearance › Show agent logos is on by default, and switched off it stays off after a relaunch.# The bot list's logos themselves are checked on the desktop (apps/desktop/e2e/agent-logos.spec.ts).# Needs a signed-in phone (`npm run phone-account`, docs/guides/dev-app.md), so it keeps the app's state:-# run it apart from `smoke`, whose welcome flow clears that state.+# run it apart from `smoke`, whose welcome flow clears that state. A computer in the account leaves a fresh phone on+# first-run setup's choice page, which it skips to reach the tabs.# Android reports the switch's state on its row, not on the row's label, and matches only `checked: true` there,# hence the per-platform checks.# One flow for iPhone and Android (docs/guides/test-stack.md):@@ -22,6 +23,15 @@ tags:commands:- launchApp:appId: com.pokai.Codync.android.dev+# `when` doesn't wait: first let the spinner give way to one page or the other.+- extendedWaitUntil:+ visible: "(Connect a computer|Settings)"+ timeout: 20000+- runFlow:+ when:+ visible: "Connect a computer"+ commands:+ - tapOn: "Skip"- tapOn: "Settings"- runFlow:when:diff --git a/apps/maestro/computer-choice-empty.yaml b/apps/maestro/computer-choice-empty.yamlnew file mode 100644index 00000000..46196b92--- /dev/null+++ b/apps/maestro/computer-choice-empty.yaml@@ -0,0 +1,27 @@+# First-run setup, signed in to an account with no computer: no choice page, straight to the install page.+# Needs a phone that hasn't finished setup, signed in with `npm run phone-account` to a sandbox whose account has no+# computer (`npm run dev` without `--cloud`, docs/guides/dev-app.md), so it keeps the app's state: run it apart from+# `smoke`, whose welcome flow clears that state.+# One flow for iPhone and Android (docs/guides/test-stack.md):+# maestro --device "<simulator udid>,<adb serial>" test --shard-all 2 --include-tags computer-choice-empty apps/maestro+appId: com.pokai.Codync.ios.dev+tags:+ - computer-choice-empty+---+- runFlow:+ when:+ platform: iOS+ commands:+ - launchApp:+ appId: com.pokai.Codync.ios.dev+- runFlow:+ when:+ platform: Android+ commands:+ - launchApp:+ appId: com.pokai.Codync.android.dev+- extendedWaitUntil:+ visible: "Install Codync.*"+ timeout: 20000+- assertNotVisible: "Connect a computer"+- assertVisible: "https://www.codync.dev/#install"diff --git a/apps/maestro/computer-choice-skip.yaml b/apps/maestro/computer-choice-skip.yamlnew file mode 100644index 00000000..47839836--- /dev/null+++ b/apps/maestro/computer-choice-skip.yaml@@ -0,0 +1,47 @@+# First-run setup, signed in to an account that already has a computer: Skip opens the tabs, and the choice page+# doesn't come back after a relaunch.+# Starts where computer-choice.yaml does (a phone that hasn't finished setup, `npm run phone-account`, `npm run dev -- --cloud`).+# Skipping finishes setup, so it runs on its own fresh setup, apart from `smoke` and computer-choice.+# One flow for iPhone and Android (docs/guides/test-stack.md):+# maestro --device "<simulator udid>,<adb serial>" test --shard-all 2 --include-tags computer-choice-skip apps/maestro+appId: com.pokai.Codync.ios.dev+tags:+ - computer-choice-skip+---+- runFlow:+ when:+ platform: iOS+ commands:+ - launchApp:+ appId: com.pokai.Codync.ios.dev+- runFlow:+ when:+ platform: Android+ commands:+ - launchApp:+ appId: com.pokai.Codync.android.dev+- extendedWaitUntil:+ visible: "Connect a computer"+ timeout: 20000+- tapOn: "Skip"+- extendedWaitUntil:+ visible: "Settings"+ timeout: 20000+- runFlow:+ when:+ platform: iOS+ commands:+ - stopApp: com.pokai.Codync.ios.dev+ - launchApp:+ appId: com.pokai.Codync.ios.dev+- runFlow:+ when:+ platform: Android+ commands:+ - stopApp: com.pokai.Codync.android.dev+ - launchApp:+ appId: com.pokai.Codync.android.dev+- extendedWaitUntil:+ visible: "Settings"+ timeout: 20000+- assertNotVisible: "Connect a computer"diff --git a/apps/maestro/computer-choice.yaml b/apps/maestro/computer-choice.yamlnew file mode 100644index 00000000..87a6f02e--- /dev/null+++ b/apps/maestro/computer-choice.yaml@@ -0,0 +1,41 @@+# First-run setup, signed in to an account that already has a computer: nothing is asked by itself, the first page+# offers that computer or a new one, and the new one's install page has the download link to send.+# Needs a phone that hasn't finished setup, signed in with `npm run phone-account`, and a computer in that account+# (`npm run dev -- --cloud`, docs/guides/dev-app.md), so it keeps the app's state: run it apart from `smoke`,+# whose welcome flow clears that state. It ends with a request on the computer: each computer-choice flow starts from+# its own fresh setup, in its own run.+# One flow for iPhone and Android (docs/guides/test-stack.md):+# maestro --device "<simulator udid>,<adb serial>" test --shard-all 2 --include-tags computer-choice apps/maestro+appId: com.pokai.Codync.ios.dev+tags:+ - computer-choice+---+- runFlow:+ when:+ platform: iOS+ commands:+ - launchApp:+ appId: com.pokai.Codync.ios.dev+- runFlow:+ when:+ platform: Android+ commands:+ - launchApp:+ appId: com.pokai.Codync.android.dev+- extendedWaitUntil:+ visible: "Connect a computer"+ timeout: 20000+- assertVisible: "Ask for access"+- assertVisible: "Skip"+- tapOn: "Pair a new computer"+- assertVisible: "Install Codync.*"+- assertVisible: "https://www.codync.dev/#install"+- assertVisible: "Send this link to your computer"+- assertVisible: "Copy"+- assertVisible: "Share link"+- tapOn: "Back"+- assertVisible: "Connect a computer"+- tapOn: "Ask for access"+- extendedWaitUntil:+ visible: "Check the code on .*"+ timeout: 20000diff --git a/docs/architecture/file-structure.md b/docs/architecture/file-structure.mdindex 66c5e382..a1a8b202 100644--- a/docs/architecture/file-structure.md+++ b/docs/architecture/file-structure.md@@ -112,7 +112,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`, `MenuItem.swift` (system menus: `MenuItem`, `.contextActions`, `DropdownMenu`), `Platform.swift` |-| iOS navigation, pairing, account, settings, computer management | `apps/ios/Views/RootView.swift`, `BotListView.swift`, `PairingView.swift`, `AccountSwitcherView.swift`, `SettingsView.swift`, `ComputersView.swift` |+| iOS navigation, pairing, account, settings, computer management | `apps/ios/Views/RootView.swift`, `BotListView.swift`, `ChooseComputerView.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/` |@@ -120,7 +120,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 setting, the tools, the replies); the switch in desktop `apps/desktop/src/renderer/views/settings/ComputersView.tsx` (+ `store/cloud.ts`) and terminal `host/src/tui/manage/network.rs`; shown read-only in the iPhone and Android network sheets || 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`, `ComputersView.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`), `ChooseComputerView.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/guides/accounts-and-ssh.md b/docs/guides/accounts-and-ssh.mdindex 3773c787..47471393 100644--- a/docs/guides/accounts-and-ssh.md+++ b/docs/guides/accounts-and-ssh.md@@ -113,8 +113,15 @@ against a cloud that issues device certificates (or a self-hosted cloud, with`CODYNC_DEVICE_CERT_KEY` on the host); builds without Clerk only keep thepairings moved over from older versions in the signed-out context, and can't pair.QR pairing requires the phone and the computer to be in the same account-(phase 2, below). The iPhone's scan step always offers **Skip**,-including when the account has no computers. Skipping finishes onboarding and opens the main+(phase 2, below). First-run setup on the phones waits for the account's answer, then starts+from it. With computers in the account, the first page lists them (**Ask for access**: nothing+is requested until the tap, since the user may be here to set up another computer) next to+**Pair a new computer**, which leads to the install page. With none, or only older copies, setup+goes straight to the install page. That page has the website's download link to copy or share+to the computer. A computer that joins the account meanwhile brings up the first page the next+time the app is opened, unless the user already chose to pair or moved on to scanning. Only+reaching a computer or **Skip** finishes setup. The first page and the scan step always offer+**Skip**. Skipping finishes onboarding and opens the maintabs; this choice survives relaunches and account changes. The empty Bots screenoffers **Computers** to pair later. Skipping while adding a computer from settingsonly closes that pairing sheet. It does not grant access to a computer or changediff --git a/docs/guides/test-stack.md b/docs/guides/test-stack.mdindex 90a09199..26256647 100644--- a/docs/guides/test-stack.md+++ b/docs/guides/test-stack.md@@ -24,7 +24,7 @@ maestro --device "<simulator udid>,<adb serial>" test --shard-all 2 --include-taThe devices are the worktree's own simulator `Codync <sandbox name>` and the shared `codync_worktree` emulator, under its lock ([worktree sandboxes](dev-app.md#worktree-sandboxes)). Install the worktree's builds first: `xcodebuild … -scheme "iOS Dev" -configuration DevDebug -derivedDataPath build/dd` for the simulator, `./gradlew :app:assembleDebug` for the emulator.-A flow past the welcome screen (`agent-logos.yaml`) needs the phone signed in with `npm run phone-account` and keeps the app's state. `welcome.yaml` (`smoke`) clears it and signs the app out, so run such a flow in a Maestro run of its own, after the sign-in.+A flow past the welcome screen (`agent-logos.yaml`) needs the phone signed in with `npm run phone-account` and keeps the app's state. `welcome.yaml` (`smoke`) clears it and signs the app out, so run such a flow in a Maestro run of its own, after the sign-in. Signed in isn't past first-run setup: `agent-logos.yaml` skips the choice page when it's there. The `computer-choice` flows need setup unfinished (fresh app data) and each finishes or changes it, so each gets its own run with its own start: `computer-choice` and `computer-choice-skip` with a computer in the account (`npm run dev -- --cloud`), `computer-choice-empty` without one.Two things that look like failures but aren't the app's:diff --git a/docs/reference/analytics-events.md b/docs/reference/analytics-events.mdindex 3344e348..e5261a58 100644--- a/docs/reference/analytics-events.md+++ b/docs/reference/analytics-events.md@@ -37,8 +37,8 @@ host answers and sends it once the host is up.| `window_opened` | host `track` (desktop) | The chat window is shown after being hidden (tray, dock, shortcut, second launch). A long-running menu bar app opens it many times per launch. | — || `host_started` | host | Each start of the host process | `first_run` (the first start of a new install; `open_store` marks a new host id with an empty `analytics_version`), `updated_from` (the previous version, when it changed), `service` (started by launchd, systemd or the Windows runner: `XPC_SERVICE_NAME`, `SYSTEMD_EXEC_PID`, `CODYNC_SERVICE`) || `host_setup_failed` | desktop main | The desktop app couldn't get a working host | `stage` (`missing_binary`/`install`/`verify`/`not_responding`/`environment`) |-| `onboarding_step_viewed` | iOS, Android | An onboarding screen appears. `welcome` is also the sign-in screen, so it's sent again after each sign-out (builds with accounts require sign-in): count persons, or the first one per person, for first runs | `step` (`welcome`/`install`/`scan`) |-| `onboarding_completed` | host `track` (desktop), iOS, Android | Once per setup. Desktop: the first run's welcome is finished (by signing in, in a build with accounts). Phones: the first-run screens are finished and the tabs appear (a computer paired, signed in to an account with computers, or skipped). | desktop `signed_in`; phones `via` (`paired`/`account`/`skipped`) |+| `onboarding_step_viewed` | iOS, Android | An onboarding screen appears. `welcome` is also the sign-in screen, so it's sent again after each sign-out (builds with accounts require sign-in): count persons, or the first one per person, for first runs | `step` (`welcome`/`choose`/`install`/`scan`; `choose`: the account has computers, ask one or pair a new one) |+| `onboarding_completed` | host `track` (desktop), iOS, Android | Once per setup. Desktop: the first run's welcome is finished (by signing in, in a build with accounts). Phones: the first-run screens are finished and the tabs appear (a computer reached, or skipped). | desktop `signed_in`; phones `via` (`paired`: by its code; `account`: approved after asking; `skipped`) || `computer_access_finished` | host `track` (desktop) | The *Computer access* step is left | `ready` (screen recording and control granted), `onboarding` || `sign_in_started` | host `track` (desktop), iOS, Android | A sign-in button is pressed | `provider` (`apple`/`google`/`github`/`hosted`) || `sign_in_failed` | host `track` (desktop), iOS, Android | Sign-in ended without an account | `provider`, `reason` (`cancelled`/`timeout`/`verification`/`error`) |@@ -57,7 +57,7 @@ host answers and sends it once the host is up.| `notifications_answered` | iOS, Android | The system notification prompt was answered | `granted`, `source` (`settings`/`widgets`/`automatic`) || `notification_opened` | iOS, Android | A Codync notification was tapped | `kind` (`done`/`needs_input`/`failed`) || `star_prompt_answered` | host `track` (desktop) | The GitHub star setup invitation or reminder was answered or closed | `ask` (`first`/`second`), `starred` |-| `link_opened` | host `track` (desktop), iOS, Android | An outbound link was opened (`install_command`: an install command copied) | `link` (`github`/`docs`/`issues`/`discord`/`app_store`/`demo`/`tailscale`/`privacy`/`support`/`install_command`/`product_hunt`) |+| `link_opened` | host `track` (desktop), iOS, Android | An outbound link was opened (`install_command`: an install command copied; `install_link`: the phone's download link copied or shared) | `link` (`github`/`docs`/`issues`/`discord`/`app_store`/`demo`/`tailscale`/`privacy`/`support`/`install_command`/`install_link`/`product_hunt`) |## Using Codync@@ -141,7 +141,7 @@ The *Onboarding & conversion* dashboard in PostHog reads these steps, each per ``message_sent` with `client = remote` (Activated).- **iPhone / Android**: first `onboarding_step_viewed` `welcome` → `sign_in_started` → `signed_in`→ `install` → `scan` → `computer_paired` → `message_sent` with `client = remote` on that- `computer`. The sign-in steps are the gate's sign-in rate (sign-in is required since 2.35.0).+ `computer`; an account with computers goes `choose` → `access_requested` → `computer_paired` (`via = account`), or `choose` → `install`. The sign-in steps are the gate's sign-in rate (sign-in is required since 2.35.0).- **Star**: `star_prompt_answered` with `starred` ÷ all `star_prompt_answered`, per `ask`.- **Website**: `$pageview` → `download_clicked` (per `platform`) → the first `app_opened` that day(counts only, no link between a visitor and an install).diff --git a/web/content/docs/getting-started.mdx b/web/content/docs/getting-started.mdxindex 6517b914..720ff405 100644--- a/web/content/docs/getting-started.mdx+++ b/web/content/docs/getting-started.mdx@@ -79,7 +79,7 @@ On the computer, show the pairing code:- **Any desktop app:** Settings → Computers, then the **Pair iPhone** button on the computer.- **Terminal:** run `codync-host pair`, or press `P` in the terminal UI.-On the iPhone, open Codync, sign in with Apple, Google or GitHub, tap **Continue**, then scan the code. The iPhone Camera app can scan it too. If you can't scan, copy the pairing link on the computer and paste it into the field under the viewfinder. To pair later, tap the account button at the top left of the Bots tab, then **Scan a computer's code**.+On the iPhone, open Codync and sign in with Apple, Google or GitHub. If your account already has a computer, the first page offers it: tap **Pair a new computer** to set up another one here, or see below to use that one. Tap **Continue**, then scan the code. The iPhone Camera app can scan it too. If you can't scan, copy the pairing link on the computer and paste it into the field under the viewfinder. To pair later, tap the account button at the top left of the Bots tab, then **Scan a computer's code**.The iPhone app has three tabs: **Bots** (your bots and chats), **State** (widgets, Live Activities and usage limits) and **Settings** (this iPhone's own settings). Each computer's settings, such as Extensions, voice chat and push notifications, are in **Manage computers**: tap the connection status at the top of the Bots tab (such as **1 connected**).@@ -87,7 +87,9 @@ A pairing code expires. If pairing fails, show a new code on the computer and scAfter pairing, the phone connects directly when it's on the same Wi-Fi or Tailscale network as the computer. Anywhere else it goes through the Codync relay, end-to-end encrypted, while **Reach from anywhere** is on in the computer's Codync settings. See [Remote access](/docs/remote-access).-If you signed in to the same account on the computer and the phone, the phone can also ask the computer for access instead of scanning. The computer then shows the request and a code for you to check. See [Remote access](/docs/remote-access).+If you signed in to the same account on the computer and the phone, the phone can ask the computer for access instead of scanning: the first page lists your account's computers with **Ask for access**. The computer then shows the request and a code for you to check. See [Remote access](/docs/remote-access).++Started on the phone, with Codync not on the computer yet? The install page has a download link: copy it or share it to the computer, and open it there. Sign in there with the same account, and the computer shows up on the phone the next time you open the app.## 4. Meet your lead botdiff --git a/web/content/docs/linux-servers.mdx b/web/content/docs/linux-servers.mdxindex 0795ee00..8bdd7219 100644--- a/web/content/docs/linux-servers.mdx+++ b/web/content/docs/linux-servers.mdx@@ -42,7 +42,7 @@ codync-host status## Pair your phone-With the host running, run `codync-host pair` over SSH. It prints a QR code and a short code like `QRTX-4821`. On the iPhone, signed in, scan the QR code from the welcome screen or later from **Manage computers → Pair a computer** (tap the connection status at the top of the Bots tab, such as **1 connected**), or type the short code into the field under the scanner. A server that isn't in an account yet asks in the terminal whether to let the phone in and join your account: check the phone shows the same 6-digit code, then answer `y` within 90 seconds. With `codync-host pair --json`, or SSH without a terminal, answer with `codync-host access approve <code>` instead. A server that lets the phone in but can't join your account at that moment (its cloud is off, or the phone couldn't reach the Codync cloud) joins it the next time the phone connects with the Codync cloud on. If it still isn't in your account after that, pair it again. `codync-host cloud` says which account the server is in, and `codync-host cloud --leave` takes the server out of it: every phone paired with it loses access and pairs again with a new code.+With the host running, run `codync-host pair` over SSH. It prints a QR code and a short code like `QRTX-4821`. On the iPhone, signed in, scan the QR code during first-time setup (tap **Continue** on the install page, after **Pair a new computer** if your account already has a computer) or later from **Manage computers → Pair a computer** (tap the connection status at the top of the Bots tab, such as **1 connected**), or type the short code into the field under the scanner. A server that isn't in an account yet asks in the terminal whether to let the phone in and join your account: check the phone shows the same 6-digit code, then answer `y` within 90 seconds. With `codync-host pair --json`, or SSH without a terminal, answer with `codync-host access approve <code>` instead. A server that lets the phone in but can't join your account at that moment (its cloud is off, or the phone couldn't reach the Codync cloud) joins it the next time the phone connects with the Codync cloud on. If it still isn't in your account after that, pair it again. `codync-host cloud` says which account the server is in, and `codync-host cloud --leave` takes the server out of it: every phone paired with it loses access and pairs again with a new code.The code works once and expires after 10 minutes. More about pairing and accounts: [Remote access](/docs/remote-access).diff --git a/web/content/docs/remote-access.mdx b/web/content/docs/remote-access.mdxindex da150c38..892556de 100644--- a/web/content/docs/remote-access.mdx+++ b/web/content/docs/remote-access.mdx@@ -26,7 +26,7 @@ Show the code on the computer:- **Terminal:** run `codync-host pair`. It prints the QR code in the terminal, and waits to answer when the computer asks about a phone (see below). `codync-host pair --json` prints the link instead and doesn't wait.- **Terminal UI:** press `^k` and choose **Pair a phone…**.-Then, on the iPhone, scan it from the welcome screen, or later from **Manage computers → Pair a computer** (tap the connection status at the top of the Bots tab, such as **1 connected**). You can also paste the `codync://pair` link instead of scanning, or type the short code `codync-host pair` prints, like `QRTX-4821`.+Then, on the iPhone, scan it during first-time setup (tap **Continue** on the install page, after **Pair a new computer** if your account already has a computer), or later from **Manage computers → Pair a computer** (tap the connection status at the top of the Bots tab, such as **1 connected**). You can also paste the `codync://pair` link instead of scanning, or type the short code `codync-host pair` prints, like `QRTX-4821`.A code works once and expires after 10 minutes. If it has expired, show a new one on the computer. Pairing works over any route, including the relay.@@ -44,7 +44,7 @@ Changing the account a computer belongs to (moving it, or **Remove from account*The iPhone, Android and desktop apps ask you to sign in with Apple, Google or GitHub before you use them. Signing in doesn't give any device access by itself. It lets your phone find the computers in your account without scanning a code:1. On the computer, sign in to the desktop app. The computer joins your account. For an SSH computer, choose **Add to account** on its card in **Settings → Computers**.-2. On the iPhone, sign in with the same account and open **Manage computers**. Your account's computers are listed there. Tap **Ask for access**. The phone shows a 6-digit code.+2. On the iPhone, sign in with the same account. The first time, the first page lists your account's computers; after that, they're in **Manage computers**. Tap **Ask for access**. The phone shows a 6-digit code. (Setting up another computer, like a VPS? Tap **Pair a new computer** on that first page.)3. On the computer, an **Access request** opens with a code. Choose **Approve** only if it matches the code on your phone exactly. If it doesn't, choose **Deny**: someone may be trying to get in.On a computer without the desktop app, use `codync-host access` to list requests and `codync-host access approve <code>` to approve one.