UX: emphasize connections; show grouped endpoints

This commit is contained in:
Mohamed Boudra
2026-02-05 00:26:30 +07:00
parent 6e882aaceb
commit 9b8f1e348d
2 changed files with 20 additions and 6 deletions
+16 -2
View File
@@ -120,6 +120,11 @@ const styles = StyleSheet.create((theme) => ({
fontSize: theme.fontSize.sm, fontSize: theme.fontSize.sm,
fontFamily: Fonts.mono, fontFamily: Fonts.mono,
}, },
hostConnections: {
color: theme.colors.foregroundMuted,
fontSize: theme.fontSize.xs,
fontFamily: Fonts.mono,
},
hostError: { hostError: {
color: theme.colors.palette.red[300], color: theme.colors.palette.red[300],
fontSize: theme.fontSize.xs, fontSize: theme.fontSize.xs,
@@ -662,7 +667,7 @@ export default function SettingsScreen() {
style={styles.addButton} style={styles.addButton}
onPress={() => setIsAddHostMethodVisible(true)} onPress={() => setIsAddHostMethodVisible(true)}
> >
<Text style={styles.addButtonText}>+ Add host</Text> <Text style={styles.addButtonText}>+ Add connection</Text>
</Pressable> </Pressable>
</View> </View>
@@ -1060,7 +1065,15 @@ function DaemonCard({
? "rgba(245, 158, 11, 0.1)" ? "rgba(245, 158, 11, 0.1)"
: statusTone === "error" : statusTone === "error"
? "rgba(248, 113, 113, 0.1)" ? "rgba(248, 113, 113, 0.1)"
: "rgba(161, 161, 170, 0.1)"; : "rgba(161, 161, 170, 0.1)";
const connectionsSummary = (() => {
const parts = daemon.connections.map((conn) => {
if (conn.type === "relay") return `relay:${conn.relayEndpoint}`;
return `direct:${conn.endpoint}`;
});
return parts.join(" • ");
})();
return ( return (
<View style={styles.hostCard} testID={`daemon-card-${daemon.serverId}`}> <View style={styles.hostCard} testID={`daemon-card-${daemon.serverId}`}>
@@ -1097,6 +1110,7 @@ function DaemonCard({
return ""; return "";
})()} })()}
</Text> </Text>
{connectionsSummary ? <Text style={styles.hostConnections}>{connectionsSummary}</Text> : null}
{connectionError ? <Text style={styles.hostError}>{connectionError}</Text> : null} {connectionError ? <Text style={styles.hostError}>{connectionError}</Text> : null}
</View> </View>
<View style={styles.hostActionsRow}> <View style={styles.hostActionsRow}>
@@ -63,12 +63,12 @@ export function AddHostMethodModal({
}, [onClose, onPasteLink]); }, [onClose, onPasteLink]);
return ( return (
<AdaptiveModalSheet title="Add host" visible={visible} onClose={onClose} testID="add-host-method-modal"> <AdaptiveModalSheet title="Add connection" visible={visible} onClose={onClose} testID="add-host-method-modal">
<Pressable style={styles.option} onPress={handleDirect} accessibilityLabel="Direct connection"> <Pressable style={styles.option} onPress={handleDirect} accessibilityLabel="Direct connection">
<Link2 size={18} color={theme.colors.foreground} /> <Link2 size={18} color={theme.colors.foreground} />
<View style={styles.optionBody}> <View style={styles.optionBody}>
<Text style={styles.optionText}>Direct connection</Text> <Text style={styles.optionText}>Direct connection</Text>
<Text style={styles.optionSubtext}>Enter a host and port.</Text> <Text style={styles.optionSubtext}>Local network or Tailscale (unencrypted).</Text>
</View> </View>
</Pressable> </Pressable>
@@ -77,7 +77,7 @@ export function AddHostMethodModal({
<QrCode size={18} color={theme.colors.foreground} /> <QrCode size={18} color={theme.colors.foreground} />
<View style={styles.optionBody}> <View style={styles.optionBody}>
<Text style={styles.optionText}>Scan QR code</Text> <Text style={styles.optionText}>Scan QR code</Text>
<Text style={styles.optionSubtext}>Use your camera to pair.</Text> <Text style={styles.optionSubtext}>Relay pairing (E2EE).</Text>
</View> </View>
</Pressable> </Pressable>
) : null} ) : null}
@@ -86,7 +86,7 @@ export function AddHostMethodModal({
<ClipboardPaste size={18} color={theme.colors.foreground} /> <ClipboardPaste size={18} color={theme.colors.foreground} />
<View style={styles.optionBody}> <View style={styles.optionBody}>
<Text style={styles.optionText}>Paste pairing link</Text> <Text style={styles.optionText}>Paste pairing link</Text>
<Text style={styles.optionSubtext}>Works without a camera.</Text> <Text style={styles.optionSubtext}>Relay pairing (E2EE).</Text>
</View> </View>
</Pressable> </Pressable>
</AdaptiveModalSheet> </AdaptiveModalSheet>