[fix](trx-frontend-http): fix FT4/FT2/WSPR message container styling and cap DOM rows
Apply #ft8-messages container style (border, rounded corners, monospace font, max-height with scroll) to #ft4-messages, #ft2-messages, and #wspr-messages which were missing it. Add #ft4-decode-toggle-btn and #ft2-decode-toggle-btn to the narrow- screen white-space:nowrap media query rule alongside FT8/WSPR. Cap DOM rows rendered per history view to 200 (FT8_MAX_DOM_ROWS, FT4_MAX_DOM_ROWS, FT2_MAX_DOM_ROWS). Full history is retained in memory; only the DOM representation is bounded. This prevents tab switching from becoming sluggish after a long decode session where thousands of rows accumulate in the DOM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -13,6 +13,7 @@ const ft2PeriodEl = document.getElementById("ft2-period");
|
||||
const ft2MessagesEl = document.getElementById("ft2-messages");
|
||||
const ft2FilterInput = document.getElementById("ft2-filter");
|
||||
const FT2_PERIOD_MS = 3750;
|
||||
const FT2_MAX_DOM_ROWS = 200;
|
||||
let ft2FilterText = "";
|
||||
let ft2MessageHistory = [];
|
||||
|
||||
@@ -80,10 +81,12 @@ function renderFt2History() {
|
||||
if (!ft2MessagesEl) return;
|
||||
const filter = ft2FilterText;
|
||||
const fragment = document.createDocumentFragment();
|
||||
for (let i = 0; i < ft2MessageHistory.length; i++) {
|
||||
let rendered = 0;
|
||||
for (let i = 0; i < ft2MessageHistory.length && rendered < FT2_MAX_DOM_ROWS; i++) {
|
||||
const msg = ft2MessageHistory[i];
|
||||
if (filter && !(msg.message || "").toString().toUpperCase().includes(filter)) continue;
|
||||
fragment.appendChild(renderFt2Row(msg));
|
||||
rendered++;
|
||||
}
|
||||
ft2MessagesEl.replaceChildren(fragment);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user