Closed jacob-ai-bot[bot] closed 1 month ago
Hello human! 👋
This PR was created by JACoB to address the issue Add Toggle to Enable/Disable Live Updates on Assigned Tasks Page
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
Currently, the Assigned Tasks page implements live updates to automatically refresh task statuses and icons in real-time. While this feature ensures users receive the most up-to-date information, some users may prefer to manually control updates to reduce distractions or save bandwidth.
Feature Request
Implement a toggle switch that allows users to enable or disable live updates on the Assigned Tasks page. When the toggle is turned off, live updates will be paused, and the selected task's icon will no longer update automatically when a new event occurs.
Benefits
Requirements
Toggle Placement
Default State
Functionality
Persistence
Acceptance Criteria
Additional Notes
@jacob-ai-bot --skip-build
Plan:
Step 1: Edit
/src/app/dashboard/[org]/[repo]/assigned-tasks/TasksPage.tsx
Task: Add Live Updates Toggle and Manual Refresh to Assigned Tasks Page
Instructions: Modify the Assigned Tasks page to add a toggle switch labeled 'Live Updates' at the top of the page. Steps:
/src/app/dashboard/[org]/[repo]/assigned-tasks/TasksPage.tsx
, import React hooksuseState
,useEffect
.liveUpdatesEnabled
usinguseState
, defaulting totrue
.liveUpdatesEnabled
.api.events.onAdd.useSubscription
hook to conditionally subscribe based onliveUpdatesEnabled
. If live updates are disabled, the subscription should not update the state. You may need to use a conditional statement or adjust theenabled
option in the hook.onClick
handler that callsrefetchTasks()
andrefetchEvents()
to manually update the data.Exit Criteria: The Assigned Tasks page includes a 'Live Updates' toggle switch and a 'Refresh' button (visible when live updates are disabled). The toggle state persists across page reloads and user sessions. When live updates are disabled, task statuses and icons do not update automatically, and the 'Refresh' button successfully updates the tasks and events when clicked.