feat(viewer): merge filter row into table header using placeholder text
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,14 +36,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
if (emptyNotice) emptyNotice.hidden = visibleCount > 0;
|
||||
}
|
||||
|
||||
const filterRow = document.createElement("tr");
|
||||
filterRow.className = "filter-row";
|
||||
|
||||
headerCells.forEach((th, colIndex) => {
|
||||
const colName = th.dataset.col || "";
|
||||
const filterTh = document.createElement("th");
|
||||
if (th.className) filterTh.className = th.className;
|
||||
|
||||
const isIconCol = colName === "severity_icon" || colName === "status";
|
||||
|
||||
if (isIconCol) {
|
||||
@@ -74,12 +68,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
activeFilters.set(colIndex, select.value);
|
||||
applyFilters();
|
||||
});
|
||||
filterTh.appendChild(select);
|
||||
th.textContent = "";
|
||||
th.appendChild(select);
|
||||
}
|
||||
} else if (colName) {
|
||||
const input = document.createElement("input");
|
||||
input.type = "text";
|
||||
input.className = "col-filter col-filter-text";
|
||||
input.placeholder = colName;
|
||||
input.setAttribute("aria-label", "filter " + colName);
|
||||
let debounceTimer;
|
||||
input.addEventListener("input", () => {
|
||||
@@ -89,12 +85,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
applyFilters();
|
||||
}, 300);
|
||||
});
|
||||
filterTh.appendChild(input);
|
||||
th.textContent = "";
|
||||
th.appendChild(input);
|
||||
}
|
||||
|
||||
filterRow.appendChild(filterTh);
|
||||
});
|
||||
|
||||
thead.appendChild(filterRow);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user