From 8513ec17f504658bebdb16646918256cd4a43d84 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Tue, 24 Nov 2026 22:40:52 +0100 Subject: [PATCH] fix(options): hoist category tabs to the top-level tab bar (Prompt D) With optionspage=custom, core renders the custom options page inside a single outer "Simple options" tab (#simple). A new inline script (respondage-hoist-tabs, POS_END) moves our tab buttons into the outer ul#theme-options-tabs, our panes into the outer .tab-content and the spinner/inherit row above the tab bar, then drops the #simple wrapper and the outer "Simple options" li; the first tab (Fonts) becomes the active top-level tab and the debug "Advanced options" tab stays last. Bootstrap 5 tabs use delegated click handlers, so moved buttons keep working. No core changes, no config.xml change, no OPTIONS_JS_TOKEN bump (options.js untouched). Verified via jsdom full-page fixture (global + survey/inherit): flat tab bar, panes in outer tab-content, tab clicking works, 63 option wrappers intact, radio groups still idempotent. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- options/options.twig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/options/options.twig b/options/options.twig index 7690837..589c4b0 100644 --- a/options/options.twig +++ b/options/options.twig @@ -388,6 +388,16 @@ {% endfor %} +{# HOIST TABS (Prompt D): with optionspage=custom, core renders this whole page inside + one outer "Simple options" tab (ul#theme-options-tabs > li > #simple). Move our tab + buttons into the outer tab bar, our panes into the outer .tab-content and everything + else (spinner, inherit row, hr) above the outer tab bar, then drop the #simple + wrapper — so our category tabs sit at the SAME level as the outer bar. + Inline (rendered into the page HTML, so it runs on every fresh page load even with a + heuristically cached options.js; idempotent). Bootstrap 5 tabs use delegated click + handlers on document, so the moved buttons keep working without re-init. #} +{{ registerScript('respondage-hoist-tabs', "(function(){function hoist(){var outer=document.getElementById('theme-options-tabs');var simple=document.getElementById('simple');if(!outer||!simple){return;}var innerNav=null,innerContent=null,i;var kids=Array.prototype.slice.call(simple.children);for(i=0;i