Asset-Frameworker/ProjectNotes/GUI_Enhancement_Plan.md
2025-04-29 18:26:13 +02:00

2.3 KiB

GUI Enhancement Plan

Objective

Implement two new features in the Graphical User Interface (GUI) of the Asset Processor Tool:

  1. Automatically switch the preview to "simple view" when more than 10 input files (ZIPs or folders) are added to the queue.
  2. Remove the specific visual area labeled "Drag and drop folders here" while keeping the drag-and-drop functionality active for the main processing panel.

Implementation Plan

The changes will be made in the gui/main_window.py file.

  1. Implement automatic preview switch:

    • Locate the add_input_paths method.
    • After adding the newly_added_paths to self.current_asset_paths, check the total number of items in self.current_asset_paths.
    • If the count is greater than 10, programmatically set the state of the "Disable Detailed Preview" menu action (self.toggle_preview_action) to checked=True. This will automatically trigger the update_preview method, which will then render the simple list view.
  2. Remove the "Drag and drop folders here" visual area:

    • Locate the setup_main_panel_ui method.
    • Find the creation of the self.drag_drop_area QFrame and its associated QLabel (drag_drop_label).
    • Add a line after the creation of self.drag_drop_area to hide this widget (self.drag_drop_area.setVisible(False)). This will remove the visual box and label while keeping the drag-and-drop functionality enabled for the main window.

Workflow Diagram

graph TD
    A[User drops files/folders] --> B{Call add_input_paths}
    B --> C[Add paths to self.current_asset_paths]
    C --> D{Count items in self.current_asset_paths}
    D{Count > 10?} -->|Yes| E[Set toggle_preview_action.setChecked(True)]
    D{Count > 10?} -->|No| F[Keep current preview state]
    E --> G[update_preview triggered]
    F --> G[update_preview triggered]
    G --> H{Check toggle_preview_action state}
    H{Checked (Simple)?} -->|Yes| I[Display simple list in preview_table]
    H{Checked (Simple)?} -->|No| J[Run PredictionHandler for detailed preview]
    J --> K[Display detailed results in preview_table]

    L[GUI Initialization] --> M[Call setup_main_panel_ui]
    M --> N[Create drag_drop_area QFrame]
    N --> O[Hide drag_drop_area QFrame]
    O --> P[Main window accepts drops]
    P --> B