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

StorybookUI: Opening canvas in new tab should maintain custom properties (such as the background set for the canvas) #12430

Closed
iugabogdan opened this issue Sep 9, 2020 · 9 comments

Comments

@iugabogdan
Copy link

iugabogdan commented Sep 9, 2020

Describe the bug

Opening a canvas in new tab should maintain all the previous properties set on the canvas.

I am not sure if this is a bug or should be a feature. However I expect that if I set a particular background on the canvas, I expect to see it also in the new tab, because I want to see the canvas I edited before, right ?

Also, is there a way to override that background ? Or like providing some parameters ? like knobs. If yes then it would be perfect.

To Reproduce

  1. Open storybook UI - it should have backgrounds addon.
  2. Open any story
  3. Change the canvas default background to any other colour (grey for example)
  4. Click on: open canvas in new tab
  5. Check new tab -> the canvas has the default colour

Expected behavior
The canvas opened in new tab should have the background colour I have set in the story

Screenshots
How the canvas looks before I open it in new tab:
image

How it looks after it is opened in new tab:
image

System:
Environment Info:

System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 12.10.0 - ~/.nvm/versions/node/v12.10.0/bin/node
Yarn: 1.17.3 - ~/.nvm/versions/node/v12.10.0/bin/yarn
npm: 6.14.7 - ~/.nvm/versions/node/v12.10.0/bin/npm
Browsers:
Chrome: 84.0.4147.89
Safari: 13.1.2

@iugabogdan iugabogdan changed the title Opening canvas in new tab should maintain all the custom properties StorybookUI: Opening canvas in new tab should maintain custom properties (such as the background set for the canvas) Sep 9, 2020
@shilman
Copy link
Member

shilman commented Sep 9, 2020

cc @ndelangen @tmeasday

@tmeasday
Copy link
Member

I think we can (should?) do this for args and globals via query parameters. I think we've mooted doing it before @shilman? Was there a reason not to do it (beyond time)?

@shilman
Copy link
Member

shilman commented Sep 10, 2020

@tmeasday I think it's mostly a time constraint. I think we're storing globals in session storage now, so we get some of this for free.

I like the knobs solution of "exporting to URL" and "reading from URL" which is related: #12291

@iugabogdan
Copy link
Author

Thanks guys for looking into this, really appreciated!
Our use case is visual-comparison testing related. We basically want to open a story directly on the canvas parametrised with knobs, thus we will need to set the background of the canvas for some of the use cases, because for example, white components will blend into the white canvas.

@tmeasday
Copy link
Member

@iugabogdan -- I wonder why you wouldn't create a hardcoded story for the given args combinations (I realise you can't set globals in a Story, at least at the moment)?

@stale
Copy link

stale bot commented Oct 12, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Oct 12, 2020
@tmeasday tmeasday removed the inactive label Oct 12, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Dec 25, 2020
@shilman
Copy link
Member

shilman commented Mar 1, 2021

Possibly fixed by #13803

@stale stale bot removed the inactive label Mar 1, 2021
@iugabogdan
Copy link
Author

Yes, thanks a lot guys! Much appreciated! <3

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

No branches or pull requests

3 participants