In the Todo frontend dashboard, there's a bug where the "Generate Research" button stays grayed out when a user navigates from one todo to another while research is being generated. This persistent disabled state occurs because the generate state is managed by a single boolean value, which incorrectly affects all todos instead of handling each todo's state individually.
Steps to Reproduce
Open the Todo dashboard in your browser.
Select a specific todo item from the list.
Click the "Generate Research" button for the selected todo.
While the research is being generated, navigate to a different todo item.
Observe the state of the "Generate Research" button in the newly selected todo.
Expected Behavior
Each todo item's "Generate Research" button should manage its own state independently. When generating research for one todo:
The "Generate Research" button for that specific todo should remain disabled or indicate that research is in progress.
The "Generate Research" buttons for other todos should remain enabled and functional, allowing users to generate research for multiple todos independently.
Actual Behavior
After initiating research generation for a specific todo and navigating to a different todo:
The "Generate Research" button remains grayed out in the newly selected todo, suggesting that research is still being generated.
This behavior prevents users from generating research for multiple todos simultaneously as the state is incorrectly shared across all todos.
Additional Information
The issue stems from the generate state being managed globally with a single boolean value. Implementing individual state management for each todo item will ensure that the "Generate Research" button accurately reflects the status of each todo independently.
Suggested Fix
Refactor the state management logic to handle the generate state on a per-todo basis. This can be achieved by:
Using the todo.id as a unique identifier for each todo to track its generate state individually.
Updating the state management to use an object or map that associates each todo's ID with its respective generate state.
Ensuring that UI components reflect the correct state based on the individual todo's status.
Description
In the Todo frontend dashboard, there's a bug where the "Generate Research" button stays grayed out when a user navigates from one todo to another while research is being generated. This persistent disabled state occurs because the generate state is managed by a single boolean value, which incorrectly affects all todos instead of handling each todo's state individually.
Steps to Reproduce
Expected Behavior
Each todo item's "Generate Research" button should manage its own state independently. When generating research for one todo:
Actual Behavior
After initiating research generation for a specific todo and navigating to a different todo:
Additional Information
The issue stems from the generate state being managed globally with a single boolean value. Implementing individual state management for each todo item will ensure that the "Generate Research" button accurately reflects the status of each todo independently.
Suggested Fix
Refactor the state management logic to handle the generate state on a per-todo basis. This can be achieved by: