tirkarthi commented on code in PR #46820:
URL: https://github.com/apache/airflow/pull/46820#discussion_r1966679832
##########
airflow/ui/src/queries/useLogs.tsx:
##########
@@ -49,8 +50,47 @@ const parseLogs = ({ data }: ParseLogsProps) => {
return { data, warning };
}
- // eslint-disable-next-line react/no-array-index-key
- const parsedLines = lines.map((line, index) => <p key={index}>{line}</p>);
+ let startGroup = false;
+ let groupLines: Array<string> = [];
+ let groupName = "";
+
+ // TODO: Add support for nested groups
+ /* eslint-disable react/no-array-index-key */
+ const parsedLines = lines.map((line, index) => {
+ if (line.includes("::group::") && !startGroup) {
+ startGroup = true;
+ groupName = line.split("::group::")[1] as string;
+ } else if (line.includes("::endgroup::")) {
+ startGroup = false;
+ groupLines.push(line);
+ const group = (
+ <details key={groupName}>
+ <summary data-testid={`summary-${groupName}`}>
+ <Text as="span" color="fg.info" cursor="pointer">
+ {groupName}
+ </Text>
+ </summary>
+ {groupLines.map((text, groupIndex) => (
+ <Text key={groupIndex} py={1}>
Review Comment:
I am not sure about the accessibility aspects of a lighter background for
the text. I will leave this to @bbovenzi and would be happy to add if it's
accessible.
--
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]