Closed jacob-ai-bot[bot] closed 1 month ago
Hello human! 👋
This PR was created by JACoB to address the issue Display All Tasks When No Assigned Open Tasks Are Available
Please review the PR carefully. Auto-generated code can and will contain subtle bugs and mistakes.
If you identify code that needs to be changed, please reject the PR with a specific reason. Be as detailed as possible in your comments. JACoB will take these comments, make changes to the code and push up changes. Please note that this process will take a few minutes.
Once the code looks good, approve the PR and merge the code.
Summary:
Description
In the current task management interface, when a user has no open tasks assigned, the task list appears empty. This can lead to confusion, as users might assume there are no tasks available rather than understanding that no tasks are currently assigned to them. To improve user experience and task visibility, the system should display all available tasks when there are no open tasks assigned to the user.
Current Behavior
Proposed Solution
Plan:
Step 1: Edit
/src/app/dashboard/[org]/[repo]/assigned-tasks/TasksPage.tsx
Task: Update Task Filtering Logic to Display All Tasks When No Open Tasks Are Assigned
Instructions: In the TasksPage component located at '/src/app/dashboard/[org]/[repo]/assigned-tasks/TasksPage.tsx', modify the task filtering logic within the useEffect hook that handles task filtering. After applying the status and search filters, check if the 'filtered' tasks array is empty. If it is empty and the 'tasks' array from the API is not empty, update the 'showAllTasks' state variable to 'true'. This will ensure that when a user has no assigned open tasks, all available tasks are displayed. Be sure to prevent any infinite render loops by only setting 'showAllTasks' to 'true' if it's currently 'false'. Also, ensure that the toggle switch in the UI reflects the updated 'showAllTasks' state correctly.
Exit Criteria: When a user has no assigned open tasks, the task list automatically displays all available tasks, including closed ones, and the 'Show all tasks' toggle switch is set to 'on', accurately reflecting the state.