yuseok89 commented on code in PR #67242:
URL: https://github.com/apache/airflow/pull/67242#discussion_r3456711415


##########
airflow-core/src/airflow/ui/src/pages/DagsList/DagsList.tsx:
##########
@@ -270,6 +307,26 @@ export const DagsList = () => {
     tagsMatchMode: selectedMatchMode,
   });
 
+  const visibleDagIds = useMemo(() => data?.dags.map((dag) => dag.dag_id) ?? 
[], [data?.dags]);
+  const { data: runStateCountsData, isLoading: runStateCountsLoading } = 
useDagRunStateCounts({
+    dagIds: visibleDagIds,
+    dags: data?.dags,
+    startDate,
+  });
+  const runStateContext: RunStateCountsContext = useMemo(
+    () => ({
+      countsByDag: Object.fromEntries(
+        (runStateCountsData?.dags ?? []).map((entry) => [entry.dag_id, 
entry.state_counts]),
+      ),
+      isLoading: runStateCountsLoading,
+      stateCountLimit: runStateCountsData?.state_count_limit,
+    }),
+    [runStateCountsData, runStateCountsLoading],
+  );
+
+  const columns = useMemo(() => createColumns(translate, runStateContext), 
[translate, runStateContext]);
+  const cardDef = useMemo(() => createCardDef(runStateContext), 
[runStateContext]);
+

Review Comment:
   Yeah, these weren't here before. I added them in this PR to cut down on 
re-renders.
   If they're more confusing than helpful, would it be better to remove them? 
   I've already removed the one that looked unnecessary.



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