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

Addon-backgrounds: set background on iframe instead of adding a wrapper in preview #2807

Merged
merged 6 commits into from
Feb 16, 2018

Conversation

Hypnosphi
Copy link
Member

@Hypnosphi Hypnosphi commented Jan 22, 2018

It fixes second part of #2655


This change is Reviewable

@Hypnosphi Hypnosphi added bug addon: backgrounds patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jan 22, 2018
@codecov
Copy link

codecov bot commented Jan 22, 2018

Codecov Report

Merging #2807 into master will decrease coverage by 1.56%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2807      +/-   ##
=========================================
- Coverage   37.37%   35.8%   -1.57%     
=========================================
  Files         426     428       +2     
  Lines        9151    9422     +271     
  Branches      870     965      +95     
=========================================
- Hits         3420    3374      -46     
- Misses       5184    5410     +226     
- Partials      547     638      +91
Impacted Files Coverage Δ
addons/background/src/index.js 80% <100%> (-6.37%) ⬇️
addons/background/src/BackgroundPanel.js 92.3% <80%> (-1.64%) ⬇️
app/vue/src/server/config/babel.js 0% <0%> (-100%) ⬇️
app/vue/src/server/utils.js 0% <0%> (-100%) ⬇️
app/react/src/server/babel_config.js 0% <0%> (-76.67%) ⬇️
addons/knobs/src/components/types/Select.js 7.93% <0%> (-16.71%) ⬇️
addons/knobs/src/base.js 6.66% <0%> (-5.1%) ⬇️
addons/info/src/components/types/OneOfType.js 57.14% <0%> (-2.86%) ⬇️
addons/info/src/components/types/PrettyPropType.js 85.71% <0%> (-0.29%) ⬇️
lib/ui/src/modules/ui/components/layout/index.js 29.28% <0%> (ø) ⬆️
... and 114 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7211cd...1d41762. Read the comment docs.

@ndelangen
Copy link
Member

@Hypnosphi We can actually improve this addon a lot.

We can set the iframe background to be transparent, and set the background in the manager.

What do you think?

@Hypnosphi
Copy link
Member Author

@ndelangen Sorry, missed your comment.

Yeah, that sounds like a good idea, will try.

@Hypnosphi
Copy link
Member Author

Hypnosphi commented Jan 25, 2018

@ndelangen wouls your idea mean an API change? Currently the addon is used as decorator, which implies that it adds something to preview not manager

UPD: nevermind, I can just render the story as is

@Hypnosphi
Copy link
Member Author

Another problem is, addons can't currently add things anywhere in manager outside of the addons panel. Should we allow them?

@ndelangen
Copy link
Member

@Hypnosphi the viewport addon seems to be able to just fine?

@Hypnosphi Hypnosphi changed the title Addon-backgrounds: place story outside of background element Addon-backgrounds: set background on iframe instead of adding a wrapper in preview Jan 26, 2018
@Hypnosphi Hypnosphi requested a review from a team February 15, 2018 12:24
Copy link
Member

@igor-dv igor-dv left a comment

Choose a reason for hiding this comment

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

LGTM, but I wonder if these changes are considered backward compatible. For example for people that use both, storyshots and background addons.

@Hypnosphi
Copy link
Member Author

Do you mean that people will need to update their snapshots? To me personally it seems OK. Plus we're actually removing noise from storyshots: https://github.com/storybooks/storybook/pull/2807/files#diff-261e00eb9848ef08cfb37eb5e7e0b012

@igor-dv
Copy link
Member

igor-dv commented Feb 15, 2018

Yeah, that what I meant. Maybe it worth adding some note about it, Just to reduce confusion... I don't know where though

@Hypnosphi
Copy link
Member Author

I'm pretty sure we're introducing changes that can affect existing snapshots all the time

@Hypnosphi Hypnosphi merged commit cd5dc85 into master Feb 16, 2018
@Hypnosphi Hypnosphi deleted the put-stories-outside branch February 16, 2018 09:04
@Hypnosphi Hypnosphi added patch:done Patch/release PRs already cherry-picked to main/release branch and removed patch:done Patch/release PRs already cherry-picked to main/release branch labels Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: backgrounds bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants