Commit a164bc62 authored by vertighel's avatar vertighel
Browse files

feat: auto pill mode for status.html dynamic vars



In status-view.js, makeVar now defaults to data-display="auto": booleans
and semantic strings get colored pills, raw numbers stay plain text-light.

Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent 23d195fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ document.addEventListener('DOMContentLoaded', () => {
        });
    }

    function makeVar(statusKey, displayMode = 'plain') {
    function makeVar(statusKey, displayMode = 'auto') {
        const varTag = document.createElement('var');
        varTag.setAttribute('data-status', statusKey);
        varTag.setAttribute('data-display', displayMode);
+3 −2
Original line number Diff line number Diff line
@@ -146,9 +146,10 @@ export function applyVarStatusStyles(el, value) {
    if (mode === 'raw') return;

    const statusType = getStatusType(value);
    const theme = UI_CONFIG.COLORS[statusType];
    const isAutoNum = mode === 'auto' && typeof value === 'number';
    const theme = isAutoNum ? UI_CONFIG.COLORS.DEFAULT : UI_CONFIG.COLORS[statusType];

    if (mode === 'pill') {
    if (!isAutoNum && (mode === 'pill' || (mode === 'auto' && statusType !== 'DEFAULT'))) {
        const fill = el.closest('.status-container') ? ' w-100' : '';
        el.setAttribute('class', `badge ${theme.css} font-monospace${fill} ${theme.text_pill}`);
    } else {