-
Notifications
You must be signed in to change notification settings - Fork 118
Description
The search functionality on the Collections page has a UX flaw where it filters on already-filtered results instead of the original dataset, making it impossible to recover from typos without clearing the entire search field.
Steps to Reproduce:
Navigate to the Collections page
Type "test" in the search bar → Shows filtered results for "test"
Continue typing "abc" (making it "testabc") → Now filters the already-filtered "test" results
Delete "abc" to go back to just "test" → Results don't restore, shows empty or incorrect results
Expected Behavior:
Each search should filter from the complete original list of collections, allowing users to backspace and see results update correctly as they type.
Current Behavior:
Search filters are applied sequentially on already-filtered data, causing the original data to be lost. Users must clear the entire search field to start over.
Root Cause:
In Collections.jsx, the getFilteredCollectionsCall function filters from the collections state and then overwrites it:
javascriptconst filtered = collections.filter(...);
setFilteredCollections(filtered); // This works
// But 'collections' is also being modified, causing the issue
Proposed Solution:
Maintain two separate states:
collections: Original, unmodified list (fetched once)
filteredCollections: Filtered results for display
Always filter from collections, never modify it during search operations.