Skip to content

Issue with searching in collections page #323

@anoopw3bdev

Description

@anoopw3bdev

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.

Screen.Recording.2025-10-30.at.11.38.41.PM.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions