[fix](client): move the instance address field above the notice that points at it
The 'No instance configured' row said 'Set your instance address above' while the field lived two cards further down, so a fresh install had an instruction and no visible way to follow it. The Connection card is now the first card.
This commit is contained in:
@@ -132,6 +132,45 @@ export default function SettingsScreen() {
|
|||||||
{!online ? <OfflineStrip /> : null}
|
{!online ? <OfflineStrip /> : null}
|
||||||
<Header title="Settings & health" onBack={() => navigation.goBack()} />
|
<Header title="Settings & health" onBack={() => navigation.goBack()} />
|
||||||
<ScrollView contentContainerStyle={styles.content}>
|
<ScrollView contentContainerStyle={styles.content}>
|
||||||
|
{/* ── Connection ───────────────────────────────────────────────── */}
|
||||||
|
<Card>
|
||||||
|
<View style={{ gap: space3 }}>
|
||||||
|
<AppText style={{ ...typeHeading, color: text }}>Connection</AppText>
|
||||||
|
<Row
|
||||||
|
icon={Server}
|
||||||
|
tint={online ? stateDisarmed : warn}
|
||||||
|
title={online ? 'Instance reachable' : 'No instance answered'}
|
||||||
|
detail={resolved?.baseUrl ? resolved.baseUrl : 'No instance address set yet.'}
|
||||||
|
/>
|
||||||
|
<AppText style={{ ...typeMicro, color: textFaint }}>
|
||||||
|
Your instance exposes one address; every service is a path under it. The client
|
||||||
|
only ever talks to this origin — Maestro routes the alarm service.
|
||||||
|
</AppText>
|
||||||
|
<TextInput
|
||||||
|
value={instanceDraft}
|
||||||
|
onChangeText={setInstanceDraft}
|
||||||
|
onEndEditing={saveInstance}
|
||||||
|
onSubmitEditing={saveInstance}
|
||||||
|
placeholder="http://127.0.0.1:8080"
|
||||||
|
placeholderTextColor={textFaint}
|
||||||
|
autoCapitalize="none"
|
||||||
|
autoCorrect={false}
|
||||||
|
keyboardType="url"
|
||||||
|
accessibilityLabel="Instance address"
|
||||||
|
style={styles.instanceInput}
|
||||||
|
/>
|
||||||
|
<Button label="Save instance address" variant="secondary" onPress={saveInstance} />
|
||||||
|
<AppText style={styles.code}>{wsUrl ?? 'ws:// — no alert selected'}</AppText>
|
||||||
|
<Button label={probing ? 'Checking…' : 'Check connection'} variant="secondary" onPress={reprobe} />
|
||||||
|
{!isRelease ? (
|
||||||
|
<AppText style={{ ...typeMicro, color: textFaint }}>
|
||||||
|
Dev build · default instance {DEFAULT_SETTINGS.instanceUrl} ·
|
||||||
|
`adb reverse tcp:8080 tcp:8080` on a USB phone
|
||||||
|
</AppText>
|
||||||
|
) : null}
|
||||||
|
</View>
|
||||||
|
</Card>
|
||||||
|
|
||||||
{/* ── Delivery ─────────────────────────────────────────────────── */}
|
{/* ── Delivery ─────────────────────────────────────────────────── */}
|
||||||
<Card>
|
<Card>
|
||||||
<View style={{ gap: space3 }}>
|
<View style={{ gap: space3 }}>
|
||||||
@@ -273,45 +312,6 @@ export default function SettingsScreen() {
|
|||||||
</View>
|
</View>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* ── Connection ───────────────────────────────────────────────── */}
|
|
||||||
<Card>
|
|
||||||
<View style={{ gap: space3 }}>
|
|
||||||
<AppText style={{ ...typeHeading, color: text }}>Connection</AppText>
|
|
||||||
<Row
|
|
||||||
icon={Server}
|
|
||||||
tint={online ? stateDisarmed : warn}
|
|
||||||
title={online ? 'Instance reachable' : 'No instance answered'}
|
|
||||||
detail={resolved?.baseUrl ? resolved.baseUrl : 'No instance address set yet.'}
|
|
||||||
/>
|
|
||||||
<AppText style={{ ...typeMicro, color: textFaint }}>
|
|
||||||
Your instance exposes one address; every service is a path under it. The client
|
|
||||||
only ever talks to this origin — Maestro routes the alarm service.
|
|
||||||
</AppText>
|
|
||||||
<TextInput
|
|
||||||
value={instanceDraft}
|
|
||||||
onChangeText={setInstanceDraft}
|
|
||||||
onEndEditing={saveInstance}
|
|
||||||
onSubmitEditing={saveInstance}
|
|
||||||
placeholder="http://127.0.0.1:8080"
|
|
||||||
placeholderTextColor={textFaint}
|
|
||||||
autoCapitalize="none"
|
|
||||||
autoCorrect={false}
|
|
||||||
keyboardType="url"
|
|
||||||
accessibilityLabel="Instance address"
|
|
||||||
style={styles.instanceInput}
|
|
||||||
/>
|
|
||||||
<Button label="Save instance address" variant="secondary" onPress={saveInstance} />
|
|
||||||
<AppText style={styles.code}>{wsUrl ?? 'ws:// — no alert selected'}</AppText>
|
|
||||||
<Button label={probing ? 'Checking…' : 'Check connection'} variant="secondary" onPress={reprobe} />
|
|
||||||
{!isRelease ? (
|
|
||||||
<AppText style={{ ...typeMicro, color: textFaint }}>
|
|
||||||
Dev build · default instance {DEFAULT_SETTINGS.instanceUrl} ·
|
|
||||||
`adb reverse tcp:8080 tcp:8080` on a USB phone
|
|
||||||
</AppText>
|
|
||||||
) : null}
|
|
||||||
</View>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
{/* ── Account ──────────────────────────────────────────────────── */}
|
{/* ── Account ──────────────────────────────────────────────────── */}
|
||||||
<Card>
|
<Card>
|
||||||
<View style={{ gap: space3 }}>
|
<View style={{ gap: space3 }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user