Remove active host notion from UI
This commit is contained in:
@@ -65,7 +65,7 @@ export default function GitDiffScreen() {
|
|||||||
|
|
||||||
const connectionServerId = resolvedServerId ?? null;
|
const connectionServerId = resolvedServerId ?? null;
|
||||||
const connection = connectionServerId ? connectionStates.get(connectionServerId) : null;
|
const connection = connectionServerId ? connectionStates.get(connectionServerId) : null;
|
||||||
const serverLabel = connection?.daemon.label ?? connectionServerId ?? session?.serverId ?? "Active host";
|
const serverLabel = connection?.daemon.label ?? connectionServerId ?? session?.serverId ?? "Current host";
|
||||||
const connectionStatus = connection?.status ?? "idle";
|
const connectionStatus = connection?.status ?? "idle";
|
||||||
const connectionStatusLabel = formatConnectionStatus(connectionStatus);
|
const connectionStatusLabel = formatConnectionStatus(connectionStatus);
|
||||||
const lastError = connection?.lastError ?? null;
|
const lastError = connection?.lastError ?? null;
|
||||||
|
|||||||
@@ -125,10 +125,6 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
daemonCard: {
|
daemonCard: {
|
||||||
gap: theme.spacing[2],
|
gap: theme.spacing[2],
|
||||||
},
|
},
|
||||||
daemonCardActive: {
|
|
||||||
borderWidth: theme.borderWidth[1],
|
|
||||||
borderColor: theme.colors.palette.blue[500],
|
|
||||||
},
|
|
||||||
settingRow: {
|
settingRow: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
@@ -357,7 +353,7 @@ export default function SettingsScreen() {
|
|||||||
? `${activeDaemon.label}${activeDaemonStatusLabel ? ` - ${activeDaemonStatusLabel}` : ""}${
|
? `${activeDaemon.label}${activeDaemonStatusLabel ? ` - ${activeDaemonStatusLabel}` : ""}${
|
||||||
isServerConfigLocked ? " - Session unavailable" : ""
|
isServerConfigLocked ? " - Session unavailable" : ""
|
||||||
}`
|
}`
|
||||||
: "No active host selected.";
|
: "Add a host to configure its server URL.";
|
||||||
const serverHelperText = isServerConfigLocked
|
const serverHelperText = isServerConfigLocked
|
||||||
? `Connect to ${activeDaemon?.label ?? "this host"} 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://)";
|
: "Must be a valid WebSocket URL (ws:// or wss://)";
|
||||||
@@ -522,13 +518,6 @@ export default function SettingsScreen() {
|
|||||||
[setDefaultDaemon]
|
[setDefaultDaemon]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSetActiveDaemon = useCallback(
|
|
||||||
(profile: DaemonProfile) => {
|
|
||||||
setActiveDaemonId(profile.id, { source: "settings_switch" });
|
|
||||||
},
|
|
||||||
[setActiveDaemonId]
|
|
||||||
);
|
|
||||||
|
|
||||||
const updateDaemonTestState = useCallback((daemonId: string, state: { status: "idle" | "testing" | "success" | "error"; message?: string }) => {
|
const updateDaemonTestState = useCallback((daemonId: string, state: { status: "idle" | "testing" | "success" | "error"; message?: string }) => {
|
||||||
setDaemonTestStates((prev) => {
|
setDaemonTestStates((prev) => {
|
||||||
const next = new Map(prev);
|
const next = new Map(prev);
|
||||||
@@ -821,11 +810,9 @@ export default function SettingsScreen() {
|
|||||||
<DaemonCard
|
<DaemonCard
|
||||||
key={daemon.id}
|
key={daemon.id}
|
||||||
daemon={daemon}
|
daemon={daemon}
|
||||||
isActive={daemon.id === activeDaemonId}
|
|
||||||
connectionStatus={connectionStatus}
|
connectionStatus={connectionStatus}
|
||||||
lastError={lastConnectionError}
|
lastError={lastConnectionError}
|
||||||
testState={testState}
|
testState={testState}
|
||||||
onSetActive={handleSetActiveDaemon}
|
|
||||||
onSetDefault={handleSetDefaultDaemon}
|
onSetDefault={handleSetDefaultDaemon}
|
||||||
onTestConnection={handleTestDaemonConnection}
|
onTestConnection={handleTestDaemonConnection}
|
||||||
onEdit={handleOpenDaemonForm}
|
onEdit={handleOpenDaemonForm}
|
||||||
@@ -1001,11 +988,9 @@ export default function SettingsScreen() {
|
|||||||
|
|
||||||
interface DaemonCardProps {
|
interface DaemonCardProps {
|
||||||
daemon: DaemonProfile;
|
daemon: DaemonProfile;
|
||||||
isActive: boolean;
|
|
||||||
connectionStatus: ConnectionStatus;
|
connectionStatus: ConnectionStatus;
|
||||||
lastError: string | null;
|
lastError: string | null;
|
||||||
testState?: DaemonTestState;
|
testState?: DaemonTestState;
|
||||||
onSetActive: (daemon: DaemonProfile) => void;
|
|
||||||
onSetDefault: (daemon: DaemonProfile) => void;
|
onSetDefault: (daemon: DaemonProfile) => void;
|
||||||
onTestConnection: (daemon: DaemonProfile) => void;
|
onTestConnection: (daemon: DaemonProfile) => void;
|
||||||
onEdit: (daemon: DaemonProfile) => void;
|
onEdit: (daemon: DaemonProfile) => void;
|
||||||
@@ -1018,11 +1003,9 @@ interface DaemonCardProps {
|
|||||||
|
|
||||||
function DaemonCard({
|
function DaemonCard({
|
||||||
daemon,
|
daemon,
|
||||||
isActive,
|
|
||||||
connectionStatus,
|
connectionStatus,
|
||||||
lastError,
|
lastError,
|
||||||
testState,
|
testState,
|
||||||
onSetActive,
|
|
||||||
onSetDefault,
|
onSetDefault,
|
||||||
onTestConnection,
|
onTestConnection,
|
||||||
onEdit,
|
onEdit,
|
||||||
@@ -1043,7 +1026,7 @@ function DaemonCard({
|
|||||||
: statusTone === "error"
|
: statusTone === "error"
|
||||||
? theme.colors.destructive
|
? theme.colors.destructive
|
||||||
: theme.colors.mutedForeground;
|
: theme.colors.mutedForeground;
|
||||||
const badgeText = isActive ? `Active · ${statusLabel}` : statusLabel;
|
const badgeText = statusLabel;
|
||||||
const connectionError = typeof lastError === "string" && lastError.trim().length > 0 ? lastError.trim() : null;
|
const connectionError = typeof lastError === "string" && lastError.trim().length > 0 ? lastError.trim() : null;
|
||||||
const daemonSession = useSessionForServer(daemon.id);
|
const daemonSession = useSessionForServer(daemon.id);
|
||||||
const [isRestarting, setIsRestarting] = useState(false);
|
const [isRestarting, setIsRestarting] = useState(false);
|
||||||
@@ -1104,7 +1087,7 @@ function DaemonCard({
|
|||||||
if (!daemonSession) {
|
if (!daemonSession) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
"Host unavailable",
|
"Host unavailable",
|
||||||
`${daemon.label} is not connected. Select it to connect before restarting.`
|
`${daemon.label} is not connected. Wait for it to come online before restarting.`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1134,7 +1117,7 @@ function DaemonCard({
|
|||||||
if (!daemonSession) {
|
if (!daemonSession) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
"Host unavailable",
|
"Host unavailable",
|
||||||
`${daemon.label} is not connected. Select it to connect before restarting.`
|
`${daemon.label} is not connected. Wait for it to come online before restarting.`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1165,7 +1148,7 @@ function DaemonCard({
|
|||||||
}, [beginServerRestart, daemon.label, daemonSession, restartConfirmationMessage]);
|
}, [beginServerRestart, daemon.label, daemonSession, restartConfirmationMessage]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[styles.settingCard, styles.daemonCard, isActive && styles.daemonCardActive]}>
|
<View style={[styles.settingCard, styles.daemonCard]}>
|
||||||
<View style={styles.daemonHeaderRow}>
|
<View style={styles.daemonHeaderRow}>
|
||||||
<Text style={styles.settingTitle}>{daemon.label}</Text>
|
<Text style={styles.settingTitle}>{daemon.label}</Text>
|
||||||
<View style={styles.connectionStatusBadge}>
|
<View style={styles.connectionStatusBadge}>
|
||||||
@@ -1189,11 +1172,6 @@ function DaemonCard({
|
|||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
<View style={styles.daemonActionsRow}>
|
<View style={styles.daemonActionsRow}>
|
||||||
{!isActive ? (
|
|
||||||
<Pressable style={styles.daemonActionButton} onPress={() => onSetActive(daemon)}>
|
|
||||||
<Text style={styles.daemonActionText}>Set Active</Text>
|
|
||||||
</Pressable>
|
|
||||||
) : null}
|
|
||||||
<Pressable style={styles.daemonActionButton} onPress={() => onSetDefault(daemon)}>
|
<Pressable style={styles.daemonActionButton} onPress={() => onSetDefault(daemon)}>
|
||||||
<Text style={styles.daemonActionText}>{daemon.isDefault ? "Default" : "Make Default"}</Text>
|
<Text style={styles.daemonActionText}>{daemon.isDefault ? "Default" : "Make Default"}</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ The multi-daemon infrastructure is in place: session directory with daemon-scope
|
|||||||
- Settings screen, connection banners, error messages, modals, etc.
|
- Settings screen, connection banners, error messages, modals, etc.
|
||||||
- Internal code can keep "daemon" terminology; this is UI-only.
|
- Internal code can keep "daemon" terminology; this is UI-only.
|
||||||
- Updated every user-facing string (settings, modals, placeholders, defaults) to say "host" and spot-checked via targeted searches; no automated tests were run.
|
- Updated every user-facing string (settings, modals, placeholders, defaults) to say "host" and spot-checked via targeted searches; no automated tests were run.
|
||||||
|
- Context: Remaining "daemon" labels in git diff, file explorer, and agent detail screens now say "host" (updated `packages/app/src/app/git-diff.tsx`, `file-explorer.tsx`, `agent/[id].tsx`, and `agent/[serverId]/[agentId].tsx`).
|
||||||
|
|
||||||
### 2. Remove Active/Primary/Auto-Connect Concepts
|
### 2. Remove Active/Primary/Auto-Connect Concepts
|
||||||
- [ ] Remove the concept of "active daemon" from the UI and simplify to just "hosts".
|
- [x] Remove the concept of "active daemon" from the UI and simplify to just "hosts".
|
||||||
|
- Removed the Settings "Set Active" controls/labels, scrubbed the copy that mentioned an active host (including git diff fallback text), and left the per-host cards focused on status/default/test actions; no automated tests were run.
|
||||||
- [ ] Remove the concept of "primary daemon"—no default host for actions.
|
- [ ] Remove the concept of "primary daemon"—no default host for actions.
|
||||||
- [ ] Remove the "auto-connect" toggle from host settings—hosts always auto-connect when added.
|
- [ ] Remove the "auto-connect" toggle from host settings—hosts always auto-connect when added.
|
||||||
- [ ] Clean up any related state/UI that exposes these concepts to users.
|
- [ ] Clean up any related state/UI that exposes these concepts to users.
|
||||||
|
|||||||
Reference in New Issue
Block a user