authorgravatar for 71498452+StiensWout@users.noreply.github.comWout Stiens <71498452+StiensWout@users.noreply.github.com> 2026-06-22 18:46:15+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-06-22 09:46:15-07:00
logea52bb1dbda115f9824415f7589505c9e57268c6
tree50c7345743149b35ad75a0335aac5feb53eb12c6
parent28107e89c25711a835369c2b52c552f82e8de02a
signature Signed by PGP key B5690EEEBB952194

[codex] fix: guard trace ID clipboard copy (#3505)

Co-authored-by: Codex <codex@openai.com>

1 files changed, 26 insertions(+), 1 deletions(-)

apps/web/src/components/settings/ConnectionsSettings.tsx+26-1
...@@ -1423,6 +1423,31 @@ function SavedBackendListRow({...@@ -1423,6 +1423,31 @@ function SavedBackendListRow({
1423 : "bg-muted-foreground/40";1423 : "bg-muted-foreground/40";
1424 const statusTooltip = connectionStatusText(environment.connection);1424 const statusTooltip = connectionStatusText(environment.connection);
1425 const errorTraceId = environment.connection.traceId;1425 const errorTraceId = environment.connection.traceId;
1426 const { copyToClipboard: copyTraceIdToClipboard } = useCopyToClipboard<{ traceId: string }>({
1427 target: "trace ID",
1428 onCopy: ({ traceId }) => {
1429 toastManager.add({
1430 type: "success",
1431 title: "Trace ID copied",
1432 description: traceId,
1433 });
1434 },
1435 onError: (error) => {
1436 toastManager.add(
1437 stackedThreadToast({
1438 type: "error",
1439 title: "Could not copy trace ID",
1440 description: error.message,
1441 }),
1442 );
1443 },
1444 });
1445 const copyTraceId = useCallback(
1446 (traceId: string) => {
1447 copyTraceIdToClipboard(traceId, { traceId });
1448 },
1449 [copyTraceIdToClipboard],
1450 );
1426 const versionMismatch = resolveServerConfigVersionMismatch(environment.serverConfig);1451 const versionMismatch = resolveServerConfigVersionMismatch(environment.serverConfig);
1427 const sshTarget =1452 const sshTarget =
1428 environment.entry.target._tag === "SshConnectionTarget" &&1453 environment.entry.target._tag === "SshConnectionTarget" &&
...@@ -1468,7 +1493,7 @@ function SavedBackendListRow({...@@ -1468,7 +1493,7 @@ function SavedBackendListRow({
1468 <button1493 <button
1469 type="button"1494 type="button"
1470 className="shrink-0 underline underline-offset-2"1495 className="shrink-0 underline underline-offset-2"
1471 onClick={() => void navigator.clipboard.writeText(errorTraceId)}1496 onClick={() => copyTraceId(errorTraceId)}
1472 >1497 >
1473 Copy trace ID1498 Copy trace ID
1474 </button>1499 </button>