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

New Save Button component #7515

Closed
JohnONolan opened this issue Oct 7, 2016 · 4 comments
Closed

New Save Button component #7515

JohnONolan opened this issue Oct 7, 2016 · 4 comments
Assignees
Labels
affects:admin Anything relating to Ghost Admin css / design / mobile Minor UI issues

Comments

@JohnONolan
Copy link
Member

image

Updated design for save button component, with 4 states:

1. Default

  • Button appears normal, and reads "Save"
  • When button is clicked, go to saving

2. Saving

  • Button gets animated SVG loading spinner, and still reads "Save"
  • Button automatically transitions to either success or fail

3. Success

  • Button gets SVG check icon, which animates-in, and reads "Saved"
  • Button Remains in this state
  • When button is clicked, go to saving

4. Fail

  • Button gets SVG x icon, which animates-in, and reads "Retry"
  • Button Remains in this state
  • When button is clicked, go to saving

Notes

  • Colours and button style are unimportant / just for reference. The important thing is the icons and the behaviour.
  • I found an SVG loading spinner generator here
  • I don't have an animated check or X icon, we'll need to either find or make them
  • Button should not change width between states
  • This issue isn't a priority that needs doing right now, just creating it so that it exists!
@kevinansfield
Copy link
Contributor

Do we want to have the spinner displayed for a certain period or can the switch to the Saved state be nearly instantaneous?

@Saytuamin
Copy link

This idea would definitely be welcome, The current save button is rather basic and it would be good to update it to a more responsive design.

kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Mar 7, 2017
refs TryGhost/Ghost#7515
- changes to `gh-task-button`:
  - can take `buttonText` (default: "Save"), `runningText` ("Saving"), `successText` ("Saved"), and `failureText` ("Retry") params
  - positional param for `buttonText`
  - default button display can be overridden by passing in a block, in that scenario the component will yield a hash containing all states to be used in this fashion:
    ```
    {{#gh-task-button task=myTask as |task|}}
    {{if task.isIdle "Save me"}}
    {{if task.isRunning "Saving"}}
    {{if task.isSuccess "Thank you!"}}
    {{if task.isFailure "Nooooooo!"}}
    {{/gh-task-button}}
    ```
- update existing uses of `gh-task-button` to match new component signature
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Mar 7, 2017
refs TryGhost/Ghost#7515
- changes to `gh-task-button`:
  - can take `buttonText` (default: "Save"), `runningText` ("Saving"), `successText` ("Saved"), and `failureText` ("Retry") params
  - positional param for `buttonText`
  - default button display can be overridden by passing in a block, in that scenario the component will yield a hash containing all states to be used in this fashion:
    ```
    {{#gh-task-button task=myTask as |task|}}
    {{if task.isIdle "Save me"}}
    {{if task.isRunning "Saving"}}
    {{if task.isSuccess "Thank you!"}}
    {{if task.isFailure "Nooooooo!"}}
    {{/gh-task-button}}
    ```
- update existing uses of `gh-task-button` to match new component signature
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Mar 7, 2017
refs TryGhost/Ghost#7515
- changes to `gh-task-button`:
  - can take `buttonText` (default: "Save"), `runningText` ("Saving"), `successText` ("Saved"), and `failureText` ("Retry") params
  - positional param for `buttonText`
  - default button display can be overridden by passing in a block, in that scenario the component will yield a hash containing all states to be used in this fashion:
    ```
    {{#gh-task-button task=myTask as |task|}}
    {{if task.isIdle "Save me"}}
    {{if task.isRunning "Saving"}}
    {{if task.isSuccess "Thank you!"}}
    {{if task.isFailure "Nooooooo!"}}
    {{/gh-task-button}}
    ```
- update existing uses of `gh-task-button` to match new component signature
acburdine pushed a commit to TryGhost/Admin that referenced this issue Mar 7, 2017
refs TryGhost/Ghost#7515
- changes to `gh-task-button`:
  - can take `buttonText` (default: "Save"), `runningText` ("Saving"), `successText` ("Saved"), and `failureText` ("Retry") params
  - positional param for `buttonText`
  - default button display can be overridden by passing in a block, in that scenario the component will yield a hash containing all states to be used in this fashion:
    ```
    {{#gh-task-button task=myTask as |task|}}
    {{if task.isIdle "Save me"}}
    {{if task.isRunning "Saving"}}
    {{if task.isSuccess "Thank you!"}}
    {{if task.isFailure "Nooooooo!"}}
    {{/gh-task-button}}
    ```
- update existing uses of `gh-task-button` to match new component signature
@kevinansfield
Copy link
Contributor

The functionality for this has been added via TryGhost/Admin#566. We still have some design work left, namely the animated icons and a review of how the fixed-width should work if the success/failure message is longer than the default message.

There are still a few places where we are not yet using the save-state button, these are being tracked in #7865

@kevinansfield kevinansfield added this to the 1.0.0 milestone Mar 13, 2017
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Apr 11, 2017
refs TryGhost/Ghost#7515
- adds animated spinner and check SVG icons
- improves SVG sizing/alignment in buttons
- disables old technique of fixing button size because it doesn't work now that buttons have more than a single spinner when running/saved/failed
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Apr 11, 2017
refs TryGhost/Ghost#7515
- adds animated spinner and check SVG icons
- improves SVG sizing/alignment in buttons
- disables old technique of fixing button size because it doesn't work now that buttons have more than a single spinner when running/saved/failed
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Apr 11, 2017
refs TryGhost/Ghost#7515
- adds animated spinner and check SVG icons
- improves SVG sizing/alignment in buttons
- disables old technique of fixing button size because it doesn't work now that buttons have more than a single spinner when running/saved/failed
- fixes broken spinner in `gh-spin-button` components
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Apr 11, 2017
refs TryGhost/Ghost#7515
- adds animated spinner and check SVG icons
- improves SVG sizing/alignment in buttons
- disables old technique of fixing button size because it doesn't work now that buttons have more than a single spinner when running/saved/failed
- fixes broken spinner in `gh-spin-button` components
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Apr 11, 2017
refs TryGhost/Ghost#7515
- adds animated spinner and check SVG icons
- improves SVG sizing/alignment in buttons
- disables old technique of fixing button size because it doesn't work now that buttons have more than a single spinner when running/saved/failed
- fixes broken spinner in `gh-spin-button` components
ErisDS pushed a commit to TryGhost/Admin that referenced this issue Apr 11, 2017
refs TryGhost/Ghost#7515
- adds animated spinner and check SVG icons
- improves SVG sizing/alignment in buttons
- disables old technique of fixing button size because it doesn't work now that buttons have more than a single spinner when running/saved/failed
- fixes broken spinner in `gh-spin-button` components
kevinansfield added a commit to TryGhost/Admin that referenced this issue Apr 14, 2017
refs TryGhost/Ghost#7515
- add a `retry` icon that better matches button text dimensions
- add a spin animation for the retry icon
- use the new retry icon in the default `gh-task-button` template
- add a "restart animation" method to `gh-task-button` so that repeated clicks on a button appear to register the action when local validation means that there's no transition from failed->running->failed
@kevinansfield
Copy link
Contributor

Closing as complete. The fixed-width requirement still needs some work/discussion so I've opened a new issue for that #8341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin css / design / mobile Minor UI issues
Projects
None yet
Development

No branches or pull requests

3 participants