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
fix(ios): move a computer together with its bots
leepokai7407a8fa0bec
diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swiftindex 001807a2..5564330b 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Actions.swift@@ -233,8 +233,9 @@ extension BotStore {// MARK: roster order/// Puts the roster in `ids` order (pinned bots still sort first) and sends it; the host- /// syncs it to every device.+ /// syncs it to every device. The order it already has sends nothing.public func reorder(_ ids: [String]) {+ guard ids != roster.map(\.id) else { return }for (position, id) in ids.enumerated() { bots[id]?.position = position }perform(replay: true) { try await $0.reorderBots(ids) }}diff --git a/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swift b/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swiftindex 2f01fcf9..ced521cf 100644--- a/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swift@@ -17,6 +17,8 @@ import Testing}let order = { store.roster.map(\.id) }#expect(order() == ["p", "a", "b", "c"]) // Never arranged: recent activity.+ store.reorder(order()) // A drop in place: nothing to save or send.+ #expect(store.bots.values.allSatisfy { $0.position == 0 })store.reorder(["p", "c", "a", "b"])#expect(order() == ["p", "c", "a", "b"])store.move("a", by: -1)diff --git a/apps/ios/Views/BotListView.swift b/apps/ios/Views/BotListView.swiftindex cfe6b8ef..11751440 100644--- a/apps/ios/Views/BotListView.swift+++ b/apps/ios/Views/BotListView.swift@@ -4,7 +4,8 @@ import SwiftUI/// The roster: every bot on every computer is a person you can message (Grok Bot sidebar, phone-sized)./// A `List` with its styling taken away, for the system's reordering: touch and hold opens a bot's-/// menu, and dragging it (before or after the menu shows) moves it.+/// menu, and dragging it (before or after the menu shows) moves it among its computer's bots.+/// Dragging a computer's heading moves the computer with its bots.struct BotListView: View {@Environment(AppStore.self) private var app@Environment(AccountStore.self) private var accounts@@ -12,7 +13,7 @@ struct BotListView: View {@State private var editing: EditTarget?@State private var editingGroup: GroupTarget?@State private var confirmDelete: RosterItem?- /// The bot whose row is lifted, to drag or for its menu.+ /// The row that's lifted (a `RosterLine` id): a bot to drag or for its menu, or a computer's heading.@State private var lifted: String?@Environment(\.accessibilityReduceMotion) private var reduceMotion/// Computers left out of the list on this device, comma-separated IDs.@@ -70,6 +71,8 @@ struct BotListView: View {var body: some View {let roster = accounts.roster.filter { shownIDs.contains($0.ref.computerId) }+ let lines = self.lines+ let movingComputer = lines.contains { $0.id == lifted && $0.computerId != nil }List {Group {// A newer app release (dismissible; everything still works). Computers update@@ -87,8 +90,12 @@ struct BotListView: View {}ForEach(lines) { line inswitch line {- case let .computer(_, store): computerHeading(store, roster: roster)- case let .bot(item, store): row(item, store: store)+ case let .computer(_, store): computerHeading(store, roster: roster, folded: movingComputer)+ case let .bot(item, store):+ // A dragged heading folds every computer's bots into their headings. Each+ // row stays, empty: taking it out would move the lifted heading's place in+ // the list, and the system then drops the drag.+ if movingComputer { Color.clear.frame(height: 0) } else { row(item, store: store) }}}.onMove(perform: moveLines)@@ -175,9 +182,9 @@ struct BotListView: View {}}- /// A row the system's reordering dropped. A heading moves its computer (an order kept on this- /// device); a bot moves among its computer's bots, an order the host syncs to every device.- /// A bot dropped among another computer's bots goes back.+ /// A row the system's reordering dropped. A heading moves its computer and its bots (an order+ /// kept on this device); a bot moves only among its computer's bots, an order the host syncs to+ /// every device: dropped above or below them (on another computer), it goes first or last.private func moveLines(from source: IndexSet, to destination: Int) {let before = linesguard let from = source.first, before.indices.contains(from) else { return }@@ -189,10 +196,7 @@ struct BotListView: View {guard let to = new.firstIndex(of: id), old[to] != id else { return }withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { accounts.move(id, to: old[to]) }case let .bot(item, store):- let computerId = item.ref.computerId- let at = after.firstIndex { $0.id == before[from].id } ?? 0- if grouped, after[..<at].last(where: { $0.computerId != nil })?.computerId != computerId { return }- store.reorder(after.compactMap { $0.botId(on: computerId) })+ store.reorder(after.compactMap { $0.botId(on: item.ref.computerId) })}}@@ -204,22 +208,24 @@ struct BotListView: View {}}- /// A light heading per computer, with its update notice. Dragging it moves the computer; its- /// bots follow when it's dropped.- private func computerHeading(_ store: BotStore, roster: [RosterItem]) -> some View {+ /// A light heading per computer, with its update notice. Dragging it moves the computer with its+ /// bots: while it's lifted (`folded`), every computer's bots fold into their headings.+ private func computerHeading(_ store: BotStore, roster: [RosterItem], folded: Bool) -> some View {let id = store.computer.idreturn VStack(spacing: 0) {// Not synced while it needs an update: "No bots yet" wouldn't be true.ComputerSection(store: store, empty: store.mismatch == nil && !roster.contains { $0.ref.computerId == id },- collapsed: collapsedIDs.contains(id), toggle: { toggleCollapsed(id) }, move: move)+ collapsed: folded || collapsedIDs.contains(id), toggle: { toggleCollapsed(id) }, move: move).contentShape(Rectangle()).onTapGesture { toggleCollapsed(id) }updateCard(store)}+ .itemProvider { lift(.computer(id, store)) }}private func row(_ item: RosterItem, store: BotStore) -> some View {let bot = item.bot+ let line = RosterLine.bot(item, store)let card = RoundedRectangle(cornerRadius: 16, style: .continuous)// A plain button instead of a NavigationLink: same push, no chevron.return Button { accounts.selection = item.ref } label: {@@ -229,10 +235,10 @@ struct BotListView: View {.buttonStyle(.plain)// Lifted, it's a rounded card with room around the avatar..padding(.horizontal, 8)- .background(lifted == bot.id ? Palette.surface : .clear, in: card)+ .background(lifted == line.id ? Palette.surface : .clear, in: card).contentShape([.dragPreview, .contextMenuPreview], card).padding(.horizontal, -8)- .itemProvider { lift(bot.id) }+ .itemProvider { lift(line) }.accessibilityLabel(accounts.computers.count > 1 ? "\(bot.name), on \(store.hostName)" : bot.name).accessibilityActions {Button("Move up") { withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { store.move(bot.id, by: -1) } }@@ -252,9 +258,12 @@ struct BotListView: View {}/// The system asks for a row's item as it lifts; the row shows as lifted until it lets go.- private func lift(_ id: String) -> NSItemProvider {- lifted = id- return LiftItem { Task { @MainActor in if lifted == id { lifted = nil } } }+ /// A heading folds the bots away and back with an animation.+ private func lift(_ line: RosterLine) -> NSItemProvider {+ let id = line.id+ let animation = line.computerId != nil ? Motion.reduced(Motion.layout, reduceMotion) : nil+ withAnimation(animation) { lifted = id }+ return LiftItem { Task { @MainActor in if lifted == id { withAnimation(animation) { lifted = nil } } } }}/// A group chat gathers bots of one computer (the first one online; more computers are future work).@@ -274,8 +283,7 @@ struct BotListView: View {}}-/// One row the user can drag in the roster: a computer's heading or a bot.-/// The item a lifted bot row carries (nothing): the system lets go of it when the drag or the+/// The item a lifted row carries (nothing): the system lets go of it when the drag or the/// menu ends.private final class LiftItem: NSItemProvider {private let ended: @Sendable () -> Void@@ -288,6 +296,7 @@ private final class LiftItem: NSItemProvider {deinit { ended() }}+/// One row the user can drag in the roster: a computer's heading or a bot.private enum RosterLine: Identifiable {case computer(ComputerID, BotStore)case bot(RosterItem, BotStore)diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.mdindex 39e126ba..dd518065 100644--- a/docs/design/ui-conventions.md+++ b/docs/design/ui-conventions.md@@ -10,7 +10,7 @@ iPhone conversation scrolling leaves dragging, deceleration, and bottom rubber-bDo not wrap those toolbar controls in `IconButtonStyle`, hand-sized rounded backgrounds or another glass effect. The account avatar is toolbar content, with the system supplying the enclosing surface. This is the explicit exception to the custom-chrome rule below.-Connecting and reconnecting are background work. `BotStore` gives initial offline reports 1 second to recover and holds drops from online (including relay "computer offline" reports) for 5 seconds. "No access" shows immediately. Automatic read acknowledgements never open an error dialog and visible conversations are acknowledged again after reconnecting. An action taken during a reconnect (back in the foreground, a new network, a drop still inside its grace) waits for the link, up to 20 seconds, instead of failing; while one waits, headers read `Connecting…` and the conversation's connection label shows a spinner. Calls that are safe to repeat (send, stop, approvals, pin, hide, mark as read, delete) are tried again when the link drops under them. Tapping while the header says Offline because the computer can't be reached starts a fresh connection attempt and waits for it, instead of failing until the backoff gets there; a computer the relay reports as off fails at once, since the relay says when it is back. A permission card shows a spinner on the chosen option, dims the others and takes no second answer until the computer has it. The desktop app's `BotStore` (link handling in `apps/desktop/src/renderer/store/bot-sync.ts`) applies the same graces and 20-second wait. The TUI follows the same rule over loopback: a command the host can't be reached for is retried for up to 20 seconds behind its "Reconnecting…" indicator (the `hello` probe that explains an unreachable host still answers at once), and its permission cards spin on the chosen option. The "Something went wrong" dialog is left for a computer that is off, a refused device, the computer's own answers, and reconnects that outlast the wait. Background work (cloud refresh, device registration) logs connection, busy-cloud and stale-token failures instead of showing them. The iOS app disconnects only in `.background`, not `.inactive`. Connection status lives only in headers and their menus. The roster header shows a small summary (`1 connected`, `1/2 connected`, `2 offline`, or `Connecting…`). Its computer menu supports multiple selections, Show only, All computers, reconnect, and management. At least one available computer stays selected; if saved exclusions would hide every computer, the list falls back to all. Filters persist on the device. Bots sort pinned first, then in the order the user dragged them into, then by recency ([bot order](../features/computer-order.md#bot-order)). On iPhone, when more than one computer is shown, each computer gets a light heading (badge, name, connection, and "No bots yet" when empty) above its own bots; with one computer the list stays flat. Tapping a heading folds that computer's bots away (chevron; saved on the device). Long-press a heading to lift the whole section and drag it up or down; the other sections slide out of its way and the order is saved on the device on release (`AccountStore.move`; VoiceOver: Move up / Move down). The desktop app shows a flat roster. There are no connection banners. The compact desktop rail uses a computer icon for the same menu. Conversation headers show a small connection label, with the computer name available in the header menu or help text. Pull-to-refresh remains available on iPhone. Computer setup and access requests live under Manage computers; a phone asks an account computer for access only when the user taps Ask for access, never on its own.+Connecting and reconnecting are background work. `BotStore` gives initial offline reports 1 second to recover and holds drops from online (including relay "computer offline" reports) for 5 seconds. "No access" shows immediately. Automatic read acknowledgements never open an error dialog and visible conversations are acknowledged again after reconnecting. An action taken during a reconnect (back in the foreground, a new network, a drop still inside its grace) waits for the link, up to 20 seconds, instead of failing; while one waits, headers read `Connecting…` and the conversation's connection label shows a spinner. Calls that are safe to repeat (send, stop, approvals, pin, hide, mark as read, delete) are tried again when the link drops under them. Tapping while the header says Offline because the computer can't be reached starts a fresh connection attempt and waits for it, instead of failing until the backoff gets there; a computer the relay reports as off fails at once, since the relay says when it is back. A permission card shows a spinner on the chosen option, dims the others and takes no second answer until the computer has it. The desktop app's `BotStore` (link handling in `apps/desktop/src/renderer/store/bot-sync.ts`) applies the same graces and 20-second wait. The TUI follows the same rule over loopback: a command the host can't be reached for is retried for up to 20 seconds behind its "Reconnecting…" indicator (the `hello` probe that explains an unreachable host still answers at once), and its permission cards spin on the chosen option. The "Something went wrong" dialog is left for a computer that is off, a refused device, the computer's own answers, and reconnects that outlast the wait. Background work (cloud refresh, device registration) logs connection, busy-cloud and stale-token failures instead of showing them. The iOS app disconnects only in `.background`, not `.inactive`. Connection status lives only in headers and their menus. The roster header shows a small summary (`1 connected`, `1/2 connected`, `2 offline`, or `Connecting…`). Its computer menu supports multiple selections, Show only, All computers, reconnect, and management. At least one available computer stays selected; if saved exclusions would hide every computer, the list falls back to all. Filters persist on the device. Bots sort pinned first, then in the order the user dragged them into, then by recency ([bot order](../features/computer-order.md#bot-order)). On iPhone, when more than one computer is shown, each computer gets a light heading (badge, name, connection, and "No bots yet" when empty) above its own bots; with one computer the list stays flat. Tapping a heading folds that computer's bots away (chevron; saved on the device). Long-press a heading to drag the computer with its bots up or down: while it is lifted every computer's bots fold into their headings, they unfold on release, and the order is saved on the device (`AccountStore.move`; VoiceOver: Move up / Move down). A bot moves only among its own computer's bots. The desktop app shows a flat roster. There are no connection banners. The compact desktop rail uses a computer icon for the same menu. Conversation headers show a small connection label, with the computer name available in the header menu or help text. Pull-to-refresh remains available on iPhone. Computer setup and access requests live under Manage computers; a phone asks an account computer for access only when the user taps Ask for access, never on its own.Sources: `apps/ios/Views/BotListView.swift`, `AccountSwitcherView.swift`, `apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift`, `Bots/ComputerFilterHeader.swift`, `Store/ComputerSelection.swift`, `Bots/BotRow.swift`; desktop: `apps/desktop/src/renderer/views/ChatWindow.tsx`, `ComputerFilterHeader.tsx`, `BotRow.tsx`.diff --git a/docs/features/computer-order.md b/docs/features/computer-order.mdindex 2801490d..fc899b70 100644--- a/docs/features/computer-order.md+++ b/docs/features/computer-order.md@@ -27,7 +27,9 @@ they return. Computer names and bots never become ordering keys, and an orderingentry never grants access to a computer or imports another device's SSH connection.On iOS, touch and hold a computer heading, then drag up or down and release to save-the order; its bots follow when it's dropped. Cancelling a drag leaves the saved order unchanged. A tap folds or expands+the order. The computer moves with its bots: while the heading is lifted, every computer's+bots fold into their headings (rows kept at no height, so the system's drag keeps its place),+and they unfold under their computers when it's dropped. Cancelling a drag leaves the saved order unchanged. A tap folds or expandsthe section; Move up/down accessibility actions are also available. The desktopapp supports heading drags and Alt+Up/Down on macOS, Linux and Windows.The terminal UI connects to one host, so it has no cross-computer ordering.@@ -47,7 +49,8 @@ appears on top. Hidden bots keep their position for when they return.removed, so the system does the reordering: holding still opens the row's menu, and draggingthe lifted row moves it, also once the menu shows, unless the finger goes into the menu. Lifted,the row is a rounded card: it fills while the system holds its drag item (`BotListView.lift`). A bot- dropped among another computer's bots goes back. The drop saves the order (`BotListView.moveLines`,+ moves only among its own computer's bots: dropped above or below them, among another computer's,+ it goes first or last. The drop saves the order (`BotListView.moveLines`,`BotStore.reorder`). VoiceOver: Move up / Move down. SwiftUI's own drag and drop can't do this:with a context menu on the row, a drag never starts on iPhone.- **Desktop:** drag a row, or Alt+Up/Down on the selected bot (macOS, Linux, Windows).