[fix](trx-frontend-http): smooth decode history loading

Reduce main-thread stalls while decode history replays.\n\nCoalesce decoder list redraws and map maintenance so spectrum\nand controls stay responsive during history import.\n\nVerification: node --check on modified frontend JS files.\n\nCo-authored-by: OpenAI Codex <codex@openai.com>

Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-14 12:56:02 +01:00
parent 28d5494c3b
commit c4d1313625
7 changed files with 174 additions and 38 deletions
@@ -19,6 +19,14 @@ let hfAprsHideCrc = false;
let hfAprsCollapseDup = false;
let hfAprsTypeFilter = "all";
function scheduleHfAprsHistoryRender() {
if (typeof window.trxScheduleUiFrameJob === "function") {
window.trxScheduleUiFrameJob("hf-aprs-history", () => renderHfAprsHistory());
return;
}
renderHfAprsHistory();
}
function hfAprsPacketCategory(pkt) {
const type = String(pkt.type || "").toLowerCase();
const info = String(pkt.info || "").toLowerCase();
@@ -294,10 +302,11 @@ function renderHfAprsHistory() {
return;
}
const visible = hfAprsVisiblePackets();
hfAprsPacketsEl.innerHTML = "";
const fragment = document.createDocumentFragment();
for (let i = 0; i < visible.length; i++) {
hfAprsPacketsEl.appendChild(renderHfAprsRow(visible[i], i === 0));
fragment.appendChild(renderHfAprsRow(visible[i], i === 0));
}
hfAprsPacketsEl.replaceChildren(fragment);
updateHfAprsSummary();
updateHfAprsChipState();
}
@@ -324,7 +333,7 @@ function addHfAprsPacket(pkt) {
return;
}
renderHfAprsHistory();
scheduleHfAprsHistoryRender();
}
document.getElementById("hf-aprs-decode-toggle-btn")?.addEventListener("click", async () => {