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): open every menu with the system Menu and contextMenu
leepokaic92b3c731660
diff --git a/CLAUDE.md b/CLAUDE.mdindex 858fef7e..66b5134b 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -17,7 +17,7 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess- Clients: iOS app, native Mac window (menu bar app), native Linux app (`apps/linux/`, GTK 4 + libadwaita in Rust), terminal UI (`codync-host tui`, `host/src/tui/`, ratatui; layout and state vocabulary modeled on herdr). All talk to the host API; no web UI.- Shared Swift (`kit/`): `CodyncKit` (models, client, theme, avatars) + `CodyncUI` (`BotStore` + chat screens) used by iOS and macOS. Platform specifics go through `BotStore` hooks or `Platform.swift`.- UI principle: buttons an icon can express are icon-only (with tooltip / accessibility label); text only where an icon would be ambiguous (approval choices).-- UI controls default to the shared custom components. Explicit exception: iOS BotListView and ThreadView use native navigation/toolbar items and automatic back navigation for system Liquid Glass, as specified in `docs/design/ui-conventions.md`. On iOS, `DropdownMenu`/`ChoicePicker` open the native `Menu` (the custom overlay mis-anchors inside sheets). The macOS menu bar also uses native `MenuBarExtra(.menu)`, menus, pickers and toggles. Keep system authentication and widget containers native. Outside these exceptions, avoid: no `Menu`/`Picker`, `.switch` toggles, `Form`/`List` styling, `confirmationDialog`/`alert`, `ProgressView`, `.sheet`/`.popover`/`.fullScreenCover`, `.toolbar`/navigation bars, `TabView`, `ContentUnavailableView`. Use `kit/Sources/CodyncUI/Controls.swift` + `Chrome.swift` (`.codyncSheet`, `ModalHeader`, `ScreenHeader`, `TabBar`, `.codyncMenu`, `.codyncDialog`, `ToggleStyle.codync`). Every tap that shows/hides something animates (`Motion`). Anything with a background fill gets no border line.+- UI controls default to the shared custom components. Explicit exception: iOS BotListView and ThreadView use native navigation/toolbar items and automatic back navigation for system Liquid Glass, as specified in `docs/design/ui-conventions.md`. **iOS menus are always the system ones**: tap menus through `DropdownMenu`/`ChoicePicker` (native `Menu`), long-press through `.contextActions` (native `contextMenu`). Never hand-build a dropdown on iOS and never call `.codyncMenu` there (it is macOS-only and a compile error on iOS): the custom overlay lands in the wrong place (sheets, scroll views, the composer's + menu). The macOS menu bar also uses native `MenuBarExtra(.menu)`, menus, pickers and toggles. Keep system authentication and widget containers native. Outside these exceptions, avoid: no `Menu`/`Picker`, `.switch` toggles, `Form`/`List` styling, `confirmationDialog`/`alert`, `ProgressView`, `.sheet`/`.popover`/`.fullScreenCover`, `.toolbar`/navigation bars, `TabView`, `ContentUnavailableView`. Use `kit/Sources/CodyncUI/Controls.swift` + `Chrome.swift` (`.codyncSheet`, `ModalHeader`, `ScreenHeader`, `TabBar`, `.codyncMenu`, `.codyncDialog`, `ToggleStyle.codync`). Every tap that shows/hides something animates (`Motion`). Anything with a background fill gets no border line.- `host/` — **codync-host** (Rust, macOS + Linux). Detects installed harnesses (`agent/backends.rs`: login-shell PATH + known dirs) and the ACP registry (`agent/registry.rs`, cached in `~/.codync/registry.json`, binaries under `~/.codync/agents`). Drives agents over **ACP** (JSON-RPC on stdio, hand-rolled in `agent/acp.rs`, updates kept as `serde_json::Value` so new adapter variants never break parsing). One actor per bot (`agent/bot.rs`) owns the agent process + session and maps `session/update` onto transcript entries.- **Chat ≠ session**: a bot is one endless transcript (SQLite `entries`, ordered by `seq`); the ACP session underneath is resumed with `session/load` or replaced by *New session*.- **Group chats and threads** are host features every client drives through the same methods (`send` with `threadId`, `thread`, `createBot {kind: group}`); clients never route, parse mentions or count replies themselves. A group is a roster row whose members answer in their own sessions (Grok Bot's room turns); a thread on a bot's message is a forked session: [docs/features/groups-and-threads.md](docs/features/groups-and-threads.md).diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swiftindex 4d570e86..28f496f3 100644--- a/apps/ios/Views/SettingsView.swift+++ b/apps/ios/Views/SettingsView.swift@@ -209,7 +209,6 @@ private struct ComputerRow: View {let remove: () -> Void@Environment(AccountStore.self) private var accounts@State private var coloring = false- @State private var routing = falsevar body: some View {HStack(spacing: 12) {@@ -231,14 +230,20 @@ private struct ComputerRow: View {IconButton("Screen", systemImage: "display", action: openScreen)}// Which route goes first, and whether Cloudflare is a fallback at all.- IconButton("Connection", systemImage: preference.icon, selected: routing) { routing = true }- .codyncMenu(isPresented: $routing) {- ConnectionRoute.allCases.map { route in- MenuItem(route.title, icon: route.icon, selected: route == preference) {- accounts.setRoute(store.computer.id, route)- }+ DropdownMenu {+ ConnectionRoute.allCases.map { route in+ MenuItem(route.title, icon: route.icon, selected: route == preference) {+ accounts.setRoute(store.computer.id, route)}}+ } label: {+ Image(systemName: preference.icon)+ .font(.system(size: 18, weight: .medium))+ .foregroundStyle(Palette.secondary)+ .frame(width: 36, height: 36)+ .contentShape(Rectangle())+ }+ .accessibilityLabel("Connection")if inAccount != nil {Image(systemName: "person.crop.circle.badge.checkmark").foregroundStyle(Palette.tertiary)@@ -249,13 +254,7 @@ private struct ComputerRow: View {.contentShape(Rectangle()).contextActions {var items = [- MenuItem("Color", icon: "paintpalette") {- // ponytail: waits for the menu to fade out before opening the swatches; one overlay at a time.- Task {- try? await Task.sleep(for: .milliseconds(350))- coloring = true- }- },+ MenuItem("Color", icon: "paintpalette") { coloring = true },]if store.connection == .online {items.append(MenuItem("Marketplace", icon: "storefront", action: openMarketplace))diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.mdindex 5cee8116..497bf47a 100644--- a/docs/design/ui-conventions.md+++ b/docs/design/ui-conventions.md@@ -32,7 +32,7 @@ Other custom screens use `Chrome.swift` and `Controls.swift`:| Header outside the native bot navigation flow | `ModalHeader`, `ScreenHeader` || Icon action | `IconButton` || Tab selection | `TabBar` |-| Menu / confirmation | `.codyncMenu`, `.codyncDialog` |+| Menu / confirmation | `.codyncMenu` (macOS), `DropdownMenu` / `.contextActions` (system menus on iOS), `.codyncDialog` || Toggle | `ToggleStyle.codync` || Form-like content | `CardForm`, `CardSection` |@@ -60,7 +60,7 @@ On iPhone, the routine editor uses a single column of trigger choices so titlesNew bots use automatically allocated personal workspaces. Settings offer Personal or an optional project folder; see [bot workspaces](../features/bot-workspaces.md).-Shared `.codyncMenu` lists scroll vertically when their content exceeds 420 points or the available space beside the trigger. Menus open toward the side with more vertical room; short lists keep their content height. Menu width is capped at 320 points and constrained to the window, and long option titles remain available through help text. This applies to Agent, Model, and other shared choice menus on macOS. On iOS, `DropdownMenu` and `ChoicePicker` present the native `Menu` instead (choices as checkmarked toggles), because an overlay anchored by global frame lands in the wrong place inside `.codyncSheet` and scroll views. Each computer has its own marketplace; its header names the computer and, with several online, switches between them. A new bot's editor on iPhone has a Computer dropdown listing every computer in the current account, including computers hidden by the roster filter and offline computers. It remains a dropdown with one computer. Offline choices stay selectable and are labeled; creation waits until the selected computer is online. Switching computers resets the folder, model and connectors that belonged to the old computer.+Shared `.codyncMenu` lists scroll vertically when their content exceeds 420 points or the available space beside the trigger. Menus open toward the side with more vertical room; short lists keep their content height. Menu width is capped at 320 points and constrained to the window, and long option titles remain available through help text. This applies to Agent, Model, and other shared choice menus on macOS. On iOS every menu is the system one: `DropdownMenu` and `ChoicePicker` present the native `Menu` (choices as checkmarked toggles) and `.contextActions` the native `contextMenu` (reactions as a palette row), because an overlay anchored by global frame lands in the wrong place inside `.codyncSheet`, scroll views and the composer (the + menu opened mid-screen on iPhone, 2026-09-30). `.codyncMenu` is macOS-only and does not compile on iOS. Each computer has its own marketplace; its header names the computer and, with several online, switches between them. A new bot's editor on iPhone has a Computer dropdown listing every computer in the current account, including computers hidden by the roster filter and offline computers. It remains a dropdown with one computer. Offline choices stay selectable and are labeled; creation waits until the selected computer is online. Switching computers resets the folder, model and connectors that belonged to the old computer.## Reading conversationsdiff --git a/kit/Sources/CodyncUI/Controls.swift b/kit/Sources/CodyncUI/Controls.swiftindex 5ba3e37d..6b5fb0dd 100644--- a/kit/Sources/CodyncUI/Controls.swift+++ b/kit/Sources/CodyncUI/Controls.swift@@ -6,9 +6,13 @@ import AppKitimport UIKit#endif-// Codync's own controls. Never use the stock ones (Menu, Picker, .switch toggles,+// Codync's own controls. Never use the stock ones (Picker, .switch toggles,// Form/List styling, confirmationDialog/alert, ProgressView, DisclosureGroup,-// .bordered buttons, contextMenu/swipeActions): build from these instead.+// .bordered buttons, swipeActions): build from these instead.+// Menus are the one exception on iOS: `DropdownMenu`/`ChoicePicker` open the system+// `Menu` and `.contextActions` the system `contextMenu`. A hand-built overlay anchored+// by global frame lands in the wrong place there (sheets, scroll views, the composer),+// so `.codyncMenu` is macOS-only.// Anything with a background fill gets no border line.// MARK: - Switch@@ -315,12 +319,14 @@ private struct MenuRow: View {}public extension View {- /// Shows a Codync menu under (or above) this view while `isPresented` is true.+ /// Mac only: shows a Codync menu under (or above) this view while `isPresented` is true.+ /// iOS menus are the system ones (`DropdownMenu`, `.contextActions`).+ @available(iOS, unavailable, message: "iOS menus are the system Menu: use DropdownMenu")func codyncMenu(isPresented: Binding<Bool>, items: @escaping () -> [MenuItem]) -> some View {modifier(AnchoredMenu(isPresented: isPresented, point: nil, items: items))}- /// Long-press (iPhone) or right-click (Mac) opens a Codync menu: the replacement for `contextMenu`.+ /// Right-click (Mac) opens a Codync menu; long-press (iPhone) the system context menu./// `reactions` puts a quick-reaction row on top.func contextActions(reactions: ReactionPick? = nil, _ items: @escaping () -> [MenuItem]) -> some View {modifier(ContextActions(items: items, reactions: reactions))@@ -330,16 +336,31 @@ public extension View {private struct ContextActions: ViewModifier {let items: () -> [MenuItem]let reactions: ReactionPick?+ #if os(macOS)@State private var open = false@State private var point: CGPoint?+ #endiffunc body(content: Content) -> some View {+ #if os(iOS)+ content.contextMenu {+ if let reactions {+ ControlGroup {+ ForEach(reactions.emoji, id: \.self) { emoji in+ let chosen = reactions.chosen.contains(emoji)+ Toggle(isOn: Binding(get: { chosen }, set: { _ in reactions.toggle(emoji) })) { Text(emoji) }+ }+ }+ .controlGroupStyle(.palette)+ }+ ForEach(items()) { item in+ if item.divider { Divider() }+ systemMenuRow(item)+ }+ }+ #elsecontent- #if os(macOS).overlay { SecondaryClickCapture { point = $0; open = true } }- #else- .onLongPressGesture(minimumDuration: 0.35) { point = nil; open = true }- #endif.modifier(AnchoredMenu(isPresented: $open, point: point, items: items, reactions: reactions)).accessibilityActions {ForEach(items()) { item in@@ -351,8 +372,25 @@ private struct ContextActions: ViewModifier {}}}+ #endif+ }+}++#if os(iOS)+/// A `MenuItem` inside a system `Menu` or `contextMenu`: choices as checkmarked toggles.+@ViewBuilder private func systemMenuRow(_ item: MenuItem) -> some View {+ let role: ButtonRole? = item.destructive ? .destructive : nil+ if let selected = item.selected {+ Toggle(isOn: Binding(get: { selected }, set: { _ in item.action() })) {+ if let icon = item.icon { SwiftUI.Label(item.title, systemImage: icon) } else { Text(item.title) }+ }+ } else if let icon = item.icon {+ Button(role: role, action: item.action) { SwiftUI.Label(item.title, systemImage: icon) }+ } else {+ Button(item.title, role: role, action: item.action)}}+#endif/// Presents `MenuPanel` next to the view (or at `point` inside it, for right-clicks).private struct AnchoredMenu: ViewModifier {@@ -433,7 +471,7 @@ public struct DropdownMenu<Label: View>: View {Menu {ForEach(items()) { item inif item.divider { Divider() }- Self.row(item)+ systemMenuRow(item)}} label: { label }.buttonStyle(.plain)@@ -444,21 +482,6 @@ public struct DropdownMenu<Label: View>: View {.codyncMenu(isPresented: $open, items: items)#endif}-- #if os(iOS)- @ViewBuilder private static func row(_ item: MenuItem) -> some View {- let role: ButtonRole? = item.destructive ? .destructive : nil- if let selected = item.selected {- Toggle(isOn: Binding(get: { selected }, set: { _ in item.action() })) {- if let icon = item.icon { SwiftUI.Label(item.title, systemImage: icon) } else { Text(item.title) }- }- } else if let icon = item.icon {- Button(role: role, action: item.action) { SwiftUI.Label(item.title, systemImage: icon) }- } else {- Button(item.title, role: role, action: item.action)- }- }- #endif}/// Picks one value: shows the current choice in a pill with a chevron, opens a Codync menu.diff --git a/kit/Sources/CodyncUI/Thread/Composer.swift b/kit/Sources/CodyncUI/Thread/Composer.swiftindex 2a7b9d3c..2a19d0d4 100644--- a/kit/Sources/CodyncUI/Thread/Composer.swift+++ b/kit/Sources/CodyncUI/Thread/Composer.swift@@ -16,7 +16,6 @@ struct Composer: View {@State private var draft = ""/// Files going out with the next message.@State private var files: [OutgoingFile] = []- @State private var addMenu = false@State private var pickingFiles = false@State private var pickingPhotos = false@State private var photoItems: [PhotosPickerItem] = []@@ -212,36 +211,34 @@ struct Composer: View {}}- /// Photos or files (iPhone), files (Mac); dropping files on the box works too.- private var addButton: some View {- Button {- #if os(iOS)- addMenu = true- #else- pickingFiles = true- #endif- } label: {- Image(systemName: "plus")- .font(.system(size: InterfaceMetrics.value(mac: 13, mobile: 18), weight: .medium))- .foregroundStyle(Palette.text)- .frame(width: buttonSize + 2 * InterfaceMetrics.value(mac: 4, mobile: 6),- height: buttonSize + 2 * InterfaceMetrics.value(mac: 4, mobile: 6))- .composerSurface(in: Circle())- .contentShape(Circle())- }- .buttonStyle(PressScale())- .accessibilityLabel("Add files")- .help("Add files")- .codyncMenu(isPresented: $addMenu) {- var items = [MenuItem("Photos", icon: "photo.on.rectangle") { pickingPhotos = true },- MenuItem("Files", icon: "folder") { pickingFiles = true }]- #if os(iOS)+ /// Photos or files (iPhone, a system menu), files (Mac); dropping files on the box works too.+ @ViewBuilder private var addButton: some View {+ #if os(iOS)+ DropdownMenu {+ var items = [MenuItem("Photos", icon: "photo.on.rectangle") { pickingPhotos = true },+ MenuItem("Files", icon: "folder") { pickingFiles = true }]if UIPasteboard.general.hasImages || UIPasteboard.general.hasURLs {items.append(MenuItem("Paste", icon: "doc.on.clipboard") { pasteFiles() })}- #endif- return items- }+ return items+ } label: { addLabel }+ .accessibilityLabel("Add files")+ #else+ Button { pickingFiles = true } label: { addLabel }+ .buttonStyle(PressScale())+ .accessibilityLabel("Add files")+ .help("Add files")+ #endif+ }++ private var addLabel: some View {+ Image(systemName: "plus")+ .font(.system(size: InterfaceMetrics.value(mac: 13, mobile: 18), weight: .medium))+ .foregroundStyle(Palette.text)+ .frame(width: buttonSize + 2 * InterfaceMetrics.value(mac: 4, mobile: 6),+ height: buttonSize + 2 * InterfaceMetrics.value(mac: 4, mobile: 6))+ .composerSurface(in: Circle())+ .contentShape(Circle())}#if os(iOS)