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: Anvil Modal rendering issues when added via property pane. #33161

Merged
merged 10 commits into from
May 7, 2024

Conversation

marks0351
Copy link
Contributor

@marks0351 marks0351 commented May 3, 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.

Fixes #31889
Fixes #33205
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/8983872645
Commit: a243293
Cypress dashboard url: Click here!

Communication

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

  • Yes
  • No

marks0351 added 3 commits May 3, 2024 12:28
Modal widget is rendered as a skeleton widget until evaluations are returned which causes a glitch.

Modal should render its own version of loader when loading until then Modal will not be rendered until evaluations are returned.
Copy link
Contributor

coderabbitai bot commented May 3, 2024

Walkthrough

The updates primarily focus on refining URL handling in editor and preview modes, and modifying widget rendering logic in the Anvil system. The changes enhance user experience by maintaining widget selections and improving error handling for different widget types.

Changes

File Path Summary of Changes
.../src/ce/sagas/PageSagas.tsx Updated URL logic for editor modes and added isEditorPath import.
.../anvil/editor/AnvilEditorDetachedWidgetOnion.tsx Removed AnvilWidgetComponent, added AnvilErrorBoundary, and updated rendering logic based on widget type.
.../anvil/viewer/AnvilViewerDetachedWidgetOnion.tsx Replaced AnvilWidgetComponent with AnvilErrorBoundary and updated rendering conditionally based on widget type.
.../sagas/selectors.tsx Implemented memoization in getAllDetachedWidgetIds for potential performance improvement.
.../integrations/modalSelectors.ts Added getCurrentlyOpenWidgets memoized function for optimizing performance in filtering open modal widgets.

Assessment against linked issues

Objective Addressed Explanation
Resolve the issue causing the whole canvas to flicker when a modal is added through the action selector (#31889) The changes do not directly address the flickering issue when adding a modal through the action selector.
Enhance modal widget behavior and performance (#30788) While the changes do not directly focus on modal widgets, the improved error handling and performance optimizations could indirectly benefit modal behavior and user experience.

Possibly related issues


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 Anvil Pod Issue related to Anvil project Anvil team issues related to the new layout system anvil Bug Something isn't working High This issue blocks a user from building or impacts a lot of users WDS team labels May 3, 2024
@marks0351 marks0351 added the ok-to-test Required label for CI label May 3, 2024
@marks0351 marks0351 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 6, 2024
@marks0351 marks0351 changed the title fix: Anvil Modal rendering issues fix: Anvil Modal rendering issues when added via property pane. May 6, 2024
@marks0351 marks0351 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels May 6, 2024
@marks0351 marks0351 requested a review from riodeuno May 6, 2024 06:18
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: 1

Out of diff range and nitpick comments (1)
app/client/src/layoutSystems/anvil/integrations/modalSelectors.ts (1)

5-12: Consider adding type annotations for better type safety and clarity.

Adding type annotations to the function parameters and return type can help improve the readability and maintainability of the code by making the expected types explicit.

Comment on lines 80 to 84
export const getAllDetachedWidgetIds = memoize((state: AppState) => {
return Object.values(state.entities.canvasWidgets)
.filter((widget: FlattenedWidgetProps) => !!widget.detachFromLayout)
.map((widget: FlattenedWidgetProps) => widget.widgetId);
};
});
Copy link
Contributor

@coderabbitai coderabbitai bot May 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize the memoization of getAllDetachedWidgetIds to enhance performance.

Consider refining the memoization of getAllDetachedWidgetIds to ensure that it only recomputes when necessary. This can be achieved by providing a more specific dependency array or by using a more efficient memoization technique.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using only the canvasWidgets state now, instead of the entire state.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marks0351, your update to use only the canvasWidgets state for memoization in getAllDetachedWidgetIds is a solid improvement. By narrowing down the dependency to just the relevant part of the state, you've effectively optimized the function to only recompute when necessary, which should enhance performance. Great job on refining this!

If you have any more areas where you think performance could be improved or need further assistance, feel free to ask!

@marks0351
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented May 6, 2024

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

@github-actions github-actions bot added the Deploy Preview Issues found in Deploy Preview label May 6, 2024
Copy link

github-actions bot commented May 6, 2024

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

@marks0351 marks0351 removed the ok-to-test Required label for CI label May 7, 2024
@marks0351 marks0351 added the ok-to-test Required label for CI label May 7, 2024
@marks0351 marks0351 merged commit c86fad8 into release May 7, 2024
41 checks passed
@marks0351 marks0351 deleted the modal-glitch branch May 7, 2024 11:00
@ramsaptami ramsaptami removed the Deploy Preview Issues found in Deploy Preview label Jul 9, 2024
@github-actions github-actions bot added the Verified When issue is retested post its fixed label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Anvil Pod Issue related to Anvil project Anvil team issues related to the new layout system anvil Bug Something isn't working High This issue blocks a user from building or impacts a lot of users ok-to-test Required label for CI Verified When issue is retested post its fixed WDS team
Projects
None yet
3 participants