From 11a617a29b70dbacb831db728559dc187ef787c1 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Thu, 26 Nov 2026 20:39:44 +0100 Subject: [PATCH] feat(options): rename Images tab to "Page background" after Top of the page; new "Groups" tab Tab order is now: Default fonts and colors > Top of the page > Page background (the config.xml "Images" category, tab id kept as category-images so the stored tab preference stays valid) > Groups > Simple options > Questions. The new "Groups" tab (id "groups") contains all ten group-related options that lived in the Questions tab: grouptitlefont, grouptitletextcolor(+custom), groupdescriptionfont, groupdescriptiontextcolor(+custom), grouptitlefontsize, grouptitlefontweight, groupdescriptionfontsize, groupdescriptionfontweight. They are excluded from the Questions pane; values are stored per option key, so no theme reset is needed and stored values are untouched. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- options/options.twig | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/options/options.twig b/options/options.twig index d1c5414..69335f5 100644 --- a/options/options.twig +++ b/options/options.twig @@ -13,7 +13,9 @@ dropdown plus "Same as base font"; see the branch below.) Tab order: the "Fonts" category tab is FIRST (default font + per-element font - overrides), then the "Top of the page" tab, then the other categories. + overrides), then the "Top of the page" tab, then the "Page background" tab (the + config.xml "Images" category), then the "Groups" tab (all group-related options + of the "Questions" category), then the other remaining categories. Exception: the options that make up the TOP OF THE PAGE (header menu, logos, header colors, progress bar) are pulled out of their config.xml categories @@ -280,19 +282,44 @@ {% set aQuestionsCol2 = ['questionborder', 'questionbordercolor', 'questionborderstyle', 'questiondropdown', 'questionborderradiusTL', 'questionborderradiusTR', 'questionborderradiusBL', 'questionborderradiusBR'] %} {% set aQuestionsCol3 = ['checkboxcolor'] %} +{# row 147: all group-related options of the "Questions" category — they are + pulled out of the Questions tab into a dedicated "Groups" tab (aGroupsTab below). + Values are stored per option key, so moving them does not change stored values. #} +{% set aGroupKeys = [ + 'grouptitlefont', 'grouptitletextcolor', 'grouptitletextcolorcustom', + 'groupdescriptionfont', 'groupdescriptiontextcolor', 'groupdescriptiontextcolorcustom', + 'grouptitlefontsize', 'grouptitlefontweight', + 'groupdescriptionfontsize', 'groupdescriptionfontweight' +] %} + {# Tab list: FIRST the "Fonts" tab (where the default/base font is chosen and the per-element font overrides live), then the "Top of the page" tab (keys = - aTopOfPageKeys), then one tab per remaining category from config.xml like the - core options page (keys = null: all options of that category, except the - top-of-page keys). Category tab ids are slugs of the category name, so they - stay stable regardless of the tab order. #} + aTopOfPageKeys), then row 147: the "Page background" tab (the config.xml "Images" + category, id kept as 'category-images' so the stored tab preference stays valid), + then the "Groups" tab (keys = aGroupKeys), then one tab per remaining category + from config.xml like the core options page (keys = null: all options of that + category, except the top-of-page and group keys). #} {% set aTabs = [] %} {% if 'Fonts' in aOptionAttributes.categories %} {% set aTabs = [{ 'id': 'category-fonts', 'label': 'Default fonts and colors', 'category': 'Fonts', 'keys': null }] %} {% endif %} {% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Top of the page', 'category': 'Top of the page', 'keys': aTopOfPageKeys }]) %} +{# row 147: "Images" category -> "Page background" tab, directly after Top of the page #} +{% set aImagesKeys = [] %} +{% for key, attr in aOptionAttributes.optionAttributes %} + {% if key != 'ajaxmode' and attr.category == 'Images' and key not in aTopOfPageKeys %} + {% set aImagesKeys = aImagesKeys|merge([key]) %} + {% endif %} +{% endfor %} +{% if aImagesKeys is not empty %} + {% set aTabs = aTabs|merge([{ 'id': 'category-images', 'label': 'Page background', 'category': 'Images', 'keys': null }]) %} +{% endif %} +{# row 147: dedicated "Groups" tab with all group-related options (aGroupKeys). + category 'Groups' (no config.xml category of that name) so the pane renders the + normal width-based grid instead of the Questions 3-column layout. #} +{% set aTabs = aTabs|merge([{ 'id': 'groups', 'label': 'Groups', 'category': 'Groups', 'keys': aGroupKeys }]) %} {% for category in aOptionAttributes.categories %} - {% if category != 'Fonts' and category != 'Top of the page' and category != 'Colors' %} + {% if category != 'Fonts' and category != 'Top of the page' and category != 'Colors' and category != 'Images' %} {# The "Colors" tab is removed on purpose. Its only remaining options are sliderhandlecolor and privacybackgroundcolor (the other Colors keys are pulled into "Top of the page" via aTopOfPageKeys) — TODO: place these two @@ -331,18 +358,21 @@ {% if aTabKeys is null %} {% set aTabKeys = [] %} {% for key, attr in aOptionAttributes.optionAttributes %} - {% if key != 'ajaxmode' and attr.category == tab.category and key not in aTopOfPageKeys %} + {# row 147: group keys are excluded here — they live in the "Groups" tab #} + {% if key != 'ajaxmode' and attr.category == tab.category and key not in aTopOfPageKeys and key not in aGroupKeys %} {% set aTabKeys = aTabKeys|merge([key]) %} {% endif %} {% endfor %} {% else %} {# the top-of-page tab also picks up options that literally carry the category "Top of the page" (so config.xml may use it after a reset) #} + {% if tab.id == 'top-of-page' %} {% for key, attr in aOptionAttributes.optionAttributes %} {% if key != 'ajaxmode' and attr.category == 'Top of the page' and key not in aTabKeys %} {% set aTabKeys = aTabKeys|merge([key]) %} {% endif %} {% endfor %} + {% endif %} {% endif %}