Skip to content

Add arrow-up support when choosing labels in a PR - #2008

Closed
idasbiste wants to merge 8 commits into
refined-github:masterfrom
idasbiste:support-arrow-up-when-choosing-labels
Closed

idasbiste wants to merge 8 commits into
refined-github:masterfrom
idasbiste:support-arrow-up-when-choosing-labels

Conversation

@idasbiste

@idasbiste idasbiste commented May 3, 2019 •

Copy link
Copy Markdown
Contributor

This feature adds support for cycled list navigation with keyboard support when choosing labels for PRs.
The PR closes #1450 (I saw the project had an older but closed PR so I thought I could give it another try).


IssueHunt Summary

IssueHunt has been backed by the following sponsors. Become a sponsor

@fregante
fregante self-requested a review May 4, 2019 05:26
@sindresorhus

Copy link
Copy Markdown
Member

Why limit it to labels? Could be applied to any list popover, like Reviewers, Assignees, Project, Milestones, etc.

@fregante
fregante removed their request for review May 11, 2019 04:01
@idasbiste

idasbiste commented May 11, 2019 •

Copy link
Copy Markdown
Contributor Author

@sindresorhus I limited it to labels because of the issue but I'm more than happy to extend it to the other lists! 👍

@refined-github refined-github deleted a comment May 12, 2019

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge with master, it needs a description field because of #2030

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work for me in Firefox and Chrome on this PR. Screenshot to show you where I'm trying:

Also ensure that it works even if the list is filtered (i.e. the user typed "d" in the box)

Comment thread source/content.ts Outdated
import './features/edit-files-faster';
import './features/update-pr-from-base-branch';
import './features/hide-disabled-milestone-sorter';
import './features/circular-movement-on-sidebar-lists';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import './features/circular-movement-on-sidebar-lists';
import './features/cycle-lists-with-keyboard-shortcuts';

/**
* With this feature RGH will support cycled lists with keyboard support for arrow-up to navigate to the last item
* when pressed at the first one and for arrow-down to navigate to the first item when pressed at the last one
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description can be dropped

}

function init(): void {
document.addEventListener('keydown', event => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use delegate-it like in my previous PR https://github.com/sindresorhus/refined-github/pull/1569/files (onetime is no longer needed though)

id: 'circular-movement-on-sidebar-lists',
description: 'Circular movement with arrow-up and -down keys on sidebar lists in compare view',
include: [
features.isCompare

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the issue, it should work on a lot more pages


features.add({
id: 'circular-movement-on-sidebar-lists',
description: 'Circular movement with arrow-up and -down keys on sidebar lists in compare view',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: 'Circular movement with arrow-up and -down keys on sidebar lists in compare view',
description: 'Cycle "select lists" (labels, etc) when selecting them with the `↑` and `↓` keys.',

@fregante

fregante commented Jun 4, 2019

Copy link
Copy Markdown
Member

Ping on this, if you have time

@fregante

fregante commented Jun 7, 2019

Copy link
Copy Markdown
Member

Feel free to reopen this if you have time to pick it up again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Support pressing arrow-up when choosing labels

3 participants