From 97424ea0af2458cd8dbc972fb302254711f79a66 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Fri, 23 Jan 2026 12:54:08 +0100 Subject: [PATCH] Update gallery_app.py --- gallery_app.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/gallery_app.py b/gallery_app.py index 85fe760..b8a82a1 100644 --- a/gallery_app.py +++ b/gallery_app.py @@ -849,16 +849,19 @@ def build_header(): state.profile_name = e.value state.load_active_profile() - state.active_cat = "control" # Reset to default category - SorterEngine.clear_staging_area() # Clear staging for new profile - # Auto-load if source path exists - if os.path.exists(state.source_dir): - load_images() - else: - state.all_images = [] - refresh_staged_info() - refresh_ui() + # Reset to first available category for new profile + cats = state.get_categories() + state.active_cat = cats[0] if cats else "control" + + # Clear staging and hotkeys for new profile + SorterEngine.clear_staging_area() + state.category_hotkeys = {} # Reset hotkeys when switching profile + state.all_images = [] + state.staged_data = {} + + refresh_staged_info() + refresh_ui() profile_select = ui.select( list(state.profiles.keys()),