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

[WIP] new layout-system #2101

Closed
wants to merge 22 commits into from
Closed

[WIP] new layout-system #2101

wants to merge 22 commits into from

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Oct 20, 2017

Work In Progress

New layout system:
This introduced a new core principle for storybook called 'layout'.
This can be set via a config.js or perhaps in the future could be set per story basis.

goals:

  • a config that describes the layout
  • implement config => render
  • support fullscreen switching
  • support switching addonPanel
  • support switching storiesPanel
  • write fantastic unittests for great covefe

stretch goals

  • allow setting of additional props
  • expose a list of default layouts importable for users
  • expose some utilities to help manage layouts
  • get global config from config.js
  • allow local config from story
  • allow modifying config at runtime

long stretch goals

  • persist changes
  • setting on where to persist (localstorage / config)
  • deal with discrepancies between local changes and config changes

@ndelangen
Copy link
Member Author

This is what the setup looks like:
screen shot 2017-10-20 at 10 43 40

This is what you do with this currently, although admittedly, having multiple previews is buggy right now.
screen shot 2017-10-20 at 10 37 34

@ndelangen
Copy link
Member Author

Progress update:
It's now possible to define "static analysable" uiOptions in a file called .storybook.js.

This file will be loaded into the manager directly, the preview does not push the options into the manager on first run. (It still can).
I'm investigating if There's more options here. Like can I use this file as a universal storybook config file, and place all storybook related configuration in a statically analysable way.

Something to discuss on the roadmap meeting 🎉

@ndelangen ndelangen changed the title Ndelangen/new layoutsystem [WIP] new layout-system Oct 23, 2017
@ndelangen
Copy link
Member Author

UPDATE:

I implemented:

  • support switching addonPanel
  • support switching storiesPanel

Made a video showcasing some of the functionality:
Video of the promised feature

@ndelangen
Copy link
Member Author

@shilman Can we discuss if this satisfies your idea of what must be done to get this merged into A 3.x release?

Anyone else on the @storybooks/team want to weigh in on that? @danielduan @Hypnosphi ?

@danielduan
Copy link
Member

I'm definitely leaning towards having this be 3.4. This does change Storybook's behavior for every possible user we have so it's definitely not a minor refactor.

However, if we can get this completed soon and go through a good amount of alpha testing, I could be convinced that this be included in 3.3.

@ndelangen
Copy link
Member Author

Definitely 3.4 or higher, 3.3 is locked for significant changes AFAIK.

@ndelangen
Copy link
Member Author

ndelangen commented Oct 29, 2017

🤣
screen shot 2017-10-29 at 09 42 23

@renaudtertrais
Copy link
Contributor

Could be great to be able to achieve those kind of layout:
image
image

@Hypnosphi Hypnosphi changed the base branch from release/3.3 to master December 23, 2017 23:56
@Hypnosphi Hypnosphi added this to the v4.0.0 milestone Mar 8, 2018
@ndelangen ndelangen closed this Apr 21, 2018
@gauthamchandra
Copy link

Hi, I was wondering if this is still being worked on (maybe in another PR)?

We wanted to customize the layout and styling for the storybook UI itself but as mentioned earlier in this issue, that's not currently possible due to the dynamically generated nature of the CSS classes.

I wouldn't mind helping out in this regard and opening a PR but wanted to make sure noone else is already working on this.

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

Successfully merging this pull request may close these issues.

5 participants