From 53b17869498198a356aa7a377f5d3a2979f4b876 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Tue, 24 Nov 2026 22:57:43 +0100 Subject: [PATCH] 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 --- options/options.twig | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/options/options.twig b/options/options.twig index 589c4b0..29bc410 100644 --- a/options/options.twig +++ b/options/options.twig @@ -164,7 +164,18 @@ {% 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' %} - {% set aTabs = aTabs|merge([{ 'id': 'category-' ~ category|lower|replace({' ': '-'}), 'label': category, 'category': category, 'keys': null }]) %} + {# 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 %}