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 c581c186987 Keep DAG folder selection distinct across bundle names 
(#75080)
c581c186987 is described below

commit c581c186987e1fc14ea86bbab68d54e8ea34a892
Author: Himanshu Chawla <[email protected]>
AuthorDate: Tue Oct 20 02:57:01 2026 +0530

    Keep DAG folder selection distinct across bundle names (#75080)
    
    Co-authored-by: Himanshu Chawla 
<[email protected]>
---
 .../DagsList/DagFolderTree/DagFolderTree.test.tsx    | 20 ++++++++++++++++++++
 .../pages/DagsList/DagFolderTree/buildFolderTree.ts  |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git 
a/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/DagFolderTree.test.tsx
 
b/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/DagFolderTree.test.tsx
index a6bd748270e..ad3e26a73a3 100644
--- 
a/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/DagFolderTree.test.tsx
+++ 
b/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/DagFolderTree.test.tsx
@@ -377,3 +377,23 @@ describe("DagFolderTree (multiple bundles)", () => {
     expect(node("ml")).toHaveAttribute("aria-selected", "false");
   });
 });
+
+it("selects the correct bundle when names and folder paths contain colons", 
async () => {
+  const onSelectFolder = vi.fn();
+
+  render(
+    <DagFolderTree
+      folders={[
+        { bundle_name: "a", folder: "b:c" },
+        { bundle_name: "a:b", folder: "c" },
+      ]}
+      onSelectFolder={onSelectFolder}
+      selectedBundle="a:b"
+      selectedFolder={undefined}
+    />,
+    { wrapper: BaseWrapper },
+  );
+
+  fireEvent.click(screen.getByTitle("c"), { button: 0 });
+  await waitFor(() => expect(onSelectFolder).toHaveBeenCalledWith({ 
bundleName: "a:b", folder: "c" }));
+});
diff --git 
a/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/buildFolderTree.ts
 
b/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/buildFolderTree.ts
index 9eeb29bb3a6..e691c9c59e8 100644
--- 
a/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/buildFolderTree.ts
+++ 
b/airflow-core/src/airflow/ui/src/pages/DagsList/DagFolderTree/buildFolderTree.ts
@@ -114,7 +114,8 @@ export type FolderTreeNode = {
 };
 
 export const bundleNodeValue = (bundleName: string) => `bundle:${bundleName}`;
-export const folderNodeValue = (bundleName: string, folder: string) => 
`folder:${bundleName}:${folder}`;
+export const folderNodeValue = (bundleName: string, folder: string) =>
+  `folder:${encodeURIComponent(bundleName)}:${folder}`;
 
 const toTreeNodes = (bundleName: string, nodes: ReadonlyArray<FolderNode>): 
Array<FolderTreeNode> =>
   nodes.map((node) => ({

Reply via email to