matrix-react-sdk
matrix-react-sdk copied to clipboard
Always display Home button in UserMenu
Fixes https://github.com/vector-im/element-web/issues/16691
Might fix https://github.com/vector-im/element-web/issues/22063
Before | After |
---|---|
![]() |
![]() |
We want to provide the user the option to go home at any time. This allows the user to "close" the room they were reading so they can walk away or perform another task on their computer and not accidentally have the room marked as read when they return to Element.
When a custom home page URL is set, clicking Home will bring the user to that custom page.
When there is no custom home page URL, clicking the Home button will bring the user back to the Welcome to BRAND page (http://localhost:8080/#/home)

Here's what your changelog entry will look like:
✨ Features
- Always display Home button in UserMenu (#7409). Fixes vector-im/element-web#16691 and vector-im/element-web#22063. Contributed by @aaronraimist.
Preview: https://61c14137b9dea7c29e0299b3--matrix-react-sdk.netlify.app ⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.
Codecov Report
Merging #7409 (c758e2d) into develop (3e31fdb) will decrease coverage by
0.07%
. The diff coverage is0.00%
.
:exclamation: Current head c758e2d differs from pull request most recent head fdaf569. Consider uploading reports for the commit fdaf569 to get more accurate results
@@ Coverage Diff @@
## develop #7409 +/- ##
===========================================
- Coverage 30.85% 30.78% -0.08%
===========================================
Files 893 893
Lines 50793 50769 -24
Branches 12928 12920 -8
===========================================
- Hits 15671 15628 -43
- Misses 35122 35141 +19
Impacted Files | Coverage Δ | |
---|---|---|
src/components/structures/UserMenu.tsx | 26.70% <0.00%> (+0.59%) |
:arrow_up: |
src/components/views/rooms/SearchBar.tsx | 0.00% <0.00%> (-89.29%) |
:arrow_down: |
src/components/views/rooms/ReadReceiptGroup.tsx | 8.33% <0.00%> (-21.67%) |
:arrow_down: |
src/contexts/RoomContext.ts | 100.00% <0.00%> (ø) |
|
src/components/structures/RoomView.tsx | 29.65% <0.00%> (ø) |
|
src/components/views/right_panel/UserInfo.tsx | 29.23% <0.00%> (ø) |
|
src/Lifecycle.ts | 1.42% <0.00%> (+<0.01%) |
:arrow_up: |
...gs/handlers/AbstractLocalStorageSettingsHandler.ts | 76.31% <0.00%> (+1.31%) |
:arrow_up: |
I definitely like this change in theory. However, one thought - for users who have their home meta-space enabled and not set to 'show all rooms', this displays in the expanded left-hand menu as 'home' and with the same icon as in this proposed change. However clicking on it does not behave as in this PR, in that it won't close the room you are in and return you to the brand page. That feels potentially confusing as we'd end up with two almost identical pieces of UI, in two different menus, with subtly different behaviours.
@jakewb-b good spot, but this issue already exists in deployments with custom home pages set up, e.g https://chat.mozilla.org/
This is quite aligned with some of the work that the Delight team has started, regarding new users journey. I've raised this to the relevant folks and hopefully we should have something concrete soon to get the ball rolling with this PR.
@niquewoodhouse Those are all valid concerns but this button already exists on instances of Element like chat.mozilla.org and webchat.kde.org where a homeUrl
is configured. The idea of this PR is to show that button to all users as a temporary step until a better solution is designed.
If you want to close this and design a better solution, feel free. I just know creating the proper solution can take a long time.
I agree with the problem, which is that it's difficult and unintuitive to find a way to not have a room open in Element Web, which creates the read-receipt issue, but also might be a privacy concern for people who prefer not to leave a chat window open on their desktop in an open-plan office.
The solution proposed in this PR seems alright as a temporary fix, but I agree with Nique that it's imperfect, and I wouldn't want to accept it if it doesn't have design approval.
Are there alternative ideas that would make it easier to 'unselect' a room, like unselecting it?
One solution that seems logical to me would be that clicking on the 'home' / 'all rooms' button a second time would take you home. This would be in line with spaces, where clicking them once takes you to the space with the last open room selected, but clicking the space a second time takes you back to the room list for the space, which is essentially the 'home' for that space (and also closes the active room). So, clicking home/all rooms a second time to take you home would be a logical interaction. In fact I occasionally find myself trying it without thinking, and find it a bit surprising that it doesn't work.
Thank you for your contribution @aaronraimist . The design team will be revising the room list, the start screen and the menus in the near future. Unfortunately, this means that the design team does not have time to review other changes in the same place. Because of that I will close the PR now.
Nonetheless I appreciate the time you've spent to work on this (of course also other people commenting here).