safaehar commented on code in PR #75979:
URL: https://github.com/apache/airflow/pull/75979#discussion_r4495171897


##########
airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx:
##########
@@ -168,15 +168,22 @@ export const DetailsLayout = ({ children, error, 
isLoading, outletContext, tabs
 
   const noDateFilters = runAfterGte === undefined && runAfterLte === undefined;
 
-  // Initial grid page (no date ceiling) — loaded first so we can check whether
-  // the selected run is already visible before fetching it individually.
-  const { data: initialGridRuns } = useGridRuns({
-    dagRunState: dagRunStateFilter,
-    limit,
-    runIdPattern: runIdPatternFilter,
-    runType: runTypeFilter,
-    triggeringUser: triggeringUserFilter,
-  });
+  // Match the Grid's first-page query so React Query shares the request. This 
observer does not
+  // keep polling after the Grid moves to another page; it only positions a 
selected older run.
+  const { data: initialGridRuns } = useGridRuns(
+    {
+      dagRunState: dagRunStateFilter,
+      limit: limit + 1,

Review Comment:
   Good catch, fixed. the layout still requests `limit + 1` to share the Grid 
query, but now slices the result to `limit` before checking whether the 
selected run is visible. I also added a regression test covering a selected run 
present only in the pagination look-ahead row



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