RoyLee1224 commented on code in PR #56083:
URL: https://github.com/apache/airflow/pull/56083#discussion_r2383126540


##########
airflow-core/src/airflow/ui/src/pages/XCom/XComEntry.tsx:
##########


Review Comment:
   It seems there might be a few unrelated changes and refactors included as 
well. For example, the renderTextWithLinks function was reworked, and the 
clipboard button was removed.
   
   To keep make it easier to review, would it be possible to scale it back to 
just the necessary changes for the new feature? Thanks!



##########
airflow-core/src/airflow/ui/src/pages/XCom/XComEntry.tsx:
##########
@@ -72,31 +87,22 @@ export const XComEntry = ({ dagId, mapIndex, runId, taskId, 
xcomKey }: XComEntry
     taskId,
     xcomKey,
   });
-  // When deserialize=true, the API returns a stringified representation
-  // so we don't need to JSON.stringify it again
-  const xcomValue = data?.value;
-  const isObjectOrArray = Array.isArray(xcomValue) || (xcomValue !== null && 
typeof xcomValue === "object");
-  const valueFormatted = typeof xcomValue === "string" ? xcomValue : 
JSON.stringify(xcomValue, undefined, 4);
 
-  return isLoading ? (
-    <Skeleton
-      data-testid="skeleton"
-      display="inline-block"
-      height="10px"
-      width={200} // TODO: Make Skeleton take style from column definition
-    />
-  ) : (
+  const value = data?.value;
+
+  const valueFormatted = value === undefined ? "" : typeof value === "string" 
? value : JSON.stringify(value);
+
+  if (isLoading) {
+    return <Skeleton data-testid="skeleton" display="inline-block" 
height="10px" width={200} />;
+  }
+
+  return (
     <HStack>
-      {isObjectOrArray ? (
-        <RenderedJsonField content={xcomValue as object} 
enableClipboard={false} />
+      {isObjectLike(value) ? (
+        <RenderedJsonField content={value} jsonProps={{ collapsed: !open }} />
       ) : (
         <Text>{renderTextWithLinks(valueFormatted)}</Text>
       )}
-      {xcomValue === undefined || xcomValue === null ? undefined : (

Review Comment:
   The copy-to-clipboard button seems to be missing for non-JSON/string values 
now.
   <img width="1834" height="783" alt="CleanShot 2025-09-26 at 14 03 12" 
src="https://github.com/user-attachments/assets/ae6f3071-36f5-41d7-a172-326f76bb6e74";
 />
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to