Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

Description

This PR introduces bulk task actions to CCSync, allowing users to efficiently manage multiple tasks at once. Users can now select multiple tasks via checkboxes and perform bulk operations like "Mark as Completed" or "Delete" through a floating action panel.

Key Enhancements

  • Added checkboxes to individual task rows and a "Select All" checkbox in the table header
  • Implemented a floating action panel that appears when tasks are selected
  • Added backend endpoints for bulk complete (POST /complete-tasks) and bulk delete (POST /delete-tasks)
  • Updated frontend state to efficiently track selected UUIDs
  • Added confirmation dialogs and loading states for better user experience
  • Added comprehensive tests for bulk selection logic, API integration, and UI interactions

Implementation Details

The bulk selection state is managed locally within the Tasks component using a Set of UUIDs to ensure O(1) lookups and efficient updates.

  • Frontend:
    • The selectedTaskUUIDs state tracks which tasks are currently selected.
    • A floating action bar is conditionally rendered when selectedTaskUUIDs.size > 0.
    • "Select All" logic toggles between adding all visible task UUIDs to the set or clearing it entirely.
  • Backend:
    • Two new endpoints were created to handle batch operations: /complete-tasks and /delete-tasks.
    • Both endpoints accept a JSON body containing an array of uuids.
    • Both endpoints now use an optimized single sync cycle pattern: SetConfig → InitialSync → Loop(operations) → FinalSync
    • Individual task failures are collected during the loop without stopping the entire batch operation
    • The backend returns a map of failed task UUIDs with their error messages for logging
    • Successful and failed counts are logged to DevLogs for debugging

Fixes: #178


Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Video: Click here to see

Screenshots:

Screenshot 2025-12-03 at 1 46 42 AM Screenshot 2025-12-03 at 1 47 23 AM

- Added checkboxes to task rows and "Select All" in header
- Implemented floating action panel for selected tasks
- Added backend endpoints for bulk complete and delete
- Updated frontend state to track selected UUIDs
- Added confirmation dialogs and loading states
- Added comprehensive tests for bulk selection and actions

- Fixes: CCExtractor#178
@github-actions
Copy link

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

More information on how to conduct a self review:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added bulk utility functions for complete/delete

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added checkbox column to task rows and also deleted tasks have disabled checkboxes since they can't be bulk actioned

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reorganized tests for better readability and added comprehensive tests for selection logic, bulk actions (complete/delete), and edge cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added unit tests for bulk utility functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

new routes added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

returns map[string]string (uuid → error) to collect individual task failures and optimized from N syncs to single sync cycle pattern (SetConfig -> InitialSync -> Loop -> FinalSync)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

returns map[string]string (uuid → error) to collect individual task failures and optimized from N syncs to single sync cycle pattern (SetConfig -> InitialSync -> Loop -> FinalSync)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added bulk request body structs, it is using array for taskUUIDs to accept multiple tasks identifiers in one request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

use DeleteTasksInTaskwarrior signature that returns a failed tasks map. Logs individual failures and final success/failure counts to DevLogs for debugging visibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

use CompleteTasksInTaskwarrior signature that returns a failed tasks map. logs individual failures and final success/failure counts to DevLogs for debugging visibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implemented bulk selection with Set state and floating action bar triggers bulk complete/delete via new endpoints

Copy link
Contributor Author

@ShivaGupta-14 ShivaGupta-14 left a comment

Choose a reason for hiding this comment

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

self-review completed! ready for review.

@its-me-abhishek
Copy link
Collaborator

Looks Great!

@its-me-abhishek its-me-abhishek merged commit 0ad188f into CCExtractor:main Dec 27, 2025
5 checks passed
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.

Bulk Task Actions: Select & Complete/Delete Multiple Tasks

2 participants