This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun 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 8b99ff41ccd Use localstorage to store the dag run limit between page 
refresh. (#48656)
8b99ff41ccd is described below

commit 8b99ff41ccd35dab473b1c366d0d141b8221a60c
Author: Karthikeyan Singaravelan <tir.kar...@gmail.com>
AuthorDate: Wed Apr 2 18:25:05 2025 +0530

    Use localstorage to store the dag run limit between page refresh. (#48656)
---
 airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx | 5 ++---
 airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx  | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx 
b/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx
index b005d4a84fc..fc95b64fc27 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx
@@ -18,7 +18,7 @@
  */
 import { Box, HStack, Flex } from "@chakra-ui/react";
 import { useReactFlow } from "@xyflow/react";
-import { useState, type PropsWithChildren, type ReactNode } from "react";
+import type { PropsWithChildren, ReactNode } from "react";
 import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
 import { Outlet, useParams } from "react-router-dom";
 import { useLocalStorage } from "usehooks-ts";
@@ -52,11 +52,10 @@ export const DetailsLayout = ({ children, error, isLoading, 
tabs }: Props) => {
   const { data: dag } = useDagServiceGetDag({ dagId });
   const [defaultDagView] = useLocalStorage<"graph" | 
"grid">("default_dag_view", "grid");
   const [dagView, setDagView] = useLocalStorage<"graph" | 
"grid">(`dag_view-${dagId}`, defaultDagView);
+  const [limit, setLimit] = useLocalStorage<number>(`dag_runs_limit-${dagId}`, 
10);
 
   const { fitView, getZoom } = useReactFlow();
 
-  const [limit, setLimit] = useState<number>(10);
-
   return (
     <OpenGroupsProvider dagId={dagId}>
       <HStack justifyContent="space-between" mb={2}>
diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx 
b/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx
index 555242d7909..2b0cb378bae 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx
@@ -42,7 +42,7 @@ type Props = {
   readonly dagView: string;
   readonly limit: number;
   readonly setDagView: (x: "graph" | "grid") => void;
-  readonly setLimit: (limit: number) => void;
+  readonly setLimit: React.Dispatch<React.SetStateAction<number>>;
 } & StackProps;
 
 const options = createListCollection({

Reply via email to