feat(options): roll the color-chooser scheme out to 4 more options (row 135)

The experimental color-chooser (mode dropdown + swatch chips + custom picker,
previously only navbarfontcolor) now also covers, with the owner-specified
defaults:
- headerbackgroundcolor — default "Default background color" (slot h1)
- progressbarcolor — COLUMN 1 of the progress colors row (was col 2), default Color 1
- progressbarbackgroundcolor — COLUMN 2 (was col 1), default Default background color
- progressbarfontcolor — column 3, default Default font color, with an extra tip
  underneath: "Make this font color the same color as the color of the progress
  bar when you do not want to see the progress in %."

Each option is a dropdown (default|defaultbackgroundcolor|color1|color2|color3|
other) whose own default carries data-default="1" + [ ] in config.xml, plus a
<key>custom colorpicker child (parent, disable-mode, data-keep-value). options.js
generalized navbarColorModeUI to colorModeUI(key) over aColorChooserKeys with
shared presets, one delegated change handler for select.selector_color_mode, and
per-key legacy hex migration (stored hex -> mode "other" + hex into the custom
child). custom_header.twig resolves the modes via a local cm() macro (import
_self, same pattern as nav_bar.twig); raw hex passes through. build.php migrates
legacy hex values in variant jsons for all 5 chooser keys. OPTIONS_JS_TOKEN ->
20261126.14. Verified: render tc=618 (all 5 selects with per-option [ ] default,
progress row col order, tip present, divs balanced, options.js?v=20261126.14),
jsdom 7/7 incl. new options_color_choosers.test.js (5 choosers, legacy migration,
chips, layout, tip) and the navbar test re-scoped to its own chips; live survey
282267 with legacy hex AND with modes (color2 -> #888888, defaultbackgroundcolor
-> #ffffff; DB row restored); export exit 0; build.php lints. Variants not
rebuilt (deferred).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-26 19:14:47 +01:00
commit cfbb4c983b

View file

@ -205,8 +205,27 @@
<!-- Various colors -->
<!-- Backgrounds of navbar/page stay plain colorpickers (owner decision
2026-11-26, row 115): they are mostly NOT one of the default colors,
default white #ffffff. -->
<headerbackgroundcolor type="colorpicker" category="Colors" width="12" title="Header background color" options="on|off" optionlabels="Yes|No">#ffffff</headerbackgroundcolor>
default white #ffffff. EXCEPTION (row 135): the HEADER background color
is part of the color-chooser scheme below — default "Default background
color". -->
<!-- Row 135: the color-chooser scheme (mode dropdown + swatch chips + custom
picker; see navbarfontcolor) rolled out to four more options. Defaults per
owner (row 135): header background = Default background color, progress
bar color = Color 1, progress background = Default background color,
progress font color = Default font color. The <option data-default="1">
carries the [ ] marker of that option's own default. A legacy stored HEX
value migrates client-side to mode "other" + hex into the <key>custom
child (options.js colorModeUI), and the views accept a raw hex directly. -->
<headerbackgroundcolor type="dropdown" category="Colors" width="12" title="Header background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">defaultbackgroundcolor
<dropdownoptions>
<option value="default">Default font color</option>
<option value="defaultbackgroundcolor" data-default="1">[Default background color]</option>
<option value="color1">Color 1</option>
<option value="color2">Color 2</option>
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></headerbackgroundcolor>
<headerbackgroundcolorcustom type="colorpicker" category="Colors" width="12" title="Custom header background color (used when 'Other ...' is chosen)" parent="headerbackgroundcolor">#ffffff</headerbackgroundcolorcustom>
<!-- Working example (row 115, reordered + relabelled row 125): menu item color
as a preset dropdown. The KEY navbarfontcolor is kept (stored DB values
stay attached); the type changes colorpicker -> dropdown with modes
@ -242,9 +261,41 @@
</dropdownoptions></navbarfontcolor>
<navbarfontcolorcustom type="colorpicker" category="Colors" width="12" title="Custom menu item color (used when 'Other ...' is chosen)" parent="navbarfontcolor">#444444</navbarfontcolorcustom>
<sliderhandlecolor type="colorpicker" category="Colors" width="12" title="Slider handle color" options="on|off" optionlabels="Yes|No">#5e1c64</sliderhandlecolor>
<progressbarbackgroundcolor type="colorpicker" category="Colors" width="12" title="Progress bar background color" options="on|off" optionlabels="Yes|No">#eeeeee</progressbarbackgroundcolor>
<progressbarcolor type="colorpicker" category="Colors" width="12" title="Progress bar color" options="on|off" optionlabels="Yes|No">#5e1c64</progressbarcolor>
<progressbarfontcolor type="colorpicker" category="Colors" width="12" title="Progress bar font color" options="on|off" optionlabels="Yes|No">#ffffff</progressbarfontcolor>
<!-- Row 135: progress bar colors as color-choosers. Layout in the "Top of the
page" tab (options.twig slots): progress bar color = COLUMN 1, progress
background = COLUMN 2, progress font color = COLUMN 3 (with an extra tip
underneath). Defaults: progress bar color = Color 1, progress background =
Default background color, progress font color = Default font color. -->
<progressbarcolor type="dropdown" category="Colors" width="12" title="Progress bar color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">color1
<dropdownoptions>
<option value="default">Default font color</option>
<option value="defaultbackgroundcolor">Default background color</option>
<option value="color1" data-default="1">[Color 1]</option>
<option value="color2">Color 2</option>
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></progressbarcolor>
<progressbarcolorcustom type="colorpicker" category="Colors" width="12" title="Custom progress bar color (used when 'Other ...' is chosen)" parent="progressbarcolor">#5e1c64</progressbarcolorcustom>
<progressbarbackgroundcolor type="dropdown" category="Colors" width="12" title="Progress bar background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">defaultbackgroundcolor
<dropdownoptions>
<option value="default">Default font color</option>
<option value="defaultbackgroundcolor" data-default="1">[Default background color]</option>
<option value="color1">Color 1</option>
<option value="color2">Color 2</option>
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></progressbarbackgroundcolor>
<progressbarbackgroundcolorcustom type="colorpicker" category="Colors" width="12" title="Custom progress bar background color (used when 'Other ...' is chosen)" parent="progressbarbackgroundcolor">#eeeeee</progressbarbackgroundcolorcustom>
<progressbarfontcolor type="dropdown" category="Colors" width="12" title="Progress bar font color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
<dropdownoptions>
<option value="default" data-default="1">[Default font color]</option>
<option value="defaultbackgroundcolor">Default background color</option>
<option value="color1">Color 1</option>
<option value="color2">Color 2</option>
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></progressbarfontcolor>
<progressbarfontcolorcustom type="colorpicker" category="Colors" width="12" title="Custom progress bar font color (used when 'Other ...' is chosen)" parent="progressbarfontcolor">#ffffff</progressbarfontcolorcustom>
<privacybackgroundcolor type="colorpicker" category="Colors" width="12" title="Privacy background color" options="on|off" optionlabels="Yes|No">lightyellow</privacybackgroundcolor>
<!-- fonts
HOUSE-STYLE: the whole Fonts section (font choice, fontsize and all