Commit Graph

2091 Commits

Author SHA1 Message Date
Timo
b993c5eb12 fix linter 2024-12-13 03:23:20 +01: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
Robin
8b19beae68 Fix lint errors 2024-12-10 13:05:09 -05:00
Will Hunt
a8a95c3f00 Ensure call sound effects are played over the correct sink (#2863)
* 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

* fix a few things

* Change the way we as unknown the mock RTC session.

* Lint

* Fix types for MockRTCSession

* value change should always be set

* Update volume slider description.

* Only load reaction sound effects if enabled.

* cache improvements

* lowercase soundMap

* lint

* move prefetch sounds to fix hot reload

* correct docs

* add a header

* Wording change

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2024-12-09 11:39:16 +00:00
Will Hunt
9d4cd211ed Authenticate media requests when loading avatars (#2856)
* Load authenicated media

* lint

* Add tests

* Add widget behaviour and test.

* Update src/Avatar.test.tsx

Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
2024-12-06 18:30:05 +00:00
Timo
43c81a2758 Make video tiles be based on MatrixRTC member not LiveKit participants (#2701)
* 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

* Revert "Make the loading state more subtle"

This reverts commit 765f7b4f31.

* Update src/state/CallViewModel.ts

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

* Fix spelling

* Remove a non-null assertion that failed at runtime

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
2024-12-06 11:28:37 +00:00
Hugh Nimmo-Smith
21b62dbd89 Use a consistent background colour for video tiles and avatars (#2868) 2024-12-05 13:26:31 +00:00
Hugh Nimmo-Smith
27620b9148 Rename en-GB language to en (#2866)
Fixes https://github.com/element-hq/element-call/issues/2865

If we want to have GB and US specific terms later on we can then add then in as `en-GB` and `en-US`.
2024-12-04 14:51:29 +00:00
Will Hunt
cc260811e2 Add a lower limit to duplicate tiles. (#2854)
* Add a limit to duplicate tiles.

* missed a change
2024-12-02 17:15:33 +00:00
Hugh Nimmo-Smith
a37c3bfb48 Show hostname in developer settings (#2857)
Also refactored developer settings labels into own locale section
2024-12-02 15:43:19 +00:00
Will Hunt
ea6f2952af Add sound effect for call joined / left (#2794)
* Add renderer for call joined / left

* lint

* Add new sounds

* Updates sounds in renderer

* lint

* move import

* pad sounds with silence

* lint

* tidy

* Drop autoplay since we now subscribe correctly.

* Comitting test files I am going to be going to lunch so will tidy up in a little while.

* finish up tests

* Add support for multiple channels per sound.

* lint
2024-12-02 15:16:58 +00:00
renovate[bot]
e142493380 Update all non-major dependencies (#2852)
* Update all non-major dependencies

* prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Timo <toger5@hotmail.de>
2024-12-02 12:10:20 +01:00
Timo
84b2dc8680 Use light background
- the icons and the font is dark so the bg should not be darkened. But making it lighter is making it easier to read.
2024-11-29 17:48:18 +01:00
Timo
65e962bf1b Fix wrong hand raise margins in pip tile. (#2840) 2024-11-28 17:24:24 +00:00
Timo
28da8c48da Mute state improvements including muting if skipLobby=true in SPA (Based on #2834) (#2846) 2024-11-28 18:05:12 +01:00
Hugh Nimmo-Smith
cf174261c9 Some simple initial tests for MediaView (#2813)
* Some simple tests for MediaView

* Use jest-dom assertions

* Add tests for videoMuted

* Add test case for placeholder video track

* Revert yarn.lock changes

* More revert

* Deduplicate test case logic and improve names

* Use role and label
2024-11-25 20:22:02 +00:00
Hugh Nimmo-Smith
fc8da6ef58 Use hot marbles for speaker tests (#2815)
* Refactor the speaker detection logic into observeSpeaker and add tests

@robintown the tests pass, but some of the values were off by 1ms from what I was expecting. Please can you sanity check them?

* Extra test cases and clean up

* Make distinctUntilChanged part of the observable itself

* More suggestions from code review

* Use hot marbles for speaker tests

This was originally part of https://github.com/element-hq/element-call/pull/2810

* Only feed speaking mocks to observables that ask for IsSpeakingChanged
2024-11-23 08:59:33 +00:00
Hugh Nimmo-Smith
4e1b4fae19 Refactor the speaker detection logic into observeSpeaker and add tests (#2814)
* Refactor the speaker detection logic into observeSpeaker and add tests

@robintown the tests pass, but some of the values were off by 1ms from what I was expecting. Please can you sanity check them?

* Extra test cases and clean up

* Make distinctUntilChanged part of the observable itself

* More suggestions from code review
2024-11-23 08:59:15 +00:00
Hugh Nimmo-Smith
5c18868aa4 The preload URL param shouldn't be used in SPA mode, so ignore it if not in widget (#2832)
* Refactor URL parameters into table

This is for readability and ahead of some possible changes

* Whitespace

* Lint

* The preload URL param shouldn't be used in SPA mode, so ignore it
2024-11-23 08:55:03 +00:00
Robin
51e4a3b14b Don't trigger keyboard shortcuts if modifiers are held
None of these keyboard shortcuts expect modifier keys, so they should in fact expect the absence of modifiers.
2024-11-22 13:17:05 -05:00
Robin
0718774cef Clarify how preferred devices work 2024-11-21 11:32:15 -05:00
Robin
a2b452c1d8 Don't override the camera without pressing "switch camera" 2024-11-21 11:24:45 -05:00
Robin
465a784345 Merge branch 'livekit' into device-fall-back 2024-11-21 11:04:36 -05:00
Robin
8de96878c0 Merge pull request #2803 from robintown/device-radio
Replace device dropdowns with radio buttons
2024-11-21 10:47:44 -05:00
Hugh Nimmo-Smith
b7b9771577 Use hot test input marbles instead of cold (#2810)
* Use hot test input marbles instead of cold

These will be needed for https://github.com/element-hq/element-call/pull/2701

* Revert for "spotlight speakers swap places" test
2024-11-21 11:03:16 +00:00
Hugh Nimmo-Smith
3885eefa4c Disambiguate between types of "member" (#2807)
We have Matrix room members and MatrixRTC session memberships. Livekit also has rooms.

So, this attempts to make it more obvious as to what type you are referring to.
2024-11-21 11:02:05 +00:00
Hugh Nimmo-Smith
9176e06195 Some tsdoc and explicit typing (#2809)
* Some tsdoc and explicit typing

Pulled out of https://github.com/element-hq/element-call/pull/2701

* Extra typing
2024-11-21 11:01:43 +00:00
Robin
3ab9bb72e2 Revert "Init client with a memory store (for MSC4222) (#2764)"
This reverts commit 83fa9661cf. We won't need this hack once we're no longer using a matrix-js-sdk branch with MSC4222 support.
2024-11-20 10:22:42 -05:00
Robin
38085baab8 Replace device dropdowns with radio buttons
This is closer to what the designs actually want device settings to look like, and it avoids the visual glitch in which the dropdown would render underneath the slider.
2024-11-20 09:44:32 -05:00
Hugh Nimmo-Smith
8891a9a70e Make it clearer what are inputs and what are expected outputs in test cases (#2808)
Rationale: try and make the marbles section of each test case more readable
2024-11-20 14:44:23 +00:00
Hugh Nimmo-Smith
fbc2cd3e97 Remove redundant distinctUntilChanged (#2804)
Because this.scope.state() does this for us
2024-11-20 10:31:36 +00:00
Robin
770730ba6c Don't fall back as eagerly to unselected devices
Somewhere around version 131 or 132, Firefox has started being more paranoid about media device fingerprinting, and will not even give you the IDs of available devices until you've requested a media stream. Instead you only get a single audio input and video input each with the empty string as their device ID, representing the system's default device. We can recognize this case and avoid resetting the device selection.
2024-11-19 13:26:40 -05:00
Will Hunt
b3ceb5300c Add keyboard shortcuts for raised hand / reactions (#2784)
* Add support for reactions / raised-hands via keyboard shortcuts.

* Add tests

* Fixup shortcuts

* update snapshotr

* fix type

* keyshortcuts

* remove mistakenly commited file

* fix label logic

* Add renderer for call joined / left

* Use caption

* lint

* remove unexpected file

* remove other unexpected change

* Remove other other unexpected change.
2024-11-19 16:57:57 +00:00
Robin
8ec2f9bb31 Update tests 2024-11-19 10:43:42 -05:00
Robin
2ee468ba44 Update icon and label of reactions button
They've been updated in the designs.
2024-11-19 09:56:46 -05:00
Hugh Nimmo-Smith
64749d0b7a Expose TestScheduler as global (#2796) 2024-11-18 22:39:59 +00:00
Timo
a551cde47b Make reactions background use the frosted glass look (#2792)
* Make reactions background use the frosted glass look

* fix spacing if there is raise hand + reaction.
2024-11-15 18:58:40 +01:00
Will Hunt
eed1b98cf9 Update reactions to new design (#2751)
* Replace search strings

* Add expander for reactions view

* lint

* Remove useless list

* Update tests

* lint

* Only shrink buttons on web version, mobile never shrinks

* Revert accidental change.

* Remove border from button

* Tidy up views.

* Finish matching designs.

* Fix height

* Remove a unneeded class

* Remove more cruft

* Remove unnessacery chunk

* Evenly space reactions

* lint

* Disable reaction buttons when busy

* Try to make menu a bit more responsive

* Update test

* further screen size tweaks
2024-11-15 16:02:06 +00:00
Will Hunt
c1208ac7b6 Small improvements to settings tab (#2789)
* align profile tab.

* Fix descriptions
2024-11-15 14:09:52 +00:00
Quentin Gliech
2e172aa3be Pre-fetch the config.json to improve startup time 2024-11-15 13:36:36 +01:00
Quentin Gliech
4c1c818ba9 Merge pull request #2776 from element-hq/quenting/locales-as-assets
Handle locales as Vite assets
2024-11-15 08:41:56 +01:00
Hugh Nimmo-Smith
50934a53cd Lazy load matrix-js-sdk when running as SPA (#2785) 2024-11-14 21:54:02 +00:00
Quentin Gliech
99d5886e32 Handles locales as Vite assets 2024-11-14 19:12:11 +01:00
Quentin Gliech
137a53dbee Load the Intl.Segmenter and Intl.DurationFormat polyfills only if needed (#2778)
* Load the Intl.Segmenter polyfill only if needed

* Also polyfill Intl.DurationFormat only if needed

* Polyfill Intl.* in tests

* Load the default translations in tests

* Instanciate the Intl.DurationFormat in the component
2024-11-14 18:06:38 +00:00