feat: yoloVisibility config, alwaysShowLabel on groups, site settings panel

- AppConfig gains yoloVisibility: 'auto' | 'never' (default: auto)
- Group gains alwaysShowLabel?: boolean
- YOLO toggle only renders when showYoloToggle is true (auto + >1 group)
- Group divider shows when >1 group OR alwaysShowLabel is set
- New /admin/api/config GET+PUT endpoint for yolo settings
- Admin: alwaysShowLabel checkbox in group form
- Admin: ⚙ Settings panel with YOLO label, description, and visibility controls
This commit is contained in:
Falkan
2026-03-18 20:15:45 -04:00
parent 2c27edc487
commit b020b74c31
8 changed files with 158 additions and 21 deletions

View File

@@ -15,6 +15,12 @@ export interface AppConfig {
yoloLabel?: string;
/** Description shown inline after the label. Defaults to "(cross-group conversions)". */
yoloDescription?: string;
/**
* Controls when the YOLO mode toggle is visible to users.
* 'auto' — show only when more than one group is present (default)
* 'never' — always hidden
*/
yoloVisibility?: 'auto' | 'never';
}
/** Read units.json synchronously. Returns parsed UnitsData. */

View File

@@ -44,6 +44,8 @@ export interface Group {
sortOrder?: 'defined' | 'alpha';
/** If true, this group (and all its units) is excluded from automatic rendering. */
hidden?: boolean;
/** If true, the group label is shown in the converter even when only one group is present. */
alwaysShowLabel?: boolean;
}
/** Full data payload for units and groups. */