Rename daemon UI copy to host

This commit is contained in:
Mohamed Boudra
2025-11-26 17:26:25 +01:00
parent 59967aad87
commit 04d51fbe10
10 changed files with 82 additions and 143 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ function MissingDaemonView() {
textAlign: "center",
}}
>
No daemon configured. Open Settings to add a server URL.
No host configured. Open Settings to add a server URL.
</Text>
</View>
);
@@ -104,7 +104,7 @@ export default function AgentScreen() {
const connectionServerId = resolvedServerId ?? null;
const connection = connectionServerId ? connectionStates.get(connectionServerId) : null;
const serverLabel = connection?.daemon.label ?? connectionServerId ?? "Selected daemon";
const serverLabel = connection?.daemon.label ?? connectionServerId ?? "Selected host";
const isUnknownDaemon = Boolean(connectionServerId && !connection);
const connectionStatus = connection?.status ?? (isUnknownDaemon ? "offline" : "idle");
const connectionStatusLabel = formatConnectionStatus(connectionStatus);
+1 -1
View File
@@ -56,7 +56,7 @@ export default function FileExplorerScreen() {
const connectionServerId = resolvedServerId ?? null;
const connection = connectionServerId ? connectionStates.get(connectionServerId) : null;
const serverLabel = connection?.daemon.label ?? connectionServerId ?? session?.serverId ?? "Selected daemon";
const serverLabel = connection?.daemon.label ?? connectionServerId ?? session?.serverId ?? "Selected host";
const connectionStatus = connection?.status ?? "idle";
const connectionStatusLabel = formatConnectionStatus(connectionStatus);
const lastError = connection?.lastError ?? null;
+1 -1
View File
@@ -65,7 +65,7 @@ export default function GitDiffScreen() {
const connectionServerId = resolvedServerId ?? null;
const connection = connectionServerId ? connectionStates.get(connectionServerId) : null;
const serverLabel = connection?.daemon.label ?? connectionServerId ?? session?.serverId ?? "Active daemon";
const serverLabel = connection?.daemon.label ?? connectionServerId ?? session?.serverId ?? "Active host";
const connectionStatus = connection?.status ?? "idle";
const connectionStatusLabel = formatConnectionStatus(connectionStatus);
const lastError = connection?.lastError ?? null;
+19 -19
View File
@@ -357,9 +357,9 @@ export default function SettingsScreen() {
? `${activeDaemon.label}${activeDaemonStatusLabel ? ` - ${activeDaemonStatusLabel}` : ""}${
isServerConfigLocked ? " - Session unavailable" : ""
}`
: "No active daemon selected.";
: "No active host selected.";
const serverHelperText = isServerConfigLocked
? `Connect to ${activeDaemon?.label ?? "this daemon"} to edit its server URL.`
? `Connect to ${activeDaemon?.label ?? "this host"} to edit its server URL.`
: "Must be a valid WebSocket URL (ws:// or wss://)";
useEffect(() => {
@@ -459,11 +459,11 @@ export default function SettingsScreen() {
const handleSubmitDaemonForm = useCallback(async () => {
if (!daemonForm.label.trim()) {
Alert.alert("Label required", "Please enter a label for the daemon.");
Alert.alert("Label required", "Please enter a label for the host.");
return;
}
if (!validateServerUrl(daemonForm.wsUrl)) {
Alert.alert("Invalid URL", "Daemon URL must be ws:// or wss://");
Alert.alert("Invalid URL", "Host URL must be ws:// or wss://");
return;
}
@@ -484,7 +484,7 @@ export default function SettingsScreen() {
handleCloseDaemonForm();
} catch (error) {
console.error("[Settings] Failed to save daemon", error);
Alert.alert("Error", "Unable to save daemon");
Alert.alert("Error", "Unable to save host");
} finally {
setIsSavingDaemon(false);
}
@@ -493,7 +493,7 @@ export default function SettingsScreen() {
const handleRemoveDaemon = useCallback(
(profile: DaemonProfile) => {
Alert.alert(
"Remove Daemon",
"Remove Host",
`Remove ${profile.label}?`,
[
{ text: "Cancel", style: "cancel" },
@@ -505,7 +505,7 @@ export default function SettingsScreen() {
await removeDaemon(profile.id);
} catch (error) {
console.error("[Settings] Failed to remove daemon", error);
Alert.alert("Error", "Unable to remove daemon");
Alert.alert("Error", "Unable to remove host");
}
},
},
@@ -541,7 +541,7 @@ export default function SettingsScreen() {
async (profile: DaemonProfile) => {
const url = profile.wsUrl;
if (!validateServerUrl(url)) {
Alert.alert("Invalid URL", "Daemon URL must be ws:// or wss://");
Alert.alert("Invalid URL", "Host URL must be ws:// or wss://");
return;
}
updateDaemonTestState(profile.id, { status: "testing" });
@@ -592,9 +592,9 @@ export default function SettingsScreen() {
function deriveDaemonLabel(url: string): string {
try {
const parsed = new URL(url);
return parsed.hostname || "Daemon";
return parsed.hostname || "Host";
} catch {
return "Daemon";
return "Host";
}
}
@@ -685,7 +685,7 @@ export default function SettingsScreen() {
if (isServerConfigLocked) {
Alert.alert(
"Session unavailable",
`${activeDaemon?.label ?? "This daemon"} is not connected. Connect to it before testing the URL.`
`${activeDaemon?.label ?? "This host"} is not connected. Connect to it before testing the URL.`
);
return;
}
@@ -803,13 +803,13 @@ export default function SettingsScreen() {
)}
</View>
{/* Daemon Management */}
{/* Host Management */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>Daemons</Text>
<Text style={styles.sectionTitle}>Hosts</Text>
{daemons.length === 0 ? (
<View style={styles.settingCard}>
<Text style={styles.settingDescription}>No daemons configured.</Text>
<Text style={styles.settingDescription}>No hosts configured.</Text>
</View>
) : (
daemons.map((daemon) => {
@@ -841,7 +841,7 @@ export default function SettingsScreen() {
{isDaemonFormVisible ? (
<View style={styles.settingCard}>
<Text style={styles.settingTitle}>{daemonForm.id ? "Edit Daemon" : "Add Daemon"}</Text>
<Text style={styles.settingTitle}>{daemonForm.id ? "Edit Host" : "Add Host"}</Text>
<Text style={styles.label}>Label</Text>
<TextInput
style={styles.input}
@@ -886,14 +886,14 @@ export default function SettingsScreen() {
disabled={isSavingDaemon}
>
<Text style={[styles.daemonActionText, styles.daemonActionPrimaryText]}>
{isSavingDaemon ? "Saving..." : daemonForm.id ? "Save Daemon" : "Add Daemon"}
{isSavingDaemon ? "Saving..." : daemonForm.id ? "Save Host" : "Add Host"}
</Text>
</Pressable>
</View>
</View>
) : (
<Pressable style={styles.addButton} onPress={() => handleOpenDaemonForm()}>
<Text style={styles.addButtonText}>Add Daemon</Text>
<Text style={styles.addButtonText}>Add Host</Text>
</Pressable>
)}
</View>
@@ -1103,7 +1103,7 @@ function DaemonCard({
const beginServerRestart = useCallback(() => {
if (!daemonSession) {
Alert.alert(
"Daemon unavailable",
"Host unavailable",
`${daemon.label} is not connected. Select it to connect before restarting.`
);
return;
@@ -1133,7 +1133,7 @@ function DaemonCard({
const handleRestartPress = useCallback(() => {
if (!daemonSession) {
Alert.alert(
"Daemon unavailable",
"Host unavailable",
`${daemon.label} is not connected. Select it to connect before restarting.`
);
return;
+2 -2
View File
@@ -146,7 +146,7 @@ export function AgentList({ agentGroups }: AgentListProps) {
</Text>
<Text style={styles.sheetSubtitle}>
{isActionDaemonUnavailable
? "Connect this daemon before managing its agents."
? "Connect this host before managing its agents."
: "Removing this agent only deletes it from Paseo. Claude/Codex keeps the original project."}
</Text>
<Pressable
@@ -160,7 +160,7 @@ export function AgentList({ agentGroups }: AgentListProps) {
(!deleteAgent || isActionDaemonUnavailable) && styles.sheetDeleteTextDisabled,
]}
>
{isActionDaemonUnavailable ? "Daemon offline" : "Delete agent"}
{isActionDaemonUnavailable ? "Host offline" : "Delete agent"}
</Text>
</Pressable>
<Pressable
@@ -326,7 +326,7 @@ function AgentFlowModal({
selectedDaemonConnection?.daemon.label ??
selectedDaemonConnection?.daemon.wsUrl ??
selectedDaemonId ??
"Selected daemon";
"Selected host";
const selectedDaemonStatusLabel = formatConnectionStatus(selectedDaemonStatus);
const selectedDaemonIsUnavailable =
!session || selectedDaemonStatus !== "online" || !ws?.isConnected;
@@ -987,7 +987,7 @@ function AgentFlowModal({
logOfflineDaemonAction("dictation");
setErrorMessage(
daemonAvailabilityError ??
"Connect to the selected daemon before using dictation."
"Connect to the selected host before using dictation."
);
return;
}
@@ -1060,8 +1060,8 @@ function AgentFlowModal({
setIsImportLoading(false);
logOfflineDaemonAction("import_list");
setImportError(
daemonAvailabilityError ??
"Connect to the selected daemon to load import candidates."
daemonAvailabilityError ??
"Connect to the selected host to load import candidates."
);
return;
}
@@ -1313,7 +1313,7 @@ function AgentFlowModal({
const trimmedWorkingDir = workingDir.trim();
const shouldInspectRepo = isCreateFlow && isVisible && trimmedWorkingDir.length > 0;
const repoAvailabilityError = shouldInspectRepo && (!isTargetDaemonReady || !isWsConnected)
? daemonAvailabilityError ?? "Connect to the selected daemon to inspect the repository."
? daemonAvailabilityError ?? "Connect to the selected host to inspect the repository."
: null;
const repoInfoStatus: "idle" | "loading" | "ready" | "error" = !shouldInspectRepo
? "idle"
@@ -1392,7 +1392,7 @@ function AgentFlowModal({
logOfflineDaemonAction("create");
setErrorMessage(
daemonAvailabilityError ??
"Connect to the selected daemon before creating an agent."
"Connect to the selected host before creating an agent."
);
return;
}
@@ -1494,8 +1494,8 @@ function AgentFlowModal({
if (!resumeAgent || !isTargetDaemonReady) {
logOfflineDaemonAction("resume");
setImportError(
daemonAvailabilityError ??
"Connect to the selected daemon before importing an agent."
daemonAvailabilityError ??
"Connect to the selected host before importing an agent."
);
return;
}
@@ -1861,9 +1861,9 @@ function AgentFlowModal({
showsVerticalScrollIndicator={false}
>
<View style={styles.daemonSelectorSection}>
<Text style={styles.daemonSelectorLabel}>Target Daemon</Text>
<Text style={styles.daemonSelectorLabel}>Target Host</Text>
{daemonEntries.length === 0 ? (
<Text style={styles.daemonChipText}>No daemons available</Text>
<Text style={styles.daemonChipText}>No hosts available</Text>
) : (
<ScrollView
horizontal
@@ -108,7 +108,7 @@ export function DaemonRegistryProvider({ children }: { children: ReactNode }) {
const removeDaemon = useCallback(async (id: string) => {
const remaining = readDaemons().filter((daemon) => daemon.id !== id);
const normalized = normalizeDefaults(remaining);
await persist(normalized.length > 0 ? normalized : [createProfile("Local Daemon", FALLBACK_DAEMON_URL, true)]);
await persist(normalized.length > 0 ? normalized : [createProfile("Local Host", FALLBACK_DAEMON_URL, true)]);
}, [persist, readDaemons]);
const setDefaultDaemon = useCallback(async (id: string) => {
@@ -154,9 +154,9 @@ function generateDaemonId(): string {
function deriveLabelFromUrl(url: string): string {
try {
const parsed = new URL(url);
return parsed.hostname || "Unnamed Daemon";
return parsed.hostname || "Unnamed Host";
} catch {
return "Unnamed Daemon";
return "Unnamed Host";
}
}
@@ -202,13 +202,13 @@ async function loadDaemonRegistryFromStorage(): Promise<DaemonProfile[]> {
const legacyParsed = JSON.parse(legacy) as Record<string, unknown>;
const legacyUrl = typeof legacyParsed.serverUrl === "string" ? legacyParsed.serverUrl : null;
if (legacyUrl) {
const migrated = [createProfile("Primary Daemon", legacyUrl, true)];
const migrated = [createProfile("Primary Host", legacyUrl, true)];
await AsyncStorage.setItem(REGISTRY_STORAGE_KEY, JSON.stringify(migrated));
return migrated;
}
}
const fallback = [createProfile("Local Daemon", FALLBACK_DAEMON_URL, true)];
const fallback = [createProfile("Local Host", FALLBACK_DAEMON_URL, true)];
await AsyncStorage.setItem(REGISTRY_STORAGE_KEY, JSON.stringify(fallback));
return fallback;
} catch (error) {
+2 -2
View File
@@ -9,7 +9,7 @@ export class DaemonSessionUnavailableError extends Error {
serverId: string;
constructor(serverId: string) {
super(`Daemon session "${serverId}" is unavailable`);
super(`Host session "${serverId}" is unavailable`);
this.name = "DaemonSessionUnavailableError";
this.serverId = serverId;
}
@@ -66,7 +66,7 @@ export function useDaemonSession(serverId?: string, options?: UseDaemonSessionOp
if (!suppressUnavailableAlert && !alertedDaemonsRef.current.has(targetServerId)) {
alertedDaemonsRef.current.add(targetServerId);
Alert.alert("Daemon unavailable", message.trim());
Alert.alert("Host unavailable", message.trim());
}
if (!loggedDaemonsRef.current.has(targetServerId)) {