Commit graph

2198 commits

Author SHA1 Message Date
Michael Weimann
7632f36624
Implement new toast UI (#10467)
* Implement new toast UI

* Use PCSS vars and Caption component

* Add GenericToast-test

* Tweak call toast

* Fix code style
2023-04-18 11:38:41 +00:00
Michael Telatynski
82a51e9674
Pick sensible default option for phone country dropdown (#10627)
* Pick sensible default option for phone country dropdown

* Add tests

* Add tests
2023-04-18 08:23:37 +00:00
Michael Telatynski
1a0e5c1805
Fix multiple accessibility defects identified by AXE (#10606)
* Mark effects overlay canvas as aria hidden

* Ensure date separators aren't seen as focusable aria separators

* Fix

* Fix font slider not having aria label

* Add missing aria labels

* Fix settings flags setting aria-checked={null}

* Update snapshots
2023-04-17 16:09:45 +00:00
Michael Telatynski
56e4ae41f8
Conform more of the codebase to strictNullChecks (#10607)
* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`

* Fix types

* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`
2023-04-17 09:25:00 +01:00
Suguru Hirahara
8a4a584ba0
Make test ID compatible with findByTestId() of Cypress Testing Library (#10617)
'data-test-id' is not discoverable with findByTestId() of Cypress Testing Library.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 06:10:11 +00:00
Michael Telatynski
daad630827
Conform more of the codebase to strictNullChecks (#10602)
* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`

* Fix types
2023-04-17 08:31:58 +01:00
Rashmit Pankhania
7751f9c622
#21451 Fix WebGL disabled error message (#10589)
* #21451 Fix WebGl disabled error message

* #21451 Fix WebGl disabled error message

Signed-off-by: Rashmit Pankhania <rashmitpankhania@gmail.com>
Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix message

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix ordering of cases in LocationShareErrors.ts

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix linting LocationPicker.tsx

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix eslint

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix file encoding for i18n CI issue

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

* Fix ts strict CI issue

Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>

---------

Signed-off-by: Rashmit Pankhania <rashmitpankhania@gmail.com>
Signed-off-by: Rashmit Pankhania <raspankh@publicisgroupe.net>
Co-authored-by: Rashmit Pankhania <raspankh@publicisgroupe.net>
Co-authored-by: Kerry <kerrya@element.io>
2023-04-17 04:25:04 +00:00
Eric Eastwood
c1e7905ddc
Properly translate errors in AddThreepid.ts (#10432)
* Properly translate errors in AddThreepid.ts

Part of https://github.com/vector-im/element-web/issues/9597

* Use translated message

* Avoid returning undefined ever

* More usage

* Introduce UserFriendlyError

* Use UserFriendlyError

* Add more usage instead of normal error

* Use types and translatedMessage

* Fix lints

* Update i18n although it's wrong

* Use unknown for easier creation from try/catch

* Use types

* Use error types

* Use types

* Update i18n strings

* Remove generic re-label of HTTPError

See https://github.com/matrix-org/matrix-react-sdk/pull/10432#discussion_r1156468143

The HTTPError already has a good label and it isn't even translated if we re-label it here in this way generically

Probably best to just remove in favor of thinking about a translations in general from the `matrix-js-sdk`, see https://github.com/matrix-org/matrix-js-sdk/issues/1309

* Make error message extraction generic

* Update i18n strings

* Add tests for email addresses

* More consistent error logging to actually see error in logs

* Consistent error handling

* Any is okay because we have a fallback

* Check error type

* Use dedicated mockResolvedValue function

See https://github.com/matrix-org/matrix-react-sdk/pull/10432#discussion_r1163344034
2023-04-14 15:40:19 +01:00
Richard van der Hoff
6b451afc50
Remove dependency on org.matrix.e2e_cross_signing unstable feature (#10593)
* Remove dependency on `org.matrix.e2e_cross_signing` unstable feature

Currently, we have some code that relies on the server declaring support for an
`unstable_feature` called `org.matrix.e2e_cross_signing`. There is nothing in
the spec that requires this, so this would make us incompatible with some
server implementations.

The features in question were added in spec v1.1, so we can test for that
instead.

* fix unit test
2023-04-14 10:14:05 +00:00
Richard van der Hoff
70b87f8bde
Simplify isDeviceVerified definitions (#10594)
* Simplify `isDeviceVerified` definitions

Currently, we have two similar but different definitions of `isDeviceVerified`,
and they both do a lot of wrangling that relies on js-sdk internals. We can
simplify it a lot by just calling `MatrixClientPeg.checkDeviceTrust`.

* fix tests

* more test fixes
2023-04-14 09:46:37 +00:00
alunturner
e4ebcf5731
Handle more completion types in rte autocomplete (#10560)
* handle at-room

* remove console log

* update and add tests

* tidy up

* refactor to switch statement

* fix TS error

* expand tests

* consolidate similar if/else if blocks
2023-04-14 09:09:38 +00:00
Kerry
6280395928
Fix: Images no longer reserve their space in the timeline correctly (#10571)
* test case

* fix + lint

* refix strictNullChecks issue

* add comment about max image size

* tweak

* use safer magic number
2023-04-13 01:22:16 +00:00
Andy Balaam
c496985ff3
Show a tile for an unloaded predecessor room if it has via_servers (#10483)
* Improve typing in constructor of RoomPermalinkCreator

* Provide via servers if present when navigating to predecessor room from Advanced Room Settings

* Show an error tile when the predecessor room is not found

* Test for MatrixToPermalinkConstructor.forRoom

* Test for MatrixToPermalinkConstructor.forEvent

* Display a tile for predecessor event if it contains via servers

* Fix missing case where event id is provided as well as via servers

* Refactor RoomPredecessor tests

* Return lost filterConsole to its home

* Comments for IState in AdvancedRoomSettingsTab

* Explain why we might render a tile even without prevRoom

* Guess the old room's via servers if they are not provided

* Fix TypeScript errors

* Adjust regular expression (hopefully) to avoid potential catastrophic backtracking

* Another attempt at avoiding super-liner regex performance

* Tests for guessServerNameFromRoomId and better implementation

* Further attempt to prevent backtracking

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-12 15:26:45 +00:00
Michael Telatynski
075cb9e622
Exclude message timestamps from aria live region (#10584)
* Exclude message timestamps from aria live region

* Update snapshot
2023-04-12 14:12:45 +00:00
Michael Telatynski
e5b1b7b632
Make composer format bar an aria toolbar (#10583)
* Make composer format bar an aria toolbar

* Iterate

* Iterate

* Update snapshot
2023-04-12 13:58:38 +00:00
Michael Telatynski
d2066ba5f5
Improve accessibility of font slider (#10473)
* Clamp font size when disabling "Use custom size"

* Switch Slider to use a semantic input range element

* Iterate

* delint

* delint

* snapshot

* Iterate

* Iterate

* Fix step size

* Add focus outline to slider

* Derp
2023-04-12 10:57:31 +00:00
alunturner
4d5744008e
Handle /me in rte (#10558)
* add /me handling

* use typeguards to avoid fighting TS

* improve clarity and use of typeguards

* add createMessageContent tests

* remove completed TODO

* improve comments

* remove duplication and renaming of argument
2023-04-11 08:23:03 +00:00
alunturner
96c62ea03d
Fix avatar text issue in rte (#10559)
* replace - with zwsp

* improve comments

* fix broken tests

* fix typo
2023-04-11 08:13:48 +00:00
Michael Weimann
29780704f1
Add unread fallback logging (#10509) 2023-04-11 07:41:59 +00:00
alunturner
3fa6f8cbf0
Handle command completions in RTE (#10521)
* pass handleCommand prop down and use it in WysiwygAutocomplete

* allow a command to generate a query from buildQuery

* port command functionality into the sendMessage util

* tidy up comments

* remove use of shouldSend and update comments

* remove console log

* make logic more explicit and amend comment

* uncomment replyToEvent block

* update util test

* remove commented out test

* use local text over import from current composer

* expand tests

* expand tests

* handle the FocusAComposer action for the wysiwyg composer

* remove TODO comment

* remove TODO

* test for action dispatch

* fix failing tests

* tidy up tests

* fix TS error and improve typing

* fix TS error

* amend return types for sendMessage, editMessage

* fix null content TS error

* fix another null content TS error

* use as to correct final TS error

* remove undefined argument

* try to fix TS errors for editMessage function usage

* tidy up

* add TODO

* improve comments

* update comment
2023-04-10 12:47:42 +00:00
Michael Weimann
818e8292cb
Fix send two join requests when joining a room from spotlight search (#10534)
* Fix send two join requests when joining a room from spotlight search

* Trigger CI

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-06 14:02:18 +00:00
Michael Telatynski
55d3548330
Conform more of the codebase to strictNullChecks (#10518
* Conform more of the codebase to `strictNullChecks`

* Iterate

* Fix tests
2023-04-06 11:10:14 +01:00
Suguru Hirahara
374a23edb5
Add E2E test of audio player (#10441)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-06 08:45:55 +00:00
alunturner
e03eac12c3
Add room and user avatars to rte (#10497)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-06 08:43:49 +00:00
Hugh Nimmo-Smith
5c0e5eb0fb
Support for MSC3882 revision 1 (#10443)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-06 08:06:12 +00:00
Michael Telatynski
09eefe14ea
Remove feedback buttons from onboarding, search, and spaces (#10506) 2023-04-05 12:17:25 +01:00
Michael Weimann
df89d2ce28
Check profiles before starting a DM (#10472) 2023-04-05 13:13:51 +02:00
Kerry
2434749f65
Highlight event when any version triggered a highlight (#10502)
* check previous events pushactions when deciding to highlight

* test event highlight

* strict fix

* highlight edited text to red
2023-04-05 02:46:17 +00:00
Kerry
1024ced52e
test AutoDiscoveryUtils (#10501) 2023-04-04 20:49:24 +00:00
Michael Telatynski
bc60a9b594
Conform more of the codebase to strictNullChecks (#10504
* Conform more of the codebase to `strictNullChecks`

* Iterate
2023-04-04 11:41:46 +01:00
Michael Weimann
56423d4d53
Restore createRoom.canEncryptToAllUsers (#10491) 2023-04-03 11:28:17 +02:00
Kerry
81a4498a8f
Apply strictNullChecks to src/utils/*!exportUtils (#10455
* Apply `strictNullChecks` to `src/utils/exportUtils`

* strict fix

* fix strictNullChecks issues in some utils

* fix error message

* test coverage

* lint

* more strictNullChecks

* small optimisation for getUniqueRoomsWithIndividuals

* tidy

* test coverage
2023-04-03 09:26:55 +01:00
Kerry
6f1a3af895
Properly generate mentions when editing a reply with MSC3952 (#10486)
* remove redundant feature_intentional_mentions settings check

* tests

* pass replytoevent to attachmmentions in editmessagecomposer

* lint

* strict fix
2023-04-02 21:32:12 +00:00
maheichyk
d3da171765
Show room create icon if "UIComponent.roomCreation" is enabled (#10364)
* Show room create button in RoomSublist if "UIComponent.roomCreation" is enabled

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* Revert "Show room create button in RoomSublist if "UIComponent.roomCreation" is enabled"

This reverts commit a332a0b02a6c3253ea7ac606211c41a09c409de5.

* Use UIComponent.ExploreRooms to display menu item "Explore public rooms" ("Explore rooms" in case of space room) in context menu of "Rooms" section of RoomList component. The context menu will be available if one of UIComponent.ExploreRooms or UIComponent.CreateRooms is enabled.

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* "Explore rooms" of space room should not be controlled by UIComponent.ExploreRooms.

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

---------

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-04-03 09:19:56 +12:00
alunturner
6f791d28c8
Add mentions as links to rte (#10463)
* adds autocomplete behaviour for mentions in rich text editor
* allows adding mentions as links
* adds tests
2023-03-31 14:14:55 +01:00
Michael Telatynski
404c412bcb
Handle IDB closed event by showing modal with prompt to reload app (#10395
* Handle IDB `closed` event by showing modal with prompt to reload app

* Iterate

* Skip the modal for guests, e.g. during registration

* Iterate

* Add tests
2023-03-31 10:08:45 +01:00
Michael Weimann
dddef858f1
Fix detection of encryption for all users in a room (#10487) 2023-03-31 09:43:47 +02:00
Eric Eastwood
ff1468b6d3
Replace newTranslatableError with UserFriendlyError (#10440
* Introduce UserFriendlyError

* Replace newTranslatableError with UserFriendlyError

* Remove ITranslatableError

* Fix up some strict lints

* Document when we/why we can remove

* Update matrix-web-i18n

Includes changes to find `new UserFriendlyError`,
see https://github.com/matrix-org/matrix-web-i18n/pull/6

* Include room ID in error

* Translate fallback error

* Translate better

* Update i18n strings

* Better re-use

* Minor comment fixes
2023-03-31 08:30:43 +01:00
David Baker
15523cde36
Update test interface to add call object (#10477)
Compatibility with https://github.com/matrix-org/matrix-js-sdk/pull/3237
2023-03-30 10:22:27 +01:00
Suguru Hirahara
232daaff68
Fix decryption failure bar covering the timeline (#10360)
* Use grid layout instead

- BEM naming style
- Increase block gap from 4px to 8px
- Use flexbox inside 'header' grid-area to let the buttons wrapped
- Use variables
- Remove 4px gap when one of the buttons is not rendered
- Change 'body' to 'message'
- Set 'align-self: start' to the icon and spinner

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Unset height of spinner

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Break lines at newline characters with white-space: pre-line

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Edit tests to check decryption failure bars on narrow timeline

- checkTimelineNarrow() looks for buttons by default
- Test indicator as well

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Remove a line

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Edit the test to have it check mx_EventTile_last only inside mx_RoomView_body

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix double underscores

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix double underscores - pcss

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Iterate - buttons at the bottom

- Set common spacing to buttons with variables
- Remove line breaks, yarn run i18n
- Set data-testid for headlines and buttons in case the tested strings would be displayed elsewhere simultaneously

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Check waiting headline as well

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Increase spacing between the message and the buttons

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* lint

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Increase block gap between wrapped buttons for clickability

Apply 8px between wrapped buttons

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Revert bottom margin of buttons which are not expected to be wrapped

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Check visibility instead of existence

This commit removes data-testid from headlines and data-testid-button and checks whether the elements are really visible, not overflowing the viewport.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Remove redundant gap between 'mx_DecryptionFailureBar_start' and the bottom edge

This commit adds '.mx_DecryptionFailureBar--withEnd' class name to have it applied to the bar only if it has button(s). This way the bar is rendered with a flexbox and the row-gap declaration is respected only if there is a 'mx_DecryptionFailureBar--withEnd' element. The element  currently includes the button(s) only.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* lint - prettier

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Have Percy take a snapshot of the bar loading spinner before checkTimelineNarrow()

The loading spinner is likely to disappear while checking the bar on the narrow timeline.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Co-authored-by: Kerry <kerrya@element.io>
2023-03-30 10:11:16 +01:00
Kerry
9a733a6444
Apply strictNullChecks to src/utils/exportUtils (#10379)
* Apply `strictNullChecks` to `src/utils/exportUtils`

* strict fix

* test coverage

* lint

* test coverage

* one more test
2023-03-29 21:47:07 +00:00
Michael Telatynski
a47b3eb0ee
Apply strictNullChecks to src/components/views/elements/* (#10462
* Apply `strictNullChecks` to `src/components/views/elements/*`

* Iterate

* Iterate

* Iterate

* Apply `strictNullChecks` to `src/components/views/elements/*`

* Iterate

* Iterate

* Iterate

* Update snapshot
2023-03-29 08:23:54 +01:00
Kerry
6eda1fa6e2
replace Polls history strings with Poll history (#10454)
Co-authored-by: Michael Weimann <michaelw@matrix.org>
2023-03-28 22:13:51 +00:00
RiotRobot
0475e7107f Merge branch 'master' into develop 2023-03-28 14:30:52 +01:00
Robin
edef4cc52e
Handle group call redaction (#10465)
Redacted group call events should be interpreted as terminated calls.
2023-03-28 13:16:30 +00:00
Michael Weimann
c30b2637c5 Changes for v3.69.0 2023-03-28 11:23:16 +01:00
Kerry
cd700e20fc
Display relative timestamp for threads on the same calendar day (#10399)
* add test cases for <24 different day time formatting

* use day instead of <24h ago to format relative date
2023-03-27 20:22:46 +00:00
maheichyk
68fa9aed9d
Show "Invite" menu option if "UIComponent.sendInvites" is enabled. (#10363)
* Show "Invite" menu option if "UIComponent.sendInvites" is enabled.

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* Update test names

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

---------

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-03-28 09:10:18 +13:00
Richard van der Hoff
d821323e5c
Prevent rust-crypto setting from leaking to other tests (#10464)
Follow-up to #9759.

Because the MatrixClientPeg pushes the use_rust_crypto setting back into the SettingsStore, the setting was leaking out to other tests despite getValue's mock being restored.

The solution is to mock out setValue as well.
2023-03-27 18:03:17 +00:00
Janne Mareike Koschinski
63678603e0
Revert "Mentions as links rte (#10422)" (#10458)
This reverts commit 1af71089dd.
2023-03-27 12:57:05 +02:00
Michael Weimann
aec454dd6f
Add UserProfilesStore, LruCache and cache for user permalink profiles (#10425) 2023-03-27 10:07:43 +02:00
Michael Telatynski
1c039fcd38
Fix joining public rooms without aliases in search dialog (#10437)
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2023-03-27 07:39:34 +00:00
Michael Telatynski
c225b8ec29
Conform more code to strictNullChecks (#10444
* Conform more code to `strictNullChecks`

* Fix tests

* Fix tests
2023-03-27 08:01:09 +01:00
Michael Weimann
ba2608ec74
Add m.direct filter / validation (#10436) 2023-03-27 08:37:35 +02:00
Eric Eastwood
e5f06df3f7
Better error handling in jump to date (#10405)
- Friendly error messages with details
 - Add a way to submit debug logs for actual errors (non-networking errors)
 - Don't jump someone back to a room they already navigated away from. Fixes bug mentioned in https://github.com/vector-im/element-web/issues/21263#issuecomment-1056809714
2023-03-24 14:39:24 -05:00
alunturner
1af71089dd
Mentions as links rte (#10422)
* bumps the RTE dependency to introduce user/room mention handling
* adds autocomplete behaviour to allow users to insert user and room mentions as links
* sets up tests for the autocomplete behaviour
2023-03-24 17:07:24 +00:00
Florian Duros
e4dfb21e56
Fix strict strictNullChecks to src/editor/* (#10428
* Fix strict `strictNullChecks` to `src/editor/*`

* Fix autoComplete creation

* Fix dom regression

* Remove changes
2023-03-23 13:35:55 +00:00
Patrick Cloke
e19127f8ad
Implement MSC3952: intentional mentions (#9983)
Implements the intentional mentions feature of MSC3952 (behind
a labs flag).

If enabled, this will send an org.matrix.msc3952.mentions property
on events that will contain the user IDs and/or whether the room is
being mentioned. These mentions also gets propagated via some
custom behaviour for replies and edits.
2023-03-23 11:47:40 +00:00
Patrick Cloke
5c47142dab
Prep for matrix-js-sdk supporting intentional mentions. (#10431)
Add a method to the fake MatrixClient used in tests for compatibility with
changes in matrix-org/matrix-js-sdk#3092. This stops the downstream tests
from failing on that PR.
2023-03-22 16:22:19 -04:00
Eric Eastwood
ed88e0cdce
Prevent future date selection in jump to date (#10419)
You can still type in whatever date you want (native date input behavior) but the UI picker has future dates disabled.

Fix https://github.com/vector-im/element-web/issues/20800
2023-03-22 11:45:44 -05:00
Michael Weimann
3eb6a55b93
Tweak pill UI (#10417) 2023-03-22 13:27:24 +01:00
Dominik Henneke
ef68650594
Implement MSC3973: Search users in the user directory with the Widget API (#10269)
* Add an action to search for users in the user directory according to MSC3973

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Fix linter errors

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Update the matrix-widget-api package to version 1.3.0

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Improve the test

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

---------

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
2023-03-21 11:38:41 +00:00
Michael Weimann
96d1b74ffc
Pillify event permalinks (#10392) 2023-03-21 10:23:20 +01:00
maheichyk
d4b81882e5
Show filterContainer if "UIComponent.filterContainer" is enabled (#10381)
Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-03-21 09:06:43 +00:00
Eric Eastwood
22451901d1
Fix failing develop with mis-matched snapshots (#10411)
- `develop` failure: https://github.com/matrix-org/matrix-react-sdk/actions/runs/4470319896/jobs/7853678384
 - What happened?
    - Date separator markup updated in https://github.com/matrix-org/matrix-react-sdk/pull/10404
    - While some new snapshot tests added and merged in https://github.com/matrix-org/matrix-react-sdk/pull/10353
 - Merge trains could have helped
2023-03-20 11:52:23 -05:00
Eric Eastwood
7a68bd9cef
Fix big date separators when jump to date is enabled (#10404)
Fix https://github.com/vector-im/element-web/issues/22969
2023-03-20 11:03:36 -05:00
Andy Balaam
ca0dfb6c1e
Further improve performance with lots of hidden events (#10353)
* Avoid re-calculating shouldShowEvent in getReadReceiptsByShownEvent

* Test that uses a MainGrouper

* Cache more calls to shouldShowEvent
2023-03-20 09:50:07 +00:00
Eric Eastwood
bc60e59eda
Add stable unstable version for jump to date before v1.6 is fully supported on a homeserver (#10398)
Add stable unstable version (`org.matrix.msc3030.stable`) for jump to date [before `v1.6` is fully supported on a homeserver](https://github.com/matrix-org/synapse/issues/15089).

Related to https://github.com/vector-im/element-web/issues/24362 but does not solve immediately because Synapse does not supply `org.matrix.msc3030.stable` yet

Also refactored `ServerSupportUnstableFeatureController` to support multiple feature groups where any one of them will enable the setting. All features in a feature group are required. This way having either `org.matrix.msc3030` or `org.matrix.msc3030.stable` will enable the jump to date feature flag with a config of `[["org.matrix.msc3030"], ["org.matrix.msc3030.stable"]]`
2023-03-17 15:08:17 -05:00
Kerry
5211b628d6
add fallback reply for poll start (#10380) 2023-03-16 21:27:56 +00:00
Michael Weimann
a86a8e7f8e
Pillify permalinks to rooms and users (#10388) 2023-03-16 15:01:09 +01:00
Michael Telatynski
1c9ea423c9
Conform more code to strictNullChecks (#10374)
* Apply `strictNullChecks` to `src/components/views/room_settings/*`

* Restore tsconfig.json

* Conform more code to `strictNullChecks`

* Iterate

* Update matrix-widget-api

* Conform more code to `strictNullChecks`
2023-03-16 11:07:29 +00:00
Michael Weimann
aae9dfbb7d
Strictify voice-broadcast (#10393) 2023-03-16 10:55:06 +01:00
Michael Weimann
6d15b05b86
Fix wrong E2E icon in room header for unencrypted local room (#10394) 2023-03-16 10:54:54 +01:00
Kerry
2344eaab1c
Poll history - remove active development labs flag (#10357)
* add poll history tab to room settings

* test poll history in room settings

* remove posthog tracking for poll his

* remove labs flag for poll history

* i18n
2023-03-15 20:54:12 +00:00
Dominik Henneke
0cfd97b180
Add API params to mute audio and/or video in Jitsi calls by default (#10376)
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
2023-03-15 13:51:00 +01:00
Michael Telatynski
87fb493783
Fix pinned messages card saying nothing pinned while loading (#10385) 2023-03-15 12:47:21 +00:00
Michael Telatynski
0c38bd7beb
Fix import e2e key dialog staying disabled after paste (#10375) 2023-03-15 09:20:20 +00:00
Michael Telatynski
e3930fb8b0
Show all labs even if incompatible, with appropriate tooltip explaining requirements (#10369)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-03-15 08:37:41 +00:00
Michael Telatynski
8cb8cd4eb1
Conform more code to strictNullChecks (#10368
* Conform more code to `strictNullChecks`

* Iterate
2023-03-14 11:09:35 +00:00
Michael Weimann
370c872d70 Roll back pillify everything (#10370)
(cherry picked from commit 05e3fb09d6)
2023-03-14 11:05:02 +00:00
Michael Weimann
05e3fb09d6
Roll back pillify everything (#10370) 2023-03-14 11:56:14 +01:00
Kerry
4c2b5df1f2
Poll history - access poll history from room settings (#10356)
* add poll history tab to room settings

* test poll history in room settings

* remove posthog tracking for poll his

* use consistent label for polls history
2023-03-13 22:08:59 +00:00
Kerry
9f66082486
Notifications: inline error message on notifications saving error (#10288)
* basic sync setup

* formatting

* get loudest value for synced rules

* more types

* test synced rules in notifications settings

* type fixes

* noimplicitany fixes

* remove debug

* tidying

* extract updatePushRuleActions fn to utils

* extract update synced rules

* just synchronise in one place?

* monitor account data changes AND trigger changes sync in notifications form

* lint

* setup LoggedInView test with enough mocks

* test rule syncing in LoggedInView

* strict fixes

* more comments

* one more comment

* add error variant for caption component

* tests for new error message

* tweak styles

* noImplicitAny

* revert out of date prettier changes to unrelated files

* limit inline message to radios only, tests

* strict fix
2023-03-13 21:59:04 +00:00
Kerry
72404d7216
Apply strictNullChecks to src/utils/beacon/* (#10337)
* strictnullchecks fixes in utils/beacon

* user filterBoolean
2023-03-13 21:55:50 +00:00
Michael Telatynski
503df62191
Conform more of the codebase to strictNullChecks (#10358
* Conform more of the codebase to `strictNullChecks`

* Fix types

* Iterate

* Iterate
2023-03-13 15:07:20 +00:00
Michael Weimann
41d88ad6ae
Fix user pill click (#10359) 2023-03-13 15:43:13 +01:00
Kerry
1e46efe89c
Poll history - make poll history independent from dialogs (#10349)
* move pollhistory from dialogs to polls directory

* rename PollHistoryDialog -> PollHistory

* rename references to PollHistoryDialog

* move title to PollHistory

* add option to collapse empty dialog header
2023-03-12 20:22:30 +00:00
Michael Telatynski
127a3b667c
Conform more of the codebase to strictNullChecks (#10350
* Conform more of the codebase to `strictNullChecks`

* Iterate

* Generics ftw

* Iterate
2023-03-10 14:55:06 +00:00
Michael Weimann
a9161981e2 Fix start DM with pending third party invite (#10347)
* Fix start DM with pending third party invite

* Make the fix more clearly visible

---------

Co-authored-by: Janne Mareike Koschinski <jannemk@element.io>
Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
(cherry picked from commit d53e91802d)
2023-03-10 14:41:04 +00:00
Michael Weimann
d53e91802d
Fix start DM with pending third party invite (#10347)
* Fix start DM with pending third party invite

* Make the fix more clearly visible

---------

Co-authored-by: Janne Mareike Koschinski <jannemk@element.io>
Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
2023-03-10 14:39:53 +00:00
Andy Balaam
102c4e5ae9
Improve performance of rendering a room with many hidden events (#10131)
* Test MessagePanel rendering with hidden events

* Cache the results of shouldShowEvent in MessagePanel

* Combine an event and its shouldShow info into a single object
2023-03-10 14:35:40 +00:00
Andy Balaam
f8e645396e
Support dynamic room predecessor in SpaceProvider (#10348) 2023-03-10 11:01:45 +00:00
Andy Balaam
6141cca652
Support dynamic room predecessors for RoomProvider (#10346) 2023-03-10 10:40:38 +00:00
Andy Balaam
2e064e57a0
Support dynamic room predecessors in ForwardDialog (#10344) 2023-03-10 09:41:30 +00:00
Andy Balaam
42abfb1fac
Support dynamic room predecessors in SpaceHierarchy (#10341) 2023-03-10 09:41:14 +00:00
Andy Balaam
b646250c90
Support dynamic room predecessors in OwnBeaconStore (#10339)
* Support dynamic room predecessors in OwnBeaconStore

* Fix type of dynamicWatcherRef

* Mock a function missing from client
2023-03-10 09:15:54 +00:00
Andy Balaam
37d2b7b17b
Support dynamic room predecessors in AddExistingToSpaceDialog (#10342) 2023-03-09 17:17:28 +00:00
Andy Balaam
421c1b9281
Support dynamic room predecessors in leave-behaviour (#10340) 2023-03-09 14:49:59 +00:00
Andy Balaam
f90bc40cfc
Support dynamic room predecessors in StopGapWidgetDriver (#10338) 2023-03-09 13:02:29 +00:00
Patrick Cloke
aca077cf2b
Add tests for createEditContent which mirror tests for createMessageContent. (#10331) 2023-03-09 12:15:48 +00:00
Michael Weimann
85e8d27697
Extract avatars from permalink hook (#10328) 2023-03-09 12:48:36 +01:00
Andy Balaam
edd8865670
Support dynamic room predecessors in WidgetLayoutStore (#10326)
* Support dynamic room predecessors in WidgetLayoutStore

* Improve TS correctness in WidgetLayoutStore

* Test to cover onNotReady to quieten SonarCloud

---------

Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
2023-03-09 10:18:23 +00:00
Andy Balaam
acb7dd84ac
Support dynamic room predecessors in SpaceStore (#10332) 2023-03-09 09:31:02 +00:00
Kerry
cef821c21b
Polls: sync push rules on changes to account_data (#10287)
* basic sync setup

* formatting

* get loudest value for synced rules

* more types

* test synced rules in notifications settings

* type fixes

* noimplicitany fixes

* remove debug

* tidying

* extract updatePushRuleActions fn to utils

* extract update synced rules

* just synchronise in one place?

* monitor account data changes AND trigger changes sync in notifications form

* lint

* setup LoggedInView test with enough mocks

* test rule syncing in LoggedInView

* strict fixes

* more comments

* one more comment
2023-03-09 00:20:06 +00:00
Michael Weimann
28abae60a6
Fix breadcrumb store test (#10330) 2023-03-08 16:10:23 +00:00
Andy Balaam
4ee57a36e0
Support dynamic room predecessors in BreadcrumbsStore (#10295)
* Tests for BreadcrumbsStore.meetsRoomRequirements

* Tests for appending rooms to BreadcrumbsStore

* Support dynamic room predecessors in BreadcrumbsStore
2023-03-08 15:13:32 +00:00
Michael Telatynski
bee4759208
Remove flux dependency (#10313) 2023-03-08 14:19:05 +00:00
Andy Balaam
b8d502be2e
Support dynamic room predecessors in RoomNotificationStateStore (#10297)
* Tests for RoomNotificationStateStore emitting events

* Support dynamic room predecessors in RoomNotificationStateStore

* Remove unused arguments from emit call.

UPDATE_STATUS_INDICATOR is used in:
* SpacePanel
* MatrixChat
* RoomHeaderButtons

but these arguments are not used in any of those places. Remove them so
when I refactor I don't have to make up values for them.

* Fix broken test (wrong expected args to emit)

UPDATE_STATUS_INDICATOR is used in:
* SpacePanel
* MatrixChat
* RoomHeaderButtons

but these arguments are not used in any of those places. Remove them so
when I refactor I don't have to make up values for them.

* Update the RoomNotificationStore whenever the predecessor labs flag changes

* Fix type errors

* Fix other tests that trigger our new watcher
2023-03-08 14:18:03 +00:00
Michael Telatynski
80fc0997a4
Explicitly specify all children props (#10312) 2023-03-08 13:28:07 +00:00
Michael Weimann
ad26925bb6
Refactor pill and add tests (#10304) 2023-03-08 13:06:50 +01:00
Michael Telatynski
c0e40217f3
Apply strictNullChecks to src/stores/widgets/* (#10324)
* Apply `strictNullChecks` to src/stores/widgets/*

* Iterate

* Iterate
2023-03-08 11:48:58 +00:00
Sebbones
0c1c3f1cde
Improved a11y for Field feedback and Secure Phrase input (#10320)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-03-08 11:32:50 +00:00
Michael Weimann
6fa00a20b0
Use compound icons (#10292) 2023-03-08 11:11:01 +01:00
Michael Telatynski
0db0d4b09d
Remove unused code (#10322) 2023-03-08 10:04:07 +00:00
Michael Telatynski
f74867e57b
Allow parsing png files to fail if thumbnailing is successful (#10308) 2023-03-07 15:48:23 +00:00
maheichyk
3e340d5906
Fixes user authentication when registering via the module API (#10257)
* Fixes authentication when user is registered via module API
* Remove "on_logging_in" action

---------

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-03-07 16:24:44 +01:00
Michael Telatynski
af1ec76149
Fix jest/no-conditional-expect lint and enable it (#10307) 2023-03-07 13:58:10 +00:00
Michael Telatynski
4b8bada24b
Apply strictNullChecks around the codebase (#10302
* Apply `strictNullChecks` around the codebase

* Iterate PR
2023-03-07 13:19:18 +00:00
Michael Telatynski
bda54a8b20
Kill off enzyme in preference of react testing library (#10255) 2023-03-06 15:17:46 +00:00
Michael Weimann
394bffbae4
Await start DM in right panel (#10290) 2023-03-06 16:09:56 +01:00
Michael Telatynski
667ec166d7
Remove Enzyme tests in favour of React testing-library (#10289) 2023-03-06 12:13:17 +00:00
Michael Weimann
303b878b17
Pillify http and non-prefixed matrix.to links (#10277) 2023-03-06 12:45:37 +01:00
Michael Weimann
9b74b0f057
Only allow to start a DM with one email if encryption by default is enabled (#10253) 2023-03-06 12:08:17 +01:00
Michael Weimann
db6ee53535
Implement third-party invite waiting room (#10229) 2023-03-06 12:08:04 +01:00
Michael Telatynski
ad8d27d2b2
Fix some features not being configurable via features (#10276) 2023-03-03 13:31:51 +00:00
Michael Weimann
6746ce2da3
Fix start DM via right panel (#10278) 2023-03-03 13:34:38 +01:00
Michael Weimann
ac3c95fa84
Directly convert Matrix and room Ids to pills (#10267) 2023-03-02 11:41:17 +01:00
Kerry
de6a1a661c
apply strictnullchecks to src/components/views/beacon/* (#10272) 2023-03-02 09:58:05 +00:00
Michael Weimann
ffa047be68
Find DMs with pending third-paty invites (#10256) 2023-03-02 09:44:12 +01:00
Kerry
10a765472b
Polls push rules: synchronise poll rules with message rules (#10263)
* basic sync setup

* formatting

* get loudest value for synced rules

* more types

* test synced rules in notifications settings

* type fixes

* noimplicitany fixes

* remove debug

* tidying
2023-03-02 05:33:19 +00:00
Michael Telatynski
e5291c195d
Replace react-dom tests with react testing-library tests (#10260) 2023-03-01 15:59:27 +00:00
Michael Weimann
5398db21ad
Add ESLint Jest (#10261) 2023-03-01 16:23:35 +01:00
Michael Telatyński
629e5cb01f
Properly type Modal props to ensure useful typescript checking (#10238
* Properly type Modal props to ensure useful typescript checking

* delint

* Iterate

* Iterate

* Fix modal.close loop

* Iterate

* Fix tests

* Add comment

* Fix test
2023-02-28 10:31:48 +00:00
Michael Weimann
2c7dfb5401
Factor out basic email check (#10244) 2023-02-28 10:39:35 +01:00
Michael Telatyński
f40d15388c
Update tests to prefer RTL over Enzyme (#10247
* Update tests to prefer RTL over Enzyme

* Strict types
2023-02-28 08:58:23 +00:00
Kerry
dd6fc124d7
Apply strictNullChecks to src/components/views/location/* (#10249
* strict fixes

* accessiblebutton without onClick explicit

* strict fix for UserMenu BaseAvatar
2023-02-28 08:55:59 +00:00
Kerry
7c70dd9d16
Poll history: fetch more poll history (#10235)
* load more pages of polls

* load more and no results messages

* style no results message

* remove debug

* strict fixes

* comments

* i18n pluralisations

* pluralisation the right way
2023-02-28 02:56:27 +00:00
Kerry
f57495d3cd
Poll history: detail screen (#10172)
* basic navigation to focused poll

* add tooltip

* drill permalinkCreator down to poll history

* render poll tile and link to timeline

* tidy and lint

* unit test poll detail

* add view poll link to ended pollliste item

* strict fix

* pr improvements

* pass room as prop

* permalinkcreator ts assertion
2023-02-27 20:39:55 +00:00
Michael Telatyński
9b2b3ca42e
Remove tests of non-spec-compliant behaviour (#10248) 2023-02-27 18:50:15 +00:00
grimhilt
0546a11fd9
Sort short/exact emoji matches before longer incomplete matches (#10212)
* apply sort for exact match

* add tests for emoji provider

* apply filter in the emoji picker

* add tests

* revert cypress version

* put correct copyright

* fix eslint

* fix eslint

* add type

* fix cypress test

* fix tsc types issues

* add forgotten space...

---------

Co-authored-by: grimhilt <grimhilt@users.noreply.github.com>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
2023-02-27 17:09:15 +00:00
Germain
b9f61da7e6
Add EventTileThreadToolbar tests (#10243) 2023-02-27 16:27:13 +00:00
David Baker
62cd0f1beb
Use the room avatar as a placeholder in calls (#10231)
* Use the room avatar as a placeholder in calls

Rather than the image for the user we're in a call with. This makes
it work correctly with virtual rooms easily since we'll get the
avatar for the correct room.

* Prettier

* TS strict errors

* More TS strict fixes

* More strict TS

* Prettier

* Even more TS strict

* more stricter
2023-02-27 09:34:02 +00:00
Michael Telatyński
12dd799301
Fix double translation issue (#10240
* Fix double translation issue

* Remove some redundant string concatenations
2023-02-27 09:15:27 +00:00
Aaron Raimist
d9d0ab3d98
Provide a more detailed error message than "No known servers" (#6048)
* Provide a more detailed error message than "No known servers"

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Fix PR since file was refactored

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Fix formatting

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* lint

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Update src/stores/RoomViewStore.tsx

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* Add example identifiers and a more detailed explanation

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Lint

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Lint

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Revert back to original wording (except s/alias/address)

Alias was a better name imo but Element calls them addresses now so changed to be consistent.

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Prettier

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Fix ts error

* Add snapshot test

* Check the Modal props

* Add test case to reach quality gate

---------

Signed-off-by: Aaron Raimist <aaron@raim.ist>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Florian Duros <florianduros@element.io>
2023-02-24 15:59:30 +00:00
Michael Telatynski
76b82b4b2b
Make more code conform to strict null checks (#10219
* Make more code conform to strict null checks

* Fix types

* Fix tests

* Fix remaining test assertions

* Iterate PR
2023-02-24 15:28:40 +00:00
maheichyk
7b77f76486
Widget permissions customizations using module api (#10121)
* Using module api to customize widget permissions

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

* Revert type export and use ComponentProps instead.

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>

---------

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Co-authored-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-02-23 14:53:44 +00:00
Germain
8f7f855ad4
Refactor ExtraTile to use functional components (#10191) 2023-02-23 11:57:37 +00:00
Germain
5f78be73f3
Add tests for AskInviteAnywayDialog (#10228)
Co-authored-by: Michael Weimann <michaelw@matrix.org>
2023-02-23 10:52:58 +00:00
maheichyk
d0c266d4a1
Support joining non-peekable rooms via the module API (#10154)
When previewing a room, we normally do not have a Room object. Currently, when the RoomPreviewBar is instantiated without a room, it doesn't raise the PreviewRoomNotLoggedIn and JoinFromRoomPreview module lifecycle events, meaning that modules are unable to intercept previews of non-peekable rooms.

To fix this, make sure that we pass the room ID into RoomPreviewBar irrespective of whether we have a Room object, and use it to raise the module lifecycle events.

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
2023-02-23 10:29:21 +00:00
Michael Weimann
880428ab94
Update „new device“ toast texts and buttons (#10200) 2023-02-23 10:25:33 +01:00