From f3aa514240335bf9f0c3009cda3e2bfc095f6c69 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:25:18 +0530 Subject: [PATCH] feat: integrate subtree ID retrieval in local folder cleanup process and enhance UI component styling for folder selection --- .../app/tasks/connector_indexers/local_folder_indexer.py | 6 +++++- surfsense_web/components/sources/FolderWatchDialog.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/surfsense_backend/app/tasks/connector_indexers/local_folder_indexer.py b/surfsense_backend/app/tasks/connector_indexers/local_folder_indexer.py index 5cac13b1b..1d890c8d3 100644 --- a/surfsense_backend/app/tasks/connector_indexers/local_folder_indexer.py +++ b/surfsense_backend/app/tasks/connector_indexers/local_folder_indexer.py @@ -861,8 +861,12 @@ async def index_local_folder( root_fid = folder_mapping.get("") if root_fid: + from app.services.folder_service import get_folder_subtree_ids + + subtree_ids = await get_folder_subtree_ids(session, root_fid) await _cleanup_empty_folders( - session, root_fid, search_space_id, existing_dirs, folder_mapping + session, root_fid, search_space_id, existing_dirs, folder_mapping, + subtree_ids=subtree_ids, ) try: diff --git a/surfsense_web/components/sources/FolderWatchDialog.tsx b/surfsense_web/components/sources/FolderWatchDialog.tsx index bb3972a09..f6814bcfb 100644 --- a/surfsense_web/components/sources/FolderWatchDialog.tsx +++ b/surfsense_web/components/sources/FolderWatchDialog.tsx @@ -170,7 +170,7 @@ export function FolderWatchDialog({ Select a folder to sync and watch for changes. -
+
{selectedFolder ? (