Repository navigation
feat: [2376] Show and hide tabs with ui-control - #2382
Merged
Merged
Conversation
Until now a tab on a Tabs layout page could only be hidden by hiding
every group assigned to it. ui-control can now show and hide a tab
directly.
msg.payload:
- New `pageTabs` key with `show` and `hide` lists. `tabs` is already an
alias for `pages` (Dashboard 1 compatibility), so tabs need their own
key.
- A tab is identified by "tabName", "tabId", "pageName:tabName",
"pageId:tabName" or { page, tab }, mirroring how groups are
identified. Ids are matched before names, and a name without a page
matches the first page with such a tab. Escaped colons work as they do
for groups and widgets.
- Unknown tabs or pages are reported as errors, and nothing is stored
when any identifier in a list fails to resolve.
Runtime:
- Tabs are not nodes, they live in the `tabs` list of their ui-page, so
the ids of hidden tabs are kept in the state store as a `hiddenTabs`
list on the page. emitConfig already merges page state into the
ui-config, so clients that connect later get the same tabs.
- The UI receives { page, tab } id pairs, because tab ids are only
unique within a page (a copied page keeps its tab ids).
UI:
- The tabsByPage getter skips hidden tabs. Groups assigned to a hidden
tab are hidden with it rather than turning into tabs of their own.
- The existing Tabs layout watcher already moves the selection to the
first remaining tab when the selected tab disappears.
Editor:
- "tab" is a new target for the Show and Hide actions, listing the tabs
of the dashboard's Tabs layout pages as "Page / Tab". The row is
stored as "<page id>:<tab id>" and marked invalid if the tab is
deleted, the page no longer uses the Tabs layout, or the action is not
Show or Hide.
Docs (en/de), editor help and tips are updated. Tests cover id/name
resolution, errors, state store updates, the ui-config sent to new
clients, editor actions, the tabsByPage getter, and Cypress tests for
hiding, showing, selection fallback and reloads.
n-lark
approved these changes
Nov 16, 2026
n-lark
left a comment
Contributor
There was a problem hiding this comment.
Hey! Thank you for the contribution, tested and looks great.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Lets
ui-controlshow and hide a tab on a Tabs layout page directly. Until now you had to hide every group in the tab.msg.payload
tabsis already an alias forpages, so tabs use a newpageTabskey:"tab","page:tab"or{ page, tab }, by id or name. Ids are checked before names. A name without a page matches the first page that has a tab with that name. Escaped colons work as they do for groups.Runtime / UI
hiddenTabslist on their page. Page state is already merged into theui-config, so clients that connect later see the same tabs.{ page, tab }id pairs, because tab ids are only unique within a page. A copied page keeps its tab ids.tabsByPageskips hidden tabs. Groups in a hidden tab are hidden too. They don't become their own tabs. If the selected tab is hidden, the existing watcher in the Tabs layout selects the first remaining tab.Editor
<page id>:<tab id>. The row is marked invalid if the tab is deleted, the page stops using the Tabs layout, or the action is changed to something other than Show or Hide.msgproperty target can't name a tab. Adding tabs to that lookup would make names that are already used by a group ambiguous, and Tabs pages often have a tab and a group with the same name. The docs point tomsg.payload.pageTabsfor that case.Docs (en/de), the editor help and the action tips are updated.
Testing
npm run lintandnpm testpass (327 tests). The new unit tests inui_control.spec.jsandtest/store/ui.spec.jsfail without the change.layouts.spec.jspasses (20 tests). It includes new tests for hiding and showing a tab, selecting the first remaining tab when the selected one is hidden, and keeping the tab hidden after a reload.button.spec.js,form.spec.jsandcontrol.spec.jsalso pass.<page id>:<tab id>. Rows with a deleted tab, a non-Tabs page or an Enable action are flagged as invalid.Related Issue(s)
Closes #2376