Skip to content

Update the UI to use a switch component for including done tasks#158

Merged
iamitprakash merged 4 commits intoRealDevSquad:developfrom
Hariom01010:update-include-done-button
Jul 24, 2025
Merged

Update the UI to use a switch component for including done tasks#158
iamitprakash merged 4 commits intoRealDevSquad:developfrom
Hariom01010:update-include-done-button

Conversation

@Hariom01010
Copy link
Contributor

@Hariom01010 Hariom01010 commented Jul 24, 2025

Date: 24 Jul 2025

Developer Name: @Hariom01010


Issue Ticket Number

Closes #157

Description

This PR updates the UI to use a switch instead of checkbox for including done tasks

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1 image image

Test Coverage

Screenshot 1

Additional Notes

Description by Korbit AI

What change is being made?

Replace the checkbox for including done tasks with a switch component in the TodoListTable UI and related components/modules.

Why are these changes being made?

Switch components provide a clearer visual indication of binary on/off states compared to checkboxes, enhancing user experience. The "@radix-ui/react-switch" library is introduced to facilitate a consistent design language across the UI elements while maintaining accessibility and usability.

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

@Hariom01010 Hariom01010 self-assigned this Jul 24, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 24, 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 an "Include Done" toggle switch to the task list, allowing users to show or hide completed tasks when viewing all tasks.
  • User Interface
    • Improved layout by displaying the "Include Done" switch inline with the search bar for easier access.
  • Chores
    • Added a new UI library dependency to support the toggle switch.

Walkthrough

The "Include Done" toggle for tasks was moved from the dashboard tabs header into the TodoListTable component, which now displays the toggle as a switch using a new UI component. The switch is only shown when the "All" tab is active. The @radix-ui/react-switch dependency was added.

Changes

File(s) Change Summary
components/todo-list-table.tsx Added optional includeDone and onIncludeDoneChange props; renders a switch for "Include Done".
components/ui/switch.tsx Introduced new Switch component using @radix-ui/react-switch.
modules/dashboard/components/dashboard-tabs.tsx Removed "Include Done" checkbox from tabs; passes props to TodoListTable instead.
package.json Added @radix-ui/react-switch dependency.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DashboardTabs
    participant TodoListTable
    participant Switch

    User->>DashboardTabs: Selects "All" tab
    DashboardTabs->>TodoListTable: Render with includeDone/onIncludeDoneChange props
    TodoListTable->>Switch: Render "Include Done" switch (if tab is "All")
    User->>Switch: Toggles switch
    Switch->>TodoListTable: onIncludeDoneChange(checked)
    TodoListTable->>DashboardTabs: (callback propagates if needed)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Add checkbox to include done task #155: Adds a checkbox toggle for including done tasks at the dashboard tabs level, whereas this PR moves the toggle to the TodoListTable and uses a switch component.

Poem

A toggle once a checkbox, now a switch with flair,
Moved to the table, tidy and rare.
Radix brings the style,
Tasks line up in file,
Rabbits approve—UI upgrades in the air!
🐇✨

✨ 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.

@Hariom01010 Hariom01010 requested a review from yesyash July 24, 2025 15:44
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 bc138c6 and 67e916a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • components/todo-list-table.tsx (3 hunks)
  • components/ui/switch.tsx (1 hunks)
  • modules/dashboard/components/dashboard-tabs.tsx (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
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.

🧬 Code Graph Analysis (3)
components/ui/switch.tsx (1)
lib/utils.ts (1)
  • cn (4-6)
modules/dashboard/components/dashboard-tabs.tsx (1)
components/todo-list-table.tsx (1)
  • TodoListTable (144-218)
components/todo-list-table.tsx (1)
components/searchbar.tsx (1)
  • Searchbar (9-23)
🔇 Additional comments (7)
package.json (1)

35-35: Confirm version and complete security audit before merging

  • Verified that @radix-ui/react-switch@1.2.5 is the latest published version on npm.
  • The npm audit step failed due to a missing lockfile, so no vulnerability report was produced.

Please generate a lockfile and re-run the audit, or manually review the package’s security advisories:

npm install --package-lock-only
npm audit --audit-level moderate
modules/dashboard/components/dashboard-tabs.tsx (2)

11-16: Clean prop interface addition.

The new props are properly typed and align with the component's responsibility of managing state while delegating UI rendering to child components.


53-58: Proper prop forwarding to TodoListTable.

The includeDone and onIncludeDoneChange props are correctly passed to the TodoListTable component, enabling it to render and manage the switch UI internally.

components/todo-list-table.tsx (4)

13-14: Proper imports for the new Switch functionality.

The Label and Switch component imports are correctly added to support the new "Include Done" toggle feature.


140-141: Clean prop interface extension.

The new optional props are properly typed and align with the parent component's interface.


144-150: Proper destructuring of enhanced props.

The component correctly receives and destructures the new props for handling the "Include Done" switch functionality.


183-183: LGTM! Proper layout adjustment for the new switch.

The change from a simple container to a flex layout appropriately accommodates the new switch component alongside the search bar.

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
Design Tab comparison using magic string ▹ view ✅ Fix detected
Documentation Undocumented Query Parameter ▹ view
Readability Complex Inline CSS Calculation ▹ view
Functionality Missing Accessibility Attributes ▹ view
Files scanned
File Path Reviewed
components/ui/switch.tsx
modules/dashboard/components/dashboard-tabs.tsx
components/todo-list-table.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 cc4d717 into RealDevSquad:develop Jul 24, 2025
3 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.

Update UI to use switch for including done tasks

2 participants