Commit Graph

2135 Commits

Author SHA1 Message Date
Hugh Nimmo-Smith
0f5dc33918 Fix copyright header to say dual license not just AGPL (#3013)
This probably should have been part of https://github.com/element-hq/element-call/pull/2984
2025-02-18 17:59:58 +00:00
Hugh Nimmo-Smith
294e67a5ba Show current SFU and Server Info in developer tab (#3000)
* Show current SFU and Server Info in developer tab

* Lint
2025-02-10 18:22:19 +01:00
Timo
bff2b73c85 Bump matrix-js-sdk to v36.1.0 (#2967)
Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2025-02-03 12:28:12 +00:00
Will Hunt
1dde54daa9 Use matrixIdentifier for screenshare (#2981) 2025-02-03 10:17:19 +00:00
Will Hunt
3506ca7feb Fix calculation of local membership identifier (#2966) 2025-01-23 13:42:29 +00:00
Robin
e636542b1e Prevent new devices from automatically starting unmuted in call (#2959) 2025-01-17 15:30:28 +00:00
Robin
cda802a2e9 Make error screens more visually consistent (#2951) 2025-01-17 09:35:39 +00:00
Robin
c218dc2f36 Remember previous mute states when devices disappear and reappear (#2957) 2025-01-17 09:11:17 +00:00
Will Hunt
3189bdba2a Fix displayname calculation around RTL / unhomoglyth. (#2953) 2025-01-16 17:26:58 +00:00
Hugh Nimmo-Smith
723fa290ff Bump matrix-js-sdk to latest (#2946)
Co-authored-by: Timo <toger5@hotmail.de>
2025-01-16 10:31:05 -05:00
Will Hunt
0f2e67dd60 Disambiguate displaynames (#2918)
* Disambigute displaynames

* Add test

* fixup test functions

* prettier

* lint

* Split displayname utils into own file and add tests.

* Split out fixtures

* Add more testcases for displayname calculation.

* lint

* Also listen for displayname changes. (I stand corrected!)

* fix missing media tiles on missing member
2025-01-14 14:46:39 +00:00
Hugh Nimmo-Smith
d9e0c67315 Use correct Sentry entrypoints for react router v7 (#2943) 2025-01-13 16:34:44 +00:00
Hugh Nimmo-Smith
2f5f0978ad Type fixes for react v19 compatibility (#2937) 2025-01-13 15:54:42 +01:00
Robin
8bfdd1f455 Merge pull request #2910 from robintown/widget-theme-change
React to theme changes in widget mode
2025-01-08 15:56:02 -05:00
renovate[bot]
dc784e95cd Update dependency react-router-dom to v7 (#1624)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2025-01-08 16:42:07 +00:00
Robin
acd4a1f179 Fix tests 2025-01-08 11:41:44 -05:00
Robin
c66b8c0fd3 Merge branch 'livekit' into widget-theme-change 2025-01-08 11:27:46 -05:00
davidegirardi
d5bf65057a Add wave/hello reaction (#2921)
Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
Co-authored-by: Davide Girardi <davideg@element.io>
2025-01-08 14:05:07 +00:00
Will Hunt
7e507d6310 Set the document title to the current call name. (#2928)
Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2025-01-08 13:24:23 +00:00
Hugh Nimmo-Smith
939aaa39eb Remove unnecessary dependency on @testing-library/react-hooks (#2926) 2025-01-07 10:18:45 -05:00
Quentin Gliech
b5f4a07868 Upgrade to React Router v6 (#2919) 2025-01-06 17:00:20 +00:00
Hugh Nimmo-Smith
2c33d65824 Add developer mode option to show RTC connection statistics (#2904)
* Add developer mode option to show RTC connection statistics

* Add note about localization

* Add titles to help explain what the numbers are

* Workaround horizontal scrolling

* Use modal to show detailed stats instead of alert

* Changed styling and fixed fps = 0 (#2916)

(React rendered 0 instead of <Text /> for fps && <Text>{fps}</text>)

---------

Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
2025-01-06 09:47:39 +00:00
Robin
e477c16a0b Fix lint errors 2025-01-02 13:32:39 -05:00
Will Hunt
abf2ecd521 Refactor reactions / hand raised to use rxjs and start ordering tiles based on hand raised. (#2885)
* Add support for using CallViewModel for reactions sounds.

* Drop setting

* Convert reaction sounds to call view model / rxjs

* Use call view model for hand raised reactions

* Support raising reactions for matrix rtc members.

* Tie up last bits of useReactions

* linting

* Update calleventaudiorenderer

* Update reaction audio renderer

* more test bits

* All the test bits and pieces

* More refactors

* Refactor reactions into a sender and receiver.

* Fixup reaction toggle button

* Adapt reactions test

* Tests all pass.

* lint

* fix a couple of bugs

* remove unused helper file

* lint

* finnish notation

* Add tests for useReactionsReader

* remove mistaken vitest file

* fix

* filter

* invert

* fixup tests with fake timers

* Port useReactionsReader hook to ReactionsReader class.

* lint

* exclude some files from coverage

* Add screen share sound effect.

* cancel sub on destroy

* tidy tidy
2024-12-19 15:54:28 +00:00
Will Hunt
7d00f85abc Add screen share sound effect. (#2917) 2024-12-19 12:37:10 +00:00
Hugh Nimmo-Smith
ba5da7e9af Inform user that their camera is starting in Lobby (#2869)
* Inform user that their camera is starting

Instead of just showing a grey box.

* Review feedback

* Show spinner from design suggestion

* useMemo

* Lint

* Lint

* Feedback from review

* Use colour that actually exists

* Refactor into Avatar superclass

* .

* Remove size limit behaviour

* Add VideoPreview tests
2024-12-18 15:31:45 +00:00
Hugh Nimmo-Smith
19d0f84f02 Introduce intent URL param and make it change the default lobby behaviour (#2828)
* Introduce `intent` URL param and make it change the default lobby behaviour

* Mark skipLobby as deprecated

* Add support for unknown intent which is default for when not specified
2024-12-18 15:30:33 +00:00
Robin
5d8804d7e8 React to theme changes in widget mode 2024-12-17 20:03:17 -05:00
Hugh Nimmo-Smith
53fff37d5d Use AutoDiscovery.getRawClientConfig() instead of MatrixClient.getClientWellKnown() (#2906)
I'm open to suggestions on what is sensible to test around this...
2024-12-17 17:44:50 +01:00
Hugh Nimmo-Smith
2b6acb9cce Use afterEach from vitest for consistency (#2908)
This slipped through the PR review. Whilst not harmful, for consistency we use it from vitest.
2024-12-17 11:17:37 +01:00
Hugh Nimmo-Smith
79c40f198c Use finnish notation for observables (#2905)
To help make our usage of the observables more readable/intuitive.
2024-12-17 04:01:56 +00:00
Robin
e4bd9d7cf9 Merge pull request #2816 from robintown/firefox-audio-output
Support selection of audio output device when using Firefox
2024-12-16 10:14:27 -05:00
Robin
25d0338f35 Skip some redundant updates to the grid and spotlight
While debugging our layout shift issue I learned that a single change to the sort order of the participants can cause 3 or 4 redundant emissions of the same items in the same order. Since each of these would cause React to re-render the grid, skipping these spurious emissions seems like an easy performance win.
2024-12-13 16:40:20 -05:00
Robin
f9e3fe3176 Use observables for more of the media devices logic 2024-12-13 15:37:29 -05:00
Robin
de276b1fc3 Annotate the default device with a label 2024-12-13 15:22:44 -05:00
Robin
9c57720852 Merge branch 'livekit' into firefox-audio-output 2024-12-13 14:55:27 -05:00
Hugh Nimmo-Smith
a723f10d2c Developer setting to show LiveKit participants that do not have MatrixRTC sessions a.k.a. non-member tiles (#2771)
* make tiles based on rtc member

* display missing lk participant + fix tile multiplier

* add show_non_member_participants config option

* per member tiles

* merge fixes

* linter

* linter and tests

* tests

* adapt tests (wip)

* Remove unused keys

* Fix optionality of nonMemberItemCount

* video is optional

* Mock RTC members

* Lint

* Merge fixes

* Fix user id

* Add explicit types for public fields

* isRTCParticipantAvailable => isLiveKitParticipantAvailable

* isLiveKitParticipantAvailable

* Readonly

* More keys removal

* Make local field based on view model class not observable

* Wording

* Fix RTC members in tes

* Tests again

* Lint

* Disable showing non-member tiles by default

* Duplicate screen sharing tiles like we used to

* Lint

* Revert function reordering

* Remove throttleTime from bad merge

* Cleanup

* Tidy config of show non-member settings

* tidy up handling of local rtc member in tests

* tidy up test init

* Fix mocks

* Cleanup

* Apply local override where participant not yet known

* Handle no visible media id

* Assertions for one-on-one view

* Remove isLiveKitParticipantAvailable and show via encryption status

* Handle no local media (yet)

* Remove unused effect for setting

* Tidy settings

* Avoid case of one-to-one layout with missing local or remote

* Iterate

* Remove option to show non-member tiles to simplify code review

* Remove unused code

* Remove more remnants of show-non-member-tiles

* iterate

* back

* Fix unit test

* Refactor

* Expose TestScheduler as global

* Fix incorrect type assertion

* Simplify speaking observer

* Fix

* Whitespace

* Make it clear that we are mocking MatrixRTC memberships

* Test case for only showing tiles for MatrixRTC session members

* Simplify diff

* Simplify diff

These changes are in https://github.com/element-hq/element-call/pull/2809

* .

* Whitespaces

* Use asObservable when exposing subject

* Show "waiting for media..." when no participant

* Additional test case

* Don't show "waiting for media..." in case of local participant

* Make the loading state more subtle
 - instead of a label we show a animated gradient

* Use correct key for matrix rtc foci in code comment. (#2838)

* Update src/tile/SpotlightTile.tsx

Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>

* Update src/state/CallViewModel.ts

Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>

* Make the purpose of BaseMediaViewModel.local explicit

* Use named object instead of unnamed array for spotlightAndPip

* Refactor spotlightAndPip into spotlight and pip

* Use if statement instead of ternary for readability in spotlight and pip logic

* Review feedback

* Fix tests for CallEventAudioRenderer

* Lint

* Developer setting to show non-member tiles

This is based on top of https://github.com/element-hq/element-call/pull/2701

* Lint

* Remove unused code

* Remove changes that should be in https://github.com/element-hq/element-call/pull/2858

* Update src/state/CallViewModel.test.ts

Co-authored-by: Robin <robin@robin.town>

* Merge branch 'livekit' into toger5/show-non-member-tiles

* Remove unused nonMemberItemCount

* Restore default showNonMemberTiles value after test

* Update comments

---------

Co-authored-by: Timo <toger5@hotmail.de>
Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
Co-authored-by: Robin <robin@robin.town>
2024-12-13 14:53:08 +00:00
Robin
0c66ec5d71 Merge pull request #2894 from robintown/stable-visibility
Determine which tiles are on screen in a more stable manner
2024-12-13 09:16:49 -05:00
Hugh Nimmo-Smith
e84ecc68b3 Refactor preferences tab strings for consistency (#2888)
* Refactor preferences tab strings for consistency

* Lint
2024-12-13 13:23:32 +00:00
Hugh Nimmo-Smith
7807c44fdc Clean up useMuteStates test (#2891)
We don't need to be mocking React for this test.
2024-12-13 10:09:27 +00:00
Timo
b993c5eb12 fix linter 2024-12-13 03:23:20 +01:00
Robin
53565ddb76 Test that participants adjust order when screen size changes 2024-12-12 19:16:01 -05:00
Robin
00056a7cd9 Determine which tiles are on screen in a more stable manner
Instead of tracking for each individual tile whether it's visible, just track the total number of tiles that appear on screen. This ought to make the whole thing a lot less dynamic, which is crucial given that our UI renders asynchronously and RxJS doesn't really support cyclic dependencies in any rigorous way.

In particular this ought to make the following kind of situation impossible:
1. There 3 tiles, ABC. A and B are on screen.
2. Now C becomes important. The requested order is now CAB.
3. To reduce the size of the layout shift, the algorithm selects to swap just B and C in the original order, giving ACB. However, the UI is blocked and doesn't render this order yet.
4. For whatever reason, a spurious update of the importance algorithm occurs. It once again requests CAB.
5. Now because the UI was blocked, the layout still thinks that A and B are on screen (rather than A and C). It thinks that C is some weird island of "off-screen territory" in the middle of the tile order. This confuses it into swapping A and C rather than keeping the layout stable.

The reality is that whenever we think N tiles are visible on screen, we're always referring to the first N tiles in the grid. It's best if the code reflects this assumption.
2024-12-12 18:00:59 -05:00
Will Hunt
77facd01e4 Add support for playing a sound when the user exits a call. (#2860)
* Refactor to use AudioContext

* Remove unused audio format.

* Reduce update frequency for volume

* Port to useAudioContext

* Port reactionaudiorenderer to useAudioContext

* Integrate raise hand sound into call event renderer.

* Simplify reaction sounds

* only play one sound per reaction type

* Start to build out tests

* fixup tests / comments

* Fix reaction sound

* remove console line

* Remove another debug line.

* fix lint

* Use testing library click

* lint

* Add support for playing a sound when the user exits a call.

* Port GroupCallView to useAudioContext

* Remove debug bits.

* asyncify

* lint

* lint

* lint

* tidy

* Add test for group call view

* Test widget mode too.

* fix ?.

* Format

* Lint

* Lint

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2024-12-12 07:33:47 +00:00
Hugh Nimmo-Smith
6c81f69590 Rename developerSettingsTab to developerMode for consistency (#2889) 2024-12-11 14:30:16 +00:00
Robin
b834d8f679 Add some quick-and-dirty debug info for TileStore (#2887)
* Add some quick-and-dirty debug info for TileStore

I'm still in need of more detailed data in order to understand why big layout shifts happen in large calls. This adds a developer option to enable logging and a visual indicator for the state of the TileStore. The indicator should be useful for matching up the behavior I'm seeing in my recordings with the right timestamps.

* Reduce performance impact of checking for whether debug mode is enabled

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2024-12-11 10:23:42 +00:00
Hugh Nimmo-Smith
54149a496c Simplify settings tabs (#2875)
* Simplify settings tabs

- Move Analytics to Feedback tab
- Rename Developer Settings to Developer Mode and move to Preferences tab
- Clean up Preferences tab
- Only way to see version number is by enabling Developer Mode

* Remove extra label

* Lint

* Lint

* Update locales/en/app.json

Co-authored-by: Robin <robin@robin.town>

---------

Co-authored-by: Robin <robin@robin.town>
2024-12-11 09:36:59 +00:00
Hugh Nimmo-Smith
0087e37f30 Enable @typescript-eslint/consistent-type-imports lint rule (#2886)
* Enable @typescript-eslint/consistent-type-imports lint rule

This is to help ensure that we get proper vite/rollup lazy loading by not `import`ing more than we need to.

Revert "Enable @typescript-eslint/consistent-type-imports lint rule"

This reverts commit ba385fa00b7e410cc508fd5fb9fe972233ae114f.

Enable @typescript-eslint/consistent-type-imports lint rule

This is to help ensure that we get proper vite/rollup lazy loading by not `import`ing more than we need to.

.

* Format
2024-12-11 09:27:55 +00:00
Hugh Nimmo-Smith
8558f0349f Check for parentUrl when deciding whether a SPA specific url parameter should be ignored (#2881) 2024-12-11 09:26:55 +00:00
Hugh Nimmo-Smith
45564fd629 Ignore URL params where they are not applicable for the mode (widget vs SPA) (#2882) 2024-12-11 09:23:37 +00:00