* Introduce a hook to track active room
This hook simply keeps a state which tracks the index of the active room
in the list of rooms passed through props. This index will be recomputed
if the active rooms changes or if the list itself changed.
* Use hook in the view model
* Write tests
* Fix broken tests
* refactor: extract room creation and right verification
* refactor: update `RoomListHeaderViewModel` to use utils
* feat(room list filter): add filter key to `PrimaryFilter` model
* feat(room list filter): return active primary filter
* feat(room list): add create room action and rights verification
* test: update room list tests
* feat(empty room list): add empty room list
* test(empty room list): add empty room list tests
* feat(room list): use empty room list in `RoomListView`
* test(room list panel): update tests
* test(e2e): add e2e tests for empty room list
* test(e2e): update room list header snapshot
* refactor(room list item): rename `RoomListCell` into `RoomListItemView`
* refactor(room list item): move open room action to new room list item view model
* feat(hover menu): add `hasAccessToOptionsMenu`
* feat(hover menu): add to `RoomListItemViewModel` the condition to display or not the hover menu
* feat(hover menu): add view model for the hover menu
* feat(hover menu): add hover menu view
* feat(hover menu): add hover menu to room list item
* feat(hover menu): update i18n
* test(view model list item): update test and add test to `showHoverMenu`
* test(room list): update snapshot
* test(room list item menu): add tests for view model
* test(room list item menu): add tests for view
* test(room list item): add tests
* test(e2e): add tests for more options menu
* chore: update compound web
* test(e2e): fix typo
* fix(room list header): in view model, can create room in space if user has the right. Display the compose menu if the user can create room or video room
* fix(room list header): can create directly chat if compose menu is disabled
* test(room list header): add tests for view model
* test(room list header): update tests of view
* test(room list header): update list test
* Add a hook that deals with the sorting behaviour
Hook will provide a function to sort the list and also provides a state
which tracks the currently active sort option.
* Use hook in vm
* Write test for the vm
* Fix broken view tests
* Add key storage toggle to Encryption settings
* Keys in the acceptable order
* Fix some tests
* Fix import
* Fix toast showing condition
* Fix import order
* Fix playwright tests
* Fix bits lost in merge
* Add key storage delete confirm screen
* Fix hardcoded Element string
* Fix type imports
* Fix tests
* Tests for key storage delete panel
* Fix test
* Type import
* Test for the view model
* Fix type import
* Actually fix type imports
* Test updating
* Add playwright test & clarify slightly confusing comment
* Show the advnced section whatever the state of key storage
* Update screenshots
* Copy css to its own file
* Add missing doc & merge loading states
* Add tsdoc & loading alt text to spinner
* Turn comments into proper tsdoc
* Switch to TypedEventEmitter and remove unnecessary loading state
* Add screenshot
* Use higher level interface
* Merge the two hooks in EncryptionUserSettingsTab
* Remove unused import
* Don't check key backup enabled state separately
as we don't need it for all the screens
* Update snapshot
* Use fixed recovery key function
* Amalgamate duplicated CSS files
* Have "key storage disabled" as a separate state
* Update snapshot
* Fix... bad merge?
* Add backup enabled mock to more tests
* More snapshots
* Use defer util
* Update to use EncryptionCardButtons
* Update snapshots
* Use EncryptionCardEmphasisedContent
* Update snapshots
* Update snapshot
* Try screenshot from CI playwright
* Try playwright screenshots again
* More screenshots
* Rename to match files
* Test that 4S secrets are deleted
* Make description clearer
* Fix typo & move related states together
* Add comment
* More comments
* Fix hook docs
* restoreAllMocks
* Update snapshot
because pulling in upstream has caused IDs to shift
* Switch icon
as apparenty the error icon has changed
* Update snapshot
* Missing copyright
* Re-order states
and also sort out indenting
* Remove phantom space
* Clarify 'button'
* Clarify docs more
* Explain thinking behind updating
* Switch to getActiveBackupVersion
which checks that key backup is happining on this device, which is
consistent with EX.
* Add use of Key Storage Panel
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Change key storage panel to be consistent
ie. using getActiveBackupVersion(), and add comment
* Add tsdoc
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Use BACKUP_DISABLED_ACCOUNT_DATA_KEY in more places
* Expand doc
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Undo random yarn lock change
* Use aggregate method for disabling key storage
in https://github.com/matrix-org/matrix-js-sdk/pull/4742
* Fix tests
* Use key backup status event to update
* Comment formatting
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Fix comment & put check inside if statement
* Add comment
* Prettier
* Fix comment
* Update snapshot
Which has gained nowrap due to 917d53a56fd6de290fdf2269a330d62fe6464907
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Track available filters and expose this info from the vm
- Adds a separate hook that tracks the filtered rooms and the available
filters.
- When secondary filters are added, some of the primary filters will be
selectively hidden. So track this info in the vm.
* Write tests
* Fix typescript error
* Fix translation
* Explain what a primary filter is
* Add space to the bottom of the room summary actions below leave room
* 8x not 6x
* Spacing needs to be within the scoll content, add it to the bottom of the leave action
* Update RoomSummaryCard-test.tsx.snap
* Fix snapshot and add screenshot test
* Refactor submit rageshake so that it uses the new error codes.
* Improve error information given in Bug Report Dialog
* use type
* Refactor with generic error & policy link.
* lint
* lint
* Add BugReportDialog test
* fix time travel
* use waitFor while waiting for fetch to finish
* lint
* Drop error prefix as per 3973bb38ef
* small fixes
* Don't change string here.
* Fixup i18n strings.
* Avoid destroying calls until they are hidden from the UI
We often want calls to exist even when no more participants are left in the MatrixRTC session. So, we should avoid destroying calls as long as they're being presented in the UI; this means that the user has an intent to either join the call or continue looking at an error screen, and we shouldn't interrupt that interaction.
The RoomViewStore is now what takes care of creating and destroying calls, rather than the CallView. In general it seems kinda impossible to safely create and destroy model objects from React lifecycle hooks, so moving this responsibility to a store seemed appropriate and resolves existing issues with calls in React strict mode.
* Wait for a close action before closing a call
This creates a distinction between the user hanging up and the widget being ready to close, which is useful for allowing Element Call to show error screens when disconnected from the call, for example.
* Don't expect a 'close' action in video rooms
These use the returnToLobby option and are expected to remain visible when the user leaves the call.
* prevent user from accidentally triggering multiple identity resets
* apply changes from review and update to latest design
* Use a CSS class and compound variable
* update snapshot
* Update test/unit-tests/components/views/settings/encryption/ResetIdentityPanel-test.tsx
---------
Co-authored-by: Richard van der Hoff <richard@matrix.org>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Remove redundant `UserIdentityWarning` test
Since the refactoring in https://github.com/element-hq/element-web/pull/29067,
this test is redundant.
It is also flaky and hard to understand. Time for it to die.
* delint
* Implement enough of the new store to get a list of rooms
* Make it possible to swap sorting algorithm
* Don't attach to window object
We don't want the store to be created if the labs flag is off
* Remove the store class
Probably best to include this PR with the minimal vm implmentation
* Create a new room list store that wraps around the skip list
* Create a minimal view model
* Fix CI
* Add some basic tests for the store
* Write more tests
* Add some jsdoc comments
* Add more documentation
* Add more docs
* feat(new room list): add space menu in view model
* test(new room list): add space menu in view model
* feat(new room list): add space menu in room list header
* chore: update i18n
* test(new room list): add tests for space menu
* test(new room list): update room list tests
* test(e2e): add tests for space menu
* chore: update `@vector-im/compound-design-tokens` & `@vector-im/compound-web` to last version
* chore: use `error-solid` icon instead of `error`
* chore: update jest snapshot
* fix: `AccessibleButton` lint
* feat(new room list): add compose menu in header for spaces
* test(new room list): add tests for space
* test(e2e new room list): update space test
* chore: formatting and reuse type var
* Use EditInPlace for identity server picker.
* Exclude picker from default dialog button styles.
* Remove unused import.
* Update test
* Remove unused css
* Update test
* drop only
* Add a test for setting an ID server.
* Add a unit test for SetIdServer
* fix tests
* Reformat mx_Dialog button :not list to use a more readable selector.
* Reformat other :not sections
* forgot a comma
* We're in 2025 now.
* Update copyright + use class methods.
* feat: create new header
* test: add tests to view model
* test: add tests to view
* feat: add header to new room list
* test(e2e): update RoomListView snapshot
* test(e2e): add tests for room list header
* refactor: minor code improvement
* Move CSS for ResetIdentityPanel into EncryptionCard
This allows it to be re-used in other components. It's a *bit* magic
that EncryptionCard applies style to divs within it, although it
somewhat makes sense that it wants them styled a particular way.
The alternative would be to add another component for a div child of
encryption card like EncryptionCardButtons that just makes it flexbox
and centered: I'm not sure which is better.
* Update snapshot
* Update snapshot
* Do it the other way
Because we only want it in the destructive cards, not the other ones.
* Use flex component
* Also use gap prop and update snapshots
* Fix justification
* Snaspshots again
* Set align-items to normal
As center affected the list items too. Also add it to the flex
component because it didn't have it as an option.
* Factor out duplicated CSS for buttons in encryption settings
By adding a component to hold the common CSS
* Update snapshot
* Update snapshot
* More snapshots
* Split EncryptionCardButtons out to separate component
* Update imports
* CreateSecretStorageDialog: error handling
I'm fed up with setup operations in EW failing silently. Rather than leaving
the user with a mysteriously broken client, let's at least tell them that
something has gone wrong, so that they can report the issue and we can
investigate.
Obviously, showing an unactionable Error dialog is a last resort: ideally, we
should handle the error ourselves, or give the user actionable steps to resolve
the problem. But that takes significant design and engineering.
Just swallowing errors is the worst of all possible options.
* Fix typo in test name
* Improve test coverage
* Create new labs flag
* Render empty room list view
* Reload on flag change
* Rename RoomList.tsx to LegacyRoomList.tsx
and rename NewRoomListView.tsx to RoomListView.tsx
* Update labs.md
* Don't reload roomview on offline connectivity check
Doesn't look like this was a regression as far as I can see, but
you did have to switch rooms while offline for it to start happening.
There's no use reloading the room until we're online again.
Fixes https://github.com/element-hq/element-web/issues/29072
* Add regression test
* Move it down the file to avoid changing the snapshots
* feat(crypto): rename "security key" into "recovery key" in lang file
* test(crypto): rename "security key" into "recovery key" in test files
* test(e2e crypto): rename "security key" into "recovery key" in test files
* doc(crypto): rename "security key" into "recovery key"
* fix(encryption settings): check encryption state when user cancels the reset identity flow
* test(encryption settings): add test to check encryption state when user cancels the reset identity flow