Skip to content

chore: EE widgets register and allow onboarding text for non main canvas widgets#39364

Merged
ashit-rath merged 4 commits intoreleasefrom
chore/ee-widgets
Feb 24, 2025
Merged

chore: EE widgets register and allow onboarding text for non main canvas widgets#39364
ashit-rath merged 4 commits intoreleasefrom
chore/ee-widgets

Conversation

@ashit-rath
Copy link
Contributor

@ashit-rath ashit-rath commented Feb 19, 2025

Description

Adds a new folder widgets under ee to have EE specific widget and right now the requirement is from UI modules.

The other changes is to allow to show Drag and drop a widget here text when there are no widgets dropped inside a canvas widget if it has flag showOnboardingText to true. Right now it is hardwired for main canvas only. This is a requirement for the UI module; since there would a container like widget as the starting point of a UI module, the empty state text has to be shown for the said container like widget.

PR for https://github.com/appsmithorg/appsmith-ee/pull/6272

Automation

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

🔍 Cypress test results

Tip

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


Mon, 24 Feb 2025 06:05:12 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Expanded widget options with a newly introduced widget collection that broadens the available selections.
    • Enhanced onboarding display across interface components by adding configurable options for showing onboarding guidance, providing a smoother and more intuitive user experience.

@ashit-rath ashit-rath self-assigned this Feb 19, 2025
@ashit-rath ashit-rath requested a review from a team as a code owner February 19, 2025 11:58
@ashit-rath ashit-rath requested review from AnaghHegde and removed request for a team February 19, 2025 11:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2025

Walkthrough

This pull request introduces a new constant EEWidgets for future widget management, incorporated into the overall widget list. The DropTargetComponent and FixedLayoutEditorCanvas components now accept an optional property showOnboardingText, enhancing control over onboarding text visibility. The changes include updated condition checks and memoization dependencies while maintaining the existing component structure.

Changes

File(s) Change Summary
app/client/src/ee/widgets/index.ts
app/client/src/widgets/index.ts
Added a new constant EEWidgets (initialized as an empty array) and imported it into the Widgets array to extend widget options.
app/client/src/layoutSystems/common/dropTarget/DropTargetComponent.tsx
app/client/src/layoutSystems/fixedlayout/canvas/FixedLayoutEditorCanvas.tsx
Introduced an optional property showOnboardingText to control onboarding text visibility. Modified condition logic and memoization to include the new property.

Possibly related PRs

  • chore: Updating types for support on EE #37077: The changes in the main PR, which introduce a new constant EEWidgets, are related as it includes an import statement for EEWidgets in the Widgets array.
  • chore: move chat widget to EE repo #36845: The changes in the main PR, which introduce the EEWidgets constant, are related as both involve modifications to the widgets structure, specifically the inclusion of EEWidgets in the Widgets array.

Suggested labels

Bug, IDE Product, IDE Pod

Suggested reviewers

  • hetunandu
  • ApekshaBhosale
  • ankitakinger

Poem

Code blooms as new constants appear,
Widgets and onboarding now shine clear.
Conditions refined with a thoughtful twist,
Dropping targets with a welcome assist.
In our code garden, progress is near!
Cheers to changes that make the path bright!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed9d287 and a9ac967.

📒 Files selected for processing (1)
  • app/client/src/widgets/index.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/widgets/index.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-build / client-build
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-prettier / prettier-check

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@ashit-rath ashit-rath added Frontend This label marks the issue or pull request to reference client code Task A simple Todo Packages Pod issues that belong to the packages pod Packages & Git Pod All issues belonging to Packages and Git labels Feb 19, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Feb 19, 2025
@ashit-rath ashit-rath requested review from a team, brayn003 and rahulbarwal and removed request for AnaghHegde February 19, 2025 11:59
@ashit-rath ashit-rath added the ok-to-test Required label for CI label Feb 19, 2025
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

🧹 Nitpick comments (1)
app/client/src/layoutSystems/common/dropTarget/DropTargetComponent.tsx (1)

328-331: Consider using optional chaining for safer null checks.

The childWidgets check can be simplified using optional chaining.

-    !(childWidgets && childWidgets.length) &&
+    !childWidgets?.length &&
     !isDragging &&
     // If the parentId is not set (true for main canvas), or the showOnboardingText is true (for module canvas)
     (!props.parentId || props.showOnboardingText);
🧰 Tools
🪛 Biome (1.9.4)

[error] 328-328: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 084ba0f and ed9d287.

📒 Files selected for processing (4)
  • app/client/src/ee/widgets/index.ts (1 hunks)
  • app/client/src/layoutSystems/common/dropTarget/DropTargetComponent.tsx (2 hunks)
  • app/client/src/layoutSystems/fixedlayout/canvas/FixedLayoutEditorCanvas.tsx (2 hunks)
  • app/client/src/widgets/index.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/client/src/ee/widgets/index.ts
🧰 Additional context used
🪛 Biome (1.9.4)
app/client/src/layoutSystems/common/dropTarget/DropTargetComponent.tsx

[error] 328-328: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
🔇 Additional comments (4)
app/client/src/layoutSystems/fixedlayout/canvas/FixedLayoutEditorCanvas.tsx (1)

41-41: LGTM! Clean implementation of the showOnboardingText prop.

The prop is correctly added to fixedLayoutDropTargetProps and its dependency array.

Also applies to: 51-51

app/client/src/layoutSystems/common/dropTarget/DropTargetComponent.tsx (1)

55-55: LGTM! Type definition is properly extended.

The showOnboardingText optional prop is correctly added to DropTargetComponentProps.

app/client/src/widgets/index.ts (2)

93-93: LGTM! Clean import of EE widgets.

The import follows the established pattern for widget imports.


200-200:

Details

❓ Verification inconclusive

LGTM! Proper integration of EE widgets.

The EE widgets are correctly integrated into the Widgets array, maintaining type safety with BaseWidget.

Let's verify the EE widgets integration:


🏁 Script executed:

#!/bin/bash
# Description: Verify EE widgets folder structure and exports

# Check if ee/widgets folder exists and contains an index.ts
fd -t f "index.ts" -p "ee/widgets"

# Check if EEWidgets is properly exported
rg -l "export const EEWidgets" "ee/widgets"

Length of output: 225


EE Widgets Integration Check Requires Manual Verification

The code at app/client/src/widgets/index.ts (line 200) correctly uses the spread operator for EEWidgets, which seems to maintain type safety with BaseWidget. However, our automated search for the expected ee/widgets folder and the export of EEWidgets turned up no results. This suggests that EEWidgets may be defined or imported from a different location than initially assumed.

Please verify manually that:

  • The EEWidgets export exists in the codebase.
  • Its source location matches the intended design (or update the verification script if the folder path has changed).

@ashit-rath ashit-rath merged commit 8de6040 into release Feb 24, 2025
85 checks passed
@ashit-rath ashit-rath deleted the chore/ee-widgets branch February 24, 2025 07:18
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Apr 12, 2025
…vas widgets (appsmithorg#39364)

## Description
Adds a new folder `widgets` under ee to have EE specific widget and
right now the requirement is from UI modules.

The other changes is to allow to show `Drag and drop a widget here` text
when there are no widgets dropped inside a canvas widget if it has flag
`showOnboardingText` to true. Right now it is hardwired for main canvas
only. This is a requirement for the UI module; since there would a
container like widget as the starting point of a UI module, the empty
state text has to be shown for the said container like widget.


PR for appsmithorg/appsmith-ee#6272

## Automation

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

### 🔍 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/13490984047>
> Commit: a9ac967
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13490984047&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Mon, 24 Feb 2025 06:05:12 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**
- Expanded widget options with a newly introduced widget collection that
broadens the available selections.
- Enhanced onboarding display across interface components by adding
configurable options for showing onboarding guidance, providing a
smoother and more intuitive user experience.
<!-- 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

Frontend This label marks the issue or pull request to reference client code ok-to-test Required label for CI Packages & Git Pod All issues belonging to Packages and Git Packages Pod issues that belong to the packages pod 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.

2 participants