Skip to content

Commit d4cfe53

Browse files
committed
feat: update filtering logic to overlap range
1 parent a108569 commit d4cfe53

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

templates/v3/library_page.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@
318318
matches(data) {
319319
if (this.searchHits && !this.searchHits.has(data.slug)) return false;
320320
if (this.grading !== 'all' && data.tier !== this.grading) return false;
321-
if (this.minCpp !== 'all' && data.cpp_min && cppRank(data.cpp_min) > cppRank(this.minCpp)) return false;
322-
if (this.maxCpp !== 'all' && data.cpp_max && cppRank(data.cpp_max) < cppRank(this.maxCpp)) return false;
321+
// Overlap filter: reject only when the library range falls entirely outside the filter range.
322+
if (this.maxCpp !== 'all' && data.cpp_min && cppRank(data.cpp_min) > cppRank(this.maxCpp)) return false;
323+
if (this.minCpp !== 'all' && data.cpp_max && cppRank(data.cpp_max) < cppRank(this.minCpp)) return false;
323324
if (this.categories.length > 0) {
324325
const hit = data.category_slugs.some((s) => this.categories.includes(s));
325326
if (!hit) return false;

0 commit comments

Comments
 (0)