Commit Graph

228 Commits (88de99733cf247c331f2a82d756a359566cc237a)

Author SHA1 Message Date
Andy Balaam 4ee57a36e0
Support dynamic room predecessors in BreadcrumbsStore (#10295)
* Tests for BreadcrumbsStore.meetsRoomRequirements

* Tests for appending rooms to BreadcrumbsStore

* Support dynamic room predecessors in BreadcrumbsStore
2023-03-08 15:13:32 +00:00
Andy Balaam b8d502be2e
Support dynamic room predecessors in RoomNotificationStateStore (#10297)
* Tests for RoomNotificationStateStore emitting events

* Support dynamic room predecessors in RoomNotificationStateStore

* Remove unused arguments from emit call.

UPDATE_STATUS_INDICATOR is used in:
* SpacePanel
* MatrixChat
* RoomHeaderButtons

but these arguments are not used in any of those places. Remove them so
when I refactor I don't have to make up values for them.

* Fix broken test (wrong expected args to emit)

UPDATE_STATUS_INDICATOR is used in:
* SpacePanel
* MatrixChat
* RoomHeaderButtons

but these arguments are not used in any of those places. Remove them so
when I refactor I don't have to make up values for them.

* Update the RoomNotificationStore whenever the predecessor labs flag changes

* Fix type errors

* Fix other tests that trigger our new watcher
2023-03-08 14:18:03 +00:00
Michael Telatynski 4b8bada24b
Apply `strictNullChecks` around the codebase (#10302
* Apply `strictNullChecks` around the codebase

* Iterate PR
2023-03-07 13:19:18 +00:00
Michael Weimann 5398db21ad
Add ESLint Jest (#10261) 2023-03-01 16:23:35 +01:00
Aaron Raimist d9d0ab3d98
Provide a more detailed error message than "No known servers" (#6048)
* Provide a more detailed error message than "No known servers"

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Fix PR since file was refactored

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Fix formatting

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* lint

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Update src/stores/RoomViewStore.tsx

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* Add example identifiers and a more detailed explanation

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Lint

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Lint

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Revert back to original wording (except s/alias/address)

Alias was a better name imo but Element calls them addresses now so changed to be consistent.

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Prettier

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Fix ts error

* Add snapshot test

* Check the Modal props

* Add test case to reach quality gate

---------

Signed-off-by: Aaron Raimist <aaron@raim.ist>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Florian Duros <florianduros@element.io>
2023-02-24 15:59:30 +00:00
maheichyk 7b77f76486
Widget permissions customizations using module api (#10121)
* Using module api to customize widget permissions

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* Revert type export and use ComponentProps instead.

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

---------

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-02-23 14:53:44 +00:00
Michael Weimann eb6278df1d
Do not prompt for a password when doing a „reset all“ after login (#10208) 2023-02-23 08:46:49 +01:00
Germain 8c22584f64
Remove threads labs flag and the ability to disable threads (#9878) 2023-02-20 14:46:07 +00:00
Michael Telatynski 4574c665ea
Conform more code to strict null checking (#10167)
* Conform more code to strict null checking

* Delint

* Iterate PR based on feedback
2023-02-16 17:21:44 +00:00
Michael Telatynski e8b92b308b
Conform more code to strict null checking (#10169)
* Conform more code to strict null checking

* delint

* Iterate

* delint

* Fix bad test
2023-02-16 09:38:44 +00:00
Michael Telatynski da7aa4055e
Conform more of the code base to strict null checking (#10147)
* Conform more of the code base to strict null checking

* More strict fixes

* More strict work

* Fix missing optional type

* Iterate
2023-02-13 17:01:43 +00:00
Michael Telatynski 61a63e47f4
Comply with noImplicitAny (#9940)
* Stash noImplicitAny work

* Stash

* Fix imports

* Iterate

* Fix tests

* Delint

* Fix tests
2023-02-13 11:39:16 +00:00
Germain 8fe5714673
Fix predecessor tests broken (#10123) 2023-02-09 12:46:17 +00:00
Andy Balaam c4a6cc8e65
Fix test failures: provide isIntialSyncComplete on mock client (#10122) 2023-02-09 11:36:02 +00:00
Andy Balaam add23e4d5d
Pass the dynamic predecessor feature flag when listing rooms (#10068) 2023-02-03 14:09:31 +00:00
Germain 6dd578e5a7
Devtools for stuck notifications (#10042) 2023-02-03 11:07:24 +01:00
Andy Balaam b7cd28bd29
Support MSC3946 in RoomListStore (#10054) 2023-02-03 09:14:44 +00:00
Andy Balaam b416e15cbd
Tests for RoomListStore's predecessor handling (#10046) 2023-02-02 13:22:30 +00:00
Germain 703587b8e9
Cleanup pre MSC3773 thread unread notif logic (#10023) 2023-01-31 16:59:24 +00:00
Clark Fischer 431afaafc6
Unify unread notification state determination (#9941)
* Add tests for unread notification facilities

Add some tests to guarantee some consistency in `useUnreadNotifications` and
`RoomNotificationState`.

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

* Add RoomNotifs#determineUnreadState

Intended as a singular replacement for the divergent implementations before.

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

* Unify room unread state determination

Have both the class-based facility and the hook use the new unified logic in
`RoomNotifs#determineUnreadState`.

Addresses https://github.com/vector-im/element-web/issues/24229

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>

---------

Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-01-31 09:58:17 +00:00
Germain 3e2bf5640e
Update to supportsThreads (#9907) 2023-01-30 12:20:11 +00:00
Kegan Dougal 676c65b55c More tests 2023-01-20 13:27:03 +00:00
Kegan Dougal 744abd935e Linting 2023-01-20 12:46:51 +00:00
Kegan Dougal 6a75054e1a More tests 2023-01-20 12:38:58 +00:00
Kegan Dougal 769fd4a786 TS errors 2023-01-20 10:32:53 +00:00
Kegan Dougal 4db1928bcd Prettier and strict 2023-01-19 12:49:20 +00:00
Kegan Dougal 7c2dd7224f unbreak jest tests 2023-01-19 11:15:08 +00:00
Michael Weimann 6d354e3e10
Add test coverage (#9928) 2023-01-18 15:49:34 +01:00
Michael Telatynski 0c30b577e0
Fix reply action in message context menu notif & file panels (#9895) 2023-01-12 14:52:52 +00:00
Michael Weimann 0f7a2ce6df
Confirm listen to a broadcast while recording (#9831) 2023-01-02 12:21:33 +00:00
Michael Weimann 91e078d96b
Show room broadcast when ending a recording (#9841) 2023-01-02 11:05:51 +00:00
Michael Weimann 5912c7a637
Replace broadcast instance with SDKContext (#9824) 2022-12-27 08:39:26 +01:00
Kerry 5b9496aad8
test toastStore (#9823) 2022-12-23 09:35:41 +00:00
Germain 8541e1c4b5
Change room list sorting to activity and unread first by default (#9773) 2022-12-19 10:42:58 +00:00
Michael Weimann 35a187a231
Handle starting a call while listen to a broadcast (#9764) 2022-12-19 08:44:19 +00:00
Michael Weimann 51554399fb
Implement broadcast message preview (#9762) 2022-12-16 11:01:16 +00:00
Germain 2d2755d145
🧵 Enable threads by default (#9736)
* Delabs threads

* remove threads reload when labs is toggled

* Fix ts strict

* fix rebase mistake

* remove .only

* fix pr comments

* re-introduce backwards compat

* Fix export test

* Fix SearchREsultTile test

* strict ts
2022-12-13 15:09:15 +00:00
Michael Weimann 526645c791
Apply prettier formatting 2022-12-12 12:24:14 +01:00
Germain 3a501003e2
Add setting to hide bold notifications (#9705) 2022-12-06 09:59:17 +00:00
Robin d2109de4ca
Remove unused Element Call capabilities (#9653)
As of 44e22e268420bd4b24a110840e2edaca46653407 in the Element Call repo, Element Call widgets no longer request the capability to start calls.
2022-11-30 13:54:18 +00:00
Michael Weimann e38c59c535
Pause voice broadcast on calls (#9623) 2022-11-28 11:43:59 +00:00
kegsay acdcda78f0
sliding sync: add lazy-loading member support (#9530)
* sliding sync: add lazy-loading member support

Also swap to `$ME` constants when referring to our own member event.

* Hook into existing LL logic when showing the MemberList

* Linting

* Use consts in js sdk not react sdk

* Add jest tests

* linting

* Store the room in the test

* Fix up getRoom impl

* Add MemberListStore

* Use the right context in MemberList tests

* Fix RightPanel-test

* Always return members even if we lazy load

* Add MemberListStore tests

* Additional tests
2022-11-18 19:05:00 +00:00
Michael Weimann fca6ff271c
Extract requestMediaPermissions (#9568) 2022-11-11 10:38:51 +01:00
Michael Weimann abec724387
Add voice broadcast pre-recoding PiP (#9548) 2022-11-10 09:38:48 +01:00
Michael Telatynski 04bc8fb71c
Optimise Jest run in CI (#9542) 2022-11-04 10:48:08 +00:00
Germain 07003a5bc1
Make thread replies trigger a room list re-ordering (#9510) 2022-10-27 13:50:05 +01:00
kegsay 0453b264e3
Sliding Sync: improve sort order, show subspace rooms, better tombstoned room handling (#9484)
* Add support for include_old_rooms and by_notification_level

* Include subspaces when apply spaces filter

* Remove stray is_tombstoned

* tests: add SlidingRoomListStore jest tests; update proxy version in cypress

* Add additional tests

* Additional tests

* Linting

* Update test/stores/room-list/SlidingRoomListStore-test.ts

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-10-26 14:04:03 +01:00
Michael Telatynski b7ff56a726
Add type assertions where we know an event is a room event (has room_id) (#9498) 2022-10-25 18:57:36 +00:00
Robin e4c44dc282
Auto-approve rageshake event capabilities for virtual Element Call widgets (#9492) 2022-10-24 13:49:54 -04:00
Michael Telatynski eafc2d23a7
Ensure spaces in the spotlight dialog have rounded square avatars (#9480) 2022-10-24 08:58:36 +00:00
Germain 9eb4f8d723
Add thread notification with server assistance (MSC3773) (#9400)
Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
2022-10-24 07:50:21 +01:00
kegsay 17c3fb89c1
Store refactor: convert WidgetPermissionStore (#9458)
* Store refactor: convert WidgetPermissionStore

Add Jest tests as well.

* More tests

* Review comments
2022-10-19 22:00:53 +02:00
kegsay 13fbd096b0
Stores refactor: convert TypingStore; rename TestStores to TestSdkContext (#9454) 2022-10-19 14:14:14 +01:00
kegsay e946674df3
Store refactor: use non-global stores in components (#9293)
* Add Stores and StoresContext and use it in MatrixChat and RoomView

Added a new kind of class:
- Add God object `Stores` which will hold refs to all known stores and the `MatrixClient`. This object is NOT a singleton.
- Add `StoresContext` to hold onto a ref of `Stores` for use inside components.

`StoresContext` is created via:
- Create `Stores` in `MatrixChat`, assigning the `MatrixClient` when we have one set. Currently sets the RVS to `RoomViewStore.instance`.
- Wrap `MatrixChat`s `render()` function in a `StoresContext.Provider` so it can be used anywhere.

`StoresContext` is currently only used in `RoomView` via the following changes:
- Remove the HOC, which redundantly set `mxClient` as a prop. We don't need this as `RoomView` was using the client from `this.context`.
- Change the type of context accepted from `MatrixClientContext` to `StoresContext`.
- Modify alllll the places where `this.context` is used to interact with the client and suffix `.client`.
- Modify places where we use `RoomViewStore.instance` and replace them with `this.context.roomViewStore`.

This makes `RoomView` use a non-global instance of RVS.

* Linting

* SDKContext and make client an optional constructor arg

* Move SDKContext to /src/contexts

* Inject all RVS deps

* Linting

* Remove reset calls; deep copy the INITIAL_STATE to avoid test pollution

* DI singletons used in RoomView; DI them in RoomView-test too

* Initial RoomViewStore.instance after all files are imported to avoid cyclical deps

* Lazily init stores to allow for circular dependencies

Rather than stores accepting a list of other stores in their constructors,
which doesn't work when A needs B and B needs A, make new-style stores simply
accept Stores. When a store needs another store, they access it via `Stores`
which then lazily constructs that store if it needs it. This breaks the
circular dependency at constructor time, without needing to introduce
wiring diagrams or any complex DI framework.

* Delete RoomViewStore.instance

Replaced with Stores.instance.roomViewStore

* Linting

* Move OverridableStores to test/TestStores

* Rejig how eager stores get made; don't automatically do it else tests break

* Linting

* Linting and review comments

* Fix new code to use Stores.instance

* s/Stores/SdkContextClass/g

* Update docs

* Remove unused imports

* Update src/stores/RoomViewStore.tsx

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove empty c'tor to make sonar happy

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-10-19 13:07:03 +01:00
Michael Weimann 0630a9c448
End voice broadcast recording on any call (#9425) 2022-10-16 11:35:25 +00:00
Dominik Henneke 7ddc0b78b3
Correct the dir parameter of MSC3715 (#9391) 2022-10-12 16:56:52 +02:00
Robin 06dbea6255
New group call experience: Room header and PiP designs (#9351)
* Update our cancel icon

The cancel icon we're using in the app has drifted out of sync with the ones used in our designs. We also had two identical-looking icons, so this consolidates them into one.

I've simultaneously updated our chevron icons, since in the case of the 'jump to unread' timeline button, it became clear that the weight of the new close icon did not match the thinner chevron.

* Don't squish bottom/top-aligned tooltips near the edge of the screen

* Close the timeline panel when returning to the fullscreen timeline view

* Add layout switching capabilities to ElementCall

* Bring the room header in line with the group call designs

* Bring the PiP header in line with the group call designs

* Fix lints

* Clarify tooltip CSS calculations

* Test PipView

* Expand RoomHeader test coverage

* Test PipView more
2022-10-07 02:27:28 +00:00
Dominik Henneke 99488b84ec
Remove unspecced `original_event` field from the `readEventRelations` response (#9349)
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
2022-10-04 17:54:26 +00:00
Michael Weimann c182c1c706
Generalise VoiceRecording (#9304) 2022-09-21 18:46:28 +02:00
kegsay 06c4ba32cd
Store refactor: make it easier to test stores (#9290)
* refactor: convert RoomViewStore from flux Store to standard EventEmitter

Parts of a series of experimental changes to improve the design of stores.

* Use a gen5 store for RoomViewStore for now due to lock handling

* Revert "Use a gen5 store for RoomViewStore for now due to lock handling"

This reverts commit 1076af071d997d87b8ae0b0dcddfd1ae428665af.

* Add untilEmission and tweak untilDispatch; use it in RoomViewStore

* Add more RVS tests; remove custom room ID listener code and use EventEmitter

* Better comments

* Null guard `dis` as tests mock out `defaultDispatcher`

* Additional tests
2022-09-20 15:32:39 +00:00
Robin cb735c9439
Element Call video rooms (#9267)
* Add an element_call_url config option

* Add a labs flag for Element Call video rooms

* Add Element Call as another video rooms backend

* Consolidate event power level defaults

* Remember to clean up participantsExpirationTimer

* Fix a code smell

* Test the clean method

* Fix some strict mode errors

* Test that clean still works when there are no state events

* Test auto-approval of Element Call widget capabilities

* Deduplicate some code to placate SonarCloud

* Fix more strict mode errors

* Test that calls disconnect when leaving the room

* Test the get methods of JitsiCall and ElementCall more

* Test Call.ts even more

* Test creation of Element video rooms

* Test that createRoom works for non-video-rooms

* Test Call's get method rather than the methods of derived classes

* Ensure that the clean method is able to preserve devices

* Remove duplicate clean method

* Fix lints

* Fix some strict mode errors in RoomPreviewCard

* Test RoomPreviewCard changes

* Quick and dirty hotfix for the community testing session

* Revert "Quick and dirty hotfix for the community testing session"

This reverts commit 37056514fbc040aaf1bff2539da770a1c8ba72a2.

* Fix the event schema for org.matrix.msc3401.call.member devices

* Remove org.matrix.call_duplicate_session from Element Call capabilities

It's no longer used by Element Call when running as a widget.

* Replace element_call_url with a map

* Make PiPs work for virtual widgets

* Auto-approve room timeline capability

Because Element Call uses this now

* Create a reusable isVideoRoom util
2022-09-16 11:12:27 -04:00
kegsay a3133fa907
bugfix: fix in-reply-to previews not disappearing when swapping rooms (#9278)
* bugfix: fix in-reply-to previews not disappearing when swapping rooms

This was caused by the fix for another issue:
  - https://github.com/vector-im/element-web/issues/21462

Both bugs are now fixed with cypress regression tests.

* Linting

* Ensure the reply-to reappears when you click back

* Add jest test for replyTo in RVS

* Linting
2022-09-15 12:09:16 +00:00
Dominik Henneke 0c22b15bba
Implement MSC3869: Read event relations with the Widget API (#9210)
* Add an action to read relations according to MSC3869

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Apply review comments

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Fix test

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Update matrix-widget-api to 1.1.1

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
2022-09-14 10:18:51 -04:00
kegsay a9f04514fb
bugfix: fix a sliding sync bug which could cause rooms to loop (#9268)
* bugfix: fix a sliding sync bug which could cause rooms to loop

With a Jest regression test.

* Linting
2022-09-12 10:55:46 +00:00
kegsay a215027c6b
Implement MSC3575: Sliding Sync (#8328)
* Add labs flag for sliding sync; add sliding_sync_proxy_url to config.json

* Disable the labs toggle if sliding_sync_proxy_url is not set

* Do validation checks on the sliding sync proxy URL before enabling it in Labs

* Enable sliding sync and add SlidingSyncManager

* Get room subscriptions working

* Hijack renderSublists in sliding sync mode

* Add support for sorting alphabetically/recency and room name filters

* Filter out tombstoned rooms; start adding show more logic

list ranges update but the UI doesn't

* update the UI when the list is updated

* bugfix: make sure the list sorts numerically

* Get invites transitioning correctly

* Force enable sliding sync and labs for now

* Linting

* Disable spotlight search

* Initial cypress plugins for Sliding Sync Proxy

* Use --rm when running Synapse in Docker for Cypress tests

* Update src/MatrixClientPeg.ts

Co-authored-by: Travis Ralston <travisr@matrix.org>

* Update src/components/views/rooms/RoomSublist.tsx

Co-authored-by: Travis Ralston <travisr@matrix.org>

* Update src/settings/controllers/SlidingSyncController.ts

Co-authored-by: Travis Ralston <travisr@matrix.org>

* Update src/components/views/rooms/RoomSublist.tsx

Co-authored-by: Travis Ralston <travisr@matrix.org>

* WIP add room searching to spotlight search

* Only read sliding sync results when there is a result, else use the local cache

* Use feature_sliding_sync not slidingSync

* Some review comments

* More review comments

* Use RoomViewStore to set room subscriptions

* Comment why any

* Update src/components/views/rooms/RoomSublist.tsx

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix cypress docker abstraction

* Iterate sliding sync proxy support

* Stash mostly functional test

* Update sliding sync proxy image

* i18n

* Add support for spaces; use list ID -> index mappings

- Mappings are more reusable and easier to understand than
  racing for index positions.
- Register for all spaces immediately on startup.

* When the active space is updated, update the list registration

* Set spaces filter in the correct place

* Skeleton placeholder whilst loading the space

* Filter out spaces from the room list

* Use the new txn_id promises

* Ensure we actually resolve list registrations

* Fix matrix-org/sliding-sync#30: don't show tombstoned search results

* Remove unused imports

* Add SYNCV3_SECRET to proxy to ensure it starts up; correct aliases for SS test

* Add another basic sliding sync e2e test

* Unbreak netlify

* Add more logging for debugging duplicate rooms

* If sliding sync is enabled, always use the rooms result even if it's empty

* Drop-in copy of RoomListStore for sliding sync

* Remove conditionals from RoomListStore - we have SlidingRoomListStore now

* WIP SlidingRoomListStore

* Add most sliding sync logic to SlidingRoomListStore

Still lots of logic in RoomSublist. Broken things:
 - Join count is wrong completely.
 - No skeleton placeholder when switching spaces.

* Migrate joined count to SS RLS

* Reinstate the skeleton UI when the list is loading

* linting

* Add support for sticky rooms based on the currently active room

* Add a bunch of passing SS E2E tests; some WIP

* Unbreak build from git merge

* Suppress unread indicators in sliding sync mode

* Add regression test for https://github.com/matrix-org/sliding-sync/issues/28

* Add invite test flows; show the invite list

The refactor to SS RLS removed the invite list entirely.

* Remove show more click as it wasn't the bug

* Linting and i18n

* only enable SS by default on netlify

* Jest fixes; merge conflict fixes; remove debug logging; use right sort enum values

* Actually fix jest tests

* Add support for favourites and low priority

* Bump sliding sync version

* Update sliding sync labs to be user configurable

* delint

* To disable SS or change proxy URL the user has to log out

* Review comments

* Linting

* Apply suggestions from code review

Co-authored-by: Travis Ralston <travisr@matrix.org>

* Update src/stores/room-list/SlidingRoomListStore.ts

Co-authored-by: Travis Ralston <travisr@matrix.org>

* Review comments

* Add issue link for TODO markers

* Linting

* Apply suggestions from code review

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* More review comments

* More review comments

* stricter types

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-09-07 15:42:39 +00:00
Robin 0d6a550c33
Prepare for Element Call integration (#9224)
* Improve accessibility and testability of Tooltip

Adding a role to Tooltip was motivated by React Testing Library's
reliance on accessibility-related attributes to locate elements.

* Make the ReadyWatchingStore constructor safer

The ReadyWatchingStore constructor previously had a chance to
immediately call onReady, which was dangerous because it was potentially
calling the derived class's onReady at a point when the derived class
hadn't even finished construction yet. In normal usage, I guess this
never was a problem, but it was causing some of the tests I was writing
to crash. This is solved by separating out the onReady call into a start
method.

* Rename 1:1 call components to 'LegacyCall'

to reflect the fact that they're slated for removal, and to not clash
with the new Call code.

* Refactor VideoChannelStore into Call and CallStore

Call is an abstract class that currently only has a Jitsi
implementation, but this will make it easy to later add an Element Call
implementation.

* Remove WidgetReady, ClientReady, and ForceHangupCall hacks

These are no longer used by the new Jitsi call implementation, and can
be removed.

* yarn i18n

* Delete call map entries instead of inserting nulls

* Allow multiple active calls and consolidate call listeners

* Fix a race condition when creating a video room

* Un-hardcode the media device fallback labels

* Apply misc code review fixes

* yarn i18n

* Disconnect from calls more politely on logout

* Fix some strict mode errors

* Fix another updateRoom race condition
2022-08-30 15:13:39 -04:00
Robin 28ed87bffe
Implement MSC3846: Allowing widgets to access TURN servers (#9061)
* Implement MSC3819: Allowing widgets to send/receive to-device messages

* Don't change the room events and state events drivers

* Implement MSC3846: Allowing widgets to access TURN servers

* Update to latest matrix-widget-api changes

* Support sending encrypted to-device messages

* Yield a TURN server immediately

* Use queueToDevice for better reliability

* Update types for latest WidgetDriver changes

* Upgrade matrix-widget-api

* Add tests

* Test StopGapWidget

* Fix a potential memory leak

* Add tests

* Empty commit to retry CI
2022-08-10 13:26:42 +00:00
Robin 103b60dfb5
Implement MSC3819: Allowing widgets to send/receive to-device messages (#8885)
* Implement MSC3819: Allowing widgets to send/receive to-device messages

* Don't change the room events and state events drivers

* Update to latest matrix-widget-api changes

* Support sending encrypted to-device messages

* Use queueToDevice for better reliability

* Update types for latest WidgetDriver changes

* Upgrade matrix-widget-api

* Add tests

* Test StopGapWidget

* Fix a potential memory leak
2022-08-10 08:57:56 -04:00
Michael Weimann fa1bff67cf
Wire local room logic (#9078)
* Wire local room logic

* Migrate to testling-lib; update test descriptions
2022-07-20 09:26:25 +02:00
Michael Weimann 8641a5210b
Add LocalRoom (#9023) 2022-07-11 07:33:37 +02:00
Kerry 4eab0deeb3
Live location share - explicitly stop beacons replaced beacons (PSG-544) (#8933)
* explicitly stop beacons before creating new ones

* remove unnecessary optional chain
2022-06-30 07:33:51 +00:00
Robin 3c14d93237
Reduce video rooms log spam (#8913)
* Reduce video rooms log spam

If you forget to call preventDefault in widget action handlers,
matrix-widget-api logs a bunch of errors complaining that the action is
unsupported/unhandled, even if it isn't.

* Fix tests
2022-06-29 16:09:41 +02:00
Robin 84cf40e0f3
Switch video rooms to spotlight layout when in PiP mode (#8912)
* Switch video rooms to spotlight layout when in PiP mode

* Add some comments
2022-06-27 20:45:13 +00:00
Robin ef48443dc9
Show chat panel when opening a video room with unread messages (#8812)
* Show chat panel when opening a video room with unread messages

* Remove unnecessary calls to private methods in tests

* Make room ID mandatory when toggling the right panel

* Restore the isViewingRoom check

* Test RightPanelStore

* Make the constructor private again

* Add even more tests

* Fix onReady
2022-06-17 16:57:40 -04:00
Robin d9396b0b54
Expire video member events after 1 hour (#8776)
* Expire video member events after 1 hour

* Iterate based on feedback

* Validate the types of video member events better

* Even more parentheses
2022-06-09 13:19:52 +00:00
Robin f152310c08
Use random widget IDs for video rooms (#8739) 2022-06-02 09:10:22 -04:00
Robin 7edc4b1965
Stop connecting to a video room if the widget messaging disappears (#8660)
* Stop connecting to a video room if the widget messaging disappears

* Clean up more listeners

* Clean up even more listeners
2022-05-24 07:43:27 -04:00
Janne Mareike Koschinski 2d386556a6
ensure metaspace changes correctly notify listeners (#8611) 2022-05-18 15:15:25 +02:00
Robin ceda77d7dc
Proactively fix stuck devices in video rooms (#8587)
* Proactively fix stuck devices in video rooms

* Fix tests

* Explain why we're disabling the lint rule

* Apply code review suggestions

* Back VideoChannelStore's flags by SettingsStore instead of localStorage
2022-05-16 16:54:08 -04:00
Kerry dc346d5e83
test typescriptification - RoomViewStore (#8539)
* test/stores/RoomViewStore-test.js -> test/stores/RoomViewStore-test.tsx

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix tsc issues

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-05-09 15:14:45 +02:00
Germain 3a63c88a11
Order new search dialog results by recency (#8444)
* Order new search dialog results by recency

* Add getLastTs tests

* Add sort rooms tests
2022-05-05 12:19:11 +01:00
Kerry e233cf5061
Live location sharing: fix safari timestamps pt 2 (#8443)
* handle safari cocoa core data timestamps

Signed-off-by: Kerry Archibald <kerrya@element.io>

* actually fix safari timestamp issue properly

Signed-off-by: Kerry Archibald <kerrya@element.io>

* actually fix safari timestamp issue properly

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-29 09:12:28 +00:00
Kerry 472222c195
LLS: error handling on stopping beacon (#8406)
* shared stopping error state for timeline, maxi and room warnign

Signed-off-by: Kerry Archibald <kerrya@element.io>

* check for stopping errors in roomlist share warning

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test stopping errors in OwnBeaconStore

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update LeftPanelLiveShareWarning tests for stopping errors

Signed-off-by: Kerry Archibald <kerrya@element.io>

* reinstate try/catch for stopping beacons in create

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove unnecessary and buggy beacon stopping on creation

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-28 12:03:51 +00:00
Kerry 8c6786bad6
LLS: rename wireError (#8401)
* rename wireError in ownbeaconstore to locationPublishError

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rename getLiveBeaconIdsWithWireError -> getLiveBeaconIdsWithLocationPublishError

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rename wire error variables in components

Signed-off-by: Kerry Archibald <kerrya@element.io>

* new snapshots for new test names

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix bad capitalisation on onResetLocationPublishError

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed variable

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-25 12:44:18 +00:00
Robin 6bfe0436e5
Fix infinite loop when pinning/unpinning persistent widgets (#8396)
Pinning or unpinning a persistent widget, such as Jitsi, could cause the
PiP view and the app drawer to fight for control over the widget, since
the PiP view never realized that it was supposed to relinquish control.
This was due to a race between the WidgetLayoutStore update and the
AppTile lifecycle tracking update.
2022-04-25 08:29:54 -04:00
Robin 2a396a406d
Stick connected video rooms to the top of the room list (#8353) 2022-04-22 08:17:31 -04:00
Kerry 988d300258
Live location sharing: only share to beacons created on device (#8378)
* create live beacons in ownbeaconstore and test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* more mocks in RoomLiveShareWarning

Signed-off-by: Kerry Archibald <kerrya@element.io>

* extend mocks in components

Signed-off-by: Kerry Archibald <kerrya@element.io>

* comment

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove another comment

Signed-off-by: Kerry Archibald <kerrya@element.io>

* extra ? hedge in roommembers change

Signed-off-by: Kerry Archibald <kerrya@element.io>

* listen to destroy and prune local store on stop

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tests

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update copy pasted copyright to 2022

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-22 12:05:36 +00:00
Kerry a3a7c60dd7
LLS: Remove beacon info illegal replace relation (#8390)
* dont apply illegal replace relation to beacon_info event

Signed-off-by: Kerry Archibald <kerrya@element.io>

* only display tiles for beacon infos with live prop

Signed-off-by: Kerry Archibald <kerrya@element.io>

* copyrights

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-22 11:38:27 +00:00
Kerry 73e8387799
test functional EventUtils (#8386)
* extract poll event test util

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test isContentActionable

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test canEditContent

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test functional eventutils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* copyrights

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-21 18:14:10 +02:00
Robin 6e86a14cc9
Show a lobby screen in video rooms (#8287)
* Show a lobby screen in video rooms

* Add connecting state

* Test VideoRoomView

* Test VideoLobby

* Get the local video stream with useAsyncMemo

* Clean up code review nits

* Explicitly state what !important is overriding

* Use spacing variables

* Wait for video channel messaging

* Update join button copy

* Show frame on both the lobby and widget

* Force dark theme for video lobby

* Wait for the widget to be ready

* Make VideoChannelStore constructor private

* Allow video lobby to shrink

* Add invite button to video room header

* Show connected members on lobby screen

* Make avatars in video lobby clickable

* Increase video channel store timeout

* Fix Jitsi Meet getting wedged on startup in Chrome and Safari

* Revert "Fix Jitsi Meet getting wedged on startup in Chrome and Safari"

This reverts commit 9f77b8c227c1a5bffa5d91b0c48bf3bbc44d4cec.

* Disable device buttons while connecting

* Factor RoomFacePile into a separate file

* Fix i18n lint

* Fix switching video channels while connected

* Properly limit number of connected members in face pile

* Fix CSS lint
2022-04-20 11:03:33 -04:00
Kerry 44d446be89
Live location sharing - set replaces relation when stopping beacon (#8266)
* set replaces relation on stopping beacon

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update tests for stopBeacon

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-11 10:28:43 +02:00
Kerry 03d0969ae3
Live location sharing - update beacon_info implementation to latest MSC (#8256)
* update calls to set and createLiveBeacon

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix stop beacon

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove variable event type from beacon utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use beacon identifier

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix RoomLiveShareWarning tests

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add case for beacon update

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* more lint

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-04-08 10:53:06 +02:00
Travis Ralston 0280c27bfd post-merge fixes 2022-04-05 10:57:16 -06:00
Travis Ralston 4057833036 Merge branch 'develop' into travis/remove-skinning 2022-04-05 10:50:37 -06:00
Robin 1f64835fab
Update video rooms to new design specs (#8207)
* Remove radio component

* "Voice room" → "video room"

* Remove interactivity from video room tiles

* Update connection state when joining via widget

* Simplify room header buttons for video rooms

* Split out video room creation into a separate menu option

* Simplify room options for video rooms

* Update video room tile layout

* Tell the Jitsi widget whether it's a video channel

* Update tests

* "Voice" → "video" in more places

* Fix tests

* Re-add frame to immersive Jitsi widgets

* Comment ack

* Make updateDevices more readable

* Type FacePile
2022-04-01 14:36:10 +00:00
Travis Ralston 97efdf7094 Merge branch 'develop' into travis/remove-skinning 2022-03-31 19:25:43 -06:00
Kerry 1175226bcb
Live location sharing - display wire error in room (#8198)
* expose wire errors in more useful way

* add wire error state to room live share warning bar

Signed-off-by: Kerry Archibald <kerrya@element.io>

* stylelint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add types to getLabel helper

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-31 10:57:12 +02:00
Kerry d09205122d
Live location sharing - Stop publishing location to beacons with consecutive errors (#8194)
* add error state after consecutive errors

Signed-off-by: Kerry Archibald <kerrya@element.io>

* polish

Signed-off-by: Kerry Archibald <kerrya@element.io>

* comment

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-30 14:01:44 +00:00
Kerry 2adc972eec
Live location sharing - stop sharing to beacons in rooms you left (#8187)
* remove beacons on membership changes

* add addMembershipToMockedRoom test util

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test remove beacons on membership changes

Signed-off-by: Kerry Archibald <kerrya@element.io>

* removelistener

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-29 18:18:34 +02:00
Travis Ralston d5ed1eb66e Step 8.3: Convert `RoomViewStore` to a more modern singleton for imports 2022-03-28 14:02:31 -06:00