Skip to content

fix: resolve misleading empty state when searching in TaskLibrary#1388

Open
Abhishek2005-ard wants to merge 19 commits into
aryandas2911:mainfrom
Abhishek2005-ard:fix/task-library-search-ux
Open

fix: resolve misleading empty state when searching in TaskLibrary#1388
Abhishek2005-ard wants to merge 19 commits into
aryandas2911:mainfrom
Abhishek2005-ard:fix/task-library-search-ux

Conversation

@Abhishek2005-ard
Copy link
Copy Markdown
Contributor

Description

This PR improves the user experience in the TaskLibrary.jsx component by resolving a confusing edge case with the search functionality.

Previously, searching for a task that yielded zero results would inadvertently trigger the generic <EmptyState /> component. Since the EmptyState component is designed to prompt users to add their first task when their entire library is empty, displaying it during a failed search made it appear as if the user's tasks were completely deleted.

Changes Made

  • Updated the conditional rendering logic in the Task List container.
  • If the entire library is empty (tasks.length === 0), it renders the standard EmptyState component prompting them to create a task.
  • If the user has tasks but their search yields no results, it now renders a contextual "No tasks found" message showing their specific search query.

Testing

  • Verified that a completely empty task library still shows the correct "Add Task" empty state.
  • Verified that searching for a non-existent task now correctly shows the contextual "We couldn't find anything matching '[query]'" message.

close #1385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix misleading EmptyState when searching for tasks in TaskLibrary

1 participant