Skip to content

context menu: below cursor + without close button + with icons - #232

Merged
karussell merged 11 commits into
masterfrom
bottom_context_menu
Oct 5, 2022
Merged

karussell merged 11 commits into
masterfrom
bottom_context_menu

Conversation

@karussell

@karussell karussell commented Oct 4, 2022 •

Copy link
Copy Markdown
Member

The problem was when you are zoomed out then the popup is too big if you clicked into an area north of Germany. And you first have to zoom in to click on "start". So moving the popup right-below the cursor seems to feel better and additionally we removed some code :)

(the elevation popup above the route is left unchanged)

Related to #136 and #135.

@easbar

easbar commented Oct 4, 2022

Copy link
Copy Markdown
Member

I liked the little 'arrow' pointing at the clicked location:

image

vs. now

image

can we put this back (I have no idea where it came from)?

@easbar

easbar commented Oct 4, 2022

Copy link
Copy Markdown
Member

Ok in maps 1 we did not have this 'arrow' either... Still in maps one the menu looks better I think:

image

image

@karussell

Copy link
Copy Markdown
Member Author

I think the little arrow is unnecessary e.g. google maps does not have it too ;)

Still in maps one the menu looks better I think

Ok, will try to tune it :)

@karussell

karussell commented Oct 4, 2022 •

Copy link
Copy Markdown
Member Author

better?

grafik

Interesting: if you are at the bottom of the map the map moves so that the popup is then completely visible :)

A similar behaviour can be observed for master, but afterwards the popup is still not even 50% visible (!?)

I think the little arrow is unnecessary

Sorry I forgot to complete this sentence: they are unnecessary because all the other corners are rounded and the arrowhead is formed indirectly :)

@karussell

Copy link
Copy Markdown
Member Author

And can you check if you still see #203?

@easbar

easbar commented Oct 5, 2022

Copy link
Copy Markdown
Member

better?

I like the green/blue/red icons for from/via/to. The old menu still looks better to me, maybe because of the smaller line spacing, less padding and smaller corner radius? But probably not so important. And of course we should get rid of the ugly 'x' button at some point.

they are unnecessary because all the other corners are rounded and the arrowhead is formed indirectly :)

yeah.. but that looks a bit strange :D

Interesting: if you are at the bottom of the map the map moves so that the popup is then completely visible :)

That is probably an OL feature? And maybe it does not work properly in master, because of the css you removed here?

And can you check if you still see #203?

I cannot reproduce this here, but I cannot reproduce it in master, either.

@karussell

Copy link
Copy Markdown
Member Author

The old menu still looks better to me, maybe because of the smaller line spacing, less padding and smaller corner radius?

So you want to look the context menu exactly like the old I guess :) ? The problem is that it would not fit well together with the rest of the app like less padding or the font itself. But I will reduce the corner radius.

And maybe it does not work properly in master, because of the css you removed here?

Yeah, not sure.

@easbar

easbar commented Oct 5, 2022 •

Copy link
Copy Markdown
Member

So you want to look the context menu exactly like the old I guess :)

I don't know, I was just saying the old one looks better to me. And actually I don't even think it fits very well with the rest of the app:

image

  • The sidebar has a horizontal grey line above 'Powered by GraphHopper', but the menu has a different horizontal grey line (its thicker)

  • The padding on the sides is bigger in the context menu than in the sidebar, even though the sidebar is wider overall, so the relative padding is much bigger in the menu.

  • The vertical spacing is hard to compare, so if we made it smaller in the menu it would still 'match' the look of the other components?

  • The 'x' button in the menu looks different than the 'x' button of the elevation diagram

  • The corner radius of the elevation diagram looks smaller than the one of the menu, and maybe even the one we use for the sidebar is smaller thane the one of the menu?

image

  • The font sizes seem to be different between the menu, the elevation diagram ('Elevation' and 'Legend') and the instructions list.

@easbar

easbar commented Oct 5, 2022

Copy link
Copy Markdown
Member

... but maybe this is for another issue :) #136

@karussell

karussell commented Oct 5, 2022 •

Copy link
Copy Markdown
Member Author

Can you try the latest commit on various browsers? I think, I found the reason the menu did close prematurely on touch events :) and then no close button would be necessary

The sidebar has a horizontal grey line above 'Powered by GraphHopper', but the menu has a different horizontal grey line (its thicker)

fixed

The padding on the sides is bigger in the context menu than in the sidebar, even though the sidebar is wider overall, so the relative padding is much bigger in the menu.

Hm, you mean a smaller component should get less padding?

The vertical spacing is hard to compare, so if we made it smaller in the menu it would still 'match' the look of the other components?

what do you mean here?

The corner radius of the elevation diagram looks smaller than the one of the menu, and maybe even the one we use for the sidebar is smaller thane the one of the menu?

The elevation diagram had the same 10px border radius :) (and the sidebar was indeed slightly smaller due to 0.5em). But reduced it for now to better know where we would create the point and to avoid having different border radius applied (I found this a nice solution tbh :) )

The 'x' button in the menu looks different than the 'x' button of the elevation diagram

In the past I just wasn't able to change the x button of the elevation diagram. E.g. the x button of the error message is the same as for the context menu.

Comment thread src/map/Popup.tsx
import { AddPoint, QueryOSM, SetPoint, ZoomMapToPoint } from '@/actions/Actions'
import { RouteStoreState } from '@/stores/RouteStore'
import { findNextWayPoint } from '@/map/findNextWayPoint'
import Cross from '@/sidebar/times-solid.svg'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We cannot remove the svg itself as it is still used from the error message.

@karussell karussell changed the title Bottom context menu context menu: below cursor + without close button + with icons Oct 5, 2022
@karussell karussell added this to the 0.4 milestone Oct 5, 2022
@easbar

easbar commented Oct 5, 2022

Copy link
Copy Markdown
Member

Hm, you mean a smaller component should get less padding?

No, I thought it should probably be the same in absolute terms, but a smaller component should definitely not have a bigger (absolute) padding?

what do you mean here?

I was trying to say: Yes, we should try to match the look of the context menu with the other components, but since I could not see anything that was similar to the menu I thought we can freely choose how much empty room there is between the map entries (rows).

The elevation diagram had the same 10px border radius :)

Really? In my above screenshot it looks like the elevation diagram radius is bigger?!

@karussell

Copy link
Copy Markdown
Member Author

The elevation diagram had the same 10px border radius :)
Really?

Yes, or I'm misunderstanding something, see ContextMenu.module.css and in heightgraph there is a css rule: .heightgraph-container { ... border-radius: 10px;

but a smaller component should definitely not have a bigger (absolute) padding?

Yes, exactly. I'm now using similar padding where possible (instead of px I use em as we use for the sidebar).

Can I merge or further improvements possible :) ?

@easbar

easbar commented Oct 5, 2022

Copy link
Copy Markdown
Member

Can I merge or further improvements possible :) ?

You can always merge and always further improvements are possible :D

@karussell
karussell merged commit 51f612d into master Oct 5, 2022
@karussell
karussell deleted the bottom_context_menu branch October 5, 2022 13:28
@easbar

easbar commented Oct 5, 2022

Copy link
Copy Markdown
Member

Thanks for this!

ZeroGxMax pushed a commit to minhhpkp/graphhopper-maps that referenced this pull request Nov 12, 2024
…hopper#232)

* reintroduce LongPressHandler for iOS

* comment

* popup menu above cursor is problematic

* try to improve right-click popup

* a bit tighter

* really no close button necessary?

* css style

* hover should be centered

* remove close button, graphhopper#235
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.

2 participants