You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2026/06/10 13:36:46 UTC

[PR] UI: Add Details tab to the mapped task instance view [airflow]

pierrejeambrun opened a new pull request, #68340:
URL: https://github.com/apache/airflow/pull/68340

   Mapped tasks (the `/mapped` view opened from the Grid) now have a **Details** tab, like normal task instances already do. It shows the task definition (operator, trigger rule, owner, retries, pool, queue, …) plus a per-state summary of the mapped instances, sourced from the grid TI summaries the page already loads.
   
   ### Screenshots
   
   - _Mapped task → Details tab_
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3390151579


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx:
##########
@@ -41,11 +41,12 @@ export const MappedTaskInstance = () => {
 
   const tabs = [
     { icon: <MdOutlineTask />, label: `${translate("tabs.taskInstances")} [${taskCount}]`, value: "" },
+    { icon: <MdDetails />, label: translate("tabs.details"), value: "details" },
   ];
 
   return (
     <ReactFlowProvider>
-      <DetailsLayout tabs={tabs}>
+      <DetailsLayout outletContext={taskInstance} tabs={tabs}>

Review Comment:
   What does this context actually do? We're only using it here and I don't get what its helping us with?



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3394451009


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Details.tsx:
##########
@@ -0,0 +1,140 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Box, Flex, Table } from "@chakra-ui/react";
+import { useTranslation } from "react-i18next";
+import { useOutletContext, useParams } from "react-router-dom";
+
+import { useTaskServiceGetTask } from "openapi/queries";
+import type { LightGridTaskInstanceSummary } from "openapi/requests/types.gen";
+import { StateBadge } from "src/components/StateBadge";
+import Time from "src/components/Time";
+import { getDuration } from "src/utils";
+
+export const Details = () => {
+  const { dagId = "", taskId = "" } = useParams();
+  const { t: translate } = useTranslation("common");
+
+  // The aggregate summary (per-state counts, dates) is streamed once by the parent page and
+  // shared through the router outlet, so this tab does not re-open the TI summaries stream.
+  const taskInstance = useOutletContext<LightGridTaskInstanceSummary | undefined>();

Review Comment:
   We are only consuming the parent context once, here. (retrieving the TIsummaries provided by the parent page to avoid opening a second stream for that)



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi merged PR #68340:
URL: https://github.com/apache/airflow/pull/68340


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3390312934


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Details.tsx:
##########
@@ -0,0 +1,140 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Box, Flex, Table } from "@chakra-ui/react";
+import { useTranslation } from "react-i18next";
+import { useOutletContext, useParams } from "react-router-dom";
+
+import { useTaskServiceGetTask } from "openapi/queries";
+import type { LightGridTaskInstanceSummary } from "openapi/requests/types.gen";
+import { StateBadge } from "src/components/StateBadge";
+import Time from "src/components/Time";
+import { getDuration } from "src/utils";
+
+export const Details = () => {
+  const { dagId = "", taskId = "" } = useParams();
+  const { t: translate } = useTranslation("common");
+
+  // The aggregate summary (per-state counts, dates) is streamed once by the parent page and
+  // shared through the router outlet, so this tab does not re-open the TI summaries stream.
+  const taskInstance = useOutletContext<LightGridTaskInstanceSummary | undefined>();

Review Comment:
   Do we want to use this hook anywhere else?



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3394451009


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/Details.tsx:
##########
@@ -0,0 +1,140 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Box, Flex, Table } from "@chakra-ui/react";
+import { useTranslation } from "react-i18next";
+import { useOutletContext, useParams } from "react-router-dom";
+
+import { useTaskServiceGetTask } from "openapi/queries";
+import type { LightGridTaskInstanceSummary } from "openapi/requests/types.gen";
+import { StateBadge } from "src/components/StateBadge";
+import Time from "src/components/Time";
+import { getDuration } from "src/utils";
+
+export const Details = () => {
+  const { dagId = "", taskId = "" } = useParams();
+  const { t: translate } = useTranslation("common");
+
+  // The aggregate summary (per-state counts, dates) is streamed once by the parent page and
+  // shared through the router outlet, so this tab does not re-open the TI summaries stream.
+  const taskInstance = useOutletContext<LightGridTaskInstanceSummary | undefined>();

Review Comment:
   No, we are only consuming the parent context once, here. (retrieving the TIsummaries provided by the parent page to avoid opening a second stream for that)



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3394444069


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx:
##########
@@ -41,11 +41,12 @@ export const MappedTaskInstance = () => {
 
   const tabs = [
     { icon: <MdOutlineTask />, label: `${translate("tabs.taskInstances")} [${taskCount}]`, value: "" },
+    { icon: <MdDetails />, label: translate("tabs.details"), value: "details" },
   ];
 
   return (
     <ReactFlowProvider>
-      <DetailsLayout tabs={tabs}>
+      <DetailsLayout outletContext={taskInstance} tabs={tabs}>

Review Comment:
   This is to re-use the Grid summary. Otherwise the detail pan will have to `useGridTiSummariesStream` but since this is a stream, it's a custom impl, not re-using react query cache and all. 
   
   So basically opening a new stream to fetch the TI summaries again. 
   
   This allow to share the stream from the grid into the details view. 



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3394444069


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx:
##########
@@ -41,11 +41,12 @@ export const MappedTaskInstance = () => {
 
   const tabs = [
     { icon: <MdOutlineTask />, label: `${translate("tabs.taskInstances")} [${taskCount}]`, value: "" },
+    { icon: <MdDetails />, label: translate("tabs.details"), value: "details" },
   ];
 
   return (
     <ReactFlowProvider>
-      <DetailsLayout tabs={tabs}>
+      <DetailsLayout outletContext={taskInstance} tabs={tabs}>

Review Comment:
   This is to re-use the Grid summary. Otherwise the detail tab will have to `useGridTiSummariesStream` to fetch the TI summary. But since this is a stream, it's a custom implementation, not re-using react query cache and all, so this would open a second stream request to get the TI summaries.
   
   This allow to share the stream from the grid view with the details view, via a context.
   
   Preventing a second call to `useGridTiSummariesStream` and preventing a second stream request for data we already have.



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3394444069


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx:
##########
@@ -41,11 +41,12 @@ export const MappedTaskInstance = () => {
 
   const tabs = [
     { icon: <MdOutlineTask />, label: `${translate("tabs.taskInstances")} [${taskCount}]`, value: "" },
+    { icon: <MdDetails />, label: translate("tabs.details"), value: "details" },
   ];
 
   return (
     <ReactFlowProvider>
-      <DetailsLayout tabs={tabs}>
+      <DetailsLayout outletContext={taskInstance} tabs={tabs}>

Review Comment:
   This is to re-use the Grid summary. Otherwise the detail tab will have to `useGridTiSummariesStream` to fetch the TI summary. But since this is a stream, it's a custom implementation, not re-using react query cache and all, so this would open a second stream request to get the TI summaries.
   
   This allow to share the stream from the grid with the details view, via a context.
   
   Preventing a second call to `useGridTiSummariesStream` and preventing a second stream request for data we already have.



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] UI: Add Details tab to the mapped task instance view [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #68340:
URL: https://github.com/apache/airflow/pull/68340#discussion_r3394444069


##########
airflow-core/src/airflow/ui/src/pages/MappedTaskInstance/MappedTaskInstance.tsx:
##########
@@ -41,11 +41,12 @@ export const MappedTaskInstance = () => {
 
   const tabs = [
     { icon: <MdOutlineTask />, label: `${translate("tabs.taskInstances")} [${taskCount}]`, value: "" },
+    { icon: <MdDetails />, label: translate("tabs.details"), value: "details" },
   ];
 
   return (
     <ReactFlowProvider>
-      <DetailsLayout tabs={tabs}>
+      <DetailsLayout outletContext={taskInstance} tabs={tabs}>

Review Comment:
   This is to re-use the Grid summary. Otherwise the detail tab will have to `useGridTiSummariesStream` but since this is a stream, it's a custom impl, not re-using react query cache and all. 
   
   So basically opening a new stream to fetch the TI summaries again. 
   
   This allow to share the stream from the grid into the details view. 



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org