chore: WDS outline buttons color adjustment#34615
Conversation
WalkthroughThe recent changes focused on enhancing the color contrast and prominence of text and borders in outlined buttons within the Changes
Assessment against linked issues
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- app/client/packages/design-system/theming/src/color/src/LightModeTheme.ts (1 hunks)
Additional comments not posted (2)
app/client/packages/design-system/theming/src/color/src/LightModeTheme.ts (2)
957-957: LGTM! The luminance adjustment ensures better visibility.The luminance value has been increased to
0.55, which makes the border color more prominent, addressing the issue of border visibility.
962-962: LGTM! The luminance adjustment ensures better visibility.The luminance value has been increased to
0.55, which makes the border color more prominent, addressing the issue of border visibility.
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- app/client/packages/design-system/theming/src/color/tests/LightModeTheme.test.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- app/client/packages/design-system/theming/src/color/tests/LightModeTheme.test.ts
|
@ichik |
d248814 to
0ec743c
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- app/client/packages/design-system/theming/src/color/src/DarkModeTheme.ts (8 hunks)
- app/client/packages/design-system/theming/src/color/src/LightModeTheme.ts (9 hunks)
- app/client/packages/design-system/theming/src/color/tests/DarkModeTheme.test.ts (5 hunks)
- app/client/packages/design-system/theming/src/color/tests/LightModeTheme.test.ts (6 hunks)
Additional comments not posted (27)
app/client/packages/design-system/theming/src/color/tests/DarkModeTheme.test.ts (5)
730-735: Verify the updatedbdAccenttest cases.The test cases for
bdAccentnow include checks for chroma values less than and greater than 0.04. Ensure that these values are consistent with the changes in theDarkModeThemeclass.Verification successful
Verification successful for
bdAccenttest cases.The test cases for
bdAccentinDarkModeTheme.test.tscorrectly reflect the behavior of thebdAccentgetter in theDarkModeThemeclass, validating the expected RGB values based on the chroma levels.
app/client/packages/design-system/theming/src/color/src/DarkModeTheme.ts: Implementation ofbdAccentgetter confirms the chroma and lightness adjustments.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the `bdAccent` getter in the `DarkModeTheme` class. # Test: Search for the `bdAccent` getter implementation. Expect: Correct handling of chroma values. ast-grep --lang typescript --pattern $'private get bdAccent() { $$$ }'Length of output: 528
Script:
#!/bin/bash # Description: Verify the implementation of the `bdAccent` getter in the `DarkModeTheme` class. # Test: Search for the `bdAccent` getter implementation. Expect: Correct handling of chroma values. ast-grep --lang typescript --pattern $'class DarkModeTheme { $$$ private get bdAccent() { $$$ } $$$ }'Length of output: 115
Script:
#!/bin/bash # Description: Search for the `bdAccent` keyword across the codebase to verify its implementation. # Test: Search for the `bdAccent` keyword. rg 'bdAccent' -A 5Length of output: 17842
769-769: Verify the updatedbdNeutraltest case.The test case for
bdNeutralnow includes a check for chroma values less than 0.04. Ensure that this value is consistent with the changes in theDarkModeThemeclass.Verification successful
Verify the updated
bdNeutraltest case.The
bdNeutralgetter in theDarkModeThemeclass correctly handles chroma values, setting it to 0.012 and adjusting to 0 for achromatic seeds. The test case expecting "rgb(33.384% 33.384% 33.384%)" is consistent with this implementation.
app/client/packages/design-system/theming/src/color/src/DarkModeTheme.ts:
private get bdNeutral() { ... }Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the `bdNeutral` getter in the `DarkModeTheme` class. # Test: Search for the `bdNeutral` getter implementation. Expect: Correct handling of chroma values. ast-grep --lang typescript --pattern $'private get bdNeutral() { $$$ }'Length of output: 530
Script:
#!/bin/bash # Description: Verify the implementation of the `bdNeutral` getter in the `DarkModeTheme` class. # Test: Search for the `bdNeutral` getter implementation. Expect: Correct handling of chroma values. ast-grep --lang typescript --pattern 'private get bdNeutral() { return $_; }'Length of output: 544
Script:
#!/bin/bash # Description: Verify the implementation of the `bdNeutral` getter in the `DarkModeTheme` class. # Search for the `bdNeutral` getter implementation in TypeScript files. rg 'private get bdNeutral' -A 10 --glob '**/*.ts'Length of output: 4429
778-778: Verify the updatedbdNeutralHovertest case.The test case for
bdNeutralHovernow includes a check for the color value. Ensure that this value is consistent with the changes in theDarkModeThemeclass.
785-785: Verify the updatedbdPositivetest case.The test case for
bdPositivenow includes a check for the color value. Ensure that this value is consistent with the changes in theDarkModeThemeclass.Verification successful
Verify the updated
bdPositivetest case.The
bdPositivegetter in theDarkModeThemeclass correctly handles color values by cloningbgPositiveand setting specific properties. This implementation aligns with the expected RGB values in the test case.
- Implementation Location:
app/client/packages/design-system/theming/src/color/src/DarkModeTheme.ts: private get bdPositive()Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the `bdPositive` getter in the `DarkModeTheme` class. # Test: Search for the `bdPositive` getter implementation. Expect: Correct handling of color values. ast-grep --lang typescript --pattern $'private get bdPositive() { $$$ }'Length of output: 532
Script:
#!/bin/bash # Description: Verify the implementation of the `bdPositive` getter in the `DarkModeTheme` class. # Test: Search for the `bdPositive` getter implementation. Expect: Correct handling of color values. ast-grep --lang typescript --pattern 'get bdPositive() { $$$ }'Length of output: 516
Script:
#!/bin/bash # Description: Verify the implementation of the `bdPositive` getter in the `DarkModeTheme` class. # Test: Search for the `bdPositive` getter implementation. Expect: Correct handling of color values. ast-grep --lang typescript --pattern 'get bdPositive() { return $_; }'Length of output: 530
Script:
#!/bin/bash # Description: Verify the implementation of the `bdPositive` getter in the `DarkModeTheme` class. # Test: Search for the `bdPositive` getter implementation. Expect: Correct handling of color values. rg 'get bdPositive' -A 5 --type tsLength of output: 2516
742-762: Verify the updatedbdFocustest cases.The test cases for
bdFocusnow include checks for various lightness and chroma values. Ensure that these values are consistent with the changes in theDarkModeThemeclass.Verification successful
Verify the updated
bdFocustest cases.The
bdFocusgetter in theDarkModeThemeclass adjusts the lightness to 0.8 and sets the chroma to 0.12 if it is below this value. The test cases should cover these scenarios to ensure the expected RGB values are returned.
- Ensure that the test cases for
bdFocuscorrectly validate the lightness adjustment to 0.8.- Ensure that the test cases for
bdFocuscorrectly validate the chroma adjustment to a minimum of 0.12.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the `bdFocus` getter in the `DarkModeTheme` class. # Test: Search for the `bdFocus` getter implementation. Expect: Correct handling of lightness and chroma values. ast-grep --lang typescript --pattern $'private get bdFocus() { $$$ }'Length of output: 526
Script:
#!/bin/bash # Description: Verify the implementation of the `bdFocus` getter in the `DarkModeTheme` class. # Search for the `bdFocus` getter implementation in the codebase. rg 'bdFocus' -A 10Length of output: 14227
app/client/packages/design-system/theming/src/color/tests/LightModeTheme.test.ts (10)
782-782: Verify the correctness of the expected RGB value.The expected RGB value for the
bdFocuscolor whenlightness < 0.6has been updated.Ensure the new RGB value matches the intended color adjustment.
787-787: Verify the correctness of the expected RGB value.The expected RGB value for the
bdFocuscolor whenlightness > 0.8has been updated.Ensure the new RGB value matches the intended color adjustment.
792-792: Verify the correctness of the expected RGB value.The expected RGB value for the
bdFocuscolor whenchroma < 0.15has been updated.Ensure the new RGB value matches the intended color adjustment.
797-797: Verify the correctness of the expected RGB value.The expected RGB value for the
bdFocuscolor whenhue is between 0 and 55has been updated.Ensure the new RGB value matches the intended color adjustment.
802-802: Verify the correctness of the expected RGB value.The expected RGB value for the
bdFocuscolor whenhue > 340has been updated.Ensure the new RGB value matches the intended color adjustment.
827-827: Verify the correctness of the expected RGB value.The expected RGB value for the
bdPositivecolor has been updated.Ensure the new RGB value matches the intended color adjustment.
836-836: Verify the correctness of the expected RGB value.The expected RGB value for the
bdPositiveHovercolor has been updated.Ensure the new RGB value matches the intended color adjustment.
845-845: Verify the correctness of the expected RGB value.The expected RGB value for the
bdNegativecolor has been updated.Ensure the new RGB value matches the intended color adjustment.
854-854: Verify the correctness of the expected RGB value.The expected RGB value for the
bdNegativeHovercolor has been updated.Ensure the new RGB value matches the intended color adjustment.
861-861: Verify the correctness of the expected RGB value.The expected RGB value for the
bdWarningcolor has been updated.Ensure the new RGB value matches the intended color adjustment.
app/client/packages/design-system/theming/src/color/src/DarkModeTheme.ts (6)
921-936: Adjustments tobdAccentColor ValuesThe changes to
bdAccentinvolve adjusting the lightness and chroma values based on whether the seed color is cold or not, and ensuring the border is lighter and less saturated to emphasize the text label.
946-947: Increase Lightness forbdFocusThe lightness value for the
bdFocuscolor has been increased to 0.8, which should improve visibility for keyboard focus outlines.
961-969: Adjustments tobdNeutralLightness and ChromaThe changes to
bdNeutralinvolve setting the lightness to 0.4 and chroma to 0.012, with additional adjustments based on contrast calculations.
996-1001: Adjustments tobdPositiveLightness and ChromaThe lightness for
bdPositiveis set to 0.41 and chroma to 0.05, with additional adjustments based on contrast calculations.
Line range hint
1020-1043:
Adjustments tobdNegativeLightness and ChromaThe lightness for
bdNegativeis set to 0.46 and chroma to 0.1, with additional adjustments based on hue and contrast calculations.
Line range hint
1064-1087:
Adjustments tobdWarningLightness and ChromaThe lightness for
bdWarningis set to 0.48 and chroma to 0.12, with additional adjustments based on hue and contrast calculations.app/client/packages/design-system/theming/src/color/src/LightModeTheme.ts (6)
936-947: Adjustments tobdAccentColor ValuesThe changes to
bdAccentinvolve adjusting the lightness to 0.55 and chroma based on whether the seed color is achromatic or not, ensuring the border is lighter and less saturated to emphasize the text label.
957-959: Increase Lightness forbdFocusThe lightness value for the
bdFocuscolor has been increased to 0.55, which should improve visibility for keyboard focus outlines.
974-981: Adjustments tobdNeutralChroma and LightnessThe chroma for
bdNeutralis set to 0.01, with additional adjustments to lightness based on contrast calculations.
1013-1014: Adjustments tobdPositiveLightnessThe lightness for
bdPositiveis set to 0.8, with additional adjustments based on hue and contrast calculations.
1049-1050: Adjustments tobdNegativeLightnessThe lightness for
bdNegativeis set to 0.78, with additional adjustments based on hue and contrast calculations.
1085-1086: Adjustments tobdWarningLightnessThe lightness for
bdWarningis set to 0.82, with additional adjustments based on hue and contrast calculations.
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (12)
app/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvas.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetCanvasDark.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployipad-2.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeployiphone-6.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetDeploymacbook-13.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilButtonWidgetSnapshot_spec.ts/anvilButtonWidgetPreview.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvas.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetCanvasDark.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployipad-2.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeployiphone-6.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetDeploymacbook-13.snap.pngis excluded by!**/*.pngapp/client/cypress/snapshots/AnvilIconButtonWidgetSnapshot_spec.ts/anvilIconButtonWidgetPreview.snap.pngis excluded by!**/*.png
Files selected for processing (1)
- app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (1 hunks)
Additional context used
Path-based instructions (1)
app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (1)
Pattern
app/client/cypress/**/**.*: Follow best practices for Cypress code and e2e automation.
Avoid using cy.wait in code.
Avoid using cy.pause in code.
Use variables for locators, not strings.
Usedata-*attributes for selectors; avoid Xpaths and CSS attributes.
Avoid selectors like.btn.submitorbutton[type=submit].
Perform logins via API withLoginFromAPI.
Only interact with controlled sites/servers.
Ensure tests can run withit.onlyand are independent.
Usebefore,beforeEach,after,afterEachcorrectly; clean state before tests.
Check new specs for flakiness by running them 10 times on CI.
Use multiple assertions; don't treat Cypress as unit tests.
Use constants for strings.
Include datasource operations inbeforehooks.
Do not use duplicate filenames.
Additional comments not posted (1)
app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (1)
27-29: LGTM!The addition of the
comparisonMethod: "ssim"parameter to thematchImageSnapshotfunction improves the accuracy of image snapshot comparisons.
|
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |

Description
Fixes #34336
It was rare before, but with some lighter seeds borders could be perceivably more prominent than fg. I made sure this can't be the case.Borders are now lighter and less saturated than accents to emphasize the text label.
Automation
/ok-to-test tags="@tag.Anvil"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9889245682
Commit: b1769eb
Cypress dashboard.
Tags:
@tag.AnvilSpec:
Thu, 11 Jul 2024 10:09:49 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
comparisonMethodparameter for improved image comparison inAnvilSnapshot.Improvements
Tests