diff --git a/airflow/www/static/js/grid/renderTaskRows.tsx b/airflow/www/static/js/grid/renderTaskRows.tsx index c7f82333f4b4f..11658e873f2de 100644 --- a/airflow/www/static/js/grid/renderTaskRows.tsx +++ b/airflow/www/static/js/grid/renderTaskRows.tsx @@ -23,7 +23,6 @@ import { Td, Box, Flex, - Collapse, useTheme, } from '@chakra-ui/react'; @@ -140,13 +139,14 @@ const Row = (props: RowProps) => { [isGroup, isOpen, task.label, openGroupIds, onToggleGroups], ); - const isFullyOpen = level === openParentCount; + // check if the group's parents are all open, if not, return null + if (level !== openParentCount) return null; return ( <> { width="100%" zIndex={1} > - - - + { width={`${dagRunIds.length * columnWidth}px`} borderBottom={0} > - - - + - {isGroup && ( + {isGroup && isOpen && ( renderTaskRows({ - ...props, level: level + 1, openParentCount: openParentCount + (isOpen ? 1 : 0), + ...props, level: level + 1, openParentCount: openParentCount + 1, }) )}