()
| 105 | } |
| 106 | |
| 107 | function renderSidebar(): void { |
| 108 | const nav = document.getElementById('sidebarNav'); |
| 109 | if (!nav) return; |
| 110 | |
| 111 | const items: string[] = []; |
| 112 | |
| 113 | const progress = getTotalProgress(); |
| 114 | const overviewDotClass = progress.ready === progress.total ? 'dot-ok' : progress.ready > 0 ? 'dot-partial' : 'dot-warn'; |
| 115 | items.push(` |
| 116 | <button class="settings-nav-item${activeSection === 'overview' ? ' active' : ''}" data-section="overview" role="tab" aria-selected="${activeSection === 'overview'}"> |
| 117 | ${SIDEBAR_ICONS.overview} |
| 118 | <span class="settings-nav-label">Overview</span> |
| 119 | <span class="settings-nav-dot ${overviewDotClass}"></span> |
| 120 | </button> |
| 121 | `); |
| 122 | |
| 123 | items.push('<div class="settings-nav-sep"></div>'); |
| 124 | |
| 125 | for (const cat of SETTINGS_CATEGORIES) { |
| 126 | const { ready, total } = getFeatureStatusCounts(cat); |
| 127 | const dotClass = ready === total ? 'dot-ok' : ready > 0 ? 'dot-partial' : 'dot-warn'; |
| 128 | items.push(` |
| 129 | <button class="settings-nav-item${activeSection === cat.id ? ' active' : ''}" data-section="${cat.id}" role="tab" aria-selected="${activeSection === cat.id}"> |
| 130 | ${SIDEBAR_ICONS[cat.id] || ''} |
| 131 | <span class="settings-nav-label">${escapeHtml(cat.label)}</span> |
| 132 | <span class="settings-nav-count">${ready}/${total}</span> |
| 133 | <span class="settings-nav-dot ${dotClass}"></span> |
| 134 | </button> |
| 135 | `); |
| 136 | } |
| 137 | |
| 138 | items.push('<div class="settings-nav-sep"></div>'); |
| 139 | |
| 140 | items.push(` |
| 141 | <button class="settings-nav-item${activeSection === 'debug' ? ' active' : ''}" data-section="debug" role="tab" aria-selected="${activeSection === 'debug'}"> |
| 142 | ${SIDEBAR_ICONS.debug} |
| 143 | <span class="settings-nav-label">Debug & Logs</span> |
| 144 | </button> |
| 145 | `); |
| 146 | |
| 147 | nav.innerHTML = items.join(''); |
| 148 | } |
| 149 | |
| 150 | // ── Section rendering ── |
| 151 |
no test coverage detected