SG-43959 UI/UX for VariantSet component selector - #157
SG-43959 UI/UX for VariantSet component selector#157carlos-villavicencio-adsk wants to merge 3 commits into
Conversation
chenm1adsk
left a comment
There was a problem hiding this comment.
Left some comments and questions!
| 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( |
There was a problem hiding this comment.
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)
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
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]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
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]VARIANT_SETS_ROLE) to the model for storing variant set metadata.UI and Async Thumbnail Handling
Imports and Initialization
VariantSelectorWidgetin the FlowAM module initialization.Screenshots