This is an automated email from the ASF dual-hosted git repository.
guanmingchiu 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 e4c4e3625f5 Persist table columns visibility in local storage (#61858)
e4c4e3625f5 is described below
commit e4c4e3625f5b562e58393cac58cf0b93b50e4542
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Fri Feb 13 17:04:51 2026 +0100
Persist table columns visibility in local storage (#61858)
---
airflow-core/src/airflow/ui/src/components/DataTable/DataTable.tsx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/components/DataTable/DataTable.tsx
b/airflow-core/src/airflow/ui/src/components/DataTable/DataTable.tsx
index c7e2903163c..caf507dcb0c 100644
--- a/airflow-core/src/airflow/ui/src/components/DataTable/DataTable.tsx
+++ b/airflow-core/src/airflow/ui/src/components/DataTable/DataTable.tsx
@@ -29,8 +29,9 @@ import {
type Table as TanStackTable,
type Updater,
} from "@tanstack/react-table";
-import React, { type ReactNode, useRef, useState, useCallback } from "react";
+import React, { type ReactNode, useRef, useCallback } from "react";
import { useTranslation } from "react-i18next";
+import { useLocalStorage } from "usehooks-ts";
import { CardList } from "src/components/DataTable/CardList";
import { TableList } from "src/components/DataTable/TableList";
@@ -109,7 +110,8 @@ export const DataTable = <TData,>({
[onStateChange],
);
- const [columnVisibility, setColumnVisibility] = useState<VisibilityState>(
+ const [columnVisibility, setColumnVisibility] =
useLocalStorage<VisibilityState>(
+ `dataTable:${modelName}:columnVisibility`,
initialState?.columnVisibility ?? {},
);