Skip to content

Comments

feat: add switch to view done tasks in teams#187

Merged
iamitprakash merged 4 commits intodevelopfrom
feat/done-team-tasks
Aug 25, 2025
Merged

feat: add switch to view done tasks in teams#187
iamitprakash merged 4 commits intodevelopfrom
feat/done-team-tasks

Conversation

@MayankBansal12
Copy link
Member

@MayankBansal12 MayankBansal12 commented Aug 22, 2025

Date: 22-08-2025

Developer Name: @MayankBansal12


Issue Ticket Number

Description

  • Adds a switch to allow user to view Done tasks in teams dashboard
  • Refactored done switch button into a reusable component and using it in dashboard and teams page

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

demo
Screencast.from.2025-08-22.21-06-37.mp4

Description by Korbit AI

What change is being made?

Add a switch feature to allow users to toggle the visibility of completed ("done") tasks in team views and other dashboard components.

Why are these changes being made?

The feature provides users with the flexibility to decide whether to include completed tasks in their task view, enhancing the task management experience. The implementation centralizes the toggle logic using IncludeDoneSwitch to reduce duplication and improve maintainability, ensuring consistent functionality across different components. By leveraging URL search parameters, this approach also maintains state consistency when navigating through the application.

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

@MayankBansal12 MayankBansal12 self-assigned this Aug 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 22, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

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 an “Include Done” toggle to Team Tasks, allowing you to include completed tasks in the list.
    • Filter state persists in the URL, so sharing or reloading preserves your selection.
    • Task results update immediately when the toggle is changed.
  • Style

    • Minor header layout adjustment to fit the new filter control next to the search bar.

Walkthrough

Adds an “Include Done” toggle to TeamTasks. Initializes state from the status URL param, updates the param on toggle, and switches task fetching to use a params-based query (typed with GetTaskReqDto) that includes status: 'DONE' when enabled. Minor layout/import updates.

Changes

Cohort / File(s) Summary
Team tasks filter & param-driven fetch
modules/teams/team-tasks.tsx
Adds Include Done switch, syncs with status URL param, builds queryParams: GetTaskReqDto, updates React Query key/fn to use params, and calls TasksApi.getTasks with status: 'DONE' when enabled; imports GetTaskReqDto, Switch, Label, and adjusts layout.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as TeamTasks UI
  participant Router as Router/URL
  participant RQ as React Query
  participant API as TasksApi

  User->>UI: Toggle "Include Done"
  UI->>Router: Update URL query (?status=DONE / remove)
  Router-->>UI: Params changed
  UI->>RQ: Recompute queryKey with queryParams
  RQ->>API: getTasks(queryParams)
  API-->>RQ: Tasks (filtered by status when applicable)
  RQ-->>UI: Update task list
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • yesyash
  • iamitprakash
  • Achintya-Chatterjee

Poem

I flipped a tiny switch—click, click!
Now DONE hops in the task list, quick.
URLs align, the queries flow,
Params in tow, away we go.
A rabbit nods: “Filters done!” ✅
Sprinting through tasks, one by one. 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/done-team-tasks

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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 Inconsistent Status Value Comparison ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
modules/teams/team-tasks.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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1c63bf9 and 6ddf2a2.

📒 Files selected for processing (1)
  • modules/teams/team-tasks.tsx (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
modules/teams/team-tasks.tsx (3)
api/tasks/tasks.types.ts (1)
  • GetTaskReqDto (39-42)
api/tasks/tasks.api.ts (1)
  • TasksApi (17-77)
components/searchbar.tsx (1)
  • Searchbar (9-23)
🔇 Additional comments (4)
modules/teams/team-tasks.tsx (4)

5-5: Typed query params import is a good move

Importing GetTaskReqDto strengthens the API call typing and aligns the queryKey/fn usage. Looks good.


15-16: UI control imports look correct

Label and Switch imports are appropriate for the new toggle. No concerns.


132-133: Query key/fn now reflect filter state

Switching to TasksApi.getTasks.key(queryParams) and fn(queryParams) is correct and will cache per-filter. With the memoized queryParams (suggested above), this remains stable.


165-165: Layout adjustment LGTM

Adding space for the new control beside the search bar looks fine and keeps the header compact.

Copy link
Contributor

@AnujChhikara AnujChhikara left a comment

Choose a reason for hiding this comment

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

LGTM

@iamitprakash iamitprakash merged commit b6609c3 into develop Aug 25, 2025
3 checks passed
@iamitprakash iamitprakash deleted the feat/done-team-tasks branch August 25, 2025 17:59
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.

show done tasks in teams page

4 participants