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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Reverting Anvil currently open modal state implementation #33067

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

marks0351
Copy link
Member

@marks0351 marks0351 commented Apr 30, 2024

workerB

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

In #33040 we added a state exclusively to capture modals that are opened/closed to avoid computing which modal is open based on meta state.
However the problem with this approach that I had understood after testing it with deployed apps is that closing a modal is not done only via the saga, but is done via actions and the modal itself without dispatching the common saga.
Obviously the above implementation dunked.

Reverting to the previous implementation of relying on meta state to select visible detached widgets.

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

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

馃攳 Cypress test results

Tip

馃煝 馃煝 馃煝 All cypress tests have passed! 馃帀 馃帀 馃帀
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8895170744
Commit: 517ffc6
Cypress dashboard url: Click here!

Communication

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

  • Yes
  • No

Copy link
Contributor

coderabbitai bot commented Apr 30, 2024

Walkthrough

Walkthrough

The recent updates focus on removing features related to detached widgets in the Anvil layout system. This includes the elimination of specific Redux states, actions, and sagas associated with detached widgets. Additionally, there's an update in the CSS for widget overlay and a new selector function to handle widget IDs. The changes streamline the codebase by phasing out unused or redundant functionalities related to detached widgets.

Changes

File Path Change Summary
.../ce/reducers/index.tsx
.../ce/reducers/uiReducers/index.tsx
.../layoutSystems/anvil/integrations/sagas/index.ts
Removed references and functionalities related to AnvilDetachedWidgetsReduxState and associated reducers and sagas.
.../layoutSystems/anvil/integrations/actions/actionTypes.ts Removed actions related to show, hide, and reset operations for detached widgets.
.../layoutSystems/anvil/editor/canvasArenas/styles.module.css Added CSS for z-index management on .detachedWidgetsDropOverlay.
.../layoutSystems/anvil/integrations/modalSelectors.ts
.../sagas/selectors.tsx
Updated and added selectors for handling detached widget visibility and IDs.
.../layoutSystems/anvil/integrations/sagas/pasteSagas.ts Improved logic for determining when to trigger specific sagas based on layout.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 225fa5d and 517ffc6.
Files selected for processing (8)
  • app/client/src/ce/reducers/index.tsx (2 hunks)
  • app/client/src/ce/reducers/uiReducers/index.tsx (2 hunks)
  • app/client/src/layoutSystems/anvil/editor/canvasArenas/styles.module.css (1 hunks)
  • app/client/src/layoutSystems/anvil/integrations/actions/actionTypes.ts (1 hunks)
  • app/client/src/layoutSystems/anvil/integrations/modalSelectors.ts (1 hunks)
  • app/client/src/layoutSystems/anvil/integrations/sagas/index.ts (2 hunks)
  • app/client/src/layoutSystems/anvil/integrations/sagas/pasteSagas.ts (3 hunks)
  • app/client/src/sagas/selectors.tsx (1 hunks)
Files skipped from review due to trivial changes (4)
  • app/client/src/ce/reducers/index.tsx
  • app/client/src/layoutSystems/anvil/editor/canvasArenas/styles.module.css
  • app/client/src/layoutSystems/anvil/integrations/actions/actionTypes.ts
  • app/client/src/layoutSystems/anvil/integrations/sagas/index.ts
Additional comments not posted (4)
app/client/src/layoutSystems/anvil/integrations/modalSelectors.ts (1)

2-14: The updated filtering logic in getCurrentlyOpenAnvilDetachedWidgets aligns well with the PR's objectives to simplify state management around detached widgets. Good use of existing selectors to achieve the desired functionality.

app/client/src/layoutSystems/anvil/integrations/sagas/pasteSagas.ts (1)

125-136: The introduction of shouldCallSaga enhances the clarity and maintainability of saga execution conditions based on the Anvil layout. This change is a good example of improving code readability and control flow.

app/client/src/ce/reducers/uiReducers/index.tsx (1)

Line range hint 1-1: The removal of anvilDetachedWidgetsReducer from uiReducerObject correctly reflects the PR's objective to simplify the handling of detached widgets. This change should help in reducing the complexity of the state management.

app/client/src/sagas/selectors.tsx (1)

80-84: The addition of getAllDetachedWidgetIds is a well-implemented selector that supports the PR's goal of simplifying the management of detached widgets. The use of filtering based on detachFromLayout is appropriate and aligns with the changes made in other parts of the codebase.


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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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 Apr 30, 2024
@marks0351 marks0351 added the ok-to-test Required label for CI label Apr 30, 2024
@marks0351 marks0351 changed the title fix: Reverting Anvil open modal state implementation fix: Reverting Anvil currently open modal state implementation Apr 30, 2024
@marks0351 marks0351 requested a review from riodeuno April 30, 2024 13:28
@marks0351 marks0351 merged commit 3f222e5 into release Apr 30, 2024
49 of 50 checks passed
@marks0351 marks0351 deleted the anvil-modal-fixes branch April 30, 2024 13:57
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