Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions i18n/en.msg
Original file line number Diff line number Diff line change
Expand Up @@ -5041,3 +5041,11 @@ mobile.plan.touchhint = Drag waypoints to steer · Tap + to add · Tap point to
mobile.plan.copied = Copied
mobile.plan.widthmm = {v} mm
mobile.plan.coord = ({x}, {y} mm)
provider.notice.head = No AI provider connected
provider.notice.text.none = Connect Claude, Codex, Antigravity, or another provider to start chatting.
provider.notice.text.signedout = Sign in to Claude, Codex, or another provider in Settings → Accounts to start chatting.
provider.notice.button = Open Settings → Accounts
provider.notice.senderr = No AI provider connected yet. Open Settings → Accounts to connect Claude, Codex, Antigravity, or another provider.
provider.notice.senderr.remote = No AI provider connected on {machine}. Open Settings → Accounts on {machine} to connect Claude, Codex, Antigravity, or another provider.
web.settings.providers = AI providers
web.settings.providers.browser = Connect a provider in the Backplane desktop or mobile app under Settings → Accounts.
8 changes: 8 additions & 0 deletions i18n/es.msg
Original file line number Diff line number Diff line change
Expand Up @@ -5041,3 +5041,11 @@ mobile.plan.touchhint = Arrastra vértices para guiar · Toca + para añadir ·
mobile.plan.copied = Copiado
mobile.plan.widthmm = {v} mm
mobile.plan.coord = ({x}, {y} mm)
provider.notice.head = No hay ningún proveedor de IA conectado
provider.notice.text.none = Conecta Claude, Codex, Antigravity u otro proveedor para empezar a chatear.
provider.notice.text.signedout = Inicia sesión en Claude, Codex u otro proveedor en Configuración → Cuentas para empezar a chatear.
provider.notice.button = Abrir Configuración → Cuentas
provider.notice.senderr = Aún no hay ningún proveedor de IA conectado. Abre Configuración → Cuentas para conectar Claude, Codex, Antigravity u otro proveedor.
provider.notice.senderr.remote = No hay ningún proveedor de IA conectado en {machine}. Abre Configuración → Cuentas en {machine} para conectar Claude, Codex, Antigravity u otro proveedor.
web.settings.providers = Proveedores de IA
web.settings.providers.browser = Conecta un proveedor en la aplicación de escritorio o móvil de Backplane en Configuración → Cuentas.
8 changes: 8 additions & 0 deletions i18n/ja.msg
Original file line number Diff line number Diff line change
Expand Up @@ -5064,3 +5064,11 @@ mobile.plan.touchhint = 頂点をドラッグして誘導 · + をタップで
mobile.plan.copied = コピーしました
mobile.plan.widthmm = {v} mm
mobile.plan.coord = ({x}, {y} mm)
provider.notice.head = AI プロバイダーが接続されていません
provider.notice.text.none = チャットを始めるには、Claude、Codex、Antigravity などのプロバイダーを接続してください。
provider.notice.text.signedout = チャットを始めるには、設定 → アカウントで Claude、Codex などのプロバイダーにサインインしてください。
provider.notice.button = 設定 → アカウントを開く
provider.notice.senderr = AI プロバイダーがまだ接続されていません。設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。
provider.notice.senderr.remote = {machine} に AI プロバイダーが接続されていません。{machine} で設定 → アカウントを開いて、Claude、Codex、Antigravity などのプロバイダーを接続してください。
web.settings.providers = AI プロバイダー
web.settings.providers.browser = Backplane のデスクトップまたはモバイルアプリの設定 → アカウントからプロバイダーを接続してください。
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class DataActivity : ComponentActivity() {
if (BuildConfig.DEBUG && u.host == "unpair") { DataClient.unpair(); return }
// (a thread of another machine, `desktop~t9` or a link id: the hub says which thread it is; this machine's own opens as it did)
if (u.host == "thread") u.pathSegments.firstOrNull()?.let { if (it.contains('~')) DataClient.openLink(u.toString(), "") else DataClient.openFromIntent = it }
else if (u.host == "account") u.pathSegments.firstOrNull()?.let { DataClient.openAccount = it } else DataClient.askLink = u.toString()
else if (u.host == "account") u.pathSegments.firstOrNull()?.let { DataClient.openAccount = it }
else if (u.host == "settings") { if (u.pathSegments.firstOrNull() == "accounts") DataClient.openAccounts = true else DataClient.openSettings = true }
else DataClient.askLink = u.toString()
}
override fun onResume() { super.onResume(); DataClient.foreground = true; DataClient.foreground(); DataVoice.background(false) }
override fun onPause() { super.onPause(); DataClient.foreground = false; DataVoice.background(true) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ object DataClient {
/** the strip's words (the hub's English) in place of its usual look, or null */
val restartText: String? get() = RestartStrip.text(restarting, hubBack, conn == Conn.ONLINE, stripNow)
var telemetryNotice by mutableStateOf<DTelemetryNotice?>(null); private set // the one-time telemetry notice (feature "telemetryNotice"): shown while the hub says so
/** Hub notice when zero AI providers / accounts are configured or signed in (`hello.noProvider` / `info["provider.notice"]`) */
var noProvider by mutableStateOf<DNoProvider?>(null); private set
var openAccounts by mutableStateOf(false)
var openSettings by mutableStateOf(false)
/** Alerts not allowed yet (Android 13+): AlertsBanner offers them, with the reason, instead of the system asking at start. Not now hides it until the next launch. */
var alertsAsk by mutableStateOf(false)
var migrating by mutableStateOf<DMigrateCard?>(null); private set // a 0.14 home coming across: hello `migrating`, then each `migrating` frame (DataMigrate.kt)
Expand Down Expand Up @@ -168,9 +172,9 @@ object DataClient {
private fun reset(clearDisk: Boolean = false) {
saveJob?.cancel()
shellHashes.clear(); threadHashes.clear(); threadIds.clear(); subEntriesById.clear(); subEntryIds = emptyList()
Swarms.reset(); restarting = null; hubBack = null; notice = HubNotice(); star = null; telemetryNotice = null; migrating = null; migrateOpen = false; projects = emptyList(); threads = emptyList(); entries = emptyMap(); older = emptyMap(); listsLoaded = false; open = null
Swarms.reset(); restarting = null; hubBack = null; notice = HubNotice(); star = null; telemetryNotice = null; noProvider = null; migrating = null; migrateOpen = false; projects = emptyList(); threads = emptyList(); entries = emptyMap(); older = emptyMap(); listsLoaded = false; open = null
home = null
Swarms.reset(); notice = HubNotice(); star = null; telemetryNotice = null; migrating = null; migrateOpen = false; projects = emptyList(); threads = emptyList(); entries = emptyMap(); older = emptyMap(); listsLoaded = false; open = null
Swarms.reset(); notice = HubNotice(); star = null; telemetryNotice = null; noProvider = null; migrating = null; migrateOpen = false; projects = emptyList(); threads = emptyList(); entries = emptyMap(); older = emptyMap(); listsLoaded = false; open = null
if (clearDisk) link?.let { Pairing.key(it) }?.let { cacheFile(it).delete() }
}

Expand Down Expand Up @@ -268,6 +272,7 @@ object DataClient {
scope.launch { synchronise(g) }
scope.launch { Clones.reconcile() } // a clone followed across the reconnect: its pushes meanwhile were missed
heardOffer(o.optString("hubOffer"))
noProvider = DNoProvider.of(o.opt("noProvider"))
}
"reply" -> {
val d = calls.remove(o.optInt("id", -1)) ?: return
Expand All @@ -283,7 +288,7 @@ object DataClient {
"hub.restarting" -> { o.optString("text").takeIf { it.isNotEmpty() }?.let { restarting = RestartNote(it, System.currentTimeMillis()); strip() } }
"telemetry.notice" -> { telemetryNotice = DTelemetryNotice.of(o.optJSONObject("notice")) }
"migrating" -> heardMigrating(o)
"info" -> o.optJSONObject("info")?.let { if (it.has("hub.offer")) heardOffer(it.optString("hub.offer")); if (it.has("hub.back")) heardBack(it.optString("hub.back")); heardMgmt(it) }
"info" -> o.optJSONObject("info")?.let { if (it.has("hub.offer")) heardOffer(it.optString("hub.offer")); if (it.has("hub.back")) heardBack(it.optString("hub.back")); if (it.has("provider.notice")) noProvider = DNoProvider.of(it.opt("provider.notice")); heardMgmt(it) }
"shot" -> { shotBot = o.optString("bot"); shot = o.optLong("n") }
}
}
Expand Down Expand Up @@ -908,7 +913,7 @@ object DataClient {
suspend fun runCommand(tid: String, text: String): JSONObject {
// `exists`: this app offers Add existing on a folder /project found not empty (the answer's kind "exists")
val r = call("composer.run", JSONObject().put("thread", tid).put("text", text).put("exists", true))
if (r.optString("kind") == "btw") btw = btw + (tid to Btw(r.optString("q"), Msg.android_thinking))
if (r.optString("kind") == "btw") btw = btw + (tid to Btw(r.optString("q"), r.optString("a").ifEmpty { Msg.android_thinking }))
return r
}
fun closeBtw(tid: String) { btw = btw - tid }
Expand Down Expand Up @@ -1405,3 +1410,20 @@ data class DTelemetryNotice(val token: String, val text: String, val off: String
fun act(token: String, action: String): JSONObject = JSONObject().put("token", token).put("action", action)
}
}

/** Hub notice shown when zero AI providers / accounts are configured or signed in. */
data class DNoProvider(val reason: String, val head: String, val text: String, val button: String, val url: String) {
companion object {
fun of(v: Any?): DNoProvider? {
val o = when (v) {
is JSONObject -> v
is String -> v.trim().takeIf { it.isNotEmpty() }?.let { runCatching { JSONObject(it) }.getOrNull() }
else -> null
} ?: return null
val head = o.optString("head").trim()
if (head.isEmpty()) return null
return DNoProvider(o.optString("reason"), head, o.optString("text"), o.optString("button"), o.optString("url"))
}
fun isSendError(msg: String): Boolean = msg.startsWith("No AI provider connected yet.")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.json.JSONObject
// phone numbers in the dialer. A backplane:// link or a path is asked of the hub (link.resolve), which says what it opens: a thread (also one on a linked machine), a
// project, a room, a file at a line, or a short note why not. DataRoot follows `DataClient.linkTarget`.
data class LinkTarget(val kind: Kind, val id: String, val path: String = "", val line: Int = 0, val n: Long = System.nanoTime()) {
enum class Kind { THREAD, PROJECT, ROOM, FILE }
enum class Kind { THREAD, PROJECT, ROOM, FILE, SETTINGS }
}

/** What to ask the hub for a tapped link: a backplane:// address (this build's own scheme counts as it), or the path a bppath: link carries. */
Expand Down Expand Up @@ -59,7 +59,10 @@ fun DataClient.openLink(url: String, thread: String) {
// a hub that does not know link.resolve: a thread link as before, the rest says so
if (!has("links")) {
val id = if (text.startsWith("backplane://thread/")) text.removePrefix("backplane://thread/").substringBefore('#').substringBefore('/') else ""
if (id.isNotEmpty()) linkTarget = LinkTarget(LinkTarget.Kind.THREAD, id) else say(Msg.android_link_old)
val page = if (text.startsWith("backplane://settings/")) text.removePrefix("backplane://settings/").substringBefore('#').substringBefore('?').trimEnd('/') else null
if (id.isNotEmpty()) linkTarget = LinkTarget(LinkTarget.Kind.THREAD, id)
else if (page != null) linkTarget = LinkTarget(LinkTarget.Kind.SETTINGS, page)
else say(Msg.android_link_old)
return@launch
}
try {
Expand All @@ -69,6 +72,7 @@ fun DataClient.openLink(url: String, thread: String) {
"project" -> LinkTarget(LinkTarget.Kind.PROJECT, r.optString("project"))
"room" -> LinkTarget(LinkTarget.Kind.ROOM, r.optString("room"))
"file" -> LinkTarget(LinkTarget.Kind.FILE, r.optString("thread"), r.optString("path"), r.optInt("line"))
"settings" -> LinkTarget(LinkTarget.Kind.SETTINGS, r.optString("page"))
else -> {
// a file the reply lists that no viewer here opens is downloaded instead
val f = pathOf(url)?.let { p -> FileFetch.find(p, entries[thread].orEmpty().flatMap { it.files }) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ fun DataRoot() {
var page by remember { mutableStateOf<Page>(DataClient.openFromIntent?.let { if (DataClient.openViewerTab != null) Page.Viewer(it) else Page.Thread(it) } ?: Page.Home) }
// an expired sign-in's alert: that account, its sign-in started
LaunchedEffect(DataClient.openAccount) { DataClient.openAccount?.let { page = Page.Account(it, true); DataClient.openAccount = null } }
LaunchedEffect(DataClient.openAccounts) { if (DataClient.openAccounts) { DataClient.openAccounts = false; page = Page.Accounts } }
LaunchedEffect(DataClient.openSettings) { if (DataClient.openSettings) { DataClient.openSettings = false; page = Page.Settings } }
LaunchedEffect(DataClient.openFromIntent) { DataClient.openFromIntent?.let { page = if (DataClient.openViewerTab != null) Page.Viewer(it) else Page.Thread(it); DataClient.openFromIntent = null } }
// a link the hub resolved (DataLinks.kt): its screen
LaunchedEffect(DataClient.openAddProject) { if (DataClient.openAddProject) { DataClient.openAddProject = false; page = Page.Folders() } }
Expand All @@ -120,6 +122,7 @@ fun DataRoot() {
LinkTarget.Kind.THREAD -> page = Page.Thread(t.id)
LinkTarget.Kind.FILE -> page = Page.Viewer(t.id, t.path, t.line)
LinkTarget.Kind.PROJECT -> { DataClient.focusProject = t.id; page = Page.Home }
LinkTarget.Kind.SETTINGS -> page = if (t.id == "accounts") Page.Accounts else Page.Settings
LinkTarget.Kind.ROOM -> {
if (Swarms.on() && !Swarms.isSwarm(t.id)) Swarms.load()
if (Swarms.isSwarm(t.id)) { page = Page.Swarm(t.id); return@LaunchedEffect } // a swarm's page is its room's
Expand Down Expand Up @@ -351,6 +354,7 @@ private fun HomeScreen(open: (String) -> Unit, settings: () -> Unit, hub: () ->
IconButton(onClick = settings, modifier = Modifier.testTag("home.settings")) { Icon(Icons.Default.Settings, Msg.palette_settings, tint = dcs.onSurfaceVariant) }
}
ConnBanner(hub, settings)
NoProviderBanner { DataClient.openAccounts = true }
Row(Modifier.fillMaxWidth().padding(start = 10.dp, end = 4.dp, top = 8.dp, bottom = 8.dp), verticalAlignment = Alignment.CenterVertically) {
if (DataClient.has("search")) Box(Modifier.weight(1f)) { DField(q, { q = it }, Msg.android_search_hint, Modifier.testTag("home.searchfield")) } else Spacer(Modifier.weight(1f))
IconButton(onClick = addProject, modifier = Modifier.testTag("home.add")) { Icon(Icons.Default.Add, Msg.sidebar_add_project, tint = dcs.onSurfaceVariant) }
Expand Down Expand Up @@ -741,6 +745,7 @@ private fun ThreadBody(id: String, viewer: () -> Unit, hub: () -> Unit, go: (Str
if (thread?.state == "working") item("working") { WorkingRow() }
}
DLine()
if (!id.contains('~')) NoProviderBanner { DataClient.openAccounts = true }
review?.let { r -> ReviewBar(r, !reviewing) { if (!reviewing) { reviewing = true; scope.launch { try { review = DataClient.reviewSet(id, r.value) } catch (e: Exception) { notice = e.message ?: "" } finally { reviewing = false } } } } }
order?.let { OrderCard(it) }
MentionPopup(draft) { put(it) }
Expand All @@ -752,7 +757,10 @@ private fun ThreadBody(id: String, viewer: () -> Unit, hub: () -> Unit, go: (Str
if (notice.isNotEmpty()) DMono(Tr.t(notice), dwarn, 12)
existing?.let { dir -> DBtn(Msg.android_hub_cmd_project_existing, false, true, Modifier.testTag("thread.project.existing")) { scope.launch { try { DataClient.addProject(dir); existing = null; notice = ""; put("") } catch (e: Exception) { notice = e.message ?: Msg.android_failed_generic } } } }
thread?.mark?.let { m -> DMono(Tr.t(m.runs) + if (m.away) " · " + Msg.android_away else "", dfaint, 11, Modifier.testTag("thread.runs")) }
DataClient.sendError[id]?.let { DMono(Tr.t(it), dcs.error, 12, Modifier.testTag("thread.refused")) }
DataClient.sendError[id]?.let {
DMono(Tr.t(it), dcs.error, 12, Modifier.testTag("thread.refused"))
if (DNoProvider.isSendError(it)) DBtn(Msg.provider_notice_button, false, true, Modifier.testTag("thread.refused.accounts")) { DataClient.openAccounts = true }
}
if (pending.isNotEmpty()) Row(Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
pending.toList().forEach { b -> Box(Modifier.testTag("thread.pending").clickable { pending.remove(b) }) { Pic(b, 64) }; }
}
Expand Down Expand Up @@ -1534,6 +1542,18 @@ internal fun ReviewBar(r: DReviewBar, enabled: Boolean, press: () -> Unit) {
}
}

/** Proactive banner shown when the hub has zero AI providers configured or signed in. */
@Composable
internal fun NoProviderBanner(onOpenAccounts: () -> Unit) {
val n = DataClient.noProvider ?: return
Column(Modifier.fillMaxWidth().padding(horizontal = 12.dp, vertical = 6.dp).border(BorderStroke(1.dp, dwarn)).background(dcs.surfaceVariant).padding(horizontal = 10.dp, vertical = 8.dp).testTag("provider.notice"),
verticalArrangement = Arrangement.spacedBy(6.dp)) {
DMono(Tr.t(n.head), dcs.onSurface, 12, bold = true)
if (n.text.isNotEmpty()) DMono(Tr.t(n.text), dcs.onSurfaceVariant, 11, lines = 3)
DBtn(if (n.button.isNotEmpty()) Tr.t(n.button) else Msg.provider_notice_button, true, modifier = Modifier.testTag("provider.notice.button")) { onOpenAccounts() }
}
}

/** A buy thread's Order card: the steps, the hub's line, the total and what it covers about customs, and Buy now (the hub's link, opened in the browser). */
@Composable
private fun OrderCard(o: DataClient.Order) {
Expand Down
Loading
Loading