Skip to content

Comments

Add checkbox to include done task#155

Merged
iamitprakash merged 4 commits intoRealDevSquad:developfrom
Hariom01010:checkbox-for-done-task
Jul 23, 2025
Merged

Add checkbox to include done task#155
iamitprakash merged 4 commits intoRealDevSquad:developfrom
Hariom01010:checkbox-for-done-task

Conversation

@Hariom01010
Copy link
Contributor

@Hariom01010 Hariom01010 commented Jul 23, 2025

Date: 24 Jul 2025

Developer Name: @Hariom01010


Issue Ticket Number

Closes #156

Description

A checkbox is added to the dashboard page such that when it is checked all tasks including done status are shown and when it is unchecked only tasks whose status is not equal to done are shown.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1 Screenshot 2025-07-24 023511 Screenshot 2025-07-24 023521

Test Coverage

Screenshot 1

Additional Notes

Description by Korbit AI

What change is being made?

Add a checkbox to filter tasks by status, specifically to include or exclude completed tasks, and update relevant query parameters and UI components accordingly.

Why are these changes being made?

The update provides users with more control over their task views by allowing them to filter tasks based on their completion status, improving the usability and customization of the dashboard interface. The integration of the checkbox is implemented using @radix-ui/react-checkbox, ensuring a consistent and accessible UI across the application.

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

…enabled

When the Include Done checkbox is checked, all tasks including Done
status are shown otherwise tasks with status not equal to Done are shown
@Hariom01010 Hariom01010 self-assigned this Jul 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 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 a user-controllable "Include Done" checkbox to the dashboard, allowing filtering of tasks by completion status.
    • Introduced a new Checkbox component for consistent UI experience.
  • Enhancements

    • Task filtering now supports an optional status parameter, enabling more precise queries.
  • Chores

    • Added a new UI library dependency to support the Checkbox component.

Walkthrough

A new checkbox UI component was added and integrated into the dashboard to allow toggling the inclusion of "Done" tasks. Supporting this, the task API and types were updated to handle a new status filter. The dashboard and tab components were refactored to manage and propagate this filter state, and a new dependency was introduced.

Changes

File(s) Change Summary
components/ui/checkbox.tsx Added a new exported Checkbox React component using @radix-ui/react-checkbox and lucide-react.
api/tasks/tasks.api.ts Updated getTasks API key logic to use a JSON-stringified params object instead of just teamId.
api/tasks/tasks.types.ts Extended GetTaskReqDto type to include optional status property.
modules/dashboard/components/dashboard-tabs.tsx Added "Include Done" checkbox and related props to DashboardTabs component.
modules/dashboard/index.tsx Added state and logic to filter tasks by status; integrated with DashboardTabs and query logic.
package.json Added @radix-ui/react-checkbox dependency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Dashboard
    participant DashboardTabs
    participant TasksApi
    participant Backend

    User->>DashboardTabs: Toggle "Include Done" checkbox
    DashboardTabs->>Dashboard: onIncludeDoneChange(checked)
    Dashboard->>Dashboard: Update includeDoneTasks state
    Dashboard->>TasksApi: getTasks({ status: checked ? "DONE" : undefined })
    TasksApi->>Backend: Fetch tasks with status filter
    Backend-->>TasksApi: Return filtered tasks
    TasksApi-->>Dashboard: Return tasks
    Dashboard->>DashboardTabs: Pass updated tasks and includeDone state
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Poem

A checkbox hops onto the scene,
To filter tasks both done and clean.
The dashboard now can show or hide,
Those finished tasks you set aside.
With status checked and code refined,
The rabbit’s work is well-designed!
🐇✅

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 generate unit tests to generate unit tests for 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
Functionality Incorrect Task Filtering Logic ▹ view
Readability Complex TailwindCSS Class String ▹ view
Performance Redundant Boolean Coercion ▹ view
Performance Unstable Cache Key Generation ▹ view
Documentation Missing status parameter documentation ▹ view
Functionality Task Status Type Mismatch ▹ view
Files scanned
File Path Reviewed
api/tasks/tasks.types.ts
api/tasks/tasks.api.ts
components/ui/checkbox.tsx
modules/dashboard/index.tsx
modules/dashboard/components/dashboard-tabs.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: 6

🔭 Outside diff range comments (1)
api/tasks/tasks.api.ts (1)

18-22: Good implementation, consider stable cache key generation.

The updated parameter handling and cache key generation look correct. The use of JSON.stringify(params) is functional but could be unstable if object property order varies.

Consider a more stable cache key approach:

-    key: (params?: GetTaskReqDto) => ['TasksApi.getTasks', JSON.stringify(params)],
+    key: (params?: GetTaskReqDto) => ['TasksApi.getTasks', params?.teamId, params?.status],

This approach is more explicit and doesn't depend on object serialization order.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5a2ea5d and 9068277.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • api/tasks/tasks.api.ts (1 hunks)
  • api/tasks/tasks.types.ts (1 hunks)
  • components/ui/checkbox.tsx (1 hunks)
  • modules/dashboard/components/dashboard-tabs.tsx (3 hunks)
  • modules/dashboard/index.tsx (2 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 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.types.ts (1)

Learnt from: Hariom01010
PR: #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-tabs.tsx (1)

Learnt from: yesyash
PR: #109
File: app/(internal-routes)/teams/[teamId]/layout.tsx:8-15
Timestamp: 2025-07-16T13:18:36.847Z
Learning: In Next.js layout components, error handling and validation for params extraction (like const { teamId } = await params) is not required in this codebase. The framework handles routing validation adequately.

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

Learnt from: Hariom01010
PR: #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/index.tsx (1)

Learnt from: Hariom01010
PR: #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 (2)
components/ui/checkbox.tsx (1)
lib/utils.ts (1)
  • cn (4-6)
api/tasks/tasks.api.ts (1)
api/tasks/tasks.types.ts (1)
  • GetTaskReqDto (37-40)
🔇 Additional comments (5)
package.json (1)

26-26: @radix-ui/react-checkbox@1.3.2 verified as latest stable with no known security issues

  • Confirmed that version 1.3.2 is the current release as of July 2025.
  • No direct security vulnerabilities reported in reputable databases (e.g. Snyk) or the Radix Primitives issue tracker.
  • General React security practices (e.g. CSP, XSS) still apply, so continue to monitor overall app security and Radix release notes for any future advisories.

No further changes required.

modules/dashboard/components/dashboard-tabs.tsx (1)

16-17: Well-implemented props and component structure.

The new props are properly typed and integrated into the component signature.

Also applies to: 23-25

modules/dashboard/index.tsx (3)

15-15: State initialization looks good.

The includeDoneTasks state is properly initialized to false, which makes sense as the default behavior.


20-22: Query integration needs adjustment.

The query key and function correctly use the queryParams, but the logic error in line 17 affects this implementation.


41-45: Props passing to DashboardTabs is correct.

The props are correctly passed to the DashboardTabs component, maintaining proper data flow and state management.

@iamitprakash iamitprakash merged commit bc138c6 into RealDevSquad:develop Jul 23, 2025
2 checks passed
@Hariom01010 Hariom01010 changed the title Checkbox for done task Add checkbox to include done task Jul 23, 2025
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.

Add checkbox to include done tasks on dashboard

3 participants