feat(options): sticky header as label + 3 standalone checkboxes (Prompt L)

config.xml: the three headersticky* checkboxes lose parent="headersticky"
and get width=12 (stacked as a vertical list); the master key headersticky
stays in config.xml/DB for backward compatibility but is rendered as a
static label only (special case in options.twig — no input). Views:
custom_header.twig emits the per-breakpoint fixed-top media queries based
on the three checkboxes alone (master gate dropped; defaults on/on/off
when undefined); nav_bar.twig fallback now keys off headerstickycomputer
being defined. Migration note: an old row with headersticky=off no longer
disables sticky — only the checkboxes govern it.

Verified: CLI render row 270 — top-of-page pane shows the label + 3
checkboxes (col-md-12, no parent, checked on/on/off, no option-visibility);
survey 282267 renders media queries for computer+tablet but not mobile and
no hardcoded fixed-top; jsdom toggle/serialize + radio idempotency PASS;
run_all PASS; export green. Variants NOT rebuilt yet (config.xml batch —
rebuild+reset once after Prompt U per standing rule).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-24 23:03:57 +01:00
commit b44d120d7d
2 changed files with 39 additions and 28 deletions

View file

@ -145,24 +145,24 @@
background-color: {{ aSurveyInfo.options.headerbackgroundcolor }};
}
{# THEME ADDITION: sticky header per screen size (options headersticky +
headersticky{computer,tablet,mobile}). Breakpoints are Bootstrap's
{# THEME ADDITION: sticky header per screen size (options
headersticky{computer,tablet,mobile}; Prompt L — the master key
"headersticky" no longer gates this). Breakpoints are Bootstrap's
defaults: phone < md (768px), tablet = md..lg (768-991px),
computer >= lg (992px). The rules are the same as Bootstrap's
.fixed-top, but only inside the selected range(s). Only emitted when
the options exist (after a theme reset); before that nav_bar.twig keeps
the fixed-top class (old behaviour). #}
{% if aSurveyInfo.options.headersticky is defined %}
{% if aSurveyInfo.options.headersticky == 'on' %}
{% if aSurveyInfo.options.headerstickycomputer|default('on') == 'on' %}
the checkbox options exist (after a theme reset); before that nav_bar.twig
keeps the fixed-top class (old behaviour). Defaults when a checkbox is
undefined: computer on, tablet on, mobile off. #}
{% if aSurveyInfo.options.headerstickycomputer is defined %}
{% if aSurveyInfo.options.headerstickycomputer|default('on') == 'on' %}
@media (min-width: 992px) { #survey-nav { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } }
{% endif %}
{% if aSurveyInfo.options.headerstickytablet|default('on') == 'on' %}
{% endif %}
{% if aSurveyInfo.options.headerstickytablet|default('on') == 'on' %}
@media (min-width: 768px) and (max-width: 991.98px) { #survey-nav { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } }
{% endif %}
{% if aSurveyInfo.options.headerstickymobile|default('off') == 'on' %}
{% endif %}
{% if aSurveyInfo.options.headerstickymobile|default('off') == 'on' %}
@media (max-width: 767.98px) { #survey-nav { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } }
{% endif %}
{% endif %}
{% endif %}

View file

@ -34,12 +34,13 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
inherits the body font (body gets font-<base font>). Applied on #survey-nav,
so it covers the menu items and the survey name as well. #}
{% set sHeaderFont = aSurveyInfo.options.headerfont|default('base') %}
{# THEME ADDITION: sticky header per screen size (options headersticky +
headersticky{computer,tablet,mobile}). When the options exist (theme was
reset after adding them), fixed-top is NOT hardcoded here anymore —
custom_header.twig emits the media queries instead. Before a reset the
old behaviour (always fixed-top) is kept as fallback. #}
{% set bStickyConfigured = aSurveyInfo.options.headersticky is defined %}
{# THEME ADDITION: sticky header per screen size (options
headersticky{computer,tablet,mobile}; Prompt L — the master key no longer
counts). When the checkbox options exist (theme was reset after adding
them), fixed-top is NOT hardcoded here anymore — custom_header.twig emits
the media queries instead. Before a reset the old behaviour (always
fixed-top) is kept as fallback. #}
{% set bStickyConfigured = aSurveyInfo.options.headerstickycomputer is defined %}
{# Per-logo "hide on small screens" (Bootstrap classes d-none d-md-block).
Default (option missing or "on") keeps the logo hidden below the md breakpoint. #}
{% set hideSmallLeft = (aSurveyInfo.options.brandlogohideonsmall != "off") %}