bbovenzi commented on code in PR #55927: URL: https://github.com/apache/airflow/pull/55927#discussion_r2391993119
########## airflow-core/src/airflow/ui/src/layouts/Details/Grid/GridTI.tsx: ########## @@ -62,15 +60,49 @@ type Props = { readonly taskId: string; }; -const Instance = ({ dagId, instance, isGroup, isMapped, onClick, runId, search, taskId }: Props) => { +const Instance = ({ + dagId, + fullInstance, + instance, + isGroup, + isMapped, + onClick, + runId, + search, + taskId, +}: Props) => { const { setHoveredTaskId } = useHover(); const { groupId: selectedGroupId, taskId: selectedTaskId } = useParams(); - const { t: translate } = useTranslation(); const location = useLocation(); + const [open, setOpen] = useState(false); + const onMouseEnter = handleMouseEnter(setHoveredTaskId); const onMouseLeave = handleMouseLeave(taskId, setHoveredTaskId); + // include the map index for mapped tasks so API returns the specific TI + const mapIndexArray = + "map_index" in instance && typeof instance.map_index === "number" ? [instance.map_index] : undefined; + + // Hydrate the tooltip with a full TaskInstance when opened (skip if parent already provided one) + const { data: tiPage } = useTaskInstanceServiceGetTaskInstances( + { + dagId, Review Comment: +1 there's no way we should have an API call inside of a Grid element. At best, we should fetch the list of task instances corresponding to the grid once and lookup by taskId and runId. Even then, I would only do that very carefully to make sure we're not adding to how long or how often the Grid view re-renders. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org