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: Updating the function icon on JS editor #37340

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

ankitakinger
Copy link
Contributor

@ankitakinger ankitakinger commented Nov 12, 2024

Description

Updating the function icon on JS editor to use the below icon:
https://www.figma.com/design/8L9BXMzNTKboGWlHpdXyYP/Appsmith-IDE?node-id=3320-86616&t=m7Tv72GIRzKZCugh-4

Fixes #37331

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11811778322
Commit: 1e8555b
Cypress dashboard.
Tags: @tag.JS
Spec:


Wed, 13 Nov 2024 07:03:04 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a new JavaScript function icon (js-function-v2) for enhanced visual representation in the application.
    • Added a new icon for data sources (DataSourcesIconV2).
    • Updated dropdown options for JavaScript functions to improve organization and accessibility.
  • Bug Fixes

    • Adjusted the icon rendering logic to ensure the correct icon is displayed based on the feature flag.
  • Documentation

    • Improved clarity in the action selection interface for JavaScript functions and their arguments.

@ankitakinger ankitakinger added the ok-to-test Required label for CI label Nov 12, 2024
Copy link
Contributor

coderabbitai bot commented Nov 12, 2024

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • app/client/packages/design-system/ads/src/__assets__/icons/menu/js-function.svg is excluded by !**/*.svg
  • app/client/src/assets/icons/menu/js-function.svg is excluded by !**/*.svg

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The pull request introduces a new JavaScript function icon, JSFunctionV2, which is integrated into the IconProvider component and the action creator's dropdown. The changes include updating the icon references in various components to reflect this new icon, enhancing the representation of JavaScript functions. Additionally, the JSFunctionRun component's rendering logic is modified to conditionally display either the old or new component based on a feature flag, ensuring backward compatibility while transitioning to the new design.

Changes

File Change Summary
app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx Added new icon JSFunctionV2 and updated ICON_LOOKUP to include "js-function-v2".
app/client/src/components/editorComponents/ActionCreator/helpers.tsx Updated icon references from js-function to js-function-v2 and refined getJSOptions logic.
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx Conditional rendering based on release_actions_redesign_enabled and updated button icon to js-function-v2.
app/client/src/icons/MenuIcons.tsx Updated JSFunctionIcon import to js-function-v2 and added new icon DataSourcesIconV2.

Assessment against linked issues

Objective Addressed Explanation
Update the function icon on JS editor (#37331)

Possibly related PRs

Suggested reviewers

  • hetunandu
  • albinAppsmith

🎉 In the land of code where functions play,
A new icon shines, brightening the day.
With dropdowns refined and logic so neat,
Our JS functions now dance to a new beat!
So here's to the changes, both big and small,
In the realm of design, we’re having a ball! 🎈


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>, please review it.
    • 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 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 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 IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Task A simple Todo labels Nov 12, 2024
@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Nov 12, 2024
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11797429337.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 37340.
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: 1

🧹 Outside diff range and nitpick comments (1)
app/client/src/components/editorComponents/ActionCreator/helpers.tsx (1)

Line range hint 282-284: Consider addressing the eslint TODOs

Multiple TODOs indicate the need to fix explicit any types. Addressing these would improve type safety.

Would you like me to create a GitHub issue to track the TypeScript improvements needed in this file?

Also applies to: 449-451, 566-568, 633-635

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5af1bbe and ec2833e.

⛔ Files ignored due to path filters (1)
  • app/client/packages/design-system/ads/src/__assets__/icons/menu/js-function-v2.svg is excluded by !**/*.svg
📒 Files selected for processing (3)
  • app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx (2 hunks)
  • app/client/src/components/editorComponents/ActionCreator/helpers.tsx (2 hunks)
  • app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx (1 hunks)
🔇 Additional comments (5)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx (2)

Line range hint 31-45: LGTM! Clean implementation of feature flag toggle

The component properly handles the transition between old and new versions using the feature flag.


Line range hint 63-70: LGTM! Functionality preserved while updating UI

The icon update maintains all existing button functionality, accessibility features, and test hooks.

app/client/src/components/editorComponents/ActionCreator/helpers.tsx (1)

611-611: LGTM: Icon update is consistent across function types

The icon update from "js-function" to "js-function-v2" is applied consistently for both regular JS functions and module instance functions.

Let's verify no legacy icon references remain:

Also applies to: 661-661

✅ Verification successful

LGTM: Icon update is consistent and no legacy references found

All references to name="js-function" have been successfully updated to name="js-function-v2" across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old icon name
# Expect: No occurrences of the old icon name

rg "name=\"js-function\"" --type ts --type tsx

Length of output: 74


Script:

#!/bin/bash
# Step 1: List available file types in rg
rg --type-list

# Step 2: Search for any remaining references to the old icon name in TypeScript and TSX files using glob patterns
rg 'name="js-function"' --glob '*.ts' --glob '*.tsx'

Length of output: 4876

app/client/packages/design-system/ads/src/Icon/Icon.provider.tsx (2)

966-968: LGTM: Icon import follows established patterns.

The import statement is well-structured and follows the existing conventions for icon imports.


1291-1291: LGTM: Icon lookup entry is properly defined.

The icon mapping follows the established naming convention and is correctly integrated into the lookup object.

Copy link

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

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: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ec2833e and c857505.

⛔ Files ignored due to path filters (1)
  • app/client/src/assets/icons/menu/js-function-v2.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • app/client/src/icons/MenuIcons.tsx (1 hunks)

app/client/src/icons/MenuIcons.tsx Outdated Show resolved Hide resolved
app/client/src/icons/MenuIcons.tsx Outdated Show resolved Hide resolved
Copy link
Member

@hetunandu hetunandu left a comment

Choose a reason for hiding this comment

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

Please update the existing js-function icon instead of creating a new one.
Just updating the current SVG should be enough

@ankitakinger
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

Copy link

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

@ankitakinger ankitakinger merged commit d90faa2 into release Nov 13, 2024
51 checks passed
@ankitakinger ankitakinger deleted the chore/update-function-icon-js-editor branch November 13, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product 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.

[Task]: Update the function icon on JS editor
2 participants