-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add shortcut to select parent way(s) #8264
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2fff6ae
Added shortcut to select parent way
1ec5 acc127b
Select all parent ways if specific parent way not selected
1ec5 d95d204
Recurse up, not down
1ec5 e031ee3
Ctrl+UpArrow for selecting parent way
1ec5 5433c8f
Select all parent ways, not just common parents
1ec5 8e2301d
Consolidated parent selection functions
1ec5 3802a48
Maintain selection if there are no parents
1ec5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
(Repeating this comment in a thread so it’s easier to discuss.)
I couldn’t think of an intuitive keyboard shortcut that was as convenient as the [ and ] shortcuts that it would complement. So I went with <, based on (of all things) the
<
operator in OverpassQL, which recurses up to the parent of a node or way. I’m open to other ideas.< is a common character on keyboard layouts due to its prevalence in basic math. Just to be on the safe side, I consulted Apple’s visual guide to physical keyboard localizations and checked each of the 169 keyboard layouts available on macOS:
To accommodate these keyboard layouts, we could make the keyboard shortcut localizable, relying on an assumption that keyboard layouts generally correspond to languages. If we choose a letter as the keyboard shortcut instead, then it would definitely have to be localizable.
All the other keyboard layouts have a < key, but some require pressing both Shift and AltGr at the same time, which can be inconvenient.
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 originally went with punctuation because it seems like iD generally reserves letters for editing operations and uses control keys or punctuation for navigation, which makes sense. The problem is that there are very few control keys left that aren’t used by iD or the browser, and very few punctuation characters are universal among keyboard layouts.
An alternative I didn’t consider earlier was Ctrl↑ on Windows or ⌘↑ on macOS. These keys are physical keys on every keyboard, regardless of locale.
This combination is unlikely to cause a conflict with browsers. On Windows, Ctrl↑ would move the caret to the beginning of the paragraph, but this shortcut would take effect when no text field has focus. On macOS, ⌘↑ would move the caret to the beginning of a text field or scroll to the top of the page, but iD doesn’t scroll like a page (cue request to jump to the North Pole). It’s also Finder’s shortcut for moving up to the containing folder.
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 the focus is somehow on the sidebar (but not one of its fields), then pressing ⌘↓ jumps to the bottom of the scroll view but ⌘↑ would select the parent ways instead of jumping to the top of the scroll view. I think this situation would be relatively rare, but hopefully there’s a way to special-case the shortcut to only occur when the canvas has focus. Otherwise, that would be a good argument for making the shortcut CtrlShift↑ on Windows and ⇧⌘↑ on macOS.