Commit graph

1147 commits

Author SHA1 Message Date
Richard van der Hoff
83f12fcba0
More tests for UserInfo (#10677)
* UserInfo-test: move mocking to `beforeEach`

... so that changes to the mocks do not leak between tests

* Add some more tests for UserInfo
2023-04-21 13:48:27 +00:00
Michael Telatynski
be5928cb64
Conform more of the codebase to strictNullChecks (#10672)
* Conform more of the codebase to `strictNullChecks`

* Iterate

* Iterate

* Iterate

* Iterate

* Conform more of the codebase to `strictNullChecks`

* Iterate

* Update record key
2023-04-21 11:50:42 +01:00
Michael Telatynski
792a39a39b
ARIA Accessibility improvements (#10675)
* Fix confusing tab indexes in EventTilePreview

* Stop using headings inside buttons

* Prefer labelledby and describedby over duplicated aria-labels

* Improve semantics of tables used in settings

* Fix types

* Update tests

* Fix timestamps
2023-04-21 09:48:48 +00:00
Michael Telatynski
782060a26e
ARIA Accessibility improvements (#10674)
* Add missing aria-expanded attributes

* Improve autoComplete for phone numbers & email addresses

* Fix room summary card heading order

* Fix missing label on timeline search field

* Use appropriate semantic elements for dropdown listbox

* Use semantic list elements in keyboard settings tab

* Use semantic list elements in spotlight

* Fix types and i18n

* Improve types

* Update tests

* Add snapshot test
2023-04-20 17:13:30 +00:00
Michael Telatynski
2da52372d4
Add arrow key controls to emoji and reaction pickers (#10637)
* Add arrow key controls to emoji and reaction pickers

* Iterate types

* Switch to using aria-activedescendant

* Add tests

* Fix tests

* Iterate

* Update test

* Tweak header keyboard navigation behaviour

* Also handle scrolling on left/right arrow keys

* Iterate
2023-04-20 14:56:21 +00:00
Michael Telatynski
1efa82917a
Fix wrong room topic tooltip position (#10667)
* Fix wrong room topic tooltip position

* Update snapshots

* Fix tests
2023-04-20 08:25:53 +00:00
Michael Weimann
83e6a6057d
Add developer tools option to room list context menu (#10635)
* Make developer tools more accessible

* Extend tests

* Use settings hook

* Trigger CI
2023-04-19 11:34:27 +00:00
Kerry
957945b356
remove old debug logging in AsyncWrapper (#10661) 2023-04-19 07:45:27 +00:00
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
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
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
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
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
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
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
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
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
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
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