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

LPS-124271 Resolve computed image sized based on real media queries #3234

Closed
wants to merge 6 commits into from

Conversation

p2kmgcl
Copy link

@p2kmgcl p2kmgcl commented Dec 15, 2020

No description provided.

@liferay-continuous-integration
Copy link
Collaborator

To conserve resources, the PR Tester does not automatically run for every pull.

If your code changes were already tested in another pull, reference that pull in this pull so the test results can be analyzed.

If your pull was never tested, comment "ci:test" to run the PR Tester for this pull.

Instead of using viewports [min, max] sizes, we reuse existing
globalContext to check if any image media query matches, which
emulates CSS behavior and should produce the exact same result.

There is one situation where this process does not behave like
CSS: window resizing. If user changes window size without
closing/opening the sidebar panel, it won't update automatically.
I've intentionally ignored this situation because it would lead
to a lot of extra computation (a resize listener is not cheap)
and it does work if our viewport size selector is used.
@p2kmgcl p2kmgcl added the 🔍 Frontend Review Needed Frontend code needs to be reviewed by a member of the team. label Dec 15, 2020
@p2kmgcl
Copy link
Author

p2kmgcl commented Dec 15, 2020

ci:test:sf

@p2kmgcl
Copy link
Author

p2kmgcl commented Dec 15, 2020

ci:test:relevant

type === EDITABLE_TYPES.image && handleImageSizeChanged
type === EDITABLE_TYPES.image
? handleImageSizeChanged
: null
Copy link
Collaborator

Choose a reason for hiding this comment

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

propTypes were failing?

Copy link
Author

Choose a reason for hiding this comment

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

More or less. If you pass false to an optional value it cries, but if you pass null it's fine 😆

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 3 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 6f795f0a5e11372a48c9aac2b316396c96a7d53c

Sender Branch:

Branch Name: bg-im-124271
Branch GIT ID: 1df497e1566754a038e090b0d429d34f1faf89e0

1 out of 1jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator

@victorg1991
Copy link
Collaborator

LGTM, btw is this is a requirement of the story? Just wondering if we could just set the resolution based on the width from the viewports instead of relying on the current size of the window which would make things a bit simpler

@p2kmgcl
Copy link
Author

p2kmgcl commented Dec 15, 2020

LGTM, btw is this is a requirement of the story? Just wondering if we could just set the resolution based on the width from the viewports instead of relying on the current size of the window which would make things a bit simpler

Try if you dare

Sadly it didn't because:

  • Sometimes we do not have the "editableElement" (ex. container backgrounds)
  • Media queries are checked against viewport size, not element width, so I found (well, Tim found) that the resolution is not the same than the real CSS.

But yes, this is terribly complex and I would prefer not to include it
image

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:stable - 9 out of 9 jobs passed

❌ ci:test:relevant - 22 out of 25 jobs passed in 1 hour 51 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 6f795f0a5e11372a48c9aac2b316396c96a7d53c

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 0ff04d9f73a4643abdd2b335581feef26b985b8a

ci:test:stable - 9 out of 9 jobs PASSED
9 Successful Jobs:
ci:test:relevant - 22 out of 25 jobs PASSED
22 Successful Jobs:
For more details click here.

Failures unique to this pull:


Failures in common with acceptance upstream results at e02a7b7:

@victorg1991 victorg1991 added ✅ Ready to Merge Pull request is ready and can be forwarded. and removed 🔍 Frontend Review Needed Frontend code needs to be reviewed by a member of the team. labels Dec 15, 2020
@victorg1991
Copy link
Collaborator

Ship it!

@victorg1991
Copy link
Collaborator

Maybe some poshi tests need adjustement though

@Tim-Cao
Copy link

Tim-Cao commented Dec 15, 2020

Hi @p2kmgcl and @victorg1991, the Auto is not shown in Resolution field of Image fragment in non-desktop viewport by default when use direct Image Source. Could you have a look at?

@p2kmgcl
Copy link
Author

p2kmgcl commented Dec 15, 2020

On my way

@p2kmgcl
Copy link
Author

p2kmgcl commented Dec 15, 2020

@Tim-Cao I found to small issues, but the resolution is displayed correctly. Can you check with these changes?

@p2kmgcl
Copy link
Author

p2kmgcl commented Dec 15, 2020

ci:forward

@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:relevant
  •     ci:test:sf

The pull request will automatically be forwarded to the user brianchandotcom if the following test suites pass:

  •     ci:test:relevant
  •     ci:test:sf
  •     ci:test:stable

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 6f795f0a5e11372a48c9aac2b316396c96a7d53c

Sender Branch:

Branch Name: bg-im-124271
Branch GIT ID: 4deb7005868d6c48fb6119a181d585cfa50119f2

1 out of 1jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:stable - 9 out of 9 jobs passed

✔️ ci:test:relevant - 24 out of 25 jobs passed in 1 hour 45 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 6f795f0a5e11372a48c9aac2b316396c96a7d53c

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 0ff04d9f73a4643abdd2b335581feef26b985b8a

ci:test:stable - 9 out of 9 jobs PASSED
9 Successful Jobs:
ci:test:relevant - 23 out of 25 jobs PASSED
23 Successful Jobs:
For more details click here.

This pull contains no unique failures.


Failures in common with acceptance upstream results at 6f795f0:

@liferay-continuous-integration
Copy link
Collaborator

All required test suite(s) passed.
Forwarding pullrequest to brianchandotcom.

@liferay-continuous-integration
Copy link
Collaborator

Pull request has been successfully forwarded to brianchandotcom#96949

@liferay-continuous-integration
Copy link
Collaborator

@Tim-Cao
Copy link

Tim-Cao commented Dec 16, 2020

@p2kmgcl, works as expected

@p2kmgcl p2kmgcl deleted the bg-im-124271 branch August 24, 2021 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants