I believe we are starting to push the limits of how many primary tabs (technically called primary “local tasks”) are being displayed on some of our entity pages. As such, I propose we move the “default” tabs (View, Edit and Revisions) into secondary tabs under a common primary tab for the entity. Let’s use this thread to discuss? I welcome feedback!
Note: I originally stumbled upon this idea when thinking about using contextual links for edit/revision/delete actions: Use contextual links for entity edit, revision and delete links
In that thread @mstenta requested to see the code for this so I’ve also just opened a PR that demonstrates this (this PR is compatible with asset, logs and plans, but taxonomy terms would require a bit of additional work): Move default entity tabs to secondary tabs by paul121 · Pull Request #634 · farmOS/farmOS · GitHub
A few motivations for this:
- Additional tabs will continue to be out of context with the default tabs that directly relate to viewing + editing fields about the entity. Additional tabs are often used to display information related to the entity (eg: logs referencing an asset). Moving the default tabs under a common primary tab keeps this “entity context” in one place.
- We can improve the context of a given page (eg: “What am I looking at?”) by improving the name of this proposed “common primary tab” to be 1) the entity type label (eg: “Asset”) or 2) the entity bundle (eg: “Animal”).
- There is a limited amount of space for primary tabs. Moving the default tabs to secondary tabs creates space for more primary tabs.
Right now we only have a few “additional tabs” that we add to entity pages but I foresee more being added overtime to fulfill more specific use-cases (especially on plans!). Here is a quick overview of current tabs I can recall:
Logs:
- View, edit, revisions (default)
Assets:
- View, edit, revisions (default)
- Logs (shows logs referencing an asset, visible on all asset types)
- Assets (shows assets located within an asset, visible on location assets)
- Locations (shows children locations, visible on location assets that have children)
Taxonomy terms:
- View, edit, delete (default)
- Assets (shows assets that have a field referencing this term, eg: plant + plant type)
- Logs (shows logs that have field a field referencing this term, eg: seeding log + plant type)
Plans:
- View, edit, revisions (default)
- farmOS core does not have any plan types. However, I believe many plan types will use additional tabs to display specialized UIs and relationships.
This means that right now location assets can have up to 3 tabs (logs, assets and locations), taxonomy terms can have 2 tabs (plant types have both asset and logs tabs).
An important aspect of this decision is that the placement on these default tabs is “universal” across all bundles of the entity. For example, we cannot only move these default tabs for land assets, they must be moved for all asset types. I’m currently reaching this conundrum in the Rothamsted experiment plan I’m working on. It currently has 3 additional tabs and I would like to add a couple more. I could move these default tabs for plans in the Rothamsted module… but as soon as they would like to enable additional plan types, they would be affected as well.
We can also decide which entity types to make this change on. At minimum, I’d like to see this implemented for plans. But I think there is value in implementing this for assets and *taxonomy terms, and even logs as well. I think it’s forward thinking to “create the space” for additional primary tabs before other people/modules/use-cases need them and the UI is not well-suited to add them.