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

Update go-mode hotkey filter #4704

Merged
merged 6 commits into from
Mar 9, 2018
Merged

Conversation

corylulu
Copy link
Contributor

@corylulu corylulu commented Mar 8, 2018

To match the other filters, will only show hotkeys that are enabled options, specific to the page, etc. Previously was showing every option on every page, despite the options having include set for specific pages.

Changed the names of all the 'Go to' hotkeys to start with "goto[Inbox|Frontpage|etc]" so it was more obvious which ones were linked with the Go-Mode function, based on it's description.
Reordered the options so that all the 'Go to' hotkeys and options were grouped together at the bottom.

Also made the popup show the friendly name.

chrome_2018-03-08_16-20-25

To match the other filters, will only show hotkeys that are enabled options, specific to the page, etc.
Changed the names of all the 'Go to' hotkeys to start with "goto[Inbox|Frontpage|etc]" so it was more obvious which ones were linked with the Go-Mode function, based on it's description. 

Also made the popup show the friendly name.
@@ -663,39 +663,39 @@ module.options = {
dependsOn: options => options.useGoMode.value,
callback() { if (module.options.useGoMode.value) toggleGoMode(); },
},
inbox: {
gotoInbox: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you change option keys, you also need to add a migration to move the value from the old key to the new key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll revert that part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any other ideas on how to best denote which options are go-mode enabled? Should I just group them better, all at the bottom of the list?

Copy link
Collaborator

@jewel-andraia jewel-andraia left a comment

Choose a reason for hiding this comment

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

Is it worth changing the option key names?

Grouped all the goto options together to make it more obvious which ones were affected.
@corylulu
Copy link
Contributor Author

corylulu commented Mar 9, 2018

Okay, I instead grouped all the options together and at the bottom.

chrome_2018-03-08_16-35-36

const goModes = filterMap(Object.entries(module.options), ([key, opt]) => {
if (!opt.goMode) return;
return [{ key, niceKeyCode: niceKeyCode(opt.value) }];
const goModes = filterMap(Object.entries(module.options), ([, option]) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since filtering for valid shortcuts is already performed in getActiveCommandOptions, this may be simplified to

getActiveCommandOptions()
  .filter(opt => opt.goMode)
  .map(opt => ({ key: i18n(opt.title), niceKeyCode: niceKeyCode(opt.value) }))

@erikdesjardins erikdesjardins merged commit 24edda0 into honestbleeps:master Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants