-
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
Replace radial menu with a context menu #3753
Conversation
Hey @samanpwbb can you check the screenshot here #3671 (comment) |
I think the whole form can be vertically condensed, and simplified. I would lose the semitransparent background – it's distracting and less legible than a solid background. If you make the background solid, you will be able to remove the round fills from under the action icons, which will allow you to cut a good amount of vertical space from the design. End result will be cleaner looking and easier to use. |
@bhousel I feel this is done. Could you review it ? |
I tried a white style. Notice the slimmer height of each operation and a disable cursor. cc: @samanpwbb @rasagy |
As per talk with @rasagy, he suggested on removing the operations which are always disabled. |
c540e89
to
df71690
Compare
I know that the disabled icons were always there for discoverability. I still think messages like "This feature can't be made circular because it's not a loop" are important for users to see. Maybe we can just make the icons smaller? This menu doesn't need to be so much bigger than the browser's default contextmenu. I really like the light style! 👍 |
@bhousel For example "Circularize":
Showing this message can be limited to the case of a nearly closed, nearly circular way.
Doesn't this make the icons too unspecific? Otherwise I would agree. |
b8f4928
to
308917e
Compare
Fixed - On reselecting multiple entities, right click doesn’t discard selection - On selecting new entity, right click discards previous selection - Preserved shift selection for both left & right click
@bhousel I think the idea was not to hide all the disabled icons, but only ones that didn’t seem relevant for a particular feature. On exploring a bit with @kepta, we realized that this already happens. Here’s what we felt: actions that might be disabled due to the feature not being in the screen should be shown, since they explain why something can’t be done, but actions that won’t be possible for a feature (straight road would never be able to Circularize), it only adds more confusion. Do you think there are more cases — like Circularize for straight roads — that would be disabled regardless of the context? If this isn’t common, then maybe we can take a quick call on hiding Circularize when it’s not relevant. |
The iD architecture document mentions disabled operations a bit here: https://github.com/openstreetmap/iD/blob/master/ARCHITECTURE.md#operations-module I don't know who the original author of this section was, but I think it's still important to show disabled operations for discoverability. The menu is there for teaching in addition to using. So please keep Circularize on the menu, but disabled for straight roads. |
modules/behavior/select.js
Outdated
@@ -23,6 +23,12 @@ export function behaviorSelect(context) { | |||
|
|||
|
|||
function click() { | |||
var rtClick = d3.event.type === 'contextmenu'; |
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.
contextmenu
is not quite right click. On a Mac it fires on mousedown
, and on Windows it fires on mouseup
.
The code here might be totally ok, this is just a reminder to myself to check the reselection behavior on Windows.
modules/modes/select.js
Outdated
} else { | ||
var point = context.mouse(), | ||
viewport = geoExtent(context.projection.clipExtent()).polygon(); | ||
viewport = geoExtent(context.projection.clipExtent()).polygon(), |
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 have to check, I think there is a context.map().trimmedExtent()
that can be used to get a smaller viewport avoiding UI controls around the edges.
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.
Yes, it totally makes sense to use context.map().trimmedExtent()
.
I also created this context.map().trimmedExtentPadding(p)
for the lane work, which accepts additional padding, should we have such a thing?
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 also created this context.map().trimmedExtentPadding(p) for the lane work, which accepts additional padding, should we have such a thing?
Instead of adding another method, can we just have trimmedExtent
accept an optional argument with a padding rect?
modules/renderer/map.js
Outdated
@@ -311,7 +311,7 @@ export function rendererMap(context) { | |||
function resetTransform() { | |||
if (!transformed) return false; | |||
|
|||
surface.selectAll('.radial-menu').interrupt().remove(); | |||
surface.selectAll('.edit-menu').interrupt().remove(); |
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 we're going to keep .radial-menu
around for backward compatibility and fork projects, we need to include it in the selector here.
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.
Well, so we will end up having two of these (one for radial, other for edit).
I am thinking if about all the cleaning that would need to be done for a major release ..
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 think that is ok.. selectAll
takes a CSS selector, so it can be written like:
surface.selectAll('.radial-menu, .edit-menu').interrupt().remove();
We can tell people that the radial menu is deprecated and will be removed in iD v3.
modules/ui/intro/point.js
Outdated
@@ -143,7 +143,7 @@ export function uiIntroPoint(context, reveal) { | |||
context.history().on('change.intro', deleted); | |||
|
|||
setTimeout(function() { | |||
var node = d3.select('.radial-menu-item-delete').node(); | |||
var node = d3.select('.edit-menu-item-delete').node(); |
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.
Reminder to 1. keep radial-menu
classes around for backward compat. 2. test what this actually does when we run through the tutorial.
I edited a lot with this today to test it out. Overall it's great. One example of this is: I'd draw a building and hit S to square the corners of it, and nothing would happen because too much of the building is off screen. Normally you would be able to see the menu with the disabled icons and realize that something is preventing you from running the command. But without a menu, I'd find myself wondering whether the command ran or not, and just keep hitting S, then eventually right-click to see the menu and realize what was going on. This is a hard problem to solve elegantly. #1734 touches on this - "Better indication when an action is selected". That issue is, sometimes a user will do something by accident and not realize that the action happened. But now without a menu, it's also possible for a user to try to do something on purpose and not realize when the action didn't happen. I'm thinking for keyed operations initiated by the user, we should maybe take the message that we already use for undo/redo (e.g. "Made an area circular") and flash it in the corner of the screen. If the operation is disabled, instead flash the disabled message "This can't be made circular because it isn't a loop". Flash messages are really hard to get right, in a way that is tasteful, enjoyable, and delights the user instead of being annoying. But it would close #1734 and help us replace the visual clues that we lose by not popping up the context menu on every select. I'm going to prototype this idea and see how it turns out. |
@bhousel I like the idea of notifying the user that something is not allowed. In the Mac they play that famous sound when an operation is disabled. I really like the way Maybe we could do something similar for iD? Showing the alert at the top (even if it hides something). Some of these alerts would go off and some wouldn't , depending on the severity. |
Latest version.. I like it! Thoughts @samanpwbb @kepta ? |
@bhousel, I would love to see a different colour on it. (😅 pink looks good to me) |
Deployed iD-runnable/edit_menu. View on Runnable. |
Final stuff:
|
Old menu behavior can be restored with 2 cookies: - `edit-menu-style=radial` - Display menu as a radial menu, limited to 8 items - `edit-menu-show-always=1` - Show menu on all clicks, not just contextmenu/right
This was merged! 🎉 |
Awesome🤘
…On Sun, 26 Feb 2017 at 2:03 AM, Bryan Housel ***@***.***> wrote:
This was merged! 🎉
Thanks @kepta <https://github.com/kepta> @rasagy
<https://github.com/rasagy> @samanpwbb <https://github.com/samanpwbb> &
@slhh <https://github.com/slhh>!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3753 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGpL7sn8-DmxxoHxDxEhXma8yYr2vTbMks5rgJAcgaJpZM4LijMP>
.
|
Great work! Testing this in Chrome 56.0.2924.87 when I select an element and hit SPACE to bring up the edit menu, it appears in the top right of the screen, away from the selected element. |
Good catch, I notice that too.. I'll open a new issue for it.. |
Todo
(closes #3671 )