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

Editor: Mobile editor redesign #4456

Closed
wants to merge 17 commits into from

Conversation

DanReyLop
Copy link
Contributor

I'm working on #4266, the UI revamp of the mobile post editor. This is by far the most complex task I've started yet, so I'm submitting what I have for now to have early feedback.

The main problem here is that with the new UI (see #4266), desktop and mobile are diverging more and more. I'm trying to tackle it by splitting the editor and sidebar into even smaller components.

What is done:

  • Changed the mobile action bar to the new 'tab navigation'. Since with the new design the sidebar will be no longer be a sidebar per se, but another tab at the same level as the editor, I've removed the sidebar open/close animation.
  • Extracted the whole editor sidebar to its own component.
  • Extracted the "Publish" button to its own component, since it will have to be rendered both in the sidebar (desktop) and in the navigation header (mobile).
  • Some cleaning of the EditorSidebarHeader component, since now it's going to be a desktop-specific component.

The main UI changes are not yet implemented, so the "mobile" sidebar is still the old one (just now is rendered as a tab). There's still a lot of work to do, but if you could just take a look and tell me if you see something terribly wrong it would be great, so I don't lose time coding the wrong approach to this.

@aduth Feel free to add who you consider relevant to this PR.

@DanReyLop DanReyLop self-assigned this Mar 31, 2016
@DanReyLop DanReyLop added the [Feature] Post/Page Editor The editor for editing posts and pages. label Mar 31, 2016
@aduth
Copy link
Contributor

aduth commented Apr 1, 2016

I'll plan to take a closer look soon, but immediate thoughts that come to mind:

  • Can we split this into incremental pull requests? For example, I raised the idea of moving only the action bar to the sidebar as one step.
  • By "splitting the editor and sidebar into even smaller components", do you mean viewport-specific components? I'm fine with more granular components, but maintaining components for each viewport is already quite a pain.

@aduth aduth changed the title [IN PROGRESS] Mobile editor redesign Editor: Mobile editor redesign Apr 1, 2016
@aduth aduth changed the title Editor: Mobile editor redesign Editor: Mobile editor redesign (WIP) Apr 1, 2016
@DanReyLop
Copy link
Contributor Author

I'll see what I can do, I'll try to do the needed changes to get this into a shippable state before completing the redesign. I won't start with the action bar though. I have half-done the navigation bar so I'll finish that first. I agree it's better to do incremental PR if possible :)

By 'splitting' I mean, for example, the "Publish" button. Before, it was part of the GroundControl component, but with the redesign it's needed both in the mobile navigation bar, and in the desktop GroundControl, so I'm extracting that "tiny" button (which actually has quite a lot of logic) to its own component to minimize code duplication.

@aduth
Copy link
Contributor

aduth commented Apr 1, 2016

so I'm extracting that "tiny" button (which actually has quite a lot of logic) to its own component to minimize code duplication.

Ah, in which case, I'm totally on board.

I had also eventually planned to move the sidebar to its own component, so agree with the idea of doing so here.

const closeButtonAction = page.back.bind( page, allPostsUrl );
const closeButtonUrl = '';
const closeButtonAriaLabel = translate( 'Go back' );
const EditorSidebarHeader = React.createClass( {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain the rationale for moving this from stateless function component to a React.createClass object? If it's for the pure-render mixin, note that react-redux connect includes this functionality in its wrapping behavior (docs).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was for the PureRenderMixin, I didn't know about that react-redux behavior. That was the only reason, so I will revert this change.

@DanReyLop DanReyLop force-pushed the update/4266-mobile-editor-redesign branch from 3592363 to 57b2415 Compare April 3, 2016 13:38
@DanReyLop
Copy link
Contributor Author

Ok, I would say that what I have now it's functionally complete.

The navigation bar is complete, the rest is still pending.

Here are screenshots of the date picker. What do you think? It's a bit weird that the date picker button grows if the date string is long, but I think the information it provides is useful.

captura de pantalla 2016-04-05 a las 17 37 30
captura de pantalla 2016-04-05 a las 17 38 03

@DanReyLop DanReyLop 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 Apr 5, 2016
.editor-ground-control__time-button {
border-radius: 0 4px 4px 0;
@include breakpoint( ">660px" ) {
@include is-primary;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is awful. If you have a better alternative to making a button primary in desktop but normal in mobile, let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is awful. If you have a better alternative [...]

It doesn't seem that bad to me, to be honest. Seems the primary styling comes more as a consequence of its positioning adjacent the publish button, not that the date picker button is itself a primary action. However, in terms of implementation, instead of creating a separate mixin, could we simply change this to @extend .button.is-primary; ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@extend doesn't work inside @media queries. That was my first approach :(

Copy link
Contributor

Choose a reason for hiding this comment

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

@extend doesn't work inside @media queries. That was my first approach :(

Ah, well, that's a shame, though it at least appears to be an upcoming feature (sass/sass#1050).

Perhaps we'd be better to be more specific with the naming? A global mixin named is-primary doesn't seem exclusive to its application on a button (button-is-primary or is-primary-button come to mind).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, done.

@DanReyLop DanReyLop force-pushed the update/4266-mobile-editor-redesign branch from 1cd5be6 to b6f2e31 Compare April 5, 2016 20:07
@DanReyLop DanReyLop changed the title Editor: Mobile editor redesign (WIP) Editor: Mobile editor redesign Apr 6, 2016
@@ -1,49 +1,45 @@
/* eslint-disable vars-on-top */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll rebase and resolve the conflicts on this file when #4550 gets merged.

@DanReyLop DanReyLop force-pushed the update/4266-mobile-editor-redesign branch from 19ab894 to ea7ba8d Compare May 23, 2016 11:27
@apeatling
Copy link
Member

apeatling commented Jun 3, 2016

@aduth & @mtias: Is there any chance of moving this forward? If it is blocked on a difference in approach then I think we need to close this out and use lessons learned for future improvements.

@apeatling apeatling 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 Jun 3, 2016
@DanReyLop
Copy link
Contributor Author

I couldn't find time to work on the remaining comments, I'll do it this weekend. All the discussion is in the other (related) PR: #4686 , so I'm closing this one to reduce the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants