diff --git a/photo_tagger.py b/photo_tagger.py index ab752b4..3670acf 100644 --- a/photo_tagger.py +++ b/photo_tagger.py @@ -3480,12 +3480,54 @@ class PhotoTagger: else: people_filtered = None populate_people_list() + # Update right panel based on filtered results + source = people_filtered if people_filtered is not None else people_data + if source: + # Load faces for the first person in the list + first = source[0] + try: + # Update selection state + for child in people_list_inner.winfo_children(): + for widget in child.winfo_children(): + if isinstance(widget, ttk.Label): + widget.config(font=("Arial", 10)) + # Bold the first label if present + first_row = people_list_inner.winfo_children()[0] + for widget in first_row.winfo_children(): + if isinstance(widget, ttk.Label): + widget.config(font=("Arial", 10, "bold")) + break + except Exception: + pass + # Show faces for the first person + show_person_faces(first['id'], first.get('full_name') or first.get('name') or "") + else: + # No matches: clear faces panel + clear_faces_panel() def clear_last_name_filter(): nonlocal people_filtered last_name_search_var.set("") people_filtered = None populate_people_list() + # After clearing, load faces for the first available person if any + if people_data: + first = people_data[0] + try: + for child in people_list_inner.winfo_children(): + for widget in child.winfo_children(): + if isinstance(widget, ttk.Label): + widget.config(font=("Arial", 10)) + first_row = people_list_inner.winfo_children()[0] + for widget in first_row.winfo_children(): + if isinstance(widget, ttk.Label): + widget.config(font=("Arial", 10, "bold")) + break + except Exception: + pass + show_person_faces(first['id'], first.get('full_name') or first.get('name') or "") + else: + clear_faces_panel() def clear_faces_panel(): for w in faces_inner.winfo_children():