Definition of component groups #7120
-
The methods and constructors in the library are supposed to be grouped into categories, such that it is easier to search for them in the component browser. Currently, those component groups are defined as part of component-groups:
extends:
- Standard.Base.Input:
exports:
- Standard.Table.Data.Table.Table.new
- Standard.Table.Data.Table.Table.from_rows
- Standard.Table.Data.Table.Table.from_objects
- Standard.Table.Data.Column.Column.from_vector
- Standard.Base.Select:
exports:
- Standard.Table.Data.Table.Table.at
- Standard.Table.Data.Table.Table.get
- Standard.Table.Data.Table.Table.select_columns
- Standard.Table.Data.Table.Table.remove_columns
- Standard.Table.Data.Table.Table.reorder_columns
- Standard.Table.Data.Table.Table.sort_columns The definition is supposed to contain a list of methods, and possibly a color that should be used for given group visually. There are a few problems with this approach:
Proposed changeI would like to propose a different approach to solve this. Instead of defining that information in separate file, we could annotate the methods themselves, similarly to how we deal with icons and aliases right now. Assigning items to groupsIdeally, we would use method annotations for this, but that would require dealing with widget definitions slightly differently. In the long run we would probably want the definition to look something like this:
Given that currently the annotations are always interpreted as widget for argument of given name, we can't use them for anything else without significant changes. I propose that we temporarily use the documentation tags to accomplish the same goal. When the time comes to move to actual annotations, the transition could be performed by an automated script.
Order within groupsWith current system, the order of items within the group is defined, as long as the group is defined only in a single module. When multiple libraries are using the same group, the order between them is not clear. Therefore I believe that splitting the group definition to be per-method doesn't really make this more complicated. We just have to define the desired behavior. By default, we can sort the items alphabetically by their display name within each group. In case we would want to retain some forced ordering, we could add additional notion of "group priority". Items of higher priority would be presented at the start of each group, and the alphabetical order would be used as a secondary ordering method. It could be defined as part of the tag, for example like this:
Though the exact syntax is not really important at this stage, as long as the contept holds. Group colorGiven that there is now no central place where group properties could be defined, the library has no good place to assign a color to the group. Though given that the IDE theme can be modified, I believe that it wasn't a good place to defined it to begin with anyway. Instead we could use a combination of automatic color assignment based on group name, and then use the IDE theme system to allow overriding that.
With all of the above changes, we could completely remove the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Bringing @wdanilo attention, as this affects the initial design |
Beta Was this translation helpful? Give feedback.
-
I think one important thing is missing from the new design: namely, how the order of the groups (not their content) will be specified? For example, we always want to show Input/Output as the "nearest" group after opening CB. |
Beta Was this translation helpful? Give feedback.
@jdunkerley @farmaazon @Frizi I added description of these things to the Component Browser update doc: enso-org/design#56 . Could you look there as well, please? I think I merged the proposed changes from this thread there. Of course, this doc describes the approach we are heading for and I'm totally fine with keeping some things in docs instead of in pragmas for now in order to implement it faster.