diff --git a/apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx b/apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx index 93b806f6487..d52cc6453ac 100644 --- a/apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx +++ b/apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx @@ -58,6 +58,16 @@ export function SettingsEnvironmentsRouteScreen() { const handleToggle = useCallback((environmentId: EnvironmentId) => { setExpandedId((prev) => (prev === environmentId ? null : environmentId)); }, []); + // Retries every environment at once. This is not a placebo refresh: the + // underlying command is `retryNow`, which short-circuits the reconnect + // backoff, so it is the one way to escape a long backoff delay without + // waiting it out. + const handleRefreshAll = useCallback(() => { + for (const environment of connectedEnvironments) { + onReconnectEnvironment(environment.environmentId); + } + }, [connectedEnvironments, onReconnectEnvironment]); + const canRefreshAll = connectedEnvironments.length > 0; const handleUpdateEnvironment = useCallback( ( environmentId: EnvironmentId, @@ -94,7 +104,15 @@ export function SettingsEnvironmentsRouteScreen() { navigation.goBack()} + // Rendered in array order, left to right — the reverse of the iOS + // toolbar below. Same result on screen: (refresh, add). actions={[ + { + accessibilityLabel: "Refresh all environments", + disabled: !canRefreshAll, + icon: "arrow.clockwise", + onPress: handleRefreshAll, + }, { accessibilityLabel: "Add environment", icon: "plus", @@ -105,6 +123,9 @@ export function SettingsEnvironmentsRouteScreen() { /> ) : ( + // UIKit orders right-side bar items from the right edge inward, so + // this reads right-to-left on screen: add stays outermost, refresh + // sits inside it. Visually: (refresh, add). + )}