MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / initializeFilters

Function initializeFilters

codeclash/viewer/static/js/picker.js:857–890  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

855}
856
857function initializeFilters() {
858 // Collect all game rows and extract unique values
859 allGameRows = Array.from(document.querySelectorAll(".game-row.game-folder"));
860
861 allGameRows.forEach((row) => {
862 // Extract game name
863 const gameNameElement = row.querySelector(".game-name-text");
864 if (gameNameElement && gameNameElement.textContent.trim()) {
865 uniqueGames.add(gameNameElement.textContent.trim());
866 }
867
868 // Extract model names
869 const modelTags = row.querySelectorAll(".model-tag");
870 modelTags.forEach((tag) => {
871 if (tag.textContent.trim()) {
872 uniqueModels.add(tag.textContent.trim());
873 }
874 });
875 });
876
877 // Populate filter dropdowns
878 populateGameFilter();
879 populateModelFilter();
880
881 // Load saved filters from localStorage
882 const hasFilters = loadFilters();
883 if (hasFilters) {
884 // Apply the loaded filters
885 applyFilters();
886 }
887
888 // Initialize clear filters button visibility
889 updateClearFiltersButton();
890}
891
892function populateGameFilter() {
893 const gameFilter = document.getElementById("game-filter");

Callers 1

picker.jsFile · 0.85

Calls 5

populateGameFilterFunction · 0.85
populateModelFilterFunction · 0.85
loadFiltersFunction · 0.85
applyFiltersFunction · 0.85
updateClearFiltersButtonFunction · 0.85

Tested by

no test coverage detected