matrix-react-sdk
matrix-react-sdk copied to clipboard
Remove location buttons if no map server is configured
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.
Thanks for the PR @estellecomment
I will discuss this with design/product.
Related https://github.com/vector-im/element-web/issues/21082
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.
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 ?
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 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.