This spec describes how dashboard components (fieldsets, entity fieldsets, actions, and other elements) are ordered in OliveTin. It documents the current behaviour so that it can be reasoned about and kept consistent.
Dashboards are built in two ways:
Ordering rules differ slightly between these two cases.
Fieldsets without entities: Fieldsets that are not tied to an entity type appear at the top level in config order. Their position in the dashboard matches the order in which they are defined in the config.
Other top-level components: All other top-level components (including the root "Actions" fieldset and entity fieldset groups) are sorted before being shown. Sort order:
The root "Actions" fieldset is the single fieldset created by the build to hold loose items; it is identified by reference (not by position). When present it is added last to the list, then the sort is applied among that fieldset and entity-related components. So that fieldset can appear anywhere among those according to the rules above. When there are no loose items the root is not present, and the last component in the list is not treated as the root—so a fieldset without entities in the last position keeps config order. Regular fieldsets stay in config order and are not reordered.
When a fieldset in the config is tied to an entity type (e.g. "Server" or "Project"), one fieldset is built per entity instance. Those fieldsets are shown in entity key order.
Entity key order:
So the order of entity fieldsets (e.g. one per server, one per project) is determined by this entity key order, not by config or insertion order.
Default dashboard: The single "Actions" fieldset's contents are sorted. The same rules as for top-level components apply: order value first, then entity key (numeric then alphabetical), then action title.
Config dashboards: For all fieldsets (the root "Actions" fieldset, entity fieldsets, and regular fieldsets), the contents are not sorted. They keep the order from the config:
So within any config-defined fieldset, the order of actions and other child components is the config order.