Skip to content

Commit ed997ad

Browse files
committed
Simplify scope filter checkboxes - use only Right sidebar
The code was referencing non-existent left sidebar checkboxes (scopeRequired, scopeOptional, scopeExcluded) but only the Right sidebar versions actually exist in the HTML. This caused the excluded filter to never work. Simplified by: - Reading directly from scopeRequiredRight/OptionalRight/ExcludedRight - Removing unnecessary sync logic since there's only one set - Fixing all references throughout the code Much simpler and actually works now.
1 parent a7b9358 commit ed997ad

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

index.html

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,9 +2713,9 @@ <h2>🔗 Share Current View</h2>
27132713
activeFilters.excluded = filters.includes('excluded');
27142714

27152715
// Update checkbox UI
2716-
document.getElementById('scopeRequired').checked = activeFilters.required;
2717-
document.getElementById('scopeOptional').checked = activeFilters.optional;
2718-
document.getElementById('scopeExcluded').checked = activeFilters.excluded;
2716+
document.getElementById('scopeRequiredRight').checked = activeFilters.required;
2717+
document.getElementById('scopeOptionalRight').checked = activeFilters.optional;
2718+
document.getElementById('scopeExcludedRight').checked = activeFilters.excluded;
27192719
}
27202720

27212721
// Check for path parameter (explore mode with navigation path)
@@ -2900,7 +2900,7 @@ <h2>🔗 Share Current View</h2>
29002900
container.appendChild(appItem);
29012901

29022902
// Check excluded filter state
2903-
const excludedCheckbox = document.getElementById('scopeExcluded');
2903+
const excludedCheckbox = document.getElementById('scopeExcludedRight');
29042904
const showExcluded = excludedCheckbox ? excludedCheckbox.checked : false;
29052905

29062906
// Helper function to get scope icon
@@ -4808,10 +4808,10 @@ <h2>🔗 Share Current View</h2>
48084808
}
48094809

48104810
function applyFilters() {
4811-
// Get current filter state
4812-
activeFilters.required = document.getElementById('scopeRequired').checked;
4813-
activeFilters.optional = document.getElementById('scopeOptional').checked;
4814-
activeFilters.excluded = document.getElementById('scopeExcluded').checked;
4811+
// Get current filter state (only Right sidebar has checkboxes)
4812+
activeFilters.required = document.getElementById('scopeRequiredRight').checked;
4813+
activeFilters.optional = document.getElementById('scopeOptionalRight').checked;
4814+
activeFilters.excluded = document.getElementById('scopeExcludedRight').checked;
48154815

48164816
console.log(`Filters updated: required=${activeFilters.required}, optional=${activeFilters.optional}, excluded=${activeFilters.excluded}`);
48174817

@@ -5736,24 +5736,9 @@ <h2>🔗 Share Current View</h2>
57365736
}
57375737
}
57385738

5739-
// Sync filters between any duplicates
5739+
// Apply filter changes when checkboxes change
57405740
function syncFilters(checkbox) {
5741-
const id = checkbox.id.replace('Right', '');
5742-
const isChecked = checkbox.checked;
5743-
5744-
// Sync the corresponding checkbox if it exists
5745-
const otherCheckbox = document.getElementById(id);
5746-
if (otherCheckbox && otherCheckbox !== checkbox) {
5747-
otherCheckbox.checked = isChecked;
5748-
}
5749-
5750-
// Also sync the "Right" version if we're updating the left one
5751-
const rightCheckbox = document.getElementById(id + 'Right');
5752-
if (rightCheckbox && rightCheckbox !== checkbox) {
5753-
rightCheckbox.checked = isChecked;
5754-
}
5755-
5756-
// Apply the filter change
5741+
// Simply apply the filter change
57575742
applyFilters();
57585743
}
57595744

0 commit comments

Comments
 (0)