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

Add "busy button" and Publish Flow. #3682

Merged
merged 3 commits into from
Nov 28, 2017
Merged

Conversation

mtias
Copy link
Member

@mtias mtias commented Nov 27, 2017

image

See #3496.

  • Figure out how to distinguish "publishing..." from "updating...".

cc @jasmussen @karmatosed

@mtias mtias added the Design label Nov 27, 2017
@mtias mtias changed the title Add/busy button pubish flow Add "busy button" and publish flow. Nov 27, 2017
@mtias mtias changed the title Add "busy button" and publish flow. Add "busy button" and Publish Flow. Nov 27, 2017
@codecov
Copy link

codecov bot commented Nov 27, 2017

Codecov Report

Merging #3682 into master will increase coverage by 0.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3682      +/-   ##
==========================================
+ Coverage    37.3%   37.46%   +0.15%     
==========================================
  Files         277      277              
  Lines        6690     6711      +21     
  Branches     1214     1221       +7     
==========================================
+ Hits         2496     2514      +18     
- Misses       3536     3539       +3     
  Partials      658      658
Impacted Files Coverage Δ
components/button/index.js 90.9% <ø> (ø) ⬆️
...tor/components/post-publish-with-dropdown/index.js 0% <ø> (ø) ⬆️
editor/effects.js 58.87% <100%> (+0.8%) ⬆️
editor/selectors.js 93.43% <100%> (+0.31%) ⬆️
editor/components/post-publish-button/label.js 87.5% <100%> (+4.16%) ⬆️
editor/components/post-featured-image/index.js 35.29% <0%> (+13.07%) ⬆️

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 1db24fc...ec4dc7c. Read the comment docs.

@aduth
Copy link
Member

aduth commented Nov 27, 2017

Pushed ec4dc7c which implements the isPublishingPost selector. One challenge with this implementation was knowing the transaction ID associated with the in-progress save. Since we previously generated a unique ID, we couldn't necessarily know this without otherwise saving a reference to it. With my changes, this was updated to a static value that can be referenced directly by the selector. I don't think this should be an issue, both because we don't allow simultaneous save requests to occur, but even if we did, from what I can tell redux-optimist will still clear itself out when the doubled-up transaction is committed. Another option could be to check whether a transaction has already begun when saving the post, and commit it prior to beginning a new one.

cc @youknowriad

@youknowriad
Copy link
Contributor

Changing the label of the button while saving introduces a weird flickering (the button size changes and reverts quickly) while auto-saving. Do you we could avoid changing the label and just add an is-busy style?

@jasmussen
Copy link
Contributor

Changing the label of the button while saving introduces a weird flickering (the button size changes and reverts quickly) while auto-saving. Do you we could avoid changing the label and just add an is-busy style?

This is a good point, but it may be worth it. Two options I can think of:

  1. We add a min-width to the button, so the label can increase in width, without a judder. Probably not scalable with translations.
  2. We add a transition to the button width, and see if that makes it feel less jarring — it could potentially be a non-issue.

What do you think?

@youknowriad
Copy link
Contributor

youknowriad commented Nov 28, 2017

Fixing the width would have been great but it's not possible with translations. I can live with it, but I think we should avoid the label changing at least for "auto-saves" because it's not an "explicit" click and it's a duplicated information with the Saving indicator.

@jasmussen
Copy link
Contributor

Agreed, we have the save status indicator for the autosave, the button itself should probably be only for publishing, updating, and scheduling, as well as "working" versions of those.

Riad in a little noodling on this branch I can't get the CSS transition to have any effect on the width of this — is there something I'm missing or is it just not possible?

@youknowriad
Copy link
Contributor

Riad in a little noodling on this branch I can't get the CSS transition to have any effect on the width of this — is there something I'm missing or is it just not possible?

I think it's because the width property do not change, it's the content that changes

@jasmussen
Copy link
Contributor

I think you're probably right. I tried some tricks, but couldn't get it to work.

@StaggerLeee
Copy link

What is that "gradient" on your button ?

@mtias
Copy link
Member Author

mtias commented Nov 28, 2017

It's a transition that signals something is happening and the button is not just disabled.

@mtias mtias merged commit 8d3e230 into master Nov 28, 2017
@mtias mtias deleted the add/busy-button-pubish-flow branch November 28, 2017 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants