bbovenzi commented on code in PR #39918:
URL: https://github.com/apache/airflow/pull/39918#discussion_r1688669160


##########
airflow/www/static/js/dag/details/taskInstance/Details.tsx:
##########
@@ -294,22 +309,51 @@ const Details = ({ gridInstance, taskInstance, group }: 
Props) => {
               {Object.keys(taskInstance.renderedFields).map((key) => {
                 const renderedFields = taskInstance.renderedFields as Record<
                   string,
-                  unknown
+                  Record<string, string | null>
                 >;
-                let field = renderedFields[key];
+
+                const templateFieldsRenderers =
+                  taskInstance.templateFieldsRenderers as Record<
+                    string,
+                    string
+                  >;
+
+                const field = renderedFields[key];
+                let fieldString = field as unknown as string;
+                const renderer = templateFieldsRenderers[key] || null;
+                const language: string = renderer
+                  ? languageMapping[renderer] ?? "plaintext"
+                  : "plaintext";
+
                 if (field) {
                   if (typeof field !== "string") {
                     try {
-                      field = JSON.stringify(field);
+                      fieldString = JSON.stringify(field, null, 4);
                     } catch (e) {
                       // skip
                     }
                   }
+
                   return (
                     <Tr key={key}>
                       <Td>{key}</Td>
                       <Td>
-                        <Code fontSize="md">{field as string}</Code>
+                        <Flex alignItems="right">
+                          <SyntaxHighlighter
+                            fontSize="md"

Review Comment:
   Let's fix this style with something like
   
   ```
   const theme = useTheme();
   ```
   
   and
   
   ```
                               customStyle={{
                                 fontSize: theme.fontSizes.md,
                                 font: theme.fonts.mono,
                               }}
   ```
   



-- 
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