* Revert "Apply more general fix for base avatar regressions (#10045)"
This reverts commit 371a3c0d36.
* Revert "Fix layout and visual regressions around default avatars (#10031)"
This reverts commit 0d1fce37b2.
* Revert "Member avatars without canvas (#9990)"
This reverts commit a8aa4de4b4.
* Update snapshots
* add settings while under development
* very basic tests for roomsummarycard
* empty poll history dialog and option in room summary
* pollS history in settings
* use more user-centric selectors in roomsummarycard test
* 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>
* noImplicitAny fixes for MessageDiffUtils
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Add tests for MessageDiffUtils
Adds mostly snapshot tests for MessageDiffUtils to guarantee consistent
behavior.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Strict mode fixes for MessageDiffUtils
Gets `MessageDiffUtils` to pass under `tsc --strict`.
Fixes https://github.com/vector-im/element-web/issues/23665 - no longer errors,
though it still isn't correct.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Remove obsolete DiffDOM workaround
Workaround is no longer necessary as of DiffDOM 4.2.1
See https://github.com/fiduswriter/diffDOM/issues/90
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
---------
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Strict typechecking fixes for Base/Member/Avatar
Update the core avatar files to pass `--strict --noImplicitAny` typechecks.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Add tests for Base/Member/Avatar
More thoroughly test the core avatar files. Not necessarily the most thorough,
but an improvement.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Extract TextAvatar from BaseAvatar
Extracted the fallback/textual avatar into its own component.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Use standard HTML for non-image avatars
Firefox users with `resistFingerprinting` enabled were seeing random noise
for rooms and users without avatars. There's no real reason to use data
URLs to present flat colors.
This converts non-image avatars to inline blocks with background colors.
See https://github.com/vector-im/element-web/issues/23936
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Have pills use solid backgrounds rather than colored images
Similar to room and member avatars, pills now use colored pseudo-elements
rather than background images.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
---------
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* Support token authenticated registration
https://spec.matrix.org/v1.2/client-server-api/#token-authenticated-registration
Signed-off-by: Callum Brown <callum@calcuode.com>
* Backwards compatibility with unstable auth type
Some server installs are not updated to use the stable version
of the registration token authentication type, so also handle
the unstable version defined in MSC3231.
Signed-off-by: Callum Brown <callum@calcuode.com>
* Make LOGIN_TYPE public and readonly
Co-authored-by: Travis Ralston <travpc@gmail.com>
* Remove line related to skinning
Signed-off-by: Callum Brown <callum@calcuode.com>
* Change empty string to null
Signed-off-by: Callum Brown <callum@calcuode.com>
* Use "public"s for new code style
Signed-off-by: Callum Brown <callum@calcuode.com>
* Change input to AccessibleButton
Signed-off-by: Callum Brown <callum@calcuode.com>
* Add more detail regarding source of token
Signed-off-by: Callum Brown <callum@calcuode.com>
* Fix lint error
The text and button type will be the same every time
for registration tokens, unlike (possibly) for SSO.
Signed-off-by: Callum Brown <callum@calcuode.com>
* Change null back to ""
Due to the following warning when attempting to test:
> Warning: `value` prop on `input` should not be null.
> Consider using an empty string to clear the component or
> `undefined` for uncontrolled components.
Signed-off-by: Callum Brown <callum@calcuode.com>
* Disable submit button when no token entered
Signed-off-by: Callum Brown <callum@calcuode.com>
* Add test for registration tokens
Adapted from test/components/views/dialogs/InteractiveAuthDialog-test.tsx
Signed-off-by: Callum Brown <callum@calcuode.com>
* Fix linting errors
Signed-off-by: Callum Brown <callum@calcuode.com>
* Fix test for registration tokens
Signed-off-by: Callum Brown <callum@calcuode.com>
Signed-off-by: Callum Brown <callum@calcuode.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* Applies small changes to code block display in timeline
* Makes the composer code block look like the timeline display, but without line numbers
* Adds a button to allow code blocks to be implemented
* Adds tests for the new button
* Fix viewing source of redacted events
Clicking 'View Source' in the context menu of a redacted event causes an error,
and the user gets no visible result.
This fixes <ViewSource /> to indicate that the source is unavailable when a
message has been redacted. The original source remains available.
<SyntaxHighlight /> requires a non-null string for its `content` prop, and, in
the case of redacted events, <ViewSource /> was passing `undefined`. This is
ultimately because redacting an event causes `MatrixEvent.clearEvent` to be
`undefined`, which <ViewSource /> wasn't checking.
Fixes https://github.com/vector-im/element-web/issues/24165
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Use correct highlight.js call
Previous call signature was deprecated.
See https://github.com/highlightjs/highlight.js/issues/2277
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Use js-sdk imports for poll event types instead of events-sdk
* Attempt to appease some tsc --strict errors
* Manually create poll response in cypress test
* adds buttons to toggle bulleted and numbered lists on and off
* adds icons for those buttons
* css changes to timeline display
* adds tests for the new buttons, refactors existing tests
* Fix issue where thread dropdown would not correctly
* Write additional test for both issues
- Thread dropdown should be shown if there is any thread, even if not participated
- Thread list correctly updates after every change of the dropdown immediately
* Factor out `MessageEvent.from()` usage
The class/function is disappearing from the events-sdk, at least in this form.
* Manually create contents for events used by cypress
The utility function is out of range of the calling code at runtime, for some reason.
* Run prettier
* Maybe this will fix the build
* prune client infromation events from old devices
* test client data pruning
* remove debug
* strict
* Update src/components/views/settings/devices/useOwnDevices.ts
Co-authored-by: Michael Weimann <michaelw@matrix.org>
* improvements from review
Co-authored-by: Michael Weimann <michaelw@matrix.org>
If something goes wrong with the widget, there's no way we can continue the call, so this acts as a safeguard against stuck calls in cases where the widget crashes or disconnects weirdly.
* allows switching between modes that retains formatting
* updates rich text composer dependency to 0.13.0 (@matrix-org/matrix-wysiwyg)
* improves handling of enter keypresses when ctrlEnterTosend setting is true in plain text editor
* changes the message event content when using the new editor
* adds tests for the changes to the plain text editor
* Remove unnecessary PipContainer component
* Redesign the picture-in-picture window
* Add a hover effect to the controls
* Clarify that WidgetPip has call-specific behavior
* Prevent unnecessary m.direct updates
Signed-off-by: Michael Weimann <michaelw@matrix.org>
* Replace object with Map
* Clean up comment; simplify code
* Fix rte flaky test (#9811)
* Snap in PiP widget when content changed (#9797)
* Check modified at the end of setDMRoom
* Revert "Snap in PiP widget when content changed (#9797)"
This reverts commit be1e5753677bdf84b3657994dc5ad20d250038bd.
* Revert "Fix rte flaky test (#9811)"
This reverts commit 20d9eb3924c5ebc63f03cb61b172035725e3474d.
* Update src/Rooms.ts
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Signed-off-by: Michael Weimann <michaelw@matrix.org>
Co-authored-by: Florian Duros <florianduros@element.io>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Fix blank timeline when thread root is UTD
* add test for pre join uisi checks and thread roots
* ts strict fix
* Update to timeline panel test
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Fixes to TimelinePanel-test
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This PR adds an option to `config.json` which will make the js-sdk use the rust crypto sdk, instead of the libolm implementation.
To use it, you need to add something like this to `config.json`:
```
"features": {
"feature_rust_crypto": true
},
```
We don't (yet) have any way to migrate a device between implementations, so the setting that was in use when you log in is persisted to the device; it is *visible* via the labs section but cannot currently be changed.
This is part of https://github.com/vector-im/element-web/issues/21972, and enables the functionality added to the js-sdk in https://github.com/matrix-org/matrix-js-sdk/pull/2969.
* Improve decryption error UI by consolidating error messages and providing instructions when possible
* Fix TS strict errors
* Rename .scss to .pcss
* Avoid accessing clipboard, Cypress doesn't like it
* Display DecryptionFailureBar alongside other AuxPanel bars
* Add comments
* Add small margin off-screen for visible decryption failures
* Fix some more TS strict errors
* Add unit tests for DecryptionFailureBar
* Add button to resend key requests manually
* Remove references to matrix-js-sdk crypto internals
* Add hysteresis to visible decryption failures
* Add comment
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Add comment
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Don't create empty div if we're not showing resend requests button
* cancel updateSessions on unmount
* Update unit tests
* Fix lint and implicit any
* Simplify visible event bounds checking
* Adjust cypress test descriptions
* Add percy snapshots
* Update src/components/structures/TimelinePanel.tsx
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Add comments on TimelinePanel IState
* comment
* Add names to percy snapshots
* Show Resend Key Requests button when there are sessions that haven't already been requested via this bar
* We no longer request keys from senders
* update i18n
* update expected text in cypress test
* don't download keys ourselves, update device info in response to updates from client
* fix ts strict errors
* visibledecryptionfailures undefined handling
* Fix implicitAny errors
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Because this encodes font settings into widget URLs at the time that the client first loads a call, this has the consequence that users may need to restart their client to see font setting changes take effect in Element Call. For users who rely on these settings for accessibility, it's a lot better than nothing, though.
* super WIP POC for merging virtual room events into main timeline
* remove some debugs
* c
* add some todos
* remove hardcoded fake virtual user
* insert overlay events into main timeline without resorting main tl events
* remove more debugs
* add extra tick to roomview tests
* RoomView test case for virtual room
* test case for merged timeline
* make overlay event filter generic
* remove TODOs from LegacyCallEventGrouper
* tidy comments
* remove some newlines
* test timelinepanel room timeline event handling
* use newState.roomId
* fix strict errors in RoomView
* fix strict errors in TimelinePanel
* add type
* pr tweaks
* strict errors
* more strict fix
* strict error whackamole
* update ROomView tests to use rtl
* test bulk unverified sessions toast behaviour
* unverified sessions toast text tweak
* only show bulk unverified sessions toast when current device is verified
* add Setting for BulkUnverifiedSessionsReminder
* add build config for BulkUnverifiedSessionsReminder
* add more assertions for show/hide toast, fix strict errors
* fix strict error
* add util methods for snoozing in local storage
* rename nag to reminder
* set and read snooze for toast
* test snooze
* remove debug
* strict fix
* remove unused code
* VoiceRecordings: honor advanced audio processing settings
Audio processing settings introduced in #8759 is now taken into account
when recording a voice message.
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
* VoiceRecordings: add higher-quality audio recording
When recording non-voice audio (e.g. music, FX), a different Opus encoder
application should be specified. It is also recommended to increase the
bitrate to 64-96 kb/s for musical use.
Note: the HQ mode is currently activated when noise suppression is
turned off. This is a very arbitrary condition.
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
* RecorderWorklet: fix type mismatch
src/audio/VoiceRecording.ts:129:67 - Argument of type 'null' is not
assignable to parameter of type 'string | URL'.
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
* VoiceRecording: test audio settings
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
* Fix typos
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
* VoiceRecording: refactor using destructuring assignment
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
* VoiceRecording: add comments about constants and non-trivial conditions
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
Signed-off-by: László Várady <laszlo.varady@protonmail.com>
* Fix call splitbrains when switching between rooms
Mounting CallView causes the user's call membership room state to be cleaned up. However, because the GroupCall object always thought the local device was disconnected from the call, it would remove the local device from room state when the clean method is called, causing a splitbrain. This uses GroupCall's new enteredViaAnotherSession field to fix that, and also simplify participant tracking.
* Remove clean tests that have been moved to matrix-js-sdk
* test bulk unverified sessions toast behaviour
* unverified sessions toast text tweak
* only show bulk unverified sessions toast when current device is verified
* add Setting for BulkUnverifiedSessionsReminder
* add build config for BulkUnverifiedSessionsReminder
* add more assertions for show/hide toast, fix strict errors
* fix strict error
* test bulk unverified sessions toast behaviour
* unverified sessions toast text tweak
* only show bulk unverified sessions toast when current device is verified
* add more assertions for show/hide toast, fix strict errors
* fix strict error
* really fix strict error
* bugfix: fix an issue where the Notifier would incorrectly fire for non-timeline events
This was caused by listening for ClientEvent.Event, not RoomEvent.Timeline.
Fixes https://github.com/vector-im/element-web/issues/17263
* tsc strict checks maybe
* More types?
* Update src/Notifier.ts
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Update src/Notifier.ts
* fix LL test; review comments
* More tests
* More tsc strict checks..
* More strict ts..
* More ts
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>