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 modal popup layout and scrolling #6413

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

softwarenerd
Copy link
Contributor

@softwarenerd softwarenerd commented Feb 20, 2025

Description

This PR addresses #3061 by updating how modal popups are laid out.

Tests:
@:data-explorer
@:new-project-wizard

Release Notes

New Features

  • N/A

Bug Fixes

QA Notes

We will need to think about how we can test this code in an end-to-end test.

Copy link

github-actions bot commented Feb 20, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:data-explorer @:new-project-wizard

readme  valid tags

sharon-wang
sharon-wang previously approved these changes Feb 21, 2025
Copy link
Member

@sharon-wang sharon-wang left a comment

Choose a reason for hiding this comment

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

Working well for me locally in the Project Wizard and the Data Explorer filters 🙌

Could we also run the @:new-project-wizard tests as well?

Otherwise just some minor comments and LGTM!

sharon-wang
sharon-wang previously approved these changes Feb 21, 2025
Copy link
Member

@sharon-wang sharon-wang left a comment

Choose a reason for hiding this comment

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

LGTM pending CI! ✅

Copy link
Contributor

@dhruvisompura dhruvisompura left a comment

Choose a reason for hiding this comment

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

This changed worked for the console info panel! There was some scenarios for small widths that caused the popup to get cut off but I think that has to do with the anchor point for the popup getting cut off and not scaling. Overall a much better improvement than what we had before.

I did have a comment and a couple questions but overall looks great!

positionBottom();
} else if (childrenHeight < anchorLayout.anchorY - 1) {
} if (props.popupPosition === 'top') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be an else if since its nested as part of this entire if/else block?

// Calculate the max height. This is the height of the search UI plus the height of the rows,
// plus the height of the top and bottom rows margin.
const maxHeight =
(enableSearch ? 34 : 0) +
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make 34 a constant value called SEARCH_BAR_HEIGHT or something like that so it feels less like a magic number?

};

/**
* Positions the popup aligned with the right edge of the anchor element.
*/
const positionRight = () => {
popupLayout.right = documentWidth - (anchorLayout.anchorX + anchorLayout.anchorWidth);
if (isNumber(props.width)) {
popupLayout.left = (anchorX + anchorWidth) - props.width - LAYOUT_OFFSET;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably just a me thing, but what is LAYOUT_OFFSET representing? Is this taking into account a border? or is it just shifting the layout over a tad bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a bug. - LAYOUT_OFFSET has been removed.

@softwarenerd
Copy link
Contributor Author

This changed worked for the console info panel! There was some scenarios for small widths that caused the popup to get cut off but I think that has to do with the anchor point for the popup getting cut off and not scaling. Overall a much better improvement than what we had before.

I did have a comment and a couple questions but overall looks great!

This PR dealt almost exclusively with vertical layout and vertical scrolling, which is where the major problems of #3061 were to be found. I still have to deal with horizontal layout issues. I was not able to do this work in this PR because it was time-boxed for this milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants