From 266fd748d0d32e7cf4960e899cf1feb6661861e8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 4 Jan 2026 16:46:39 +0000 Subject: [PATCH] fix(ui): allow Control UI chat without node --- ui/src/ui/app-render.ts | 13 ++----------- ui/src/ui/app.ts | 14 +------------- ui/src/ui/views/chat.ts | 14 ++++++-------- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index ad283bcd1..c84a875ab 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -183,16 +183,7 @@ export function renderApp(state: AppViewState) { const presenceCount = state.presenceEntries.length; const sessionsCount = state.sessionsResult?.count ?? null; const cronNext = state.cronStatus?.nextWakeAtMs ?? null; - const hasConnectedMobileNode = state.nodes.some((n) => { - if (!Boolean(n.connected)) return false; - const p = typeof n.platform === "string" ? n.platform.trim().toLowerCase() : ""; - return p.startsWith("ios") || p.startsWith("ipados") || p.startsWith("android"); - }); - const chatDisabledReason = !state.connected - ? "Disconnected from gateway." - : hasConnectedMobileNode - ? null - : "No connected iOS/Android node — Web Chat + Talk are disabled."; + const chatDisabledReason = state.connected ? null : "Disconnected from gateway."; return html`
@@ -398,7 +389,7 @@ export function renderApp(state: AppViewState) { stream: state.chatStream, draft: state.chatMessage, connected: state.connected, - canSend: state.connected && hasConnectedMobileNode, + canSend: state.connected, disabledReason: chatDisabledReason, sessions: state.sessionsResult, onRefresh: () => { diff --git a/ui/src/ui/app.ts b/ui/src/ui/app.ts index ca3d19550..620080abb 100644 --- a/ui/src/ui/app.ts +++ b/ui/src/ui/app.ts @@ -451,17 +451,6 @@ export class ClawdbotApp extends LitElement { this.nodesPollInterval = null; } - private hasConnectedMobileNode() { - return this.nodes.some((n) => { - if (!Boolean(n.connected)) return false; - const p = - typeof n.platform === "string" ? n.platform.trim().toLowerCase() : ""; - return ( - p.startsWith("ios") || p.startsWith("ipados") || p.startsWith("android") - ); - }); - } - resetToolStream() { this.toolStreamById.clear(); this.toolStreamOrder = []; @@ -765,9 +754,8 @@ export class ClawdbotApp extends LitElement { async loadCron() { await Promise.all([loadCronStatus(this), loadCronJobs(this)]); } - async handleSendChat() { - if (!this.connected || !this.hasConnectedMobileNode()) return; + if (!this.connected) return; await sendChat(this); void loadChatHistory(this); } diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index 7a07638cd..d501c3744 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -23,13 +23,11 @@ export type ChatProps = { export function renderChat(props: ChatProps) { const canInteract = props.connected; - const canCompose = props.canSend && !props.sending; + const canCompose = props.connected && !props.sending; const sessionOptions = resolveSessionOptions(props.sessionKey, props.sessions); - const composePlaceholder = (() => { - if (!props.connected) return "Connect to the gateway to start chatting…"; - if (!props.canSend) return "Connect an iOS/Android node to enable Web Chat + Talk…"; - return "Message (⌘↩ to send)"; - })(); + const composePlaceholder = props.connected + ? "Message (⌘↩ to send)" + : "Connect to the gateway to start chatting…"; return html`
@@ -90,7 +88,7 @@ export function renderChat(props: ChatProps) { Message