Skip to content

feat: add and remove task in watchlist#113

Merged
iamitprakash merged 2 commits intodevelopfrom
feat/add-task-watchlist
Jul 15, 2025
Merged

feat: add and remove task in watchlist#113
iamitprakash merged 2 commits intodevelopfrom
feat/add-task-watchlist

Conversation

@MayankBansal12
Copy link
Member

@MayankBansal12 MayankBansal12 commented Jul 15, 2025

Date: 15-07-25

Developer Name: @MayankBansal12


Issue Ticket Number

Description

  • Implement action to add and remove task in watchlist

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

ScreenCast
Screencast.from.2025-07-15.13-10-27.mp4

Additional Notes

Description by Korbit AI

What change is being made?

Add functionality to add and remove tasks from a watchlist in the task management API, update the data types to accommodate watchlist properties, and integrate watchlist controls in the Dashboard Tasks Table UI.

Why are these changes being made?

These changes are introduced to allow users to manage tasks more effectively by letting them mark tasks as part of a watchlist, enhancing task tracking and prioritization. The changes ensure that backend API operations reflect the modified task management logic and update the UI to provide users with intuitive controls for watchlist management. This feature improves user experience by sorting tasks based on watchlist status and providing direct interaction with task status via the UI.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@MayankBansal12 MayankBansal12 self-assigned this Jul 15, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 15, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • New Features

    • Added the ability to add tasks to a watchlist and toggle their watchlist status directly from the dashboard tasks table.
    • Introduced a new button with visual indicators to manage watchlist status for each task.
  • Bug Fixes

    • Updated task filtering and display to use the correct watchlist property.
  • Style

    • Enhanced the dashboard with new icons and tooltips for improved user interaction when managing the watchlist.

Walkthrough

The changes introduce watchlist functionality for tasks, including new API methods and DTO types for adding and toggling a task's watchlist status. UI components are updated to use the new in_watchlist property, and a WatchListButton is added to the dashboard tasks table for managing watchlist status directly from the UI.

Changes

File(s) Change Summary
api/tasks/tasks.api.ts Added addTaskToWatchList and toogleTaskWatchListStatus API methods for managing task watchlist status.
api/tasks/tasks.types.ts Renamed isInWatchlist to in_watchlist in TTask; added DTO types for watchlist API methods.
components/TodoForm.tsx Removed the isInWatchlist property from the default form data.
modules/dashboard/components/dashboard-tasks-table.tsx Added WatchListButton component; updated table to use in_watchlist and integrated watchlist actions in UI.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DashboardTasksTable
    participant WatchListButton
    participant TasksApi

    User->>DashboardTasksTable: View tasks
    DashboardTasksTable->>WatchListButton: Render per task
    User->>WatchListButton: Click add/remove watchlist
    WatchListButton->>TasksApi: addTaskToWatchList / toogleTaskWatchListStatus
    TasksApi-->>WatchListButton: API response
    WatchListButton->>DashboardTasksTable: Invalidate and refresh tasks
    DashboardTasksTable-->>User: Updated task list with watchlist status
Loading

Suggested reviewers

  • iamitprakash

Poem

A watchful eye upon each task,
Now toggled with a button's ask.
The dashboard gleams with icons bright,
As rabbits code through day and night.
Add or remove, just click and see—
A watchlist made so easily!
🐇👁️✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Readability Misspelled Type Name ▹ view ✅ Fix detected
Error Handling Lost Error Context in Watchlist Addition ▹ view
Functionality Incorrect Type for Watchlist Status ▹ view ✅ Fix detected
Readability Misspelled API Method Name ▹ view ✅ Fix detected
Performance Missing Memoization for Filtered Tasks ▹ view
Design Table Component with Mixed Data Processing ▹ view
Functionality Ambiguous Success Message ▹ view ✅ Fix detected
Readability Complex onClick handler logic ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
api/tasks/tasks.types.ts
api/tasks/tasks.api.ts
modules/dashboard/components/dashboard-tasks-table.tsx
components/TodoForm.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2955562 and 676c66b.

📒 Files selected for processing (4)
  • api/tasks/tasks.api.ts (2 hunks)
  • api/tasks/tasks.types.ts (2 hunks)
  • components/TodoForm.tsx (0 hunks)
  • modules/dashboard/components/dashboard-tasks-table.tsx (3 hunks)
💤 Files with no reviewable changes (1)
  • components/TodoForm.tsx
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: Hariom01010
PR: Real-Dev-Squad/todo-frontend#51
File: __mocks__/types.ts:33-34
Timestamp: 2025-07-09T08:59:13.002Z
Learning: In the todo-frontend project, the PATCH task API endpoint payload uses `dueAt` and `startedAt` field names, but these update the `dueDate` and `startDate` fields respectively in the Task object. This is intentional according to the API contract design.
api/tasks/tasks.api.ts (1)
Learnt from: Hariom01010
PR: Real-Dev-Squad/todo-frontend#51
File: __mocks__/types.ts:33-34
Timestamp: 2025-07-09T08:59:13.002Z
Learning: In the todo-frontend project, the PATCH task API endpoint payload uses `dueAt` and `startedAt` field names, but these update the `dueDate` and `startDate` fields respectively in the Task object. This is intentional according to the API contract design.
api/tasks/tasks.types.ts (1)
Learnt from: Hariom01010
PR: Real-Dev-Squad/todo-frontend#51
File: __mocks__/types.ts:33-34
Timestamp: 2025-07-09T08:59:13.002Z
Learning: In the todo-frontend project, the PATCH task API endpoint payload uses `dueAt` and `startedAt` field names, but these update the `dueDate` and `startDate` fields respectively in the Task object. This is intentional according to the API contract design.
modules/dashboard/components/dashboard-tasks-table.tsx (1)
Learnt from: Hariom01010
PR: Real-Dev-Squad/todo-frontend#51
File: __mocks__/types.ts:33-34
Timestamp: 2025-07-09T08:59:13.002Z
Learning: In the todo-frontend project, the PATCH task API endpoint payload uses `dueAt` and `startedAt` field names, but these update the `dueDate` and `startDate` fields respectively in the Task object. This is intentional according to the API contract design.
🧬 Code Graph Analysis (1)
api/tasks/tasks.api.ts (2)
api/tasks/tasks.types.ts (3)
  • AddTaskToWatchListDto (43-45)
  • TWatchListTask (52-60)
  • ToogleWatchListStatusDto (47-50)
lib/api-client.ts (1)
  • apiClient (6-10)
🔇 Additional comments (7)
api/tasks/tasks.api.ts (2)

3-11: LGTM: Import statements properly updated

The imports correctly include all necessary types for the new watchlist functionality.


37-42: LGTM: Add to watchlist API method implementation

The implementation correctly sends a POST request to add a task to the watchlist. The endpoint pattern and payload structure look appropriate.

api/tasks/tasks.types.ts (1)

16-16: Verify watchlist property naming

Confirm whether the backend API response actually uses snake_case in_watchlist or camelCase inWatchlist. Right now the TTask type mixes in_watchlist with other camelCase fields (e.g. dueAt). Align this with the API contract:

  • File: api/tasks/tasks.types.ts
    TTask.in_watchlist?: boolean | null

If the API returns inWatchlist, change it to match; if it truly returns in_watchlist, please document this as a deliberate exception.

modules/dashboard/components/dashboard-tasks-table.tsx (4)

19-19: LGTM: Icon imports added

The Eye and EyeOff icons are appropriate for watchlist functionality.


23-23: LGTM: Tooltip imports added

Tooltip components enhance the user experience by providing context for the watchlist actions.


144-144: LGTM: Filter logic updated correctly

The filter correctly uses the updated in_watchlist property instead of the old isInWatchlist.


190-200: LGTM: Watchlist button integration

The integration of the WatchListButton with tooltip provides good user experience. The conditional tooltip text based on watchlist status is helpful.

@MayankBansal12 MayankBansal12 marked this pull request as draft July 15, 2025 07:21
@MayankBansal12 MayankBansal12 marked this pull request as ready for review July 15, 2025 07:41
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Inconsistent Watchlist Addition Logic ▹ view
Functionality Missing Return Value from Watchlist Creation ▹ view
Functionality Missing Response Type in Toggle Status ▹ view
Error Handling Missing Return Type and Error Context in Watch List API ▹ view
Readability Inconsistent Watchlist Property Design ▹ view
Security Missing watchlist removal confirmation ▹ view
Files scanned
File Path Reviewed
api/tasks/tasks.types.ts
api/tasks/tasks.api.ts
modules/dashboard/components/dashboard-tasks-table.tsx
components/TodoForm.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@iamitprakash iamitprakash merged commit 738ebdc into develop Jul 15, 2025
4 checks passed
@iamitprakash iamitprakash deleted the feat/add-task-watchlist branch July 15, 2025 15:20
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.

feat: implement add/remove task to watchlist

3 participants