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

feat: move building blocks to bottom of widget explorer #35270

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

jacquesikot
Copy link
Contributor

@jacquesikot jacquesikot commented Jul 29, 2024

Description

Problem
While we don't have the configuration interface for blocks, we should make them available as we have other regular widgets, but we shouldn't promote them for new users, since they are not able to easily modify them.
Remove the building blocks empty state that is creating confusion.

Solution

  1. Move the building blocks group to the bottom of the widget sidebar
  2. Adjust tests to suit new demands

Fixes #34964

Automation

/ok-to-test tags="@tag.IDE, @tag.Widget, @tag.Templates"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10187244230
Commit: e0aac0e
Cypress dashboard.
Tags: @tag.IDE, @tag.Widget, @tag.Templates
Spec:


Wed, 31 Jul 2024 21:39:07 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Simplified the onboarding component to display static content instead of dynamic behavior based on application state.
  • Bug Fixes

    • Updated test cases for the onboarding component to ensure it does not render in preview mode, enhancing accuracy in expected behavior.
    • Revised tests to reflect changes in the visibility of the suggested widgets based on feature flag settings.
  • Chores

    • Minor reorganization of import statements and constants for clarity without affecting functionality.
    • Streamlined the visibility logic of suggested widgets by removing unnecessary feature flag dependencies.

Copy link
Contributor

coderabbitai bot commented Jul 29, 2024

Walkthrough

The recent code changes aim to streamline the onboarding experience and enhance clarity within the codebase. The onboarding component has been simplified to a static presentation, removing unnecessary dynamic elements that depended on application state. Additionally, import statements have been reorganized across various files to improve code readability without impacting functionality. These adjustments contribute to a more intuitive user experience and enhanced component usability.

Changes

Files Change Summary
app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts Reorganized import statements for clarity; no functional changes.
app/client/src/constants/WidgetConstants.tsx Temporarily removed and re-added BUILDING_BLOCKS in the WIDGET_TAGS constant; no value changes.
app/client/src/layoutSystems/common/dropTarget/OnBoarding/OnBoarding.test.tsx Updated tests to reflect new behavior of the onboarding component in preview mode; removed a test case.
app/client/src/layoutSystems/common/dropTarget/OnBoarding/index.tsx Simplified the Onboarding component to a static output with no dynamic rendering logic.
app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx Eliminated unused feature flag and hook, simplifying widget visibility logic.
app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx Changed test to assert presence of suggested widgets when a feature flag is enabled; adjusted querying method.

Assessment against linked issues

Objective Addressed Explanation
Promote suggested widgets and put building blocks as a regular section in the end of the UI elements list (##34964) Building blocks have been simplified, improving their integration as regular items.
Remove the building blocks empty state that is creating confusion (##34964) Dynamic elements have been removed, addressing potential confusion.
Turn on the feature to 100% (##34964) No changes were made to fully activate building blocks as regular widgets.

Poem

In code we weave, with care and grace,
Components shift, find their place.
Onboarding's now a static sight,
Simplified for user delight.
Widgets stand, both proud and tall,
A clearer path for one and all! ✨


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

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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 Integrations Product Issues related to a specific integration Learnability Issues affecting the product learnability, making the product harder for new users. Task A simple Todo Enhancement New feature or request labels Jul 29, 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 (1)
app/client/src/layoutSystems/common/dropTarget/OnBoarding/OnBoarding.test.tsx (1)

Line range hint 85-102:
Remove redundant test case.

The test case is identical to the previous one and is redundant. Consider removing it to avoid confusion.

-  it("3. does not render onboarding component when in preview mode", () => {
-    mockUseCurrentEditorStatePerTestCase(EditorEntityTab.UI);
-    const previewModeStore = {
-      ...storeToUseWithDragDropBuildingBlocksEnabled,
-      ui: {
-        ...storeToUseWithDragDropBuildingBlocksEnabled.ui,
-        gitSync: {
-          protectedBranches: false,
-        },
-        editor: {
-          isPreviewMode: true,
-        },
-      },
-    };
-    render(BaseComponentRender(previewModeStore));
-
-    const buildingBlockOnboardingElement = screen.queryByText(
-      createMessage(EMPTY_CANVAS_HINTS.DRAG_DROP_BUILDING_BLOCK_HINT.TITLE),
-    );
-    const onboardingElement = screen.queryByText(
-      createMessage(EMPTY_CANVAS_HINTS.DRAG_DROP_WIDGET_HINT),
-    );
-    expect(buildingBlockOnboardingElement).not.toBeInTheDocument();
-    expect(onboardingElement).toBeInTheDocument();
-  });
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7146bdc and e6f1cb1.

Files selected for processing (4)
  • app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts (1 hunks)
  • app/client/src/constants/WidgetConstants.tsx (2 hunks)
  • app/client/src/layoutSystems/common/dropTarget/OnBoarding/OnBoarding.test.tsx (1 hunks)
  • app/client/src/layoutSystems/common/dropTarget/OnBoarding/index.tsx (1 hunks)
Files skipped from review due to trivial changes (3)
  • app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts
  • app/client/src/constants/WidgetConstants.tsx
  • app/client/src/layoutSystems/common/dropTarget/OnBoarding/index.tsx
Additional comments not posted (2)
app/client/src/layoutSystems/common/dropTarget/OnBoarding/OnBoarding.test.tsx (2)

59-81: Great job! Ensure consistency in test descriptions.

The updated test case correctly checks that the onboarding component does not render in preview mode. However, ensure that the test description is consistent with other similar test cases for clarity.


Line range hint 140-160:
Well done! The test case is clear and consistent.

The test case correctly ensures that the onboarding component does not render in preview mode for the AirGap edition.

@jacquesikot jacquesikot changed the title feat: rearrange widget groups in explorer feat: move building blocks to bottom of widget explorer Jul 29, 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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e6f1cb1 and b22d3bb.

Files selected for processing (1)
  • app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx (3 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx

@jacquesikot
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

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

@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 29, 2024
Copy link

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

@jacquesikot jacquesikot requested a review from rahulbarwal July 30, 2024 08:58
@jacquesikot jacquesikot dismissed rahulbarwal’s stale review July 30, 2024 15:13

Review has been addressed

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b22d3bb and e0aac0e.

Files selected for processing (1)
  • app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx (1 hunks)
Additional comments not posted (5)
app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx (5)

124-128: Good job updating the test case to reflect the new requirements!

The change from queryByText to getByText is appropriate as it ensures the test will fail if the "Suggested" section is not present when the feature flag is enabled.


Line range hint 29-35:
Well done on ensuring the search input and "Suggested" section are rendered correctly!

The test case is clear and verifies the essential elements are present in the UI.


Line range hint 37-47:
Great job on testing the component's robustness with an empty cards array!

This test case ensures that the component handles edge cases gracefully, which is crucial for maintaining a robust application.


Line range hint 49-57:
Excellent work on verifying the display of grouped widget cards!

This test case ensures that the component behaves correctly when the feature flag is disabled, which is crucial for maintaining expected functionality.


Line range hint 59-70:
Nice job on testing the search functionality!

This test case ensures that the component filters the widget cards correctly based on user input, which is essential for a good user experience.

@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 31, 2024
@jacquesikot jacquesikot added the ok-to-test Required label for CI label Jul 31, 2024
@Nikhil-Nandagopal Nikhil-Nandagopal added Widgets Product This label groups issues related to widgets and removed Widgets & Blocks Pod labels Jul 31, 2024
@github-actions github-actions bot added the Query & JS Pod Issues related to the query & JS Pod label Jul 31, 2024
@jacquesikot jacquesikot added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 31, 2024
@jacquesikot jacquesikot merged commit e8cb460 into release Aug 1, 2024
85 of 106 checks passed
@jacquesikot jacquesikot deleted the feat/rearrange-widget-groups-in-explorer branch August 1, 2024 13:01
@coderabbitai coderabbitai bot mentioned this pull request Oct 30, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Integrations Product Issues related to a specific integration Learnability Issues affecting the product learnability, making the product harder for new users. ok-to-test Required label for CI Query & JS Pod Issues related to the query & JS Pod Task A simple Todo Widgets Product This label groups issues related to widgets
Projects
None yet
3 participants