Fix bad display of element choices in the in-editor context menu ("New ..." selection)
If you use the context menu inside the editor itself (e.g., for components) to create/add new model elements (via "New ..."), then it is possible that you observe the following:
- All elements are sorted alphanumerical, which makes it difficult to distinguish between basic model elements, reuse elements, etc.
- All elements are shown for which prototypes exist (and without hierarchies), i.e., if there are several reuse libraries with hundreds of reuse elements, all reuse elements are shown in the context menu list without any sorting, structure, hierarchy. Also, is it even wanted that you can see there all reuse elements?
- Since all elements are shown only with their own name one below the other, it can happen that there are multiple entries with the same name. Reuse element names only need to be unique within each reuse library, but since the context menu list collects all reuse elements from different libraries together (without adding the name of the library to the element name), there can be several occurrences of the same name (which can also be identical with the basic model element name, e.g., "Component"). See screenshot:
Thoughts/Ideas:
- Is it wanted that everything is shown in this menu? What if there are hundreds of reuse elements?
- Especially if there are so many elements in the list, it is important to have the most important ones at top (the basic model elements) --> sorting based on priority/type/category?
- If there are several elements with the same name, it would make sense to add the parent name to the element name, especially for the reuse elements, like "(LibraryName) ElementName"
Test procedure:
- Create an AF3 project with a component architecture and at least two reuse libraries with some dummy reuse elements/components
- Inside the component editor, right-click on the background and on some components.
- Experience the new context menu:
- The "New ..." entry has only the standard elements (sorted first by priority and then lexicographical, meaning that, e.g., the standard "Component" must be on top)
- There is now a new "Reuse ..." entry group in which all the found reuse elements are listed. They can now easily be distinguished even if they have the same name, because they have now their library name as prefix.
Edited by Sebastian Bergemann