From 02ae34dbd0c0333760d2d3bc489d96d3239493b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:02:06 +0000 Subject: [PATCH] fix: collect all support services before rendering sidebar (code review fix) Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/4304350a-bc4f-4698-82b5-8ee28f0ad960 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- app/sovran_systemsos_web/static/app.js | 37 +++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/app/sovran_systemsos_web/static/app.js b/app/sovran_systemsos_web/static/app.js index 0d5a0bb..a2ab79b 100644 --- a/app/sovran_systemsos_web/static/app.js +++ b/app/sovran_systemsos_web/static/app.js @@ -172,17 +172,19 @@ async function apiFetch(path, options) { function buildTiles(services, categoryLabels) { _servicesCache = services; var grouped = {}; + var supportServices = []; for (var i = 0; i < services.length; i++) { var svc = services[i]; // Support tiles go to the sidebar, not the main grid if (svc.category === "support" || svc.type === "support") { - renderSidebarSupport(svc); + supportServices.push(svc); continue; } var cat = svc.category || "other"; if (!grouped[cat]) grouped[cat] = []; grouped[cat].push(svc); } + renderSidebarSupport(supportServices); $tilesArea.innerHTML = ""; var orderedKeys = CATEGORY_ORDER.filter(function(k) { return grouped[k]; }); Object.keys(grouped).forEach(function(k) { @@ -208,21 +210,26 @@ function buildTiles(services, categoryLabels) { } } -function renderSidebarSupport(svc) { +function renderSidebarSupport(supportServices) { $sidebarSupport.innerHTML = ""; - var btn = document.createElement("button"); - btn.className = "sidebar-support-btn"; - btn.innerHTML = - '🛟' + - '' + - '' + escHtml(svc.name || "Tech Support") + '' + - 'Click for help' + - ''; - btn.addEventListener("click", function() { openSupportModal(); }); - $sidebarSupport.appendChild(btn); - var hr = document.createElement("hr"); - hr.className = "sidebar-divider"; - $sidebarSupport.appendChild(hr); + for (var i = 0; i < supportServices.length; i++) { + var svc = supportServices[i]; + var btn = document.createElement("button"); + btn.className = "sidebar-support-btn"; + btn.innerHTML = + '🛟' + + '' + + '' + escHtml(svc.name || "Tech Support") + '' + + 'Click for help' + + ''; + btn.addEventListener("click", function() { openSupportModal(); }); + $sidebarSupport.appendChild(btn); + } + if (supportServices.length > 0) { + var hr = document.createElement("hr"); + hr.className = "sidebar-divider"; + $sidebarSupport.appendChild(hr); + } } function buildTile(svc) {