matrix-react-sdk icon indicating copy to clipboard operation
matrix-react-sdk copied to clipboard

Remove location buttons if no map server is configured

Open estellecomment opened this issue 2 years ago • 4 comments

Problem solved by this PR : When no map-server is configured (either in wellknown or in SdkConfig), no location sharing is possible. Expected : the "Location" button in MessageComposer is not displayed. Obtained : the button is present, I go through the next clicks, and eventually get an error message that no map server is configured.

This PR removes the "Location" button in MessageComposer when map server is not configured.

Signed-off-by: Estelle Comment [email protected]

Checklist

  • [x] Tests written for new code (and old code if feasible)
  • [ ] Linter and other CI checks pass
  • [x] Sign-off given on the changes (see CONTRIBUTING.md)

Here's what your changelog entry will look like:

✨ Features

  • Remove location buttons if no map server is configured (#9481). Contributed by @estellecomment.

estellecomment avatar Oct 21 '22 14:10 estellecomment

Thanks for the PR @estellecomment

I will discuss this with design/product.

weeman1337 avatar Oct 24 '22 07:10 weeman1337

Related https://github.com/vector-im/element-web/issues/21082

kerryarchibald avatar Oct 26 '22 09:10 kerryarchibald

I'm not confident this is the right solution.

Having a map server configured is required to view locations (or at least, to view them on a map, which gives them any kind of useful context). It shouldn't be required to send them. It should be entirely possible for a user with no map server configured to send their location, which can be viewed by other users who do have a map server configured.

So, if currently the lack of a map server is blocking users from sending their location, then I would suggest we should fix that, and make it easier for users to still send their location in that circumstance, rather than removing the button entirely.

jakewb-b avatar Nov 03 '22 11:11 jakewb-b

So, if currently the lack of a map server is blocking users from sending their location, then I would suggest we should fix that, and make it easier for users to still send their location in that circumstance, rather than removing the button entirely.

That's another solution. It doesn't make sense for our case because our users are in a closed federation so all homeservers have the same features, but I understand that it's not the case in general.

We could also, instead of this PR, add a variable in config that enables/disables the location feature, independently of whether the map server is configured. That covers our use case, we can just set that flag to false in config.json. And with a default to true, it doesn't impact other projects.

Would that be a better PR to do ?

estellecomment avatar Nov 03 '22 17:11 estellecomment

Hi @estellecomment , Sorry about the late response.

We have since added a config option to remove location sharing from the UI. It's documented here.

UIFeature.locationSharing - Whether or not location sharing menus will be shown.

Thanks for taking the time to contribute.

langleyd avatar Mar 28 '24 13:03 langleyd

@langleyd I don't think that changes anything, the proposal here is if there's no map server configured and you'd get an error if you click the location button then you probably shouldn't get a location button. Without requiring deployments to additionally also manually disable location sharing.

t3chguy avatar Mar 28 '24 13:03 t3chguy