The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): share accessible connection trace controls (#12371)
Julius Marminge committed
Sep 17, 2026 at 20:18 UTC
05a8c6016a4070b92f5d51e7a79b9c76814947df
4 files changed
+69
-51
apps/mobile/src/features/connection/CloudEnvironmentRows.tsx
+10
-17
@@ -1,3 +1,4 @@
1
+import { ConnectionTraceId } from "./ConnectionTraceId";
2
import { useAuth } from "@clerk/expo";
3
import { SymbolView } from "../../components/AppSymbol";
4
import {
@@ -405,23 +406,15 @@ function CloudEnvironmentRowShell(props: {
406
>
407
{statusText}
408
{errorTraceId ? (
408
- <>
409
- {" Trace ID: "}
410
- <Text
411
- accessibilityHint="Copies the trace ID"
412
- accessibilityRole="button"
413
- className={cn("text-xs underline decoration-dotted", statusClassName)}
414
- onLongPress={(event) => {
415
- event.stopPropagation();
416
- copyTextWithHaptic(errorTraceId, { target: "connection-trace-id" });
417
- }}
418
- onPress={(event) => {
419
- event.stopPropagation();
420
- }}
421
- >
422
- {errorTraceId}
423
- </Text>
424
- </>
409
+ <ConnectionTraceId
410
+ traceId={errorTraceId}
411
+ tone={
412
+ props.connectionError && props.connectionState !== "unsupported"
413
+ ? "danger"
414
+ : "muted"
415
+ }
416
+ activation="longPress"
417
+ />
418
) : null}
419
</Text>
420
{errorCanExpand ? (
apps/mobile/src/features/connection/ConnectionEnvironmentRow.tsx
+6
-18
@@ -1,3 +1,4 @@
1
+import { ConnectionTraceId } from "./ConnectionTraceId";
2
import { SymbolView } from "../../components/AppSymbol";
3
import { connectionStatusText } from "@t3tools/client-runtime/connection";
4
import type { AtomCommandResult } from "@t3tools/client-runtime/state/runtime";
@@ -15,7 +16,6 @@ import { MaterialButton } from "../../components/MaterialButton";
16
import { MaterialIconButton } from "../../components/MaterialIconButton";
17
import { ThemedSwitch } from "../../components/ThemedSwitch";
18
import { cn } from "../../lib/cn";
18
-import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
19
import type { ConnectedEnvironmentSummary } from "../../state/remote-runtime-types";
20
import { serverEnvironment } from "../../state/server";
21
import { ConnectionStatusDot } from "./ConnectionStatusDot";
@@ -114,23 +114,11 @@ export function ConnectionEnvironmentRow(props: {
114
>
115
{statusLabel}
116
{statusTraceId ? (
117
- <>
118
- {" Trace ID: "}
119
- <Text
120
- accessibilityHint="Copies the trace ID"
121
- accessibilityRole="button"
122
- className="underline decoration-dotted"
123
- onLongPress={(event) => {
124
- event.stopPropagation();
125
- copyTextWithHaptic(statusTraceId, { target: "connection-trace-id" });
126
- }}
127
- onPress={(event) => {
128
- event.stopPropagation();
129
- }}
130
- >
131
- {statusTraceId}
132
- </Text>
133
- </>
117
+ <ConnectionTraceId
118
+ traceId={statusTraceId}
119
+ tone={hasConnectionFailure ? "danger" : "muted"}
120
+ activation="longPress"
121
+ />
122
) : null}
123
</Text>
124
) : null}
apps/mobile/src/features/connection/ConnectionTraceId.tsx
new
+51
@@ -0,0 +1,51 @@
1
+import { AppText as Text } from "../../components/AppText";
2
+import { cn } from "../../lib/cn";
3
+import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
4
+
5
+/** Inline trace control; disclosure rows reserve ordinary taps for their own navigation. */
6
+export function ConnectionTraceId({
7
+ traceId,
8
+ tone = "muted",
9
+ activation = "press",
10
+}: {
11
+ readonly traceId: string;
12
+ readonly tone?: "muted" | "danger";
13
+ readonly activation?: "press" | "longPress";
14
+}) {
15
+ const copy = () => copyTextWithHaptic(traceId, { target: "connection-trace-id" });
16
+ return (
17
+ <>
18
+ {" Trace ID: "}
19
+ <Text
20
+ accessibilityHint={
21
+ activation === "longPress" ? "Long press to copy the trace ID" : "Copies the trace ID"
22
+ }
23
+ accessibilityLabel={`Copy trace ID ${traceId}`}
24
+ accessibilityRole="button"
25
+ accessibilityActions={[{ name: "activate", label: "Copy trace ID" }]}
26
+ onAccessibilityAction={(event) => {
27
+ event.stopPropagation();
28
+ if (event.nativeEvent.actionName === "activate") copy();
29
+ }}
30
+ className={cn(
31
+ "underline decoration-dotted",
32
+ tone === "danger" ? "text-danger-foreground" : "text-foreground-muted",
33
+ )}
34
+ onLongPress={
35
+ activation === "longPress"
36
+ ? (event) => {
37
+ event.stopPropagation();
38
+ copy();
39
+ }
40
+ : undefined
41
+ }
42
+ onPress={(event) => {
43
+ event.stopPropagation();
44
+ if (activation === "press") copy();
45
+ }}
46
+ >
47
+ {traceId}
48
+ </Text>
49
+ </>
50
+ );
51
+}
apps/mobile/src/features/connection/EnvironmentConnectionNotice.tsx
+2
-16
@@ -1,3 +1,4 @@
1
+import { ConnectionTraceId } from "./ConnectionTraceId";
2
import {
3
type EnvironmentConnectionPhase,
4
type EnvironmentConnectionPresentation,
@@ -6,7 +7,6 @@ import { SymbolView } from "../../components/AppSymbol";
7
import { ActivityIndicator, Pressable, View } from "react-native";
8
9
import { AppText as Text } from "../../components/AppText";
9
-import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
10
11
function noticeTitle(phase: EnvironmentConnectionPhase, environmentLabel: string): string {
12
switch (phase) {
@@ -81,21 +81,7 @@ export function EnvironmentConnectionNotice(props: {
81
<Text className="text-center text-sm leading-normal text-foreground-muted">
82
{noticeDetail(props.connection.phase, props.resourceName, props.connection.error)}
83
{props.connection.traceId ? (
84
- <>
85
- {" Trace ID: "}
86
- <Text
87
- accessibilityHint="Copies the trace ID"
88
- accessibilityRole="button"
89
- className="underline decoration-dotted"
90
- onPress={() =>
91
- copyTextWithHaptic(props.connection.traceId!, {
92
- target: "connection-trace-id",
93
- })
94
- }
95
- >
96
- {props.connection.traceId}
97
- </Text>
98
- </>
84
+ <ConnectionTraceId traceId={props.connection.traceId} />
85
) : null}
86
</Text>
87