-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add keyboard-navigation feature
#3242
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
Conversation
Not the review discussion comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I tested it looks like its working. Will work on in tomorrow morning some more. Thanks for reviewing! |
fregante
left a comment
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's 4-part suggestion to split the shortcutClass.has(event.key) check in 2 pieces (since you're already checking these keys specifically: ['j', 'k'].includes(event.key))
Co-Authored-By: Fregante <opensource@bfred.it>
This reverts commit 71d2e1b.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Here's a requested change, but reviews can't be minimized.
|
@fregante I spent about 2 hours trying to figure out another solution. I need the popup to open, for review comments editing and the hide to work. Maybe you can help me. Side note: I think the feature is fully functional and working well |
This reverts commit d673891.
| const items = select.all('.js-targetable-element') | ||
| .filter(comment => !comment.querySelector('.minimized-comment:not(.d-none)')); |
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.
This filter does not work correctly it needs to check also for '.js-minimizable-comment-group'.
Can I do the following?
| const items = select.all('.js-targetable-element') | |
| .filter(comment => !comment.querySelector('.minimized-comment:not(.d-none)')); | |
| const itemsSelectors = pageDetect.isPRFiles ? '.js-targetable-element' : '.js-minimizable-comment-group' | |
| const items = select.all(itemsSelectors) | |
| .filter(comment => !comment.querySelector('.minimized-comment:not(.d-none)')); |
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.
If by "does not work correctly" you mean "it highlights reviews but they don't have a highlight outline", then the solution could be:
.js-targetable-element:not([id^="pullrequestreview"])
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
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.
That's fine. Minimized comments are still comments. A future shortcut could open them
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.
.js-targetable-element:not([id^="pullrequestreview"])
Let's also use this
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.
Sorry that this PR is taking so long, but I want to get it right 😅
Honestly I'd also drop the e/d shortcuts for now. I feel that:
- file/comment navigation is already super useful on its own
- on their own, delete/edit aren't actions one needs to take that frequently.
We could discuss this separately and merge this before tomorrow's release if those shortcuts are temporarily dropped.
The following suggestions can be applied at once to remove those 2 shortcuts
readme.md
Outdated
| - [](# "minimize-upload-bar") [Reduces the upload bar to a small button.](https://user-images.githubusercontent.com/55841/59802383-3d994180-92e9-11e9-835d-60de67611c30.png) | ||
| - [](# "clean-rich-text-editor") [Hides unnecessary comment field tooltips and toolbar items](https://user-images.githubusercontent.com/1402241/53629083-a4fe8900-3c47-11e9-8211-bfe2d254ffcb.png) (each one has a keyboard shortcut.) | ||
| - [](# "monospace-textareas") Use a monospace font for all textareas. | ||
| - [](# "keyboard-navigation") Adds shortcuts to comments: <kbd>j</kbd> focuses the comment below; <kbd>k</kbd> focuses the comment above; <kbd>e</kbd> edits the focused comment; <kbd>d</kbd> deletes the focused comment. |
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.
| - [](# "keyboard-navigation") Adds shortcuts to comments: <kbd>j</kbd> focuses the comment below; <kbd>k</kbd> focuses the comment above; <kbd>e</kbd> edits the focused comment; <kbd>d</kbd> deletes the focused comment. | |
| - [](# "keyboard-navigation") Adds shortcuts to comments and PR files: <kbd>j</kbd> focuses the comment below.. |
Co-authored-by: Fregante <opensource@bfred.it>
Thanks for working with me!! Applied will test later tonight |
|
Tested. Its good with me except for #3242 (comment) |
fregante
left a comment
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.
I haven't re-tested it, but it looks good
Co-authored-by: Fregante <opensource@bfred.it>
|
You made it! I opened a new issue for the remaining concerns: #3319 |

LINKED ISSUES:
Closes Navigating Issues/PRs with keyboard shortcuts #1270
TEST URLS:
Navigating Issues/PRs with keyboard shortcuts #1270
SCREENSHOT:
None
Adds the following shortcuts: