* Use WebAudio API to play notification sound
So that it won't appear in system media control.
* Run prettier
* Chosse from mp3 and ogg
* Run prettier
* Use WebAudioAPI everywhere
There's still one remoteAudio. I'm not sure what it does. It seems it's
only used in tests...
* Run prettier
* Eliminate a stupid error
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update setupManualMocks.ts
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* mocks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* mocks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Simplify
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* covg
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Don't consider textual characters to be emoji
We were using emojibase-regex to match emoji within messages. However, the docs (https://emojibase.dev/docs/regex/) state that this regex matches both emoji and text presentation characters. This is not what we want, and will result in false positives for characters like '↔' that could turn into an emoji if paired with a variation selector. Unfortunately, none of the other regexes provided by Emojibase do what we want either (https://github.com/milesj/emojibase/issues/174). In the meantime, browser support for the RGI_Emoji character sequence class has made it feasible to write an emoji regex by hand, so that's what I've done.
* Add a fallback for BIGEMOJI_REGEX as well
* Disable profile controls if the HS doesn't allow them to be set
Also updates to the js-sdk interface changes in https://github.com/matrix-org/matrix-js-sdk/pull/4246
* Remove unnecessary await
* Pass disabled prop to accessiblebutton in avatarsetting
* Move the account management button
The section it lives in with the server name goes, and the button
just lives on its own in the profile section.
* Update test
* Revert bits of previous PR that are no longer wanted
because we squash merge so git can no longer make sense of what changes
have been applied.
* More squash-merge fails
* More more squash merge fails
* Disable profile controls if the HS doesn't allow them to be set
Also updates to the js-sdk interface changes in https://github.com/matrix-org/matrix-js-sdk/pull/4246
* Remove unnecessary await
* Pass disabled prop to accessiblebutton in avatarsetting
* Use getCapabilities
in case there are no cached capabilities
* Fix test
* Go back to just using getCapabilities
Rather than change the other places
* Clear autocomplete input on selection accept
Fixes https://github.com/element-hq/element-web/issues/27194
* Playwright: use rust crypto for the bot user (#12708)
... because legacy crypto is legacy
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* WIP update of threepid settings section
* Remove email / phone number section from original place
and don't show the new one if 3pids are disabled
* Update snapshots
* Pull identity server / 3pid binding settings out to separate component
and put it in the security & privacy section which is its new home
* Update snapshot
* Move relevant part of test & update screenshots / snapshots
* Remove unnecessary dependency
* Add test for discovery settings
* Add spacing in terms agreement
* Extract SearchScope and SearchInfo into Searching
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Comments
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Use Rust crypto stack universally
Ignore the `feature_rust_crypto` and `RustCrypto.staged_rollout_percent`
settings, and just use RustCrypto everywhere.
* Remove labs setting for rust crypto
* Remove support for legacy crypto stack in `StorageManager`
We're not going to use the legacy stack any more.
* Update docs on `Features.RustCrypto`
* Remove now-unreachable `tryToUnlockSecretStorageWithDehydrationKey`
* Comment out test which doesn't work
* fix typo
* Hide voip buttons in group rooms in environments with widgets disabled
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix test stubs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Hide voice call button when redundant
i.e. when it'd do the same thing as the video call button like in non-dm rooms
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix widgets not being cleaned up correctly.
Widgets could persist forever because they were still sticky when we end the messaging.
Ending the messaging emits an event to which we connect ui changes that move the widget out of the screen. It does not end up in a pip view however.
So we need to make sure the widget is not persistend anymore when we call `stopMessagingByUid` so that any dom changes that remove the AppTile happen when the widget is not persistend anymore and let it destroy.
This PR also makes the role for `MatrixRTCSessionManager` more strict. We do ONLY use it in `Call.ts` and `CallStore` so that we dont end up in reaces where we updated the ui based on the session manager but not in sync with the call and callstore changes.
Rename activeCalls to connectedCalls. Active call can also be understood as a call where there are active participants but the user itself is not connected. Especially with the `hasActiveCallSession` field of the useRoomCall hook which is tracking active (not necassarly connected sessions)
* rest of the renaming
* fix test to adapt to reduced session manager event usage.
* Improve accessibility of the room summary card
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update @vector-im/compound-web to 4.5.0
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update snapshots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix bad merge
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Show tooltips on narrow tabbed views
* Also only show on left-side tabs
* Unused import
* Comments
* Add test
* More test
* Assert tooltip appears in playwright test
* Make config override other settings levels and add tests
* fix documentation
* lint
* Use a const for finalLevel.
* respect the explicit parameter
* Use supportedLevelsAreOrdered for config overrides rather than a separate setting.
* Fix typos
* Fix mock in UserSetttingsDialog-test
* Special case disabling of setting tos use config overrides.
* remove logs
* New user profile UI in User Settings
Using new Edit In Place component.
* Show avatar upload error
* Fix avatar upload error
* Wire up errors & feedback for display name setting
* Implement avatar upload / remove progress toast
* Add 768px breakpoint
* Fix display of no avatar in avatar setting controls
There was supposed to be a person icon but it was invisible, and also
would have been inappropriate for room avatars anyway.
This makes it match the designs by being the same as whatever the
default avatar is.
* Fix room profile display
* Update edit icon on avatarsetting comnponent
* Change avatarsetting componment to use a menu
As per the designs, remove the 'remove' link and instead have a menu
pop up to either upload a new file or remove the avatar.
This also changes the room profile viw, since that uses the same view.
* Update to released compund-web with required components / fixes
* Require compound-web 4.4.0
because we do need it
* Update snapshots
Because of course all the auto-generated IDs of unrelated things
have changed.
* Fix duplicate import
* Fix CSS comment
* Update snapshot
* Run all the tests so the ids stay the same
* Start of a test for ProfileSettings
* More tests
* Test that a toast appears
* Test ToastRack
* Update snapshots
* Add the usernamee control
* Fix playwright tests
* New compound version for editinplace fixes
* Fix useId to not just generate a constant ID
* Use the label in the username component
* Fix widths of test boxes
* Update screenshots
* Put ^ back on compound-web version
* Split CSS for room & user profile settings
and name the components correspondingly
* Fix playwright test
* Update room settings screenshot
* Use original screenshot instead
* Add required props in test
* Fix test
* Also here
* Update screenshots
* Remove user icon
...which is unused now, as far as I can see.
* Fix styling of unrelated buttons
Needed to be added in other places otherwise the specificity changes.
Also put the old screenshots back.
* Add copyright year
* Fix copyright year
* Switch to useMatrixClientContext
* Fix other test
* Make clickable with no avatar again and fix tests
and renmove a test for the remove button which is no longer there
* Put back missing CSS to make the menu entry red
* Fix type error
* Fix tests
* Supply open / onOpenChange props
* Fix tests
* There is no hover anymore
* Use the computed name, not the name which may be null
* Fix room avatar remove behaviour
* Remove redundant else
* New user profile UI in User Settings
Using new Edit In Place component.
* Show avatar upload error
* Fix avatar upload error
* Wire up errors & feedback for display name setting
* Implement avatar upload / remove progress toast
* Add 768px breakpoint
* Fix display of no avatar in avatar setting controls
There was supposed to be a person icon but it was invisible, and also
would have been inappropriate for room avatars anyway.
This makes it match the designs by being the same as whatever the
default avatar is.
* Fix room profile display
* Update to released compund-web with required components / fixes
* Require compound-web 4.4.0
because we do need it
* Update snapshots
Because of course all the auto-generated IDs of unrelated things
have changed.
* Fix duplicate import
* Fix CSS comment
* Update snapshot
* Run all the tests so the ids stay the same
* Start of a test for ProfileSettings
* More tests
* Test that a toast appears
* Test ToastRack
* Update snapshots
* Add the usernamee control
* Fix playwright tests
* New compound version for editinplace fixes
* Fix useId to not just generate a constant ID
* Use the label in the username component
* Fix widths of test boxes
* Update screenshots
* Put ^ back on compound-web version
* Split CSS for room & user profile settings
and name the components correspondingly
* Fix playwright test
* Update room settings screenshot
* Use original screenshot instead
* Add required props in test
* Fix test
* Also here
* Update screenshots
* Remove user icon
...which is unused now, as far as I can see.
* Fix styling of unrelated buttons
Needed to be added in other places otherwise the specificity changes.
Also put the old screenshots back.
* Add copyright year
* Fix copyright year
* Switch to useMatrixClientContext
* Fix other test
* New user profile UI in User Settings
Using new Edit In Place component.
* Show avatar upload error
* Fix avatar upload error
* Wire up errors & feedback for display name setting
* Implement avatar upload / remove progress toast
* Add 768px breakpoint
* Fix room profile display
* Update to released compund-web with required components / fixes
* Require compound-web 4.4.0
because we do need it
* Update snapshots
Because of course all the auto-generated IDs of unrelated things
have changed.
* Fix duplicate import
* Fix CSS comment
* Update snapshot
* Run all the tests so the ids stay the same
* Start of a test for ProfileSettings
* More tests
* Test that a toast appears
* Test ToastRack
* Update snapshots
* Add the usernamee control
* Fix playwright tests
* New compound version for editinplace fixes
* Fix useId to not just generate a constant ID
* Use the label in the username component
* Fix widths of test boxes
* Update screenshots
* Put ^ back on compound-web version
* Split CSS for room & user profile settings
and name the components correspondingly
* Fix playwright test
* Update room settings screenshot
* Use original screenshot instead
* Fix styling of unrelated buttons
Needed to be added in other places otherwise the specificity changes.
Also put the old screenshots back.
* Add copyright year
* Fix copyright year
* Add flag for tests to avoid double-reporting check
Some of the tests were flaking. Our best guess is that it's failing to track
some events due to false positives in the Bloom filter used to guard against
double-reporting. So we add a flag to disable using that in tests (except for
tests that test that functionality).
* invert logic to avoid double negative
* Element-R: pass pickleKey in as raw key for indexeddb encryption
Currently, we pass the `pickleKey` to the rust library for use as a passphrase
for encrypting its crypto store. The Rust libary then passes that passphrase
through 200000 rounds of PBKDF2 to generate an encryption key, which is
(deliberately) slow.
However, the pickleKey is actually 32 bytes of random data (base64-encoded). By
passing the raw key into the rust library, we can therefore save the PBKDF
operation.
Backwards-compatibility with existing sessions is maintained, because if the
rust library discovers that the store was previously encrypted with a key based
on a PBKDF, it will re-base64 and PBKDF the key we provide, thus reconstructing
the right key.
* Update src/Lifecycle.ts
Co-authored-by: Florian Duros <florianduros@element.io>
* Lifecycle-test: clean up test setup
Rely less on the unit under test for setting up the test preconditions -- not
least because we don't really want to fire up matrix clients and the like
during test setup.
* Factor out "encryptPickleKey" method
For a start it makes it easier to grok what's going on, but also I went to use
this in a test
* Improve tests for `Lifecycle.restoreFromLocalStorage`
---------
Co-authored-by: Florian Duros <florianduros@element.io>
* Use new tooltip in `RoomTopic.tsx`
* Use new tooltip in `MLocationBody.tsx`
* Fix room topic
* Update location snapshot
* Use new tooltip in `AppPermission.tsx`
* Remove `TooltipTarget`
* Add tests for `RoomTopic`
* Refactor some logic into common AvatarSetting component
We duplicated some of the logic of setting avatars between profiles &
rooms. This pulls some of that logic into the AvatarSetting component
and hopefully make things a little simpler.
* Unsed import
* Convert JS based hover to CSS
* Remove unnecessary container
* Test avatar-as-file path
* Test file upload
* Unused imports
* Add test for RoomProfileSettings
* Test removing room avatar
* Move upload control CSS too
* Remove commented code
Co-authored-by: Florian Duros <florianduros@element.io>
* Prettier
* Coments & move style to inline as per PR suggestion
* Better test names
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Fix test
Upload input doesn't have that class anymore
---------
Co-authored-by: Florian Duros <florianduros@element.io>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* persist previously-reported event IDs as a bloom filter
* Pin to older `@types/seedrandom`
... to work around https://github.com/Callidon/bloom-filters/issues/72
* Inline `DecryptionFailureTracker.addDecryptionFailure`
* Remove redundant TRACK_INTERVAL
There really doesn't seem to be much point to this batching up of decryption
failure reports. We still call the analytics callback the same number of times.
* Rename `trackedEvents` to `reportedEvents`
* Fix incorrect documentation on `visibleEvents`
This *does* overlap with `failures`.
* Combine `addFailure` and `reportFailure`
* Calculate client properties before starting reporting
* Clear localstorage after each test
... otherwise they interfere
* Remove redundant comment
* Ensure that reports are cleared on a logout/login cycle
* make private const private and const
---------
Co-authored-by: Richard van der Hoff <richard@matrix.org>
* Inline `DecryptionFailureTracker.addDecryptionFailure`
* Remove redundant TRACK_INTERVAL
There really doesn't seem to be much point to this batching up of decryption
failure reports. We still call the analytics callback the same number of times.
* Rename `trackedEvents` to `reportedEvents`
* Fix incorrect documentation on `visibleEvents`
This *does* overlap with `failures`.
* Combine `addFailure` and `reportFailure`
* Calculate client properties before starting reporting
* report time to decrypt an event if it's slow
* add more stats
* fix some tests
* keep original timestamp, and report non-visible decryption failures
* add statistic for whether the user trusts their own device
* revert local playwright docker changes
* apply changes from review
* also remove logout event handler on logout
* apply changes from review
* make eventDecrypted callback private
* Remove legacy `threepidCreds` field
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Remove `user` field legacy UIA fallback
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Update imports
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>