appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

fix: bg color for selected option in multiselect widget

Open SaiCharanChetpelly31 opened this issue 1 year ago • 6 comments

Fixes #15493 Added bg color styles to selected option(s) Added cypress test.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced automated tests for the MultiSelect widget to validate functionality and appearance.
  • Enhancements

    • Improved the styling of selected options in the MultiSelect widget for better visual feedback, including dynamic background colors and hover effects.
  • Tests

    • Added a comprehensive test suite for the MultiSelectWidget to ensure correct rendering and user interaction behavior.

SaiCharanChetpelly31 avatar Jul 22 '24 04:07 SaiCharanChetpelly31

Walkthrough

The recent updates enhance the MultiSelect widget by improving its visual feedback for selected options. New automated tests ensure the correct background color is displayed for selected items, addressing user interface consistency. Additionally, styling adjustments have been made to highlight selected options dynamically, contributing to an overall better user experience.

Changes

Files Change Summary
app/client/cypress/e2e/.../MultiSelect6_spec.ts
app/client/src/widgets/MultiSelectWidgetV2/component/index.styled.tsx
Introduced automated tests for the MultiSelect widget focusing on visual representation and background color. Enhanced styling for selected options using dynamic background colors to improve user feedback.
app/client/src/widgets/MultiSelectWidgetV2/widget/index.test.tsx Added a new test suite for the MultiSelectWidget that verifies rendering and interaction, ensuring the selected option displays the correct background color.

Assessment against linked issues

Objective Addressed Explanation
Selected options should be highlighted in the MultiSelect widget (#[15493])

🌈 In the land of code, a change does bloom,
Selected options now burst with color and loom.
With tests in place, and styles that gleam,
The MultiSelect widget fulfills its dream!
🎉 User joy is what we seek,
In every click, let colors speak!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

coderabbitai[bot] avatar Jul 22 '24 04:07 coderabbitai[bot]

@SaiCharanChetpelly31, We have seen there is change in src with business logic. This logic can be tested with Jest unit tests or React testing library. Cypress is redundant here.

sagar-qa007 avatar Jul 23 '24 04:07 sagar-qa007

@SaiCharanChetpelly31, We have seen there is change in src with business logic. This logic can be tested with Jest unit tests or React testing library. Cypress is redundant here.

@sagar-qa007 The bug involves adding a background color for a selected item. I wrote a Cypress test for it since it pertains to CSS. I didn't add any extra logic to the code; I simply added CSS for the selected option in the index.styles.tsx file.

Regarding the need for a new Jest test case for this bug fix, the Appsmith team hasn't written any Jest test cases yet. Is Cypress testing sufficient for this fix, or do I need to write Jest test cases as well?

Thanks in advance. Looking forward to your reply.

SaiCharanChetpelly31 avatar Jul 25 '24 08:07 SaiCharanChetpelly31

Hi @sagar-qa007 I have added unit tests. can you please take this pr forward for review? Thanks.

SaiCharanChetpelly31 avatar Jul 30 '24 09:07 SaiCharanChetpelly31

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

github-actions[bot] avatar Aug 07 '24 16:08 github-actions[bot]

Hi @sagar-qa007 @ApekshaBhosale @ramsaptami Can you please take this pr forward for review? Thank you.

SaiCharanChetpelly31 avatar Aug 07 '24 16:08 SaiCharanChetpelly31