This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 8e91fa7cd35 fix: remove redundant columns in XCom panel on task
instance page (#68188)
8e91fa7cd35 is described below
commit 8e91fa7cd3547d647e27052cf33bf08172b27e8b
Author: Anmol Mishra <[email protected]>
AuthorDate: Mon Jun 8 20:51:23 2026 +0530
fix: remove redundant columns in XCom panel on task instance page (#68188)
* fix: remove redundant columns in XCom panel on task instance page
Closes #68178
When viewing XCom entries from the task instance (Grid view), the
'Dag ID', 'Dag Run ID', 'Run After', 'Task', and 'Map Index' columns
are redundant because this information is already visible in the header.
Hide these columns specifically in that context while keeping them on
the global Browse > XCom page where they provide necessary context.
* chore: fix prettier formatting in XCom.tsx
* fix: make eslint happy - flip ternary and type cell params
---
.../src/airflow/ui/src/pages/XCom/XCom.tsx | 112 +++++++++++----------
1 file changed, 61 insertions(+), 51 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/pages/XCom/XCom.tsx
b/airflow-core/src/airflow/ui/src/pages/XCom/XCom.tsx
index cecc75f7bbb..da6582398cf 100644
--- a/airflow-core/src/airflow/ui/src/pages/XCom/XCom.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/XCom/XCom.tsx
@@ -49,63 +49,72 @@ const {
}: SearchParamsKeysType = SearchParamsKeys;
type ColumnsProps = {
+ readonly isTaskInstancePage: boolean;
readonly open: boolean;
readonly translate: (key: string) => string;
};
-const getColumns = ({ open, translate }: ColumnsProps):
Array<ColumnDef<XComResponse>> => [
+const getColumns = ({
+ isTaskInstancePage,
+ open,
+ translate,
+}: ColumnsProps): Array<ColumnDef<XComResponse>> => [
{
accessorKey: "key",
header: translate("xcom.columns.key"),
},
- {
- accessorKey: "dag_id",
- cell: ({ row: { original } }) => (
- <RouterLink fontWeight="bold" to={`/dags/${original.dag_id}`}>
- {original.dag_display_name}
- </RouterLink>
- ),
- header: translate("xcom.columns.dag"),
- },
- {
- accessorKey: "run_id",
- cell: ({ row: { original } }: { row: { original: XComResponse } }) => (
- <RouterLink fontWeight="bold"
to={`/dags/${original.dag_id}/runs/${original.run_id}`}>
- <TruncatedText text={original.run_id} />
- </RouterLink>
- ),
- header: translate("common:dagRunId"),
- },
- {
- accessorKey: "run_after",
- cell: ({ row: { original } }: { row: { original: XComResponse } }) => (
- <RouterLink fontWeight="bold"
to={`/dags/${original.dag_id}/runs/${original.run_id}`}>
- <Time datetime={original.run_after} />
- </RouterLink>
- ),
- header: translate("common:dagRun.runAfter"),
- },
- {
- accessorKey: "task_display_name",
- cell: ({ row: { original } }: { row: { original: XComResponse } }) => (
- <RouterLink
- fontWeight="bold"
- to={getTaskInstanceLink({
- dagId: original.dag_id,
- dagRunId: original.run_id,
- mapIndex: original.map_index,
- taskId: original.task_id,
- })}
- >
- <TruncatedText text={original.task_display_name} />
- </RouterLink>
- ),
- header: translate("common:task_one"),
- },
- {
- accessorKey: "map_index",
- header: translate("common:mapIndex"),
- },
+ ...(isTaskInstancePage
+ ? []
+ : [
+ {
+ accessorKey: "dag_id",
+ cell: ({ row: { original } }: { row: { original: XComResponse } })
=> (
+ <RouterLink fontWeight="bold" to={`/dags/${original.dag_id}`}>
+ {original.dag_display_name}
+ </RouterLink>
+ ),
+ header: translate("xcom.columns.dag"),
+ },
+ {
+ accessorKey: "run_id",
+ cell: ({ row: { original } }: { row: { original: XComResponse } })
=> (
+ <RouterLink fontWeight="bold"
to={`/dags/${original.dag_id}/runs/${original.run_id}`}>
+ <TruncatedText text={original.run_id} />
+ </RouterLink>
+ ),
+ header: translate("common:dagRunId"),
+ },
+ {
+ accessorKey: "run_after",
+ cell: ({ row: { original } }: { row: { original: XComResponse } })
=> (
+ <RouterLink fontWeight="bold"
to={`/dags/${original.dag_id}/runs/${original.run_id}`}>
+ <Time datetime={original.run_after} />
+ </RouterLink>
+ ),
+ header: translate("common:dagRun.runAfter"),
+ },
+ {
+ accessorKey: "task_display_name",
+ cell: ({ row: { original } }: { row: { original: XComResponse } })
=> (
+ <RouterLink
+ fontWeight="bold"
+ to={getTaskInstanceLink({
+ dagId: original.dag_id,
+ dagRunId: original.run_id,
+ mapIndex: original.map_index,
+ taskId: original.task_id,
+ })}
+ >
+ <TruncatedText text={original.task_display_name} />
+ </RouterLink>
+ ),
+ header: translate("common:task_one"),
+ },
+ {
+ accessorKey: "map_index",
+ header: translate("common:mapIndex"),
+ },
+ ]),
{
accessorKey: "timestamp",
cell: ({ row: { original } }) => <Time datetime={original.timestamp} />,
@@ -212,13 +221,14 @@ export const XCom = () => {
const { data, error, isFetching, isLoading } =
useXcomServiceGetXcomEntries(apiParams, undefined);
+ const isTaskInstancePage = dagId !== "~" && runId !== "~" && taskId !== "~";
+
const columns = getColumns({
+ isTaskInstancePage,
open,
translate,
});
- const isTaskInstancePage = dagId !== "~" && runId !== "~" && taskId !== "~";
-
return (
<Box>
{dagId === "~" && runId === "~" && taskId === "~" ? (