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

Viewport resizing #1145

Closed
JosefBredereck opened this issue Apr 13, 2020 · 3 comments
Closed

Viewport resizing #1145

JosefBredereck opened this issue Apr 13, 2020 · 3 comments

Comments

@JosefBredereck
Copy link
Contributor

Just took that feature request/issue from gitter from @dxsferrer

Hi there! I've been using PL2 for quite some time and now I am starting to play around with PL 3, and testing if I a migration is feasible. Among other things I have noticed that I can no longer manually set a viewport size (in PL2 it the px/rem indicators were editable). Also, when setting a max-width for "l" breakpoint (patternlab-config.json) it becomes the new global max-width and the iframe can no longer be resized above that point, thus the "full" button becomes quite useless. Are those constraints intended? Thank you so much!

I also found a todo in the code which would be great to be resolved
// @todo: re-add keyboard shortcuts to these

I will try to supply a fix for that.

Expected Behavior
  1. When I click on full size the viewport should resize to full window with independently from max size of config.ishViewportRange.l.

  2. When click into viewport size I can edit the value manually

Actual Behavior
  1. Even on clicking full size, the viewport gets resized to a maximum of size L.
  2. The value is not editable
Steps to Reproduce

Change value of config.ishViewportRange.l to 900 and serve patternlab. Click on full size.

@mfranzke
Copy link
Contributor

mfranzke commented Jan 1, 2022

@perriard was struggeling about the exact same behaviour as well and asked about the reasons why in gitter, as well as I do.

There seem to be some aspects on this one:

  • The maximum viewport size (of the iframe) is currently being determined from ishViewportRange.l, as stated on the documentation as well:

    The second entry in ishViewportRange.l is the ishViewportMaximum, which is now also obsolete.

    • Actually the configuration name ishViewportMaximum needs to get corrected to ishMaximum and still does exist (which is fine from by point of view, as this would provide a possibility to explicitly set the expected maximum viewport size), so we should probably update the documentation on this one.
  • As well as @perriard and you I would expect the "Full" button to expand the viewport (iframe) to 100% screen size (minus the menu width on the left side), instead of an (default: implicitly determined) maximum value, if ishMaximum is unset.
    • So to both still support this current behaviour, but even also provide an explicit overwrite for the actual size of the "Full" buttons viewport, what about another configuration option?

@JosefBredereck, what do you think? Or am I missing some implementation for this ticket e.g. out of the linked pull requests?

@JosefBredereck
Copy link
Contributor Author

The logic happens in the utils/viewport-sizes, and as far as I can tell, the docs are not correct anymore ishMaximum would be the new value.

The default value is also 2600 if nothing is set. I think this is a value resulting from the lack of 4k monitors when we put it. Nevertheless, I think the config with our ranges is correct and If you want to have it always on fullscreen or the real max, add ishMaximum with 10000 to the configuration.

@mfranzke
Copy link
Contributor

mfranzke commented Jan 1, 2022

Thanks, @JosefBredereck. I can take care regarding the docs.

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

No branches or pull requests

2 participants