Commit graph

40923 commits

Author SHA1 Message Date
Michael Telatynski
95630f525f
Remove usage of legacyRoot in RTL tests (#28485)
* Remove usage of legacyRoot in RTL tests

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>

* Iterate

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>
2024-11-20 18:09:51 +00:00
Florian Duros
d5c111f656
Rework UrlPreviewSettings to use MatrixClient.CryptoApi.isEncryptionEnabledInRoom (#28463)
* Rework `UrlPreviewSettings` to use `MatrixClient.CryptoApi.isEncryptionEnabledInRoom`

* Handle loading state

* Update `@vector-im/compound-web` to have `InlineSpinner`

* Use `InlineSpinner` instead of a loading text.
2024-11-20 17:08:34 +00:00
Florian Duros
5cdcf44b6f
Second batch: Replace MatrixClient.isRoomEncrypted by MatrixClient.CryptoApi.isEncryptionEnabledInRoom (#28466)
* Add `asyncFilter`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `MemberListStore.tsx`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `EventIndex.tsx`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `SendMessageComposer.tsx`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `ScalarMessaging.ts`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `RolesRoomSettingsTab.tsx`

* Add reject doc to `asyncFilter`

* Reverse `MemberListStore.loadMembers` condition

* Remove async for `ScalarMessaging.ts`

* Display permission section only after `isEncrypted` is computed

* Display composer only after `isEncrypted` is computed

* Revert "Display composer only after `isEncrypted` is computed"

This reverts commit 4d4e037391.

* Revert "Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `SendMessageComposer.tsx`"

This reverts commit 6bf06da02c.
2024-11-20 14:27:09 +00:00
Michael Telatynski
ca33d9165a
Migrate to React 18 createRoot API (#28256)
* Migrate to React 18 createRoot API

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>

* Iterate

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>

* Iterate

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>

* Discard changes to src/components/views/settings/devices/DeviceDetails.tsx

* Iterate

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>

* Attempt to stabilise test

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* legacyRoot?

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>

* Fix tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshots

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

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>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-20 13:29:23 +00:00
Florian Duros
d4ab40990b
First batch: Replace MatrixClient.isRoomEncrypted by MatrixClient.CryptoApi.isEncryptionEnabledInRoom (#28242)
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `DeviceListener.ts`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `Searching.ts`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `SlidingSyncManager.ts`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `EncryptionEvent.tsx`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `ReportEventDialog.tsx`

* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `RoomNotifications.tsx`

* Fix MessagePanel-test.tsx

* ReplaceReplace `MatrixCient..isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `shouldSkipSetupEncryption.ts`

* Add missing `await`

* Use `Promise.any` instead of `asyncSome`

* Add `asyncSomeParallel`

* Use `asyncSomeParallel` instead of  `asyncSome`
2024-11-19 10:09:25 +00:00
Hubert Chathi
0ae74a9e1f
Reset cross-signing before backup when resetting both (#28402)
* reset cross-signing before backup when resetting both

* add test for AccessSecretStorageDialog

* fix unit test
2024-11-19 03:17:24 +00:00
Hubert Chathi
ed9795137b
Listen to events so that encryption icon updates when status changes (#28407)
* listen to events so that encryption icon updates when status changes

* remove debugging message
2024-11-18 23:27:34 +00:00
Michael Telatynski
4f8e9eb9ac
Standardise icons using Compound Design Tokens (#28217)
* De-duplicate icons using Compound Design Tokens

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>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Deduplicate more icons using Compound Design Tokens

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update icon

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Discard changes to res/css/structures/_RoomSearch.pcss

* Update snapshots

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>

* Discard changes to res/fonts/Open_Sans/LICENSE.txt

* Discard changes to res/css/views/elements/_CopyableText.pcss

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-18 15:47:15 +00:00
Michael Telatynski
9b316e8e7f
Check that the file the user chose has a MIME type of image/* (#28467)
* Check that the file the user chose has a MIME type of `image/*`

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* i18n

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Optional

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* DRY

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update src/components/views/settings/AvatarSetting.tsx

Co-authored-by: Florian Duros <florianduros@element.io>

* prettier

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Florian Duros <florianduros@element.io>
2024-11-18 10:30:31 +00:00
Tulir Asokan
72a2773629
Start sending stable m.marked_unread events (#28478)
* Start sending stable `m.marked_unread` events

* Update tests
2024-11-18 10:25:36 +00:00
Michael Telatynski
ae3ca52bd2
Allow tab completing users in brackets (#28460)
* Allow tab completing users in brackets

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Account for range offsets when tab completing to not replace unrelated characters

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-15 09:11:03 +00:00
Michael Telatynski
9a126795a8
Standardise icons using Compound Design Tokens (#28286)
* Remove stale _LegacyRoomHeader.pcss and icons

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* De-duplicate icons using Compound Design Tokens

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove stale _LegacyRoomHeader.pcss and icons

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove unused icons

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Ensure legacy header styles are not used by HTML export

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update screenshots & snapshots

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>

* Update screenshots

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update screenshots

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update screenshots

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-14 12:34:27 +00:00
Michael Telatynski
ec96d33ed7
Merge branch 'develop' into midhun/fix-spotlight-1 2024-11-13 15:38:56 +00:00
R Midhun Suresh
926c45488d
Remove type cast 2024-11-13 20:40:46 +05:30
R Midhun Suresh
b8e54750a0
Use Ref type to accept both types of ref 2024-11-13 20:39:17 +05:30
Michael Telatynski
ca239fee4d
Update type and usage of window.matrixChat to be better React 18 friendly (#28415)
* Update type and usage of window.matrixChat to be better React 18 friendly

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Make modules import async to make the file testable

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-13 14:16:29 +00:00
Michael Telatynski
349c9b0c26
Remove reply fallbacks as per merged MSC2781 (#28406)
* Remove reply fallbacks as per merged MSC2781

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-13 14:11:20 +00:00
Michael Telatynski
73db771ff3
Refactor signing out devices to handle React 18 Strict Mode (#28414)
setSigningOutDeviceIds was adding the same device ID twice, and also possibly using an old reference to the value when updating it

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-13 13:40:00 +00:00
Michael Telatynski
f77d9b4bcb
Refactor TimelinePanel to avoid race conditions in React 18 between state updates (#28416)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-13 13:39:56 +00:00
R Midhun Suresh
27b62d022e
Use RefCallback type 2024-11-13 18:23:37 +05:30
R Midhun Suresh
5c3a518576
Use ref from hook 2024-11-13 17:31:55 +05:30
R Midhun Suresh
6e5f593c98
Fix EmojiPicker.tsx 2024-11-13 16:59:28 +05:30
R Midhun Suresh
e5c0cdc402
Just use one ref prop in Field.tsx 2024-11-13 16:35:02 +05:30
Florian Duros
8a756b592c
Replace MatrixClient.isRoomEncrypted by MatrixClient.CryptoApi.isEncryptionEnabledInRoom in useIsEncrypted (#28282)
* Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `useIsEncrypted`

* Catch error

* Return `null` when computed

* Use `useRoomState` & `useAsyncMemo`
2024-11-13 10:32:35 +00:00
Florian Duros
c67e67af4e
Use new CrytoApi.restoreKeyBackup & CrytoApi.restoreKeyBackupFromPassphrase api (#28385)
* Use new `CrytoApi.restoreKeyBackup` & `CrytoApi.restoreKeyBackupFromPassprhase` api

* Use new `CrytoApi.restoreKeyBackup` api in `SetupEncryptionStore`

* Add tests to `RestoreKeyBackupDialog`
2024-11-13 10:32:06 +00:00
Michael Telatynski
27a43e860a
Use React Suspense when rendering async modals (#28386)
* Use React Suspense when rendering async modals

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix test

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update src/Modal.tsx

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-12 21:19:11 +00:00
R Midhun Suresh
86c6ba9dd7
Make corresponding changes in consumers 2024-11-13 00:36:08 +05:30
R Midhun Suresh
0faf298e05
Fix React 18 strict mode breaking spotlight search
This code originally held an array of refs. But these refs were unset
just before sorting leading to errors.

For the fix, I've used a callback ref to add/remove the DOM elements
to/from the array in state. This way there's nothing that could possibly
mutate just before sort.
2024-11-13 00:28:32 +05:30
RiotRobot
6d1b702214 Merge branch 'master' into develop 2024-11-12 09:46:03 +00:00
Michael Telatynski
231073c578
Merge commit from fork
Handle rendering of invalid date errors
2024-11-12 09:08:32 +00:00
Michael Telatynski
6bc8080ec5
Merge pull request #28387 from element-hq/t3chguy/knip2 2024-11-12 09:01:24 +00:00
David Langley
bff17ff470 Make case consistent 2024-11-11 19:54:05 +00:00
David Langley
c0a313abae Make logic more DRY, simplify logic, improve naming. 2024-11-11 19:38:58 +00:00
Michael Telatynski
db30bc51a1
Deduplicate icons using Compound Design Tokens (#28419)
* Deduplicate icons using Compound Design Tokens

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update screenshots & snapshots

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-11 17:27:22 +00:00
Andrew Ferrazzutti
c8c107405f
Let widget driver send error details (#28357)
* Let widget driver send error details

* Match new widget API types

* Don't @link across packages

in case web documentation generation disallows it.

* Update matrix-widget-api

* Update matrix-js-sdk

Include matrix-org/matrix-js-sdk#4507 to fix playwright CI
2024-11-11 16:39:17 +00:00
David Langley
6134cfd9c4 Add mimetype checks
Add checks to validate the advertised mimetype and file extension of stickers, videos and images are coherent.
2024-11-11 15:44:33 +00:00
David Langley
3f70105204 lint 2024-11-11 11:42:18 +00:00
David Langley
4ff08f942d lint 2024-11-11 11:41:50 +00:00
David Langley
29b75385a3 handle rendering of invalid date errors 2024-11-11 11:41:05 +00:00
Robin
d0cddc5b66
Feed events to widgets as they are decrypted (even if out of order) (#28376)
* Refactor feeding of events to widgets

This is a pure refactor with (hopefully) no behavior changes.

* Feed events to widgets as they are decrypted (even if out of order)

The code that feeds events to widgets tries to enforce that only events from the end of the timeline will be passed through. This is to prevent old, irrelevant events from being passed to widgets as the timeline is back-filled. However, since encrypted events need to be decrypted asynchronously, it's not possible to feed them to a widget in a strictly linear order without introducing some kind of blocking or unreliable delivery. This code has been dropping events when they're decrypted out of order, which we consider to be an undesirable behavior.

The solution provided here is that, to reflect the asynchronous nature of decryption, encrypted events that arrive at the end of the timeline will be fed to a widget whenever they finish decrypting, even if this means feeding them out of order. For now we're not aware of any widgets that care about knowing the exact order of events in the timeline, but if such a need reveals itself later, we can explore adding ordering information to this part of the widget API.

* Add braces to if
2024-11-08 14:35:47 +00:00
ElementRobot
536d6ad360
[create-pull-request] automated change (#28409)
Co-authored-by: t3chguy <t3chguy@users.noreply.github.com>
2024-11-08 06:24:40 +00:00
Michael Telatynski
da4672d715
Handle authenticated media when downloading from ImageView (#28379)
* Handle authenticated media when downloading from ImageView

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>

* Iterate

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>
2024-11-07 11:43:33 +00:00
Michael Telatynski
74a919cb65
Deduplicate icons using Compound Design Tokens (#28381)
* Deduplicate icons using Compound Design Tokens

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove unused test images

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update snapshots & screenshots

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-07 11:39:18 +00:00
Timo
5057668705
Auto approvoce io.element.call.reaction capability for element call widgets (#28401) 2024-11-06 20:15:19 +00:00
Michael Telatynski
88c72a1514
Ignore m.3pid_changes for Identity service 3PID changes (#28375)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-06 14:33:50 +00:00
Michael Telatynski
d06cf09bf0
Switch secondary React trees to the createRoot API (#28296)
* Switch secondary React trees to the createRoot API

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>

* Add comment

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-06 12:44:54 +00:00
ElementRobot
3ff5a511e5
[create-pull-request] automated change (#28392)
Co-authored-by: t3chguy <t3chguy@users.noreply.github.com>
2024-11-06 06:23:22 +00:00
Michael Telatynski
f3e976d67d
Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-05 19:12:43 +00:00
Michael Telatynski
1c06ebadcd
Avoid double exports
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-05 18:36:26 +00:00
Michael Telatynski
458b4a45e5
Avoid use of transitive deps
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-11-05 18:35:53 +00:00