-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
avoid-accidental-submissions
: Keep focus and inform the user
#4556
avoid-accidental-submissions
: Keep focus and inform the user
#4556
Conversation
avoid-accidental-submissions
keep focus and show messageavoid-accidental-submissions
keep focus and show message
On second thought, this feels a bit the like the opposite of what it was: The prevention was silent and now it's too loud. 😅 Possible improvements:
I think the second bullet might be best because:
Open to more suggestions. @darkred Either way wait until we decide before updating the readme |
I am leaning towards option 2. I will try out the branch later today and let you know my final thoughts. |
@yakov116 if this message makes sense, I think it should be shown everywhere the feature runs. It wouldn’t make sense to be visible in some places and just change the behavior silently in others. |
I agree. My thinking is that when merging and commiting the submit button is just below the textArea. So another button confirm right below is unnecessary. I want to try out the branch to checkout the annoyance level and will give you feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darkred instead of checking isIssue and empty fields, what matters to us is whether the form can be submitted. There might be other logic hidden in the form and it’s best to just verify whether the submit button is disabled. Selecting the right button on every page we cover could be troublesome but [type=submit] should bring you almost all the way there. |
I now have added a main + if (select.exists('.btn-primary[type="submit"]:not([disabled])')) {
if (pageDetect.isNewFile() || pageDetect.isEditingFile() || pageDetect.isPRConversation()) {
focusedInput.after(message);
} else {
focusedInput.parentElement!.append(message);
}
+ } But, if I disable RG, then the button is initially disabled with empty title, as expected: Update: |
|
Can you open an issue for that bug? |
Yes, here: #4565 |
I don't quite understand what you mean: The contained if (pageDetect.isNewFile() || pageDetect.isEditingFile() || pageDetect.isPRConversation()) {
// ..
} else {
// .. is still needed, it's for a different reason: to create the message with either |
Co-authored-by: Federico Brigante <me@fregante.com>
Co-authored-by: Federico Brigante <me@fregante.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes required, but no gif update necessary.
} | ||
|
||
const message = ( | ||
<p className="rgh-avoid-accidental-submissions my-1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Federico Brigante <me@fregante.com>
…https://github.com/darkred/refined-github into avoid-accidental-submissions-keep-focus-show-message
Co-authored-by: yakov116 <16872793+yakov116@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for the many screenshots
Co-authored-by: Federico Brigante <me@fregante.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fregante don't co-author by me when merging, I only added a lint.
avoid-accidental-submissions
keep focus and show messageavoid-accidental-submissions
: Keep focus and inform the user
Thanks @darkred! |
I've been seen it today. It looks pleasant 😌 |
Closes #4462 (based on #4462 (comment) and #4462 (comment))
The feature now:
abovebelow the title/commit field.Test URLs
Screenshots
New issue:
New PR:
Merge PR commit:
'create new file' commit:
Notes to reviewers:
<code>
tags for the keys ?readme.md
should be updated accordingly in the end.