From d3793f89984f7ebf088673f0a56043870ab5d271 Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Wed, 28 Oct 2026 14:20:50 +0100 Subject: [PATCH] feat: return to All Files when re-tapping Browse tab Signed-off-by: Milen Pivchev --- iOSClient/Main/NCMainTabBarController.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/iOSClient/Main/NCMainTabBarController.swift b/iOSClient/Main/NCMainTabBarController.swift index 6d6e09f981..af0124d0b0 100644 --- a/iOSClient/Main/NCMainTabBarController.swift +++ b/iOSClient/Main/NCMainTabBarController.swift @@ -257,6 +257,18 @@ class NCMainTabBarController: UITabBarController { } extension NCMainTabBarController: UITabBarControllerDelegate { + func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { + // Re-tapping Browse while it shows another sidebar section returns to All Files. + guard viewController === selectedViewController, + selectedIndex == 0, + let filesNavigationController, + viewController !== filesNavigationController || filesNavigationController.personalFilesOnly else { return true } + + openSidebarFiles(personalFilesOnly: false) + + return false + } + func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { // Browse retains the sidebar destination, personal filter and folder stack when switching tabs. if previousIndex == tabBarController.selectedIndex {