Add Tag Manager Panel to Dashboard GUI for comprehensive tag management functionality

This commit introduces the TagManagerPanel class into the Dashboard GUI, providing a fully integrated interface for managing photo tags. Users can now view, add, edit, and delete tags directly within the dashboard, enhancing the overall tagging experience. The panel includes features for bulk operations, responsive layout, and a detailed preview of tag management capabilities. The README has been updated to reflect these new functionalities, emphasizing the improved user experience in managing photo tags and their associations.
This commit is contained in:
tanyar09 2025-10-10 14:02:26 -04:00
parent f40b3db868
commit cbc29a9429
2 changed files with 1401 additions and 12 deletions

View File

@ -14,6 +14,7 @@ from gui_core import GUICore
from identify_panel import IdentifyPanel
from modify_panel import ModifyPanel
from auto_match_panel import AutoMatchPanel
from tag_manager_panel import TagManagerPanel
from search_stats import SearchStats
from database import DatabaseManager
from tag_management import TagManager
@ -1330,6 +1331,7 @@ from gui_core import GUICore
from identify_panel import IdentifyPanel
from modify_panel import ModifyPanel
from auto_match_panel import AutoMatchPanel
from tag_manager_panel import TagManagerPanel
from search_stats import SearchStats
from database import DatabaseManager
from tag_management import TagManager
@ -1446,7 +1448,7 @@ class DashboardGUI:
buttons_frame,
text=text,
command=lambda p=panel_name: self.show_panel(p),
width=12 # Fixed width for consistent layout
width=16 # Fixed width for consistent layout
)
btn.grid(row=0, column=i, padx=3, sticky=tk.W)
@ -1508,6 +1510,9 @@ class DashboardGUI:
# Deactivate modify panel if it's active
if hasattr(self, 'modify_panel') and self.modify_panel and self.current_panel == "modify":
self.modify_panel.deactivate()
# Deactivate tag manager panel if it's active
if hasattr(self, 'tag_manager_panel') and self.tag_manager_panel and self.current_panel == "tags":
self.tag_manager_panel.deactivate()
# Show new panel - expand both horizontally and vertically
self.panels[panel_name].grid(row=0, column=0, sticky=(tk.W, tk.E, tk.N, tk.S), padx=15, pady=15)
@ -1520,6 +1525,8 @@ class DashboardGUI:
self.auto_match_panel.activate()
elif panel_name == "modify" and hasattr(self, 'modify_panel') and self.modify_panel:
self.modify_panel.activate()
elif panel_name == "tags" and hasattr(self, 'tag_manager_panel') and self.tag_manager_panel:
self.tag_manager_panel.activate()
# Update status
self.status_label.config(text=f"Viewing: {panel_name.replace('_', ' ').title()}")
@ -1556,6 +1563,10 @@ class DashboardGUI:
# Update identify panel layout if it's active
if self.current_panel == "identify":
self.identify_panel.update_layout()
if hasattr(self, 'tag_manager_panel') and self.tag_manager_panel:
# Update tag manager panel layout if it's active
if self.current_panel == "tags":
self.tag_manager_panel.update_layout()
def _create_home_panel(self) -> ttk.Frame:
"""Create the home/welcome panel"""
@ -1868,25 +1879,45 @@ class DashboardGUI:
return panel
def _create_tags_panel(self) -> ttk.Frame:
"""Create the tags panel (placeholder)"""
"""Create the tags panel with full functionality"""
panel = ttk.Frame(self.content_frame)
# Configure panel grid for responsiveness
panel.columnconfigure(0, weight=1)
# Remove weight=1 from row to prevent empty space expansion
# Configure rows: title (row 0) fixed, tag manager content (row 1) should expand
panel.rowconfigure(0, weight=0)
panel.rowconfigure(1, weight=1)
# Title with larger font for full screen
title_label = tk.Label(panel, text="🏷️ Tag Manager", font=("Arial", 24, "bold"))
title_label.grid(row=0, column=0, sticky=tk.W, pady=(0, 20))
placeholder_frame = ttk.LabelFrame(panel, text="Coming Soon", padding="20")
placeholder_frame.grid(row=1, column=0, sticky=(tk.W, tk.E, tk.N))
placeholder_frame.columnconfigure(0, weight=1)
# Remove weight=1 to prevent vertical centering
# placeholder_frame.rowconfigure(0, weight=1)
placeholder_text = "Tag management functionality will be integrated here."
placeholder_label = tk.Label(placeholder_frame, text=placeholder_text, font=("Arial", 14))
placeholder_label.grid(row=0, column=0, sticky=(tk.W, tk.E, tk.N))
# Create the tag manager panel if we have the required dependencies
if self.db_manager and self.tag_manager and self.face_processor:
self.tag_manager_panel = TagManagerPanel(panel, self.db_manager, self.gui_core, self.tag_manager, self.face_processor)
tag_manager_frame = self.tag_manager_panel.create_panel()
tag_manager_frame.grid(row=1, column=0, sticky=(tk.W, tk.E, tk.N, tk.S))
else:
# Fallback placeholder if dependencies are not available
placeholder_frame = ttk.LabelFrame(panel, text="Configuration Required", padding="20")
placeholder_frame.grid(row=1, column=0, sticky=(tk.W, tk.E, tk.N))
placeholder_frame.columnconfigure(0, weight=1)
placeholder_text = (
"Tag manager panel requires database, tag manager, and face processor to be configured.\n\n"
"This will contain the full tag management interface\n"
"currently available in the separate Tag Manager window.\n\n"
"Features will include:\n"
"• Photo explorer with folder grouping\n"
"• Tag management and bulk operations\n"
"• Multiple view modes (list, icons, compact)\n"
"• Tag creation, editing, and deletion\n"
"• Bulk tag linking to folders\n"
"• Photo preview and people identification"
)
placeholder_label = tk.Label(placeholder_frame, text=placeholder_text, font=("Arial", 14), justify=tk.LEFT)
placeholder_label.grid(row=0, column=0, sticky=(tk.W, tk.E, tk.N, tk.S))
return panel

1358
tag_manager_panel.py Normal file

File diff suppressed because it is too large Load Diff