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({
14231423 : "bg-muted-foreground/40";
14241424 const statusTooltip = connectionStatusText(environment.connection);
14251425 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 );
14261451 const versionMismatch = resolveServerConfigVersionMismatch(environment.serverConfig);
14271452 const sshTarget =
14281453 environment.entry.target._tag === "SshConnectionTarget" &&
......@@ -1468,7 +1493,7 @@ function SavedBackendListRow({
14681493 <button
14691494 type="button"
14701495 className="shrink-0 underline underline-offset-2"
1471 onClick={() => void navigator.clipboard.writeText(errorTraceId)}
1496 onClick={() => copyTraceId(errorTraceId)}
14721497 >
14731498 Copy trace ID
14741499 </button>