Skip to content

SG-43959 UI/UX for VariantSet component selector - #157

Open
carlos-villavicencio-adsk wants to merge 3 commits into
ticket/sg-43935/data-model-create-updatefrom
ticket/SG-43959_variantset_ui
Open

SG-43959 UI/UX for VariantSet component selector#157
carlos-villavicencio-adsk wants to merge 3 commits into
ticket/sg-43935/data-model-create-updatefrom
ticket/SG-43959_variantset_ui

Conversation

@carlos-villavicencio-adsk

Copy link
Copy Markdown
Contributor

Description

This pull request adds comprehensive support for FlowAM variant container assets in the loader dialog, enabling users to select and interact with different asset variants directly from the UI. The main changes introduce a new variant selector widget, update the data models and dialog logic to recognize and handle variant containers, and ensure that the UI updates correctly when variant selections or async thumbnail loads occur.

FlowAM Variant Container Support

  • Added a new VariantSelectorWidget (flowam/variant_selector_widget.py) that appears in the details panel when a FlowAM variant container asset is selected. This widget allows users to select among available variants, emitting signals to update the actions menu and history accordingly. [1] [2]
  • Updated the loader dialog (dialog.py) to detect when a selected asset is a variant container, display the variant selector, and route actions/history through the currently selected variant. The dialog also seeds the UI with the first variant by default. [1] [2]

Model and Data Handling Enhancements

  • Modified MedmLatestPublishModel (latestpublish_model.py) to identify variant containers, store variant sets and prebuilt sg_data for each variant, and provide a helper to populate the model with a single card for the container asset. [1] [2]
  • Added a new role (VARIANT_SETS_ROLE) to the model for storing variant set metadata.

UI and Async Thumbnail Handling

  • Ensured that when a thumbnail for a history or publish item arrives asynchronously, the details panel updates the image if that item is currently selected. This includes new signal connections and handlers for both history and publish models. [1] [2] [3]

Imports and Initialization

  • Updated imports to include the new VariantSelectorWidget in the FlowAM module initialization.
  • Added initialization and cleanup logic for the variant selector widget in the dialog.

Screenshots

image image

@chenm1adsk chenm1adsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments and questions!

Comment thread python/tk_multi_loader/flowam/variant_selector_widget.py Outdated
Comment thread python/tk_multi_loader/flowam/variant_selector_widget.py Outdated
Comment thread python/tk_multi_loader/flowam/variant_selector_widget.py Outdated
Comment thread python/tk_multi_loader/flowam/variant_selector_widget.py
Comment thread python/tk_multi_loader/flowam/latestpublish_model.py Outdated
Comment thread python/tk_multi_loader/flowam/latestpublish_model.py Outdated
sg_publish_type_counts = self._calculate_sg_publish_type_counts()
self._publish_type_model.set_active_types(sg_publish_type_counts)

def _populate_variant_container(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not saying it has to be done in the scope of this PR but this function is growing. We should consider refactor it at some point to something like:

_populate_model_from_selected_item(selected_item)

├── _resolve_asset(selected_item) -> Optional[FlowAsset]
│ └── extract + validate, return None if invalid

├── [early return] if variant container:
│ └── _populate_variant_container(asset, variant_sets) # already extracted

├── _resolve_leaf_assets(asset) -> list[sg_dict]
│ ├── _fetch_asset_children(asset)
│ └── fallback: [_asset_to_sg_dict(asset)] if leaf, else []

├── _fetch_drafts_by_asset_id(assets) -> dict[asset_id, list[sg_dict]]
│ └── per-asset draft fetch + cache + convert

└── _emit_center_panel_cards(children_sg_dicts, drafts_by_asset_id, leaf_fallback, parent_asset_id)
├── published vs draft priority logic (Pass 2)
├── leaf_fallback draft surface (edge case)
└── new draft items (Pass 3)

Comment thread python/tk_multi_loader/dialog.py
Comment thread python/tk_multi_loader/dialog.py Outdated
Comment thread python/tk_multi_loader/dialog.py Outdated

@chenm1adsk chenm1adsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.85714% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.88%. Comparing base (08f2a32) to head (29ae833).

Files with missing lines Patch % Lines
python/tk_multi_loader/dialog.py 2.85% 102 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                              @@
##           ticket/sg-43935/data-model-create-update     #157      +/-   ##
============================================================================
- Coverage                                     18.30%   17.88%   -0.43%     
============================================================================
  Files                                            32       32              
  Lines                                          3070     3159      +89     
============================================================================
+ Hits                                            562      565       +3     
- Misses                                         2508     2594      +86     
Flag Coverage Δ
Linux 17.88% <2.85%> (-0.43%) ⬇️
Python-3.10 17.88% <2.85%> (-0.43%) ⬇️
Python-3.11 17.88% <2.85%> (-0.43%) ⬇️
Python-3.13 17.88% <2.85%> (-0.43%) ⬇️
Python-3.9 17.88% <2.85%> (-0.43%) ⬇️
Windows 17.88% <2.85%> (-0.43%) ⬇️
macOS 17.88% <2.85%> (-0.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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