-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Animate Save Icon When User Enters Comment Text #9362
Comments
Can I give it a shot! This one seems to implement some great functionality :D |
@waridrox Definitely, go ahead! |
Screen.Recording.2021-03-24.mp4
@noi5e What are your views on this 🤔 ? |
@waridrox This is great work so far, and good questions!
The plots2/app/assets/javascripts/editor.js Lines 10 to 11 in a44aff7
Which can be used to refer to the particular save button that needs to be updated: plots2/app/views/editor/_toolbar.html.erb Lines 81 to 90 in a44aff7
jQuery seems like the best tool to use in this situation. Perhaps the spinner icon can be a sibling of
plots2/app/assets/javascripts/editorToolbar.js Lines 26 to 32 in a44aff7
Nice! 🙌
Hmm... Personally I want users to be able to use a feature we already have, and for them to know about it in an intuitive way... I think this issue is the best way to do it that I can think of. But definitely open to hearing other ideas about how to do that! |
Thanks for the info! 😄 |
Update - @noi5e, here are 3 versions of the implementations, though there is still a small problem to resolve 😅. But which one according to you best suits the need ? Save button with the spinner icon Sample1.mp4Save button with no functionality Sample2.mp4Everything working as expected except the dark spinner background Sample3.mp4As you might have noticed, in sample1 and sample2 there are conflicting CSS styles at the save button which I can't figure it out yet that turn the save icon 💾 to the white color of the background 😅 when the save button is clicked. So I'm going forward with sample3 and adding the |
Here's the final implementation @noi5e, I'm really not sure how to make the CSS styles work without affecting when the 💾 icon when it is clicked. Maybe someone else can try that 😅. Other than that I've implemented what was required. |
Description
From a user interaction standpoint, it would be helpful to have the save icon blink whenever a user enters text into a comment form.
The save icon is the 💾 in the comment toolbar below:
See #9131, particularly this comment.
Currently the comment form saves every single time the input is changed. This isn't very useful to the user, so we'll also want to implement some kind of debouncing or
setTimeout
delay.Summary of Changes to Be Made
These changes can be done in separate PRs, and by different contributors. But they probably have to be done in sequence:
save
method ineditor.js
, either wait 1000ms, or only runsave
when user input has stopped for 500ms (you choose the time).save
method runs, so that user knows that it's running. Darken the icon background. Replace the 💾 with one of these FontAwesome spinner icons.Drag and drop to add an image or file, or choose one
withSaving...
to absolutely spell it out for the user.Useful Links & Images
What the end goal looks like:
![Screen Shot 2021-03-23 at 12 04 39 PM](https://user-images.githubusercontent.com/4361605/112203635-fe8bd480-8bcf-11eb-9c75-05b5c0e2002e.png)
These changes are going to be made in the comment/legacy editor, which lives at
app/assets/javascripts/editor.js
:plots2/app/assets/javascripts/editor.js
Lines 116 to 119 in 62fdcd0
Leave a comment below if you want to claim this issue, and post here if you need any help getting oriented to the codebase! Good luck! 🍀
The text was updated successfully, but these errors were encountered: