Gerschel / sd_web_ui_preset_utils

Preset Manager moved private
252 stars 20 forks source link

Add element id filter and priority #14

Closed Gerschel closed 1 year ago

Gerschel commented 1 year ago

Add ability to grab component by element id if element id exists, if None, default to label A potential issue is if a component comes in with matching label, then later correct component comes in with element id. In this situation, pop other component off and replace with this component.

Other potential issue, if more than one component labels match, but no element id's do, how do I choose which is the correct one.
A possible method, but not desirable, would be to check up the parent tree and see if I can determine script/extension owner. But this traversal would have to occur after all scripts have been loaded. (non-blocking wait? dynamic fill in through out of scope mutable fields in lists?) The preferred way; I would get the name of the owner handed to me. A solution, create a pull request to the main project where a component kwargs include the script name. Ideally, others would utilize the element id's.

A short-term fix, add all matching components to additional_components.json, and allow user to specify the correct one through either the inspect, or selective save.

Gerschel commented 1 year ago

Currently, I'm exploring an idea of how to hand-off the scripts name with components, so element id's and label name clashes, become less of an issue.