The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 04:15 UTC
fix(mobile): prevent environment row taps from swallowing switches (#17677)
Rohith Kadaveru committed
Oct 18, 2026 at 15:30 UTC
97986f7ec5c508636b885a0559e07749a2aa946b
2 files changed
+94
-46
apps/mobile/src/features/connection/CloudEnvironmentRows.tsx
+59
-28
@@ -191,30 +191,24 @@ function ConnectedCloudEnvironmentRow(props: {
191
setLastDescriptor(props.descriptor);
192
}
193
return (
194
- <Pressable
195
- accessibilityHint="Long press to remove from this device"
196
- accessibilityRole={props.onOpen ? "button" : undefined}
197
- accessibilityLabel={props.onOpen ? `Manage ${props.environment.environmentLabel}` : undefined}
198
- onPress={props.onOpen}
199
- onLongPress={props.onRemove}
200
- >
201
- <CloudEnvironmentRowShell
202
- opensDetails={props.onOpen !== undefined}
203
- connectionError={enabled || unsupported ? props.environment.connectionError : null}
204
- connectionErrorTraceId={enabled ? props.environment.connectionErrorTraceId : null}
205
- connectionState={enabled || unsupported ? props.environment.connectionState : "available"}
206
- errorExpanded={props.errorExpanded}
207
- label={props.environment.environmentLabel}
208
- machine={resolveEnvironmentMachineKind(
209
- serverConfig ?? (lastDescriptor === undefined ? null : { environment: lastDescriptor }),
210
- )}
211
- onValueChange={props.onSetEnabled}
212
- onToggleError={props.onToggleError}
213
- disabled={unsupported}
214
- {...(enabled || unsupported ? {} : { statusText: "Off" })}
215
- value={enabled}
216
- />
217
- </Pressable>
194
+ <CloudEnvironmentRowShell
195
+ opensDetails={props.onOpen !== undefined}
196
+ onOpen={props.onOpen}
197
+ onRemove={props.onRemove}
198
+ connectionError={enabled || unsupported ? props.environment.connectionError : null}
199
+ connectionErrorTraceId={enabled ? props.environment.connectionErrorTraceId : null}
200
+ connectionState={enabled || unsupported ? props.environment.connectionState : "available"}
201
+ errorExpanded={props.errorExpanded}
202
+ label={props.environment.environmentLabel}
203
+ machine={resolveEnvironmentMachineKind(
204
+ serverConfig ?? (lastDescriptor === undefined ? null : { environment: lastDescriptor }),
205
+ )}
206
+ onValueChange={props.onSetEnabled}
207
+ onToggleError={props.onToggleError}
208
+ disabled={unsupported}
209
+ {...(enabled || unsupported ? {} : { statusText: "Off" })}
210
+ value={enabled}
211
+ />
212
);
213
}
214
@@ -261,6 +255,8 @@ function CloudEnvironmentRow(props: {
255
function CloudEnvironmentRowShell(props: {
256
readonly showChevron?: boolean;
257
readonly opensDetails?: boolean;
258
+ readonly onOpen?: (() => void) | undefined;
259
+ readonly onRemove?: (() => void) | undefined;
260
readonly connectionError: string | null;
261
readonly connectionErrorTraceId: string | null;
262
readonly connectionState: EnvironmentConnectionPhase;
@@ -298,6 +294,8 @@ function CloudEnvironmentRowShell(props: {
294
const errorCanExpand = props.connectionError !== null && errorLineCount > 1;
295
const isErrorExpanded = errorCanExpand && props.errorExpanded;
296
const StatusContainer = errorCanExpand ? Pressable : View;
297
+ const ContentContainer = props.onOpen || props.onRemove ? Pressable : View;
298
+ const ChevronContainer = props.onOpen || props.onRemove ? Pressable : View;
299
const onMeasuredErrorTextLayout = useCallback(
300
(event: TextLayoutEvent) => {
301
if (!props.connectionError) {
@@ -315,7 +313,20 @@ function CloudEnvironmentRowShell(props: {
313
);
314
return (
315
<View collapsable={false} className="flex-row items-center gap-3 bg-grouped-card px-4 py-3.5">
318
- <View className="min-w-0 flex-1 gap-0.5">
316
+ <ContentContainer
317
+ className="min-w-0 flex-1 gap-0.5"
318
+ accessibilityHint={props.onRemove ? "Long press to remove from this device" : undefined}
319
+ accessibilityRole={props.onOpen ? "button" : undefined}
320
+ accessibilityLabel={
321
+ props.onOpen
322
+ ? `Manage ${props.label}`
323
+ : props.onRemove
324
+ ? `Remove ${props.label} from this device`
325
+ : undefined
326
+ }
327
+ onPress={props.onOpen}
328
+ onLongPress={props.onRemove}
329
+ >
330
<View className="min-w-0 flex-row items-center gap-2">
331
<ConnectionStatusDot state={props.connectionState} pulse={shouldPulse} size={7} />
332
<EnvironmentMachineSymbol
@@ -375,17 +386,37 @@ function CloudEnvironmentRowShell(props: {
386
/>
387
) : null}
388
</StatusContainer>
378
- </View>
389
+ </ContentContainer>
390
<ThemedSwitch
391
+ accessibilityLabel={`Enable ${props.label}`}
392
style={{ alignSelf: "center" }}
393
disabled={props.disabled}
394
onValueChange={props.onValueChange}
395
value={props.value}
396
/>
397
{props.opensDetails || props.showChevron ? (
386
- <View style={{ opacity: props.opensDetails ? 1 : 0.4 }}>
398
+ <ChevronContainer
399
+ accessibilityRole={props.onOpen ? "button" : undefined}
400
+ accessibilityLabel={
401
+ props.onOpen
402
+ ? `Manage ${props.label}`
403
+ : props.onRemove
404
+ ? `Remove ${props.label} from this device`
405
+ : undefined
406
+ }
407
+ accessibilityHint={props.onRemove ? "Long press to remove from this device" : undefined}
408
+ onPress={props.onOpen}
409
+ onLongPress={props.onRemove}
410
+ style={{
411
+ opacity: props.opensDetails ? 1 : 0.4,
412
+ minWidth: 44,
413
+ minHeight: 44,
414
+ alignItems: "center",
415
+ justifyContent: "center",
416
+ }}
417
+ >
418
<SymbolView name="chevron.right" size={12} tintColorClassName="accent-icon-subtle" />
388
- </View>
419
+ </ChevronContainer>
420
) : null}
421
</View>
422
);
apps/mobile/src/features/connection/ConnectionEnvironmentRow.tsx
+35
-18
@@ -78,15 +78,17 @@ export function ConnectionEnvironmentRow(props: {
78
79
return (
80
<Animated.View layout={LinearTransition.duration(250)} className="bg-grouped-card">
81
- <Pressable
82
- className="flex-row items-center gap-3 px-4 py-3.5 active:opacity-70"
83
- accessibilityRole="button"
84
- accessibilityLabel={
85
- props.opensDetails ? `Manage ${props.environment.environmentLabel}` : undefined
86
- }
87
- onPress={props.onToggle}
88
- >
89
- <View className="flex-1 gap-0.5">
81
+ <View className="flex-row items-center gap-3 px-4 py-3.5">
82
+ <Pressable
83
+ className="min-w-0 flex-1 gap-0.5 active:opacity-70"
84
+ accessibilityRole="button"
85
+ accessibilityLabel={
86
+ props.opensDetails
87
+ ? `Manage ${props.environment.environmentLabel}`
88
+ : `${props.expanded ? "Collapse" : "Expand"} details for ${props.environment.environmentLabel}`
89
+ }
90
+ onPress={props.onToggle}
91
+ >
92
<View className="flex-row items-center gap-1.5">
93
<ConnectionStatusDot
94
state={enabled || unsupported ? props.environment.connectionState : "available"}
@@ -129,24 +131,39 @@ export function ConnectionEnvironmentRow(props: {
131
) : null}
132
</Text>
133
) : null}
132
- </View>
134
+ </Pressable>
135
136
<ThemedSwitch
137
+ accessibilityLabel={`Enable ${props.environment.environmentLabel}`}
138
style={{ alignSelf: "center" }}
139
disabled={unsupported}
140
onValueChange={(next) => props.onSetEnabled(props.environment.environmentId, next)}
141
value={enabled}
142
/>
140
- <SymbolView
141
- name={props.opensDetails ? "chevron.right" : "chevron.down"}
142
- size={12}
143
- tintColorClassName="accent-icon-subtle"
144
- type="monochrome"
143
+ <Pressable
144
+ accessibilityRole="button"
145
+ accessibilityLabel={
146
+ props.opensDetails
147
+ ? `Manage ${props.environment.environmentLabel}`
148
+ : `${props.expanded ? "Collapse" : "Expand"} details for ${props.environment.environmentLabel}`
149
+ }
150
+ onPress={props.onToggle}
151
style={{
146
- transform: [{ rotate: props.expanded ? "180deg" : "0deg" }],
152
+ minWidth: 44,
153
+ minHeight: 44,
154
+ alignItems: "center",
155
+ justifyContent: "center",
156
}}
148
- />
149
- </Pressable>
157
+ >
158
+ <SymbolView
159
+ name={props.opensDetails ? "chevron.right" : "chevron.down"}
160
+ size={12}
161
+ tintColorClassName="accent-icon-subtle"
162
+ type="monochrome"
163
+ style={{ transform: [{ rotate: props.expanded ? "180deg" : "0deg" }] }}
164
+ />
165
+ </Pressable>
166
+ </View>
167
168
{props.expanded ? (
169
<Animated.View