From 69881d38624d9184d38b4b7d94be491afc2fc500 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Wed, 26 Nov 2025 20:03:22 +0100 Subject: [PATCH] Remove connection status banners from home screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Host health now only displays in Settings. The home screen no longer shows offline/connecting/error banners for hosts, following the principle that a stopped host is not an error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- packages/app/src/app/index.tsx | 76 +--------------------------------- plan.md | 20 +++++---- 2 files changed, 15 insertions(+), 81 deletions(-) diff --git a/packages/app/src/app/index.tsx b/packages/app/src/app/index.tsx index 3d7ad105d..9b32fafd7 100644 --- a/packages/app/src/app/index.tsx +++ b/packages/app/src/app/index.tsx @@ -1,22 +1,18 @@ -import { View, Text } from "react-native"; +import { View } from "react-native"; import { useState, useCallback, useMemo, useRef, useEffect } from "react"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useReanimatedKeyboardAnimation } from "react-native-keyboard-controller"; import ReanimatedAnimated, { useAnimatedStyle } from "react-native-reanimated"; -import { StyleSheet, useUnistyles } from "react-native-unistyles"; +import { StyleSheet } from "react-native-unistyles"; import { HomeHeader } from "@/components/headers/home-header"; import { EmptyState } from "@/components/empty-state"; import { AgentList } from "@/components/agent-list"; import { CreateAgentModal, ImportAgentModal } from "@/components/create-agent-modal"; import { useAggregatedAgents } from "@/hooks/use-aggregated-agents"; -import { useDaemonConnections } from "@/contexts/daemon-connections-context"; -import { formatConnectionStatus, getConnectionStatusTone, type ConnectionStatusTone } from "@/utils/daemons"; import { useLocalSearchParams } from "expo-router"; export default function HomeScreen() { - const { theme } = useUnistyles(); const insets = useSafeAreaInsets(); - const { connectionStates } = useDaemonConnections(); const aggregatedAgents = useAggregatedAgents(); const [showCreateModal, setShowCreateModal] = useState(false); const [showImportModal, setShowImportModal] = useState(false); @@ -44,17 +40,6 @@ export default function HomeScreen() { const aggregatedCount = aggregatedAgents.reduce((count, group) => count + group.agents.length, 0); const hasAgents = aggregatedCount > 0; - const connectionIssues = useMemo(() => { - return Array.from(connectionStates.values()).filter( - (entry) => entry.status === "connecting" || entry.status === "offline" || entry.status === "error" - ); - }, [connectionStates]); - const statusColors: Record = { - success: theme.colors.palette.green[400], - warning: theme.colors.palette.amber[500], - error: theme.colors.destructive, - muted: theme.colors.mutedForeground, - }; const handleCreateAgent = useCallback(() => { setCreateModalMounted(true); @@ -119,30 +104,6 @@ export default function HomeScreen() { onImportAgent={handleImportAgent} /> - {connectionIssues.length > 0 ? ( - - {connectionIssues.map((entry) => { - const tone = getConnectionStatusTone(entry.status); - const statusColor = statusColors[tone]; - return ( - - - - - {entry.daemon.label} · {formatConnectionStatus(entry.status)} - - - {entry.lastError ? ( - - {entry.lastError} - - ) : null} - - ); - })} - - ) : null} - {/* Content Area with Keyboard Animation */} {hasAgents ? ( @@ -178,39 +139,6 @@ const styles = StyleSheet.create((theme) => ({ flex: 1, backgroundColor: theme.colors.background, }, - connectionBanner: { - paddingHorizontal: theme.spacing[4], - paddingTop: theme.spacing[4], - gap: theme.spacing[2], - }, - connectionRow: { - backgroundColor: theme.colors.card, - borderRadius: theme.borderRadius.lg, - borderWidth: theme.borderWidth[1], - borderColor: theme.colors.border, - paddingHorizontal: theme.spacing[4], - paddingVertical: theme.spacing[3], - gap: theme.spacing[1], - }, - connectionHeader: { - flexDirection: "row", - alignItems: "center", - gap: theme.spacing[2], - }, - connectionDot: { - width: 8, - height: 8, - borderRadius: theme.borderRadius.full, - }, - connectionLabel: { - color: theme.colors.foreground, - fontSize: theme.fontSize.sm, - fontWeight: theme.fontWeight.semibold, - }, - connectionError: { - color: theme.colors.destructive, - fontSize: theme.fontSize.xs, - }, content: { flex: 1, }, diff --git a/plan.md b/plan.md index 72ff90515..26e054488 100644 --- a/plan.md +++ b/plan.md @@ -56,12 +56,15 @@ The multi-daemon infrastructure is in place: session directory with daemon-scope - Updated the host-unavailable alert, agent-not-found message, and settings restart failure copy to reassure that hosts reconnect automatically instead of asking users to connect manually; verified with `npm run typecheck --workspace=@paseo/app`. ### 5. Remove Host Status from Home Screen -- [ ] Remove connection status banners/indicators from the home screen—settings is the place to check host health. +- [x] Remove connection status banners/indicators from the home screen—settings is the place to check host health. - Context (review): `packages/app/src/app/index.tsx:47-144` still renders `connectionBanner` cards that surface per-host offline/error states directly on Home, so host health is still exposed outside Settings. + - Review (2025-11-26): The `connectionIssues` filter includes `offline`, `connecting`, and `error` statuses, so any host that isn't `online` shows up in the banner. This contradicts the guiding principle that a stopped host is not an error. + - Removed the connection status banner, associated state (`connectionIssues`, `statusColors`), styles, and unused imports (`useDaemonConnections`, `formatConnectionStatus`, `getConnectionStatusTone`, `Text`, `useUnistyles`) from `packages/app/src/app/index.tsx`; verified with `npm run typecheck --workspace=@paseo/app`. ### 6. Fix Error Philosophy - [ ] A stopped/disconnected host is NOT an error—don't show error states on home screen just because a host is offline. - Context (review): The home connection banner still prints destructive red `connectionError` text for every offline host entry, so the screen treats normal downtime as an error (`packages/app/src/app/index.tsx:123-140`). + - Review (2025-11-26): The `connectionError` style unconditionally uses `theme.colors.destructive` (line 210-213) for `lastError` messages, even though `getConnectionStatusTone` correctly returns `warning` (amber) for `offline` status. The dot color respects the tone, but the error text does not. - [ ] Only show errors when the user tries to interact with an agent whose host is stopped. - [ ] Update connection banners/indicators to show neutral "offline" state instead of error styling. - [x] Make the Git Diff offline/unavailable state neutral and stop instructing users to "connect" manually. @@ -71,12 +74,15 @@ The multi-daemon infrastructure is in place: session directory with daemon-scope - [x] Audit the agent detail flows for the same issue (offline agent screen + delete sheet) and replace the "connect this host" requirement with passive/offline messaging. - Context (update): `AgentSessionUnavailableState` and the delete sheet subtitle in `packages/app/src/components/agent-list.tsx` now explain that offline hosts reconnect automatically, removing the manual "connect" instruction. -### 6. Agent Creation Flow -- [ ] Remove reliance on "primary" or "active" daemon for agent creation. -- [ ] Require explicit host selection when creating an agent—user must choose where to deploy. -- [ ] Fix the contradictory error message "Daemon is online, connect to it before creating"—this should never appear. +### 7. Agent Creation Flow +- [x] Remove reliance on "primary" or "active" daemon for agent creation. + - Review (2025-11-26): Verified that `create-agent-modal.tsx` no longer uses or falls back to any "active" or "primary" daemon; the modal requires explicit host selection and shows "Select a host before creating or importing agents" when none is chosen. +- [x] Require explicit host selection when creating an agent—user must choose where to deploy. + - Review (2025-11-26): The `selectedServerId` state controls host selection, and `daemonAvailabilityError` blocks creation until a host is selected (`packages/app/src/components/create-agent-modal.tsx:336-342`). +- [x] Fix the contradictory error message "Daemon is online, connect to it before creating"—this should never appear. + - Review (2025-11-26): Searched the codebase for this message pattern—no matches found. The message has been removed or never existed in the current code. -### 7. Home Screen Agent List +### 8. Home Screen Agent List - [ ] Show a loading indicator while agents are being fetched (not while waiting for hosts to connect). - Don't block the home screen for offline hosts. - Handle edge cases: no hosts configured, no hosts connected, partial host connectivity. @@ -88,6 +94,6 @@ The multi-daemon infrastructure is in place: session directory with daemon-scope - [ ] Sort agents by recent activity or alphabetically (not by host). - Context (review): `packages/app/src/hooks/use-aggregated-agents.ts:25-66` sorts sections by host registration order and only orders agents within a host, so we still bias the list ordering by host rather than recency across all agents. -### Review: Git Diff Metadata Cleanup +### 9. Review: Git Diff Metadata Cleanup - [x] Remove the now-unused `routeServerId` prop from `GitDiffContent` (`packages/app/src/app/git-diff.tsx:84-104`) so we aren't plumbing dead state through the component after switching to `serverLabel`. - Context: Deleted the redundant prop/const and updated `GitDiffContent` to rely solely on `serverLabel`, removing the final host-id plumbing that was no longer used anywhere in the component (`packages/app/src/app/git-diff.tsx`).