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, 08:00 UTC
perf(web): the device panel compiles with the React Compiler (#20489)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 18:53 UTC
488af8d28b8ccbc11b83445af9ec0d0cbe48f1f8
2 files changed
+21
-26
apps/web/reactCompiledFiles.ts
+1
@@ -64,4 +64,5 @@ export const REACT_COMPILED_FILES = [
64
"apps/web/src/components/media/MediaVideoPlayer.tsx",
65
"apps/web/src/components/media/MediaActions.tsx",
66
"apps/web/src/components/device/DeviceSetup.tsx",
67
+ "apps/web/src/components/device/DevicePanel.tsx",
68
] as const;
apps/web/src/components/device/DevicePanel.tsx
+20
-26
@@ -6,7 +6,7 @@ import type {
6
ScopedThreadRef,
7
} from "@t3tools/contracts";
8
import { Smartphone, X } from "lucide-react";
9
-import { useEffect, useMemo, useState } from "react";
9
+import { useEffect, useState } from "react";
10
11
import { usePreviewMiniPlayerStore } from "~/previewMiniPlayerStore";
12
import { useRightPanelStore, type RightPanelSurface } from "~/rightPanelStore";
@@ -54,10 +54,7 @@ export function DevicePanel(props: {
54
void list({ environmentId, input: {} });
55
}, [environmentId, list, loaded, props.visible, hostDisabled]);
56
57
- const sessions = useMemo(
58
- () => state.sessions.filter((session) => session.threadId === threadId),
59
- [state.sessions, threadId],
60
- );
57
+ const sessions = state.sessions.filter((session) => session.threadId === threadId);
58
const activeSession = props.surface.target
59
? sessions.find(
60
(session) =>
@@ -71,34 +68,31 @@ export function DevicePanel(props: {
68
)
69
: undefined;
70
74
- const grouped = useMemo(() => groupDevices(state), [state]);
71
+ const grouped = groupDevices(state);
72
73
const selectDevice = async (value: string) => {
74
const device = state.devices.find((candidate) => deviceKey(candidate) === value);
75
if (!device) return;
76
setOperationError(null);
77
setPendingDevice(device);
81
- try {
82
- const result = await open({
83
- environmentId,
84
- input: {
85
- threadId,
86
- hostId: device.hostId,
87
- deviceId: device.id,
88
- platform: device.platform,
89
- },
78
+ const result = await open({
79
+ environmentId,
80
+ input: {
81
+ threadId,
82
+ hostId: device.hostId,
83
+ deviceId: device.id,
84
+ platform: device.platform,
85
+ },
86
+ });
87
+ if (result._tag === "Failure") setOperationError(formatEnvironmentQueryError(result.cause));
88
+ else
89
+ useRightPanelStore.getState().openDevice(props.threadRef, {
90
+ hostId: result.value.hostId,
91
+ deviceId: result.value.deviceId,
92
+ platform: device.platform,
93
+ name: device.name,
94
});
91
- if (result._tag === "Failure") setOperationError(formatEnvironmentQueryError(result.cause));
92
- else
93
- useRightPanelStore.getState().openDevice(props.threadRef, {
94
- hostId: result.value.hostId,
95
- deviceId: result.value.deviceId,
96
- platform: device.platform,
97
- name: device.name,
98
- });
99
- } finally {
100
- setPendingDevice(null);
101
- }
95
+ setPendingDevice(null);
96
};
97
98
const floatActive = () => {