Skip to content

Conversation

@dkhalife
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 23, 2025 19:49
@dkhalife dkhalife merged commit 1efa560 into main Nov 23, 2025
13 checks passed
@dkhalife dkhalife deleted the complete_recurrence branch November 23, 2025 19:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds functionality to allow users to complete a recurring task and end its recurrence in a single action, rather than having the task automatically schedule its next occurrence.

Key Changes:

  • Added a new endRecurrence boolean parameter to the task completion flow across frontend and backend
  • Added a new menu option "Complete and end recurrence" in the MyTasks context menu for recurring tasks
  • Modified the API to accept an optional query parameter to control recurrence behavior

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/views/Tasks/TasksOverview.tsx Updated completeTask signature to accept endRecurrence parameter, passes false for existing completion flows
frontend/src/views/Tasks/TaskCard.tsx Updated completeTask signature to accept endRecurrence parameter, passes false for existing completion flows
frontend/src/views/Tasks/MyTasks.tsx Added new context menu option and handler for completing tasks with recurrence termination, passes true for the new "Complete and end recurrence" feature
frontend/src/store/tasksSlice.ts Updated Redux action to accept and forward endRecurrence parameter as part of request object
frontend/src/api/tasks.ts Updated API function to include endRecurrence as a query parameter
apiserver/internal/services/tasks/task.go Modified service layer to conditionally skip scheduling next due date when endRecurrence is true
apiserver/internal/services/tasks/handlers.go Updated WebSocket handler to parse endRecurrence from request payload
apiserver/internal/apis/task.go Updated REST API handler to parse endRecurrence query parameter with validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

export const MarkTaskComplete = async (id: number): Promise<SingleTaskResponse> =>
await Request<SingleTaskResponse>(`/tasks/${id}/do`, 'POST')
export const MarkTaskComplete = async (id: number, endRecurrence: boolean): Promise<SingleTaskResponse> =>
await Request<SingleTaskResponse>(`/tasks/${id}/do?endRecurrence=${endRecurrence}`, 'POST')
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boolean parameter endRecurrence should be URL-encoded to prevent potential issues. Boolean values in query strings can be misinterpreted if not properly encoded. Consider using encodeURIComponent() or a URL building library to ensure proper encoding:

export const MarkTaskComplete = async (id: number, endRecurrence: boolean): Promise<SingleTaskResponse> =>
    await Request<SingleTaskResponse>(`/tasks/${id}/do?endRecurrence=${encodeURIComponent(endRecurrence)}`, 'POST')
Suggested change
await Request<SingleTaskResponse>(`/tasks/${id}/do?endRecurrence=${endRecurrence}`, 'POST')
await Request<SingleTaskResponse>(`/tasks/${id}/do?endRecurrence=${encodeURIComponent(endRecurrence)}`, 'POST')

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

❌ Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apiserver/internal/apis/task.go 0.00% 8 Missing ⚠️
apiserver/internal/services/tasks/task.go 0.00% 8 Missing ⚠️
apiserver/internal/services/tasks/handlers.go 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

2 participants