KoviAnusha commented on code in PR #57265:
URL: https://github.com/apache/airflow/pull/57265#discussion_r2463109751


##########
airflow-core/src/airflow/ui/src/components/DagActions/DeleteDagButton.tsx:
##########
@@ -31,15 +31,21 @@ type DeleteDagButtonProps = {
   readonly withText?: boolean;
 } & ButtonProps;
 
-const DeleteDagButton = ({ dagDisplayName, dagId, width, withText = true }: 
DeleteDagButtonProps) => {
+const DeleteDagButton = ({
+  dagDisplayName,
+  dagId,
+  width,
+  withText = true,
+}: DeleteDagButtonProps) => {
   const { onClose, onOpen, open } = useDisclosure();
   const navigate = useNavigate();
+  const location = useLocation();
   const { t: translate } = useTranslation("dags");
   const { isPending, mutate: deleteDag } = useDeleteDag({
     dagId,
     onSuccessConfirm: () => {
       onClose();
-      navigate("/dags");
+      navigate({ pathname: "/dags", search: location.search });
     },
   });

Review Comment:
   Using useLocation() is a clean way to preserve query params. You can also 
add a quick test later for this case (filter → delete → stays filtered), which 
will help ensure this behavior stays consistent after any router or UI refactor.



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