guytepper / 1km.co.il

Protesting during pandemic times
https://1km.co.il
MIT License
60 stars 32 forks source link

Suggestion: on load, instead of showing the modal -- use device location #38

Closed OrenShalev closed 4 years ago

OrenShalev commented 4 years ago

I believe most times the page is loaded, the user wants to see protests in their area. I think it would be better not to pop the modal every time the user loads the page, and instead focus the map according to the device's location. Now that there's a "change address" button, if the user intended to input an address -- they can do that with one click / tap.

If there's an agreement that this would be a good change, I can create the PR for it.

guytepper commented 4 years ago

Hi Oren, thanks for the idea!

Initially this was the behavior, but I was afraid of a UX issue this could raise; we need to build a minimal user trust before asking them for their location. If a permission request will be shown before they saw an explanation why is it happening, it can bring up suspicious thoughts in their minds which I think we prefer to avoid. The current method allows them to give their location out of their free will, by clicking a button that makes it clear why the permission alert shows up.

But I'm open to hear other thoughts!

OrenShalev commented 4 years ago

Hi Guy,

So a solution here might be "once the user asked to use location, remember that they did that, and in the future focus on load." A relatively simple way to implement this would be saving this decision on localStorage.

I think that removing the modal on load makes sense for everyone.

But no pressure. :) It's fine to drop this if no enthusiasm.

uriklar commented 4 years ago

I think showing not showing the modal for returning users is a good idea. It's a bit annoying that it pops up everytime

daganomri commented 4 years ago

So a solution here might be "once the user asked to use location, remember that they did that, and in the future focus on load." A relatively simple way to implement this would be saving this decision on localStorage.

Maybe instead of storing the decision in localStorage, we could save the address itself. Then there won't be the problem of using the location api without user confirmation.

guytepper commented 4 years ago

That makes sense. Isn't the permission gets invalidated after a while and the permission alert shows up again?

OrenShalev commented 4 years ago

@guytepper I don't think the permission is invalidated after a while. However, it could be revoked by the user (rare but happens).

So it seems like we want to save the user's last address/location? I suggest to use the map's last location, as users can start with address or device location and then move the map. If we keep track of position changes (I guess when dispatching setMapPosition?), I think it'll cover all cases.

If someone else wants to take a shot at it I have no objection. :)

ranyitz commented 4 years ago

👋 Hey! I created a PR that saves the chosen user location (coordinates) on local storage - https://github.com/guytepper/1km.co.il/pull/48

webernir commented 4 years ago

@guytepper the permission is not invalidated once allowed. Do you want the default location to be set to:

  1. Users' current location
  2. Users last selection (taken from localStorage)

?

joeyede commented 4 years ago

I would if user has set location then 2. If not then 1

webernir commented 4 years ago

@OrenShalev can you update the PR to follow @joeyede requirement (try to use users' last selected location, with fallback to users' current location, with fallback to modal) ?

OrenShalev commented 4 years ago

Seems like #48 is merged and this bug is fixed, so closing. 👍

webernir commented 4 years ago

Thanks Oren!

On Sat, Oct 10, 2020, 16:58 Oren Shalev notifications@github.com wrote:

Closed #38 https://github.com/guytepper/1km.co.il/issues/38.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/guytepper/1km.co.il/issues/38#event-3862783194, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASM777OLBAIMT2CHHINHADSKBSBDANCNFSM4SFQDLDQ .