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: Plugin Action Editor routing #37389

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Nov 14, 2024

Description

  • Earlier we had the new Plugin Action Editor implementation mixed in with the older API and Query Editor components. We have now separated it out so that the eventual removal of older editors is easy
  • Move AppPluginActionEditor outside the EE split

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/11835509083
Commit: 3a7fda7
Cypress dashboard.
Tags: @tag.Datasource
Spec:


Thu, 14 Nov 2024 11:25:19 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced new routes for PluginActionEditor, AddQuery, and QueryEmpty with a standardized fallback UI.
  • Bug Fixes

    • Removed obsolete feature flag checks that prevented the rendering of the AppPluginActionEditor.
  • Chores

    • Deleted the AppPluginActionEditor component and its associated exports, streamlining the codebase.
  • Refactor

    • Improved the structure and clarity of hooks and component definitions.

Copy link
Contributor

coderabbitai bot commented Nov 14, 2024

Walkthrough

The changes in this pull request involve modifications to several components and hooks within the application. Key updates include enhancements to the useQueryAdd and useQueryEditorRoutes hooks, the removal of the AppPluginActionEditor component, and adjustments to the ApiEditorWrapper and QueryEditor components. Feature flag checks related to isActionRedesignEnabled have been eliminated, streamlining the rendering logic. Additionally, the introduction of a fallback UI for lazy-loaded components and updates to component signatures aim to improve code clarity and maintainability.

Changes

File Path Change Summary
app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx Modifications to useQueryAdd and useQueryEditorRoutes hooks; added feature flag check, introduced skeleton variable, updated component signatures.
app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx File deleted, removing the CE_AppPluginActionEditor component and its associated logic.
app/client/src/pages/Editor/APIEditor/index.tsx Removed feature flag check for isActionRedesignEnabled, eliminating conditional rendering of AppPluginActionEditor.
app/client/src/pages/Editor/AppPluginActionEditor/index.ts File deleted, removing the export of AppPluginActionEditor.
app/client/src/pages/Editor/QueryEditor/index.tsx Removed feature flag check for isActionRedesignEnabled and the import statement for AppPluginActionEditor, preserving core functionality.

Possibly related PRs

Suggested labels

IDE Product, Task, skip-changelog, IDE Pod, ok-to-test

Suggested reviewers

  • albinAppsmith
  • ayushpahwa

🎉 In the land of code where functions play,
Hooks and components dance and sway.
With flags removed, the path is clear,
A cleaner structure brings us cheer!
So let’s embrace this code delight,
As we code together, day and night! 🎈


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 the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Nov 14, 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 and nitpick comments (1)
app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx (1)

159-159: Consider lazy loading optimization

Good use of memoized skeleton component. However, consider implementing a loading delay to prevent flash of loading state for fast connections.

-  const skeleton = useMemo(() => <Skeleton />, []);
+  const skeleton = useMemo(() => {
+    const MinimalLoadingDelay = 100; // ms
+    return (
+      <Suspense fallback={
+        <DelayedFallback delay={MinimalLoadingDelay}>
+          <Skeleton />
+        </DelayedFallback>
+      } />
+    );
+  }, []);

Also applies to: 211-213, 228-230, 253-255, 265-267

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8a45e5a and 1b52487.

📒 Files selected for processing (5)
  • app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx (6 hunks)
  • app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx (0 hunks)
  • app/client/src/pages/Editor/APIEditor/index.tsx (0 hunks)
  • app/client/src/pages/Editor/AppPluginActionEditor/index.ts (0 hunks)
  • app/client/src/pages/Editor/QueryEditor/index.tsx (0 hunks)
💤 Files with no reviewable changes (4)
  • app/client/src/ee/pages/Editor/AppPluginActionEditor/AppPluginActionEditor.tsx
  • app/client/src/pages/Editor/APIEditor/index.tsx
  • app/client/src/pages/Editor/AppPluginActionEditor/index.ts
  • app/client/src/pages/Editor/QueryEditor/index.tsx
🔇 Additional comments (3)
app/client/src/ce/pages/Editor/IDE/EditorPane/Query/hooks.tsx (3)

54-57: LGTM: Improved variable declaration

The change from reassignment to const declaration enhances code clarity and follows immutability best practices.

Also applies to: 60-63


155-157: Verify feature flag usage across the codebase

The feature flag implementation for action redesign looks good, but we should ensure consistent usage.

Let's check for other usages of this feature flag:

#!/bin/bash
# Search for other uses of the same feature flag
rg "FEATURE_FLAG.release_actions_redesign_enabled" --type typescript

Also applies to: 277-281


114-121: Verify chunk loading behavior

The lazy loading implementation looks good and follows the established pattern.

Let's verify other similar lazy-loaded components for consistency:

✅ Verification successful

Let me try a different approach to find lazy-loaded components and verify the chunk loading pattern. The previous command might have failed due to the typescript file type not being recognized, so I'm using explicit type flags.


Let me try without file type restrictions since ripgrep seems to have issues with typescript/tsx file types in this environment.


Chunk loading implementation is consistent with codebase patterns

The implementation follows the established pattern in the codebase:

  • Uses proper webpack chunk naming convention (webpackChunkName: "PluginActionEditor")
  • Follows the same dynamic import pattern as other editor components (APIEditor, QueryEditor, JSEditor)
  • Located alongside other IDE-related lazy-loaded components in the same directory
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other lazy-loaded components with similar patterns
rg -U "lazy\(async \(\) =>\s+retryPromise\(" --type typescript

Length of output: 190


Script:

#!/bin/bash
# Search for lazy loading patterns with retryPromise, accounting for different whitespace
rg -U 'lazy\([^)]*retryPromise' --type ts --type tsx

# Also search for the specific import path to verify consistency
rg -U "import.*AppPluginActionEditor" --type ts --type tsx

Length of output: 171


Script:

#!/bin/bash
# Search for lazy loading patterns without file type restrictions
rg -U 'lazy\([^)]*retryPromise'

# Search for the specific import path
rg -U "import.*AppPluginActionEditor"

# Also look for other webpack chunk names to verify consistency
rg -U "webpackChunkName:.*"

Length of output: 3947

@hetunandu hetunandu added the ok-to-test Required label for CI label Nov 14, 2024
@hetunandu hetunandu merged commit 17537e7 into release Nov 14, 2024
50 checks passed
@hetunandu hetunandu deleted the chore/move-plugin-action-editor branch November 14, 2024 11:46
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
## Description

- Earlier we had the new Plugin Action Editor implementation mixed in
with the older API and Query Editor components. We have now separated it
out so that the eventual removal of older editors is easy
- Move AppPluginActionEditor outside the EE split

## Automation

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

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11835509083>
> Commit: 3a7fda7
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11835509083&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Datasource`
> Spec:
> <hr>Thu, 14 Nov 2024 11:25:19 UTC
<!-- end of auto-generated comment: Cypress test results  -->


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


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

## Summary by CodeRabbit

- **New Features**
- Introduced new routes for `PluginActionEditor`, `AddQuery`, and
`QueryEmpty` with a standardized fallback UI.
  
- **Bug Fixes**
- Removed obsolete feature flag checks that prevented the rendering of
the `AppPluginActionEditor`.

- **Chores**
- Deleted the `AppPluginActionEditor` component and its associated
exports, streamlining the codebase.

- **Refactor**
- Improved the structure and clarity of hooks and component definitions.

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

2 participants