fix(options): skip empty category tabs (Prompt S)
When building the tab list, resolve each category's option keys first (after excluding the top-of-page keys and ajaxmode) and only add the tab when at least one option remains. The "Progress" category's only option (progressbarposition) lives in the Top-of-page tab, so the empty Progress tab and pane are no longer rendered. Generic: any future emptied category disappears too. No config.xml change, no variant rebuild, no theme reset. Verified via CLI render (row 270): no category-progress tab/pane, 6 tabs remain, all 63 option wrappers present, progressbarposition + the 3 progressbar colors render exactly once, in the top-of-page pane. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
d61deb0ab1
commit
53b1786949
1 changed files with 12 additions and 1 deletions
|
|
@ -164,8 +164,19 @@
|
|||
{% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Top of the page', 'category': 'Top of the page', 'keys': aTopOfPageKeys }]) %}
|
||||
{% for category in aOptionAttributes.categories %}
|
||||
{% if category != 'Fonts' and category != 'Top of the page' %}
|
||||
{# Resolve this category's keys once and skip the tab entirely when none
|
||||
remain (Prompt S): e.g. "Progress" — its only option (progressbarposition)
|
||||
moved to the Top-of-page tab, so an empty tab must not be rendered. #}
|
||||
{% set catKeys = [] %}
|
||||
{% for key, attr in aOptionAttributes.optionAttributes %}
|
||||
{% if key != 'ajaxmode' and attr.category == category and key not in aTopOfPageKeys %}
|
||||
{% set catKeys = catKeys|merge([key]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if catKeys is not empty %}
|
||||
{% set aTabs = aTabs|merge([{ 'id': 'category-' ~ category|lower|replace({' ': '-'}), 'label': category, 'category': category, 'keys': null }]) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<ul class="nav nav-tabs mt-3" role="tablist">
|
||||
|
|
|
|||
Loading…
Reference in a new issue