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

Framework: Allow for a sans-sidebar layout and adjust accordingly #302

Merged
merged 9 commits into from
Nov 27, 2015

Conversation

shaunandrews
Copy link
Contributor

This PR aims to address two things:

  1. Broken notice's. Specifically notices that break the layout of the page.
  2. Broken layouts where there is no sidebar. Sometimes screens decide to hide the sidebar.

These are bugs that were introduce with the recent docked sidebar update, so I'm trying my best to get them fixed.

The solution to broken notices was to move all the layout-related CSS from .wp-primary to .wp-content — which contains notices. This means no more funky layouts when you see a notice.

Once I made that change (and after hearing a few reports of busted layouts) I noticed that notices were still broken on screens without a sidebar. Moreover, screens without a sidebar were busted in general. So, I worked to fix the broken layouts (and notices in the process) by creating a new state for layout: context.layout.setState( { noSidebar: true } ); will now remove any extra padding/margin so you don't have to. This should replace any negative margins or the .is-full class.

You can check the notices by submitting a blank payment form at /checkout or (if you're like me) looking at a Jetpack site that has connection issues.

The noSidebar stuff is scattered throughout, including /login, /me/next/welcome, /checkout/thank-you, '/devdocs, and/sites`.

@shaunandrews shaunandrews self-assigned this Nov 20, 2015
@shaunandrews shaunandrews changed the title Fix/notice layout Framework: Allow for a sans-sidebar layout and adjust accordingly Nov 20, 2015
@shaunandrews shaunandrews added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Nov 20, 2015
@shaunandrews
Copy link
Contributor Author

I should make note that this will affect the /auth/login screen, which used to use .is-full. I can't seem to get the login screen to load locally.

@rickybanister rickybanister added the [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR label Nov 20, 2015
@rickybanister
Copy link

I checked /plugins and /settings and a few other places and notices all look good from my checks.

@ebinnion
Copy link
Contributor

I added the context.layout.setState( { noSidebar: true } ) line to the accept invite controller, and it fixes the layout for me 😄

@@ -93,6 +94,10 @@ module.exports = React.createClass( {
'is-active': this.state.isLoading
} );

if ( this.state.noSidebar ) {
sectionClass += ' sidebar-off';
Copy link
Member

Choose a reason for hiding this comment

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

We should write this one as is-sidebar-off for good measure.

@mtias mtias added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 22, 2015
@mtias
Copy link
Member

mtias commented Nov 22, 2015

I'm seeing this in Devdocs:

image

@mtias
Copy link
Member

mtias commented Nov 23, 2015

I'll pick this up after launch.

@shaunandrews
Copy link
Contributor Author

This is breaking the sidebar on mobile right now. I'm working on a fix. Fixed.

@deBhal
Copy link
Contributor

deBhal commented Nov 26, 2015

Can I get the Translator Invitation on the radar here too? You can see it by setting localStorage.calypsoTranslatorInvitationIsPending = true and refreshing the page.

It looks like this PR already fixes it, so hopefully it's no extra work (right now it's under the sidebar #469 ).

Not all the elements on the screen live inside .wp-primary. Things like
notices are children to the primary element. This causes some hassles
with the new sidebar layout. To make it easier, lets apply our layout
styles to .wp-content. Along the way I moved the sidebar width to a
variable.
This avoids the misaligned dismiss button mentioned in #214

Removing the unnecessary adjustments on <Notice> for the sidebar — this
is all handled by the notice’s parent element .wp-content. Also fixed
.is-pinned to work with the new margins and widths. For some reason, I
can’t use the $sidebar-width-min/max SCSS variables here.
Use the new noSidebar layout state on the welcome screen.

Making the new noSidebar state actually do something — in this case, it
removes the extra padding thats not needed without the sidebar.

Switching everything to use to new noSidebar layout.

Making sure the padding on wp-content is 8px on mobile.
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.

10 participants