Skip to content

Adds Target Videos Sorting and new filter options#267

Draft
mr-szgz wants to merge 18 commits into
VisoMasterFusion:devfrom
mr-szgz:feat/sortable-target-videos-list
Draft

Adds Target Videos Sorting and new filter options#267
mr-szgz wants to merge 18 commits into
VisoMasterFusion:devfrom
mr-szgz:feat/sortable-target-videos-list

Conversation

@mr-szgz

@mr-szgz mr-szgz commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This work upgrades the target videos list into a more capable, metadata-driven, sortable/filterable UI while refactoring the list architecture to improve maintainability, responsiveness, and reliability.

Feature Additions

  • Added richer target-media sorting options, including:
    • Sort by name
    • Sort by file date
    • Sort by file size
    • Sort by dimensions
    • Sort by total pixels
    • Sort by frame length
    • Search reset button
    • redesign file type filters as togglable Image/video/webcam filter flow
    • Minimum width/height filtering via synchronized slider/spinbox controls
  • Added improved media metadata handling for list items (including video frame/length information used by sorting/tooltips).
  • Added new sorting glyph assets and related UI resources for clearer sort-direction/state feedback.
  • Large UI/resource churn is expected due to mainwindow ui regeneration and icon additions.
image

Sortable Target Videos List Refactor

  • refactors moving target videos list towards more native qt, including using QListWidget and QListWidgetItem to unlock sortability.
  • Classes (app\ui\widgets\sortable_widgets.py)
  • targetVideosList now inherits and us defined in .ui

Custom widgets & new traversal paths

class TargetVideosListWidget(SortableListWidget):...
class SortableListWidget(QtWidgets.QListWidget):...
class SortableListWidgetItem(QtWidgets.QListWidgetItem):...

# items has card button data
item = SortableListWidgetItem()
item.setCardButton(card_button)
card_button = item.cardButton()

# sort mode is property on list
list_widget = SortableListWidget()
list_widget.setSortingMode(SortingMode.FileName)
sort_mode = list_widget.sortingMode()

# cards buttons can access their item
card_button.setListWidgetItem(list_item)
list_item = card_button.listWidgetItem()

# items can access their card
list_item.setCardButton(card_button)
card_button = list_item.cardButton()

Using TargetVideosListWidget in MainWindow.ui

<widget class="TargetVideosListWidget" name="targetVideosList">
         <property name="acceptDrops">
          <bool>true</bool>
         </property>
         <property name="autoScroll">
          <bool>false</bool>
         </property>
</widget>
...
<customwidget>
   <class>TargetVideosListWidget</class>
   <extends>QListWidget</extends>
   <header>app.ui.widgets.actions.target_videos_list_actions</header>
  </customwidget>
</customwidgets>

Added Sorting Modes

class SortingMode(enum.IntEnum):
    FileBirthDate       = 0x140
    FileName            = 0x141
    FileSize            = 0x143
    ImageDimension      = 0x144
    ImagePixels         = 0x145
    VideoLength         = 0x146

Added Sorting Options

initialize_combobox_items = [
    ("Sort by Name",         SortingMode.FileName),
    ("Sort by File Date",    SortingMode.FileBirthDate),
    ("Sort by File Size" ,   SortingMode.FileSize),
    ("Sort by Dimensions",   SortingMode.ImageDimension),
    ("Sort by Total Pixels", SortingMode.ImagePixels),
    ("Sort by Frame Length", SortingMode.VideoLength)
]

electblake added 18 commits June 6, 2026 12:38
- Introduced `SortableListItem` class in `list_widgets.py` to support sorting of list items based on various attributes such as date, name, resolution, and file size.
- Implemented sorting logic and formatting for different data types within the `SortableListItem` class.
- Enhanced `CardButton` class in `widget_components.py` to include serialization methods for different card button types, allowing for consistent ID retrieval.
- Updated `TargetMediaCardButton`, `TargetFaceCardButton`, and `EmbeddingCardButton` classes to implement the `to_id` method for serialization.
- Added a new `uv.lock` file to manage Python package dependencies with versioning.
- Introduced new SVG glyphs for sorting: sort-size-big_on.svg, sort-size-small_bold-flipv.svg, sort-size-small_bold.svg, sort-size-small_on-flipv.svg, sort-size-small_on.svg.
- Refactored the sorting mechanism in main_ui.py to utilize a more structured approach with Sortable and SortableListItem classes.
- Updated the target videos sorting logic to support new sorting modes and improved UI responsiveness.
- Removed deprecated sorting methods and integrated new sorting logic into the existing UI framework.
- Enhanced tooltip information for media items in the list view to provide better context for sorting.
- Re-enabled target video sorting widgets and connected signals for sorting actions in main_ui.py.
- Updated set_up_target_video_sorting_combobox to directly manipulate the main window's combo box.
- Improved error handling in add_media_thumbnail_button for adding items to the list widget.
- Removed commented-out code related to SortableListWidget and its methods in list_widgets.py for clarity.
- Enhanced tooltip generation in SortableListItem with debug logging for better traceability.
- Added image dimension sliders for target videos with a range from 0 to 8K UHD.
- Implemented filtering options for images, videos, and webcams with default states.
- Improved sorting capabilities by integrating image dimensions and pixel counts.
- Refactored filter and sorting logic to streamline the user interface and enhance performance.
- Updated the `extract_frame_as_image` function to allow customizable scaling of thumbnails.
- Fixed issues related to signal connections and widget visibility in the UI.
- Addressed circular import issues and ensured proper initialization of components.
- Added debug logging for better traceability during development and troubleshooting.
- Introduced `target_videos_list_actions.py` to encapsulate actions related to target videos list management.
- Updated `MainWindow.ui` to include a status line edit for displaying target media status.
- Modified `main_window.py` to connect new UI components and actions for better user feedback.
- Adjusted progress bar handling in `ui_workers.py` to reflect loading status of target media.
- Cleaned up unused imports and functions in `filter_actions.py` and `list_view_actions.py`.
- Enhanced signal-slot connections for better responsiveness in the UI.
…ts module

- Consolidated event filter classes for graphics view, video seek slider, and list widgets into a single file for better organization and maintainability.
- Introduced a new sortable_widgets module to handle sortable list items and their associated logic, improving code structure.
- Removed the deprecated list_widgets module to streamline the codebase.
- Updated settings layout data to clarify workspace auto-load and auto-save options.
- Enhanced the UI worker classes to utilize the new sortable widgets, ensuring compatibility with the updated structure.
- Added debug print statements for better traceability during media loading processes.
- Removed the target videos reload button from the main window UI.
- Updated icons for the search reset button, sort direction button, filter menu button, and various checkboxes to use consistent icon variables.
- Changed the handling of image dimensions to use a new `SortableImageDimension` class for better clarity and consistency.
- Modified the `add_media_thumbnail_button` function to retrieve video frame information and store it in the list item.
- Updated the sorting logic to accommodate the new `VideoInfo` and `VideoFrame` data roles.
- Refactored the `SortableListWidgetItem` to include methods for handling video information and frames.
- Adjusted the `FilterWorker` to check for `SortableImageDimension` instead of the old `ImageDimension`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants