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

Render navigation and addons panels even when they are hidden #2336

Merged
merged 7 commits into from
Nov 24, 2017

Conversation

Hypnosphi
Copy link
Member

@Hypnosphi Hypnosphi commented Nov 18, 2017

Issue: #2280

Some addons (backgrounds, notes, probably others) send data from preview to addon panel when the former is rendered. The problem is that if the panel is hidden at that point, it's not actually rendered, so it will never receive that data.

What I did

Render addon panel with display: none when it should be hidden. Do the same with navigation panel just for consistency.

How to test

Open backgrounds and notes examples in cra-kitchen-sink, toggle addon panel with ⌘ ⇧ D

@codecov
Copy link

codecov bot commented Nov 18, 2017

Codecov Report

Merging #2336 into master will decrease coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2336      +/-   ##
=========================================
- Coverage   21.23%     21%   -0.23%     
=========================================
  Files         283     283              
  Lines        6155    6150       -5     
  Branches      727     732       +5     
=========================================
- Hits         1307    1292      -15     
- Misses       4298    4302       +4     
- Partials      550     556       +6
Impacted Files Coverage Δ
lib/ui/src/modules/ui/components/layout/index.js 78.43% <100%> (-1.93%) ⬇️
app/vue/src/server/utils.js 0% <0%> (-53.58%) ⬇️
lib/ui/src/modules/ui/components/layout/usplit.js 22.58% <0%> (-16.13%) ⬇️
.../ui/src/modules/ui/components/layout/dimensions.js 7.81% <0%> (-7.82%) ⬇️
addons/a11y/src/components/Report/Info.js 0% <0%> (ø) ⬆️
...res__/update-addon-info/update-addon-info.input.js 0% <0%> (ø) ⬆️
...es__/update-addon-info/update-addon-info.output.js 0% <0%> (ø) ⬆️
lib/ui/src/modules/shortcuts/actions/shortcuts.js 6.25% <0%> (ø) ⬆️
lib/ui/src/modules/api/actions/api.js 50.47% <0%> (ø) ⬆️
lib/ui/src/modules/ui/routes.js 0% <0%> (ø) ⬆️
... and 20 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 37c1645...2af6fa1. Read the comment docs.

@armandabric
Copy link
Contributor

I love this! We have currently the issue with it with some in house addons! If you need some help/feedback do not hesitate 😄

@Hypnosphi Hypnosphi requested a review from a team November 23, 2017 16:04
expect(markup).toMatch(/LeftPanel/);
expect(markup).toMatch(/DownPanel/);
expect(markup).toMatch(/Preview/);
expect(wrap).toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

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

This snapshot is huge, is there some sane way to deal with that, or is it inevitable?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can explicitly test the presence of particular styles instead

Copy link
Member Author

Choose a reason for hiding this comment

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

Did that

expect(markup).not.toMatch(/LeftPanel/);
expect(markup).not.toMatch(/DownPanel/);
expect(markup).toMatch(/Preview/);
expect(wrap).toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

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

same

expect(markup).not.toMatch(/LeftPanel/);
expect(markup).toMatch(/DownPanel/);
expect(markup).toMatch(/Preview/);
expect(wrap).toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

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

same

expect(markup).toMatch(/LeftPanel/);
expect(markup).not.toMatch(/DownPanel/);
expect(markup).toMatch(/Preview/);
expect(wrap).toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

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

same

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.

3 participants