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

fix: Remove collapsed widget tags #34979

Merged
merged 3 commits into from
Jul 23, 2024
Merged

fix: Remove collapsed widget tags #34979

merged 3 commits into from
Jul 23, 2024

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Jul 17, 2024

Description

Reverses the collapsible widget tags introduced in #34644

Automation

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

🔍 Cypress test results

Tip

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


Tue, 23 Jul 2024 06:29:58 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced the behavior of the widget sidebar for improved user interaction.
  • Bug Fixes

    • Removed automated test setup that could affect the initial state of the sidebar during testing.
  • Refactor

    • Simplified the logic for determining the initial expansion state of widget tags in the sidebar.
    • Adjusted the UIEntityTagGroup component to manage its visibility behavior statically instead of dynamically.
  • Tests

    • Updated the test suite for the UIEntitySidebar component to reflect changes in behavior regarding the "Building Blocks" section.

Copy link
Contributor

coderabbitai bot commented Jul 17, 2024

Walkthrough

The updates enhance the Widgets Sidebar's functionality and user experience through simplified state management in the UIEntitySidebar and UIEntityTagGroup. The removal of specific tests reflects a strategic shift, aiming to streamline component behavior and improve maintainability. Overall, these changes seek to create a more efficient and clear environment for both users and developers.

Changes

File Change Summary
.../cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts Removed the before hook from tests, altering automatic widget setup and impacting test initialization.
.../src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx Simplified initial open state logic by removing Redux selectors, focusing solely on widget tag presence.
.../src/pages/Editor/widgetSidebar/UIEntityTagGroup.tsx Eliminated isInitiallyOpen and onOpenChange props, suggesting a shift to a default closed state.
.../src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx Removed a test case for the "Building Blocks" section, indicating a refocus in testing strategy or relevance.

Poem

In the sidebar's realm, changes take flight,
With simpler logic, the code feels just right.
Widgets align in a more graceful dance,
Static states balance, giving new chance.
Tests evolve, shedding what's old,
A refined interface, a sight to behold!
🌈✨


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 the Bug Something isn't working label Jul 17, 2024
@hetunandu
Copy link
Member Author

/build-deploy-preview

@hetunandu hetunandu added the ok-to-test Required label for CI label Jul 17, 2024
Copy link

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6494b76 and 30f9b41.

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

162-162: Ensure proper integration of the isSearching condition.

Dear student, let's take a moment to appreciate the addition of the isSearching condition to the logic that determines if a section should be initially open. This is a crucial addition for enhancing user experience during searches. However, it's important to ensure that this new condition integrates seamlessly with the existing conditions isAnvil and hasWidgets.

Please verify that the logical combination of these conditions does not unintentionally affect other functionalities or the visibility of widget tags under different circumstances. It might be beneficial to add a few more test cases to cover scenarios where multiple conditions are true simultaneously.

Copy link

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

@jacquesikot
Copy link
Contributor

jacquesikot commented Jul 17, 2024

@hetunandu The experience still feels broken, the dropdown does not open the first time any widget is searched. It only opens after the input is cleared and searched for a second time. Here's a video to explain - https://www.loom.com/share/6d240f9fce1743af810c711a2f9168c6?sid=3dec1cb1-232b-4c77-a6df-676f60c339f7

@hetunandu hetunandu changed the title fix: Open Widget Tags when searching fix: Remove collapsed widget tags Jul 22, 2024
@hetunandu
Copy link
Member Author

Updated the PR to reverse the change as per conversation

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 30f9b41 and be3a608.

Files selected for processing (4)
  • app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts (1 hunks)
  • app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx (3 hunks)
  • app/client/src/pages/Editor/widgetSidebar/UIEntityTagGroup.tsx (3 hunks)
  • app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/pages/Editor/widgetSidebar/tests/UIEntitySidebar.test.tsx
Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx
Additional context used
Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
Additional comments not posted (3)
app/client/src/pages/Editor/widgetSidebar/UIEntityTagGroup.tsx (2)

Line range hint 13-17:
Verify the impact of removing isInitiallyOpen from Props.

The removal of the isInitiallyOpen property simplifies the interface. However, please ensure that this change does not break any existing functionality where this prop might have been used.

Verification successful

Let's correct our approach and re-run the search to ensure we capture any instances of isInitiallyOpen in the codebase.


The removal of isInitiallyOpen from the Props interface has been verified and does not impact the existing codebase.

  • No instances of isInitiallyOpen were found in the codebase, confirming that this property is not being used elsewhere.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `isInitiallyOpen` from `Props`.

# Test: Search for the usage of `isInitiallyOpen` in the codebase. Expect: No instances of `isInitiallyOpen` being used.
rg --type tsx --type ts 'isInitiallyOpen'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify the impact of removing `isInitiallyOpen` from `Props`.

# Test: Search for the usage of `isInitiallyOpen` in the codebase. Expect: No instances of `isInitiallyOpen` being used.
rg 'isInitiallyOpen' --glob '*.ts' --glob '*.tsx'

Length of output: 49


Line range hint 19-64:
Verify the component behavior after removing isInitiallyOpen.

The removal of the isInitiallyOpen state initialization simplifies the component's internal state management. Please ensure that the component behaves as expected without this prop, particularly in scenarios where the initial open state was previously controlled by isInitiallyOpen.

Verification successful

Let's correct the file type recognition issue and re-run the search to verify the usage of UIEntityTagGroup in the codebase.


Let's search for the isInitiallyOpen prop in the relevant files to confirm its removal and ensure it is not being used elsewhere in the codebase.


Verification complete: The isInitiallyOpen prop has been successfully removed and is not used elsewhere in the codebase.

The removal of the isInitiallyOpen state initialization simplifies the component's internal state management. The component should behave as expected without this prop, as confirmed by the absence of isInitiallyOpen in the relevant files.

  • UIEntityTagGroup.tsx
  • UIEntitySidebar.tsx
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the behavior of `UIEntityTagGroup` after removing `isInitiallyOpen`.

# Test: Search for the `UIEntityTagGroup` usage in the codebase. Expect: No instances where the initial open state is controlled by `isInitiallyOpen`.
rg --type tsx --type ts 'UIEntityTagGroup'

Length of output: 70


Script:

#!/bin/bash
# Description: Verify the behavior of `UIEntityTagGroup` after removing `isInitiallyOpen`.

# Test: Search for the `UIEntityTagGroup` usage in the codebase. Expect: No instances where the initial open state is controlled by `isInitiallyOpen`.
rg --glob '**/*.tsx' --glob '**/*.ts' 'UIEntityTagGroup'

Length of output: 467


Script:

#!/bin/bash
# Description: Verify the removal of `isInitiallyOpen` prop in the relevant files.

# Test: Search for `isInitiallyOpen` in the relevant files.
rg 'isInitiallyOpen' app/client/src/pages/Editor/widgetSidebar/UIEntityTagGroup.tsx app/client/src/pages/Editor/widgetSidebar/UIEntitySidebar.tsx

Length of output: 145

app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts (1)

Line range hint 1-136:
Verify the test behavior after removing the before hook.

The removal of the before hook changes the initial state of the tests. Please ensure that the tests still function correctly without this setup, particularly in scenarios where the initial state was previously controlled by the before hook.

@hetunandu hetunandu added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 22, 2024
@hetunandu hetunandu added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Jul 23, 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 be3a608 and c63a676.

Files selected for processing (2)
  • app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts (1 hunks)
  • app/client/src/pages/Editor/widgetSidebar/UIEntityTagGroup.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • app/client/cypress/e2e/Regression/ClientSide/ExplorerTests/Widgets_Sidebar.ts
  • app/client/src/pages/Editor/widgetSidebar/UIEntityTagGroup.tsx

@jacquesikot
Copy link
Contributor

/build-deploy-preview skip-tests=true

Copy link

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

@hetunandu hetunandu merged commit 7b5ad60 into release Jul 23, 2024
44 checks passed
@hetunandu hetunandu deleted the fix/widget-pane-search branch July 23, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants