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: fix modal position and styles #30805

Merged
merged 8 commits into from
Feb 6, 2024
Merged

fix: fix modal position and styles #30805

merged 8 commits into from
Feb 6, 2024

Conversation

KelvinOm
Copy link
Collaborator

@KelvinOm KelvinOm commented Jan 31, 2024

Description

Fixes for the modal widget:

  1. Added support for clickOutside. The modal is closed only by clicking on the backdrop overlay. A click on the widget name has been added to the exceptions for close event.
  2. Fixed the positioning of the modal. Now it is located in the center of the provider.
  3. For the correct positioning of the modal, it was necessary to make fixes for canvas height. The fixes also affect fixed and autolayout.

PR fixes following issue(s)

Fixes #30788

Also fixed this https://www.notion.so/appsmith/Canvas-gets-cut-off-on-preview-mode-525b95f26c6e4644bf5ab7389c02e434

Media

2024-02-02.11.22.46.mov

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (housekeeping or task changes that don't impact user perception)

Testing

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration.
Delete anything that is not relevant

  • Manual
  • JUnit
  • Jest
  • Cypress

Test Plan

Add Testsmith test cases links that relate to this PR

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • PR is being merged under a feature flag

QA activity:

  • Speedbreak features have been covered
  • Test plan covers all impacted features and areas of interest
  • Test plan has been peer reviewed by project stakeholders and other QA members
  • Manually tested functionality on DP
  • We had an implementation alignment call with stakeholders post QA Round 2
  • Cypress test cases have been added and approved by SDET/manual QA
  • Added Test Plan Approved label after Cypress tests were reviewed
  • Added Test Plan Approved label after JUnit tests were reviewed

Summary by CodeRabbit

  • New Features
    • Popover and Modal components now support dismissing by clicking outside. Custom logic and selectors can be specified to control this behavior.
  • Enhancements
    • Simplified logic for closing Modals by directly setting open state.
    • Enhanced Modal styling options, allowing for better customization of width and height.
    • ErrorBoundary component now supports custom styles.
  • Refactor
    • Removed redundant code and unused properties across various components and layout systems.
    • Simplified state management and styling adjustments in editor components.
  • Style
    • Updated Modal component styles for improved layout and responsiveness.
  • Chores
    • Codebase cleanup including removal of unused classes, variables, and adjustments for more efficient layout rendering.

@github-actions github-actions bot added the Bug Something isn't working label Jan 31, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Jan 31, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Jan 31, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Jan 31, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Jan 31, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Jan 31, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Jan 31, 2024
@KelvinOm KelvinOm force-pushed the fix/modal-issues branch 2 times, most recently from 81959cf to 8c346e2 Compare February 1, 2024 18:22
@KelvinOm KelvinOm marked this pull request as ready for review February 1, 2024 18:24
@KelvinOm KelvinOm requested review from a team, marks0351, sbalaji1192, riodeuno, prsidhu and jsartisan and removed request for a team, marks0351 and sbalaji1192 February 1, 2024 18:24
Copy link
Contributor

coderabbitai bot commented Feb 1, 2024

Walkthrough

Walkthrough

This update introduces enhanced interaction and customization options for both the Popover and Modal components, including the ability to control dismissal behaviors and style adjustments. It also simplifies modal management by streamlining the close functionality and updating CSS properties for better responsiveness. Additionally, the changes include improvements to error handling and layout adjustments across various components and systems, aimed at increasing flexibility, performance, and user experience.

Changes

Files Summary
.../design-system/headless/src/components/Popover/src/usePopover.ts
.../design-system/headless/src/components/Popover/src/types.ts
Added configuration for outside press dismissal and new properties for click outside behavior in Popover.
.../design-system/widgets/src/components/Modal/src/ModalFooter.tsx
.../design-system/widgets/src/components/Modal/src/ModalHeader.tsx
Simplified Modal close logic by removing redundant code.
.../design-system/widgets/src/components/Modal/src/styles.module.css
.../design-system/widgets/src/components/Modal/src/types.ts
Adjusted Modal CSS for responsiveness and added properties for click outside dismissal.
app/client/src/components/editorComponents/ErrorBoundry.tsx Enhanced ErrorBoundary with custom style prop.
app/client/src/layoutSystems/... Made layout and style adjustments across Anvil layout system components.
app/client/src/pages/... Simplified canvas rendering and updated styling in Editor and AppViewer pages.
app/client/src/widgets/wds/WDSModalWidget/widget/index.tsx Modified WDSModalWidget for visibility control and dismissal behavior.

Related issues

  • appsmithorg/appsmith#30788: This PR could be linked to address the objectives related to improving the modal widget's display on mobile devices, accessibility compliance, dismissal control, and performance issues, as it includes significant updates to modal behavior and styles.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added WDS team Anvil Pod Issue related to Anvil project labels Feb 2, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Feb 2, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Feb 2, 2024
@appsmithorg appsmithorg deleted a comment from github-actions bot Feb 2, 2024
Copy link

github-actions bot commented Feb 5, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7782324255.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/Widgets/Input/RTL_support.ts

  2. cypress/e2e/Regression/ClientSide/Widgets/TableV2/Inline_editing_2_spec.js
To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Feb 5, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7782324255.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@riodeuno
Copy link
Contributor

riodeuno commented Feb 5, 2024

@KelvinOm The changes look fine to me. The areas which are effected and need to be tested:

  • Canvas scrolling When banners like the following show up (Editor, Preview and Deployed)
    Screenshot 2024-02-05 at 4 53 23 PM
    Screenshot 2024-02-05 at 4 55 49 PM

  • The Main canvas resizer in AutoLayout.

I tested this briefly and found an issue:

Screen.Recording.2024-02-05.at.4.58.59.PM.mov

jsartisan
jsartisan previously approved these changes Feb 5, 2024
@KelvinOm
Copy link
Collaborator Author

KelvinOm commented Feb 5, 2024

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

Copy link

github-actions bot commented Feb 5, 2024

Whoa, @tag.All spotted in your test suite! 🚀
While @tag.All is cool, like a catch-all net, why not try specific tags? 🏷️
Narrow down your suite with specific tags for quicker and more accurate tests! 🚀 Less waiting, more zipping through tests like a ninja!
Explore the tags documentation here

Copy link

github-actions bot commented Feb 5, 2024

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7786771407.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

@KelvinOm
Copy link
Collaborator Author

KelvinOm commented Feb 5, 2024

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Feb 5, 2024

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

Copy link

github-actions bot commented Feb 5, 2024

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

@KelvinOm
Copy link
Collaborator Author

KelvinOm commented Feb 5, 2024

@KelvinOm The changes look fine to me. The areas which are effected and need to be tested:

  • Canvas scrolling When banners like the following show up (Editor, Preview and Deployed)
    Screenshot 2024-02-05 at 4 53 23 PM
    Screenshot 2024-02-05 at 4 55 49 PM
  • The Main canvas resizer in AutoLayout.

I tested this briefly and found an issue:

Screen.Recording.2024-02-05.at.4.58.59.PM.mov

Checked and fixed the behavior you mentioned.

2024-02-05.18.46.44.mov

Copy link

github-actions bot commented Feb 5, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7786771407.
Commit: ``.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/Apps/EchoApiCMS_spec.js

To know the list of identified flaky tests - Refer here

Copy link

github-actions bot commented Feb 5, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7786771407.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@KelvinOm KelvinOm merged commit f14b40c into release Feb 6, 2024
20 of 21 checks passed
@KelvinOm KelvinOm deleted the fix/modal-issues branch February 6, 2024 07:26
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 Bug Something isn't working WDS team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix modal widget issues
4 participants