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: Move Toolbar to IDE #36214

Merged
merged 14 commits into from
Sep 12, 2024
Merged

chore: Move Toolbar to IDE #36214

merged 14 commits into from
Sep 12, 2024

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Sep 10, 2024

Description

Update the old Toolbar and redesign implementation to follow the new modular approach. It creates a toolbar at the IDE level and uses that in the PluginActionToolbar. It allows extension for other components.

Unblocks #35528

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10824489362
Commit: 5c169a3
Cypress dashboard.
Tags: @tag.Datasource
Spec:


Thu, 12 Sep 2024 06:00:03 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a customizable toolbar for plugin actions, enhancing user interface interaction.
    • Added a new plugin action editor interface to manage plugin actions dynamically.
    • Implemented a context provider for managing plugin actions throughout the application.
    • Added a feature flag for conditional rendering of the new plugin action editor interface.
  • Bug Fixes

    • Removed obsolete action redesign features, streamlining the user experience.
  • Documentation

    • Added index files for better modularity and reusability of components related to plugin actions.
    • Minor formatting updates for improved code clarity in the Plugin Action Editor.

Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Warning

Rate limit exceeded

@hetunandu has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 31 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 35128b9 and 5c169a3.

Walkthrough

This pull request introduces several enhancements to the Plugin Action Editor functionality within the application. Key changes include the addition of the PluginActionContext for managing plugin action states, and the PluginActionEditor, which serves as a central interface for these actions. Various toolbar and form components have also been created to streamline the user interface. Additionally, minor formatting adjustments were made to improve code readability. Collectively, these changes aim to modularize and improve the organization of plugin-related functionalities across different parts of the application.

Changes

Files Change Summary
app/client/src/IDE/Components/Toolbar.tsx Added Toolbar, ToolbarLeft, ToolbarRight, and ToolbarProps interface for a flexible toolbar layout.
app/client/src/PluginActionEditor/PluginActionContext.tsx Created PluginActionContext and PluginActionContextProvider for managing plugin action state.
app/client/src/PluginActionEditor/PluginActionEditor.tsx Introduced PluginActionEditor component to manage plugin actions with routing and Redux state integration.
app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx Created a simple PluginActionForm component as a placeholder for future development.
app/client/src/PluginActionEditor/components/PluginActionForm/index.ts Added an index file for easier imports of PluginActionForm.
app/client/src/PluginActionEditor/components/PluginActionResponsePane.tsx Introduced PluginActionResponsePane as a simple placeholder component.
app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx Defined PluginActionToolbar for customizable action buttons with integrated toolbars.
app/client/src/PluginActionEditor/index.ts Created an index file to consolidate exports for the Plugin Action Editor components and context.
app/client/src/ce/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx Introduced AppPluginActionEditor as a container for plugin action components.
app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx Exported CE_AppPluginActionEditor as the default export for modular integration.
app/client/src/pages/Editor/APIEditor/index.tsx Added conditional rendering for AppPluginActionEditor based on a feature flag.
app/client/src/pages/Editor/AppPluginActionEditor/index.ts Created an index file for exporting AppPluginActionEditor.
app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx Removed action redesign feature and related logic for a simplified component structure.
app/client/src/pages/Editor/QueryEditor/index.tsx Added conditional rendering for AppPluginActionEditor based on a feature flag.
app/client/src/PluginActionEditor/PluginActionEditor.tsx Minor formatting change by adding a blank line before the conditional check for the existence of the action.

Poem

In the realm of code, new tools arise,
A toolbar to guide, beneath the skies.
Contexts and editors, all in a dance,
Plugin actions flourish, given a chance.
With each line written, our app finds its way,
A brighter tomorrow, in code we play! 🌟


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 10, 2024
Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 2, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 2, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

@hetunandu hetunandu added the ok-to-test Required label for CI label Sep 10, 2024
@hetunandu hetunandu marked this pull request as ready for review September 10, 2024 05:50
@hetunandu hetunandu added IDE Product Issues related to the IDE Product IDE Pod Issues that new developers face while exploring the IDE labels Sep 10, 2024
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, codebase verification and nitpick comments (2)
app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx (1)

10-36: Great work on the PluginActionToolbar component! The code is clean, well-structured, and follows best practices. 👍

A few suggestions to consider:

  1. Consider extracting the buttons in the ToolbarRight section into separate components if they are used in multiple places. This will promote reusability and maintainability.

  2. If the runOptions prop is optional, consider adding a default value of null or an empty fragment to avoid rendering undefined in the UI.

  3. Consider adding some comments to explain the purpose of each button in the ToolbarRight section. This will make the code more readable and easier to understand for other developers.

Overall, great job on this component! Let me know if you have any questions or if there's anything else I can help with.

app/client/src/IDE/Components/Toolbar.tsx (1)

8-21: The Toolbar component looks good! It's simple, straightforward, and uses the Flex component to promote a consistent UI design. 👍

One suggestion to consider:

  1. Consider extracting the styling props into a separate theme object or using CSS variables. This will make it easier to customize the component and maintain a consistent style across the application.

Other than that, the component looks great! Let me know if you have any questions or if there's anything else I can help with.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 182dbe7 and f32b633.

Files selected for processing (14)
  • app/client/src/IDE/Components/Toolbar.tsx (1 hunks)
  • app/client/src/PluginActionEditor/PluginActionContext.tsx (1 hunks)
  • app/client/src/PluginActionEditor/PluginActionEditor.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/index.ts (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionResponsePane.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionToolbar.tsx (1 hunks)
  • app/client/src/PluginActionEditor/index.ts (1 hunks)
  • app/client/src/ce/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx (1 hunks)
  • app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx (1 hunks)
  • app/client/src/pages/Editor/APIEditor/index.tsx (2 hunks)
  • app/client/src/pages/Editor/AppPluginActionEditor/index.ts (1 hunks)
  • app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx (4 hunks)
  • app/client/src/pages/Editor/QueryEditor/index.tsx (2 hunks)
Files skipped from review due to trivial changes (7)
  • app/client/src/PluginActionEditor/components/PluginActionForm/PluginActionForm.tsx
  • app/client/src/PluginActionEditor/components/PluginActionForm/index.ts
  • app/client/src/PluginActionEditor/components/PluginActionResponsePane.tsx
  • app/client/src/PluginActionEditor/index.ts
  • app/client/src/ce/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx
  • app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx
  • app/client/src/pages/Editor/AppPluginActionEditor/index.ts
Additional comments not posted (10)
app/client/src/IDE/Components/Toolbar.tsx (2)

23-34: The ToolbarLeft component looks great! It's similar to the Toolbar component, but with different styling props to position its children on the left side of the toolbar. 👍

The component name clearly indicates its purpose and position within the Toolbar, which makes the code more readable and easier to understand.

Keep up the good work!


36-47: The ToolbarRight component looks great as well! It's similar to the ToolbarLeft component, but with different styling props to position its children on the right side of the toolbar. 👍

Just like the ToolbarLeft component, the name of this component clearly indicates its purpose and position within the Toolbar, which enhances the readability and understandability of the code.

Excellent job on these toolbar components!

app/client/src/PluginActionEditor/PluginActionContext.tsx (3)

20-20: The PluginActionContext is defined correctly using the createContext function from React. 👍

The initial value of null is appropriate since the actual context value will be provided by the PluginActionContextProvider component.

Good job on setting up the context!


26-49: The PluginActionContextProvider component is implemented correctly and follows best practices. 👍

It accepts the necessary props related to a plugin action and uses the useMemo hook to memoize the context value, which is a good performance optimization to avoid unnecessary re-renders.

The component is well-structured and provides the context value to its children components using the PluginActionContext.Provider component.

Great work on this context provider component!


54-62: The usePluginActionContext hook is implemented correctly and follows best practices. 👍

It uses the useContext hook from React to access the PluginActionContext value and throws an error if the context is not available, which is a good safety measure to ensure that the hook is used correctly within the PluginActionContextProvider.

The hook is also well-documented with comments explaining its purpose and usage, which makes it easier for other developers to understand and use.

Excellent job on this custom hook!

app/client/src/PluginActionEditor/PluginActionEditor.tsx (1)

1-72: Excellent work! The code looks clean and well-organized.

The PluginActionEditor component is implemented following best practices:

  • It imports necessary dependencies and selectors.
  • It uses appropriate hooks like useLocation and useSelector to access data.
  • It handles edge cases and error scenarios gracefully.
  • The code is readable and maintainable.

Great job on structuring the component and handling different scenarios!

app/client/src/pages/Editor/APIEditor/index.tsx (1)

181-187: The feature flag check is implemented correctly.

The code introduces a new feature flag check for release_actions_redesign_enabled within the ApiEditorWrapper component. When the feature flag is enabled, the AppPluginActionEditor component is rendered instead of the ApiEditorContextProvider.

This change allows for conditional rendering based on the feature flag, enabling a new user interface experience when the feature is active.

The code change is well-structured and follows the existing coding style. The AI-generated summary accurately captures the purpose and impact of the change.

app/client/src/pages/Editor/QueryEditor/index.tsx (1)

192-198: Great job implementing the feature flag check!

The code introduces a new feature flag check for release_actions_redesign_enabled within the QueryEditor component. When the feature flag is enabled, the AppPluginActionEditor component is rendered instead of the QueryEditorContextProvider.

This change allows for conditional rendering based on the feature flag, enabling a new user interface experience when the feature is active.

The code change is well-structured and follows the existing coding style. The AI-generated summary accurately captures the purpose and impact of the change.

Keep up the good work!

app/client/src/pages/Editor/QueryEditor/EditorJSONtoForm.tsx (2)

Line range hint 1-27: Removal of unused import is approved.

The DEBUGGER_RESPONSE import has been removed as it is no longer being used in this file. This aligns with the removal of the action redesign feature.


Line range hint 175-289: Removal of action redesign feature is approved.

The changes in the EditorJSONtoForm component, including the removal of the isActionRedesignEnabled flag and the associated conditional rendering logic, align with the removal of the action redesign feature. This simplifies the component's structure and control flow, focusing solely on rendering the form.

The changes are approved as they improve the code's readability and maintainability by removing unnecessary checks and rendering logic.

Copy link

⚠️ Cyclic Dependency Check:

This PR has increased the number of cyclic dependencies by 3, when compared with the release branch.

Refer this document to identify the cyclic dependencies introduced by this PR.

ashit-rath
ashit-rath previously approved these changes Sep 11, 2024
AmanAgarwal041
AmanAgarwal041 previously approved these changes Sep 11, 2024
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
## Description

Update the old Toolbar and redesign implementation to follow the new
modular approach. It creates a toolbar at the IDE level and uses that in
the PluginActionToolbar. It allows extension for other components.

Unblocks  appsmithorg#35528



## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


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

- **New Features**
- Introduced a customizable toolbar for plugin actions, enhancing user
interface interaction.
- Added a new plugin action editor interface to manage plugin actions
dynamically.
- Implemented a context provider for managing plugin actions throughout
the application.
- Added a feature flag for conditional rendering of the new plugin
action editor interface.

- **Bug Fixes**
- Removed obsolete action redesign features, streamlining the user
experience.

- **Documentation**
- Added index files for better modularity and reusability of components
related to plugin actions.
- Minor formatting updates for improved code clarity in the Plugin
Action Editor.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants