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

Add different viewMode for iframed stories on Docs Tab #13444

Open
manuelmeister opened this issue Dec 14, 2020 · 5 comments
Open

Add different viewMode for iframed stories on Docs Tab #13444

manuelmeister opened this issue Dec 14, 2020 · 5 comments

Comments

@manuelmeister
Copy link
Contributor

manuelmeister commented Dec 14, 2020

Is your feature request related to a problem? Please describe
Inside the Canvas / Preview Tab, I globally want to wrap my stories and display a header (title and additional information). But I don't want to wrap them on the Docs Tab.

I tried to create a decorator and check if StoryContext.viewMode == 'docs' but as described in #12566, the viewMode is always story for iframed stories.

Describe the solution you'd like
Aa different viewMode for the iFrame should be used. Either docsStory inside the Docs Tab or canvas instead of story on the Canvas / Preview Tab.

Describe alternatives you've considered
Currently in my project, we wrap the component(s) inside the template, which means:

  1. Redundancy (title, description, …) on the Docs Tab
  2. Obstructing the component itself on the Docs Tab (only our wrapper/header is visible and the components move below the fold)
  3. We don't have enough benefits to migrate from storiesOf to CSF or MDX now, because we would have to touch everything again when the angular integration is more matured.

Are you able to assist to bring the feature to reality?
Yes, I just don't understand the/all implications or strategic decisions.

Additional context
I use storybook together with angular. This means that currently there is no way to inline the story inside the docs.

@manuelmeister
Copy link
Contributor Author

@shilman should I try to implement this, or does this need to be discussed?

@shilman
Copy link
Member

shilman commented Dec 20, 2020

Probably needs discussion. How would you implement it?

@manuelmeister
Copy link
Contributor Author

@shilman I'm not sure it has to be viewMode. I think it would be great if each story (and its decorators) knows where it is.

This could be composed like:

viewContext: 'canvas' | 'docs' | 'iframe';
storyMode: 'inline' | 'iframe';

@shilman
Copy link
Member

shilman commented May 27, 2021

We're in the process of redoing this for 7.0, which is coming up: #14911

To be frank, it's probably worth waiting until all of that is ready and re-evaluating at that point.

@manuelmeister manuelmeister changed the title Add viewMode for iframed stories on Docs Tab Add different viewMode for iframed stories on Docs Tab May 27, 2021
@shilman shilman removed the P2 label Oct 18, 2022
@valentinpalkovic
Copy link
Contributor

@manuelmeister As 7.0 is released, would you mind revisiting this issue? :)

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