Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove filled icon style setting #36300

Merged
merged 3 commits into from
Sep 13, 2024
Merged

Conversation

jsartisan
Copy link
Contributor

@jsartisan jsartisan commented Sep 13, 2024

Fixes #35175

/ok-to-test tags="@tag.Anvil"

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10845022776
Commit: 9224955
Cypress dashboard.
Tags: @tag.Anvil
Spec:


Fri, 13 Sep 2024 08:02:36 UTC

Summary by CodeRabbit

  • New Features

    • Simplified theme management by removing icon style options from the user interface.
  • Bug Fixes

    • Enhanced clarity in theme handling by refining type usage in various components.
  • Chores

    • Removed deprecated icon style properties and constants to streamline code and improve maintainability.
    • Deleted a test case related to icon styles to focus testing efforts elsewhere.

@github-actions github-actions bot added Anvil Pod Issue related to Anvil project Task A simple Todo labels Sep 13, 2024
Copy link
Contributor

coderabbitai bot commented Sep 13, 2024

Walkthrough

This pull request implements significant changes by removing the iconStyle property and related functionalities from various components, interfaces, and testing files across the codebase. The modifications indicate a shift in how icon styles are managed within the application, leading to the elimination of specific test cases and UI elements associated with icon styling. This streamlining reflects a broader design decision to simplify theming and icon management.

Changes

Files Change Summary
app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts Removed the "6. Icon Style" test case, which included snapshot matching for icon styles.
app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts Removed iconStyleOptions locator and setIconStyle method from AnvilSnapshot class.
app/client/packages/design-system/theming/src/hooks/src/useTheme.tsx Removed iconStyle property from UseThemeProps interface and its logic in the useTheme function.
app/client/packages/design-system/theming/src/theme/src/types.ts Removed iconStyle property from the Theme type definition.
app/client/packages/design-system/theming/src/token/src/TokensAccessor.ts Removed iconStyle property and related methods from the TokensAccessor class.
app/client/packages/design-system/theming/src/token/src/types.ts Removed iconStyle property from TokenSource interface and IconStyle type definition.
app/client/packages/design-system/widgets/src/components/Icon/src/Icon.tsx Removed filled property and associated logic from the icon component.
app/client/packages/design-system/widgets/src/scripts/build-icons.ts Modified logic to include all icon names, removing the filter for names ending with "Filled."
app/client/src/constants/AppConstants.ts Removed iconStyle property from ThemeSetting interface and its default value.
app/client/src/pages/AppViewer/index.tsx Simplified wdsThemeProps by removing explicit type annotations for IconStyle.
app/client/src/pages/Editor/Canvas.tsx Removed iconStyle property from the object passed to the useTheme hook.
app/client/src/pages/Editor/WDSThemePropertyPane/constants.ts Removed THEME_SETTINGS_ICON_STYLE_OPTIONS constant.
app/client/src/pages/Editor/WDSThemePropertyPane/index.tsx Removed section related to "Icon Style" from the WDSThemePropertyPane component.

Assessment against linked issues

Objective Addressed Explanation
Remove theme icon style settings (linked issue #35175)
Remove the ability to use filled icons from the code (linked issue #35175)

Possibly related PRs

Suggested labels

Bug

Poem

In the realm of icons, a change took flight,
Out with the filled, in with the light.
Themes now simplified, clean and clear,
A streamlined vision, we hold dear.
With every removal, a fresh start we see,
Embracing the change, as bright as can be! 🌟


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 50b1dbb and 9224955.

Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts (0 hunks)
Files not reviewed due to no reviewable changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts

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

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.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Sep 13, 2024
@jsartisan
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@jsartisan jsartisan added the ok-to-test Required label for CI label Sep 13, 2024
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10844181754.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 36300.
recreate: .

Copy link
Contributor

@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: 0

Outside diff range and nitpick comments (1)
app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts (1)

Line range hint 1-69: Consider making a few minor improvements to the test code.

The existing test code follows most of the best practices mentioned in the additional instructions. However, here are a couple of suggestions for further improvement:

  1. Use constants for commonly used values like theme names, density options, sizing options, and corner values. This will make the code more maintainable and less prone to typos.

  2. Consider extracting the repeated snapshot matching logic into a helper function. This will reduce code duplication and make the tests more readable.

For example:

const matchSnapshotsForAllModes = (snapshotName: string, theme?: string) => {
  anvilSnapshot.matchSnapshotForCanvasMode(snapshotName, theme);
  anvilSnapshot.matchSnapshotForPreviewMode(snapshotName, theme);
  anvilSnapshot.matchSnapshotForDeployMode(snapshotName, theme);
};

// Usage
matchSnapshotsForAllModes("AppTheming");
matchSnapshotsForAllModes("AppTheming", "dark");

Keep up the great work with the test code!

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 049a8a9 and d168fc1.

Files selected for processing (13)
  • app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts (1 hunks)
  • app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts (0 hunks)
  • app/client/packages/design-system/theming/src/hooks/src/useTheme.tsx (1 hunks)
  • app/client/packages/design-system/theming/src/theme/src/types.ts (1 hunks)
  • app/client/packages/design-system/theming/src/token/src/TokensAccessor.ts (0 hunks)
  • app/client/packages/design-system/theming/src/token/src/types.ts (0 hunks)
  • app/client/packages/design-system/widgets/src/components/Icon/src/Icon.tsx (2 hunks)
  • app/client/packages/design-system/widgets/src/scripts/build-icons.ts (0 hunks)
  • app/client/src/constants/AppConstants.ts (0 hunks)
  • app/client/src/pages/AppViewer/index.tsx (1 hunks)
  • app/client/src/pages/Editor/Canvas.tsx (0 hunks)
  • app/client/src/pages/Editor/WDSThemePropertyPane/constants.ts (0 hunks)
  • app/client/src/pages/Editor/WDSThemePropertyPane/index.tsx (0 hunks)
Files not reviewed due to no reviewable changes (8)
  • app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
  • app/client/packages/design-system/theming/src/token/src/TokensAccessor.ts
  • app/client/packages/design-system/theming/src/token/src/types.ts
  • app/client/packages/design-system/widgets/src/scripts/build-icons.ts
  • app/client/src/constants/AppConstants.ts
  • app/client/src/pages/Editor/Canvas.tsx
  • app/client/src/pages/Editor/WDSThemePropertyPane/constants.ts
  • app/client/src/pages/Editor/WDSThemePropertyPane/index.tsx
Files skipped from review due to trivial changes (1)
  • app/client/src/pages/AppViewer/index.tsx
Additional context used
Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
Additional comments not posted (5)
app/client/packages/design-system/theming/src/theme/src/types.ts (1)

5-5: Great work simplifying the Theme type! 👍

The removal of the iconStyle property from the Theme type aligns perfectly with the PR objectives to remove theme icon style settings and eliminate the ability to use filled icons. This change streamlines the Theme type and reflects a shift in how icon styles are managed within the application.

It's important to note that this modification may impact how themes are applied or utilized, particularly in relation to icon styling. Developers working with themes should be aware of this change and adjust their code accordingly to handle icon styles separately or through alternative means.

The remaining properties of the Theme type, such as typography and colorMode, are left intact, indicating that the focus of the theme is now more focused without the inclusion of icon styles.

Overall, this is a clean and localized change that contributes to the broader goal of simplifying theming and icon management in the codebase. Well done! 🌟

app/client/packages/design-system/widgets/src/components/Icon/src/Icon.tsx (2)

10-10: Great work simplifying the Icon component's props! 👍

Removing the filled property aligns perfectly with the PR objectives and streamlines the component's functionality. This change will make the Icon component easier to use and maintain.


26-26: Excellent update to the useMemo dependency array! 🎉

Updating the dependency array to only include name is the right move after removing the filled property and its related logic. This ensures that the icon is only recomputed when necessary, improving performance.

app/client/cypress/e2e/Regression/ClientSide/Anvil/AppTheming/AnvilAppThemingSnapshot_spec.ts (1)

69-69: Great job removing the "6. Icon Style" test case!

The removal of this test case aligns perfectly with the PR objective of eliminating the filled icon style settings from the codebase. By removing this test, you are ensuring that the test suite stays up to date with the changes in the application.

app/client/packages/design-system/theming/src/hooks/src/useTheme.tsx (1)

13-13: Great work on simplifying the theming system! 👍

The removal of the iconStyle property from the UseThemeProps interface and the corresponding logic in the useTheme function aligns perfectly with the PR objectives and the AI-generated summary. These changes streamline the theming process by reducing the number of properties the useTheme function handles, making it more focused and easier to maintain.

It's evident that you've carefully considered the implications of this change and have made the necessary adjustments throughout the file. The code remains clean, readable, and follows best practices.

Keep up the excellent work in refining the theming system and improving the overall design and architecture of the application! 🌟

Also applies to: 18-24, 28-102

Copy link

Deploy-Preview-URL: https://ce-36300.dp.appsmith.com

@jsartisan jsartisan merged commit 7e98542 into release Sep 13, 2024
52 checks passed
@jsartisan jsartisan deleted the chore/remove-icon-filled-2 branch September 13, 2024 09:32
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
Fixes appsmithorg#35175 

/ok-to-test tags="@tag.Anvil"

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10845022776>
> Commit: 9224955
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10845022776&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Anvil`
> Spec:
> <hr>Fri, 13 Sep 2024 08:02:36 UTC
<!-- end of auto-generated comment: Cypress test results  -->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Simplified theme management by removing icon style options from the
user interface.

- **Bug Fixes**
- Enhanced clarity in theme handling by refining type usage in various
components.

- **Chores**
- Removed deprecated icon style properties and constants to streamline
code and improve maintainability.
- Deleted a test case related to icon styles to focus testing efforts
elsewhere.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Pawan Kumar <pawankumar@Pawans-MacBook-Pro-2.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Anvil Pod Issue related to Anvil project ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove filled icons
2 participants