Commit Graph

1245 Commits

Author SHA1 Message Date
Kerry
23196d49e1
OIDC: Redirect to delegated auth provider when signing out (#11432)
* util for account url

* test cases

* disable multi session selection on device list

* remove sign out all from context menus when oidc-aware

* comment

* remove unused param

* redirect to auth provider when signing out

* open auth provider in new tab, refresh sessions on return

* correct comment

* fix bad copy paste

* try to make sonar happy

* Update for latest revision of MSCs

* Update SessionManagerTab-test.tsx

* Make InteractiveAuthCallback async and await it

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@matrix.org>
Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2023-08-22 11:15:35 +00:00
Kerry
5c1b62cf99
Disable 3pid fields in settings when m.3pid_changes capability is disabled (#11430)
* check m.3pid_changes capability in user settings

* comments

* assume 3pid_changes is true for older evrsions
2023-08-22 06:07:10 +00:00
Kerry
dfded8d4d3
OIDC: disable multi session signout for OIDC-aware servers in session manager (#11431)
* util for account url

* test cases

* disable multi session selection on device list

* remove sign out all from context menus when oidc-aware

* comment

* remove unused param

* typo
2023-08-22 02:25:34 +00:00
Michael Telatynski
3c52ba0c92
Use Intl to localise dates and times (#11422)
* Use Intl to generate better internationalised date formats

* Get `Yesterday` and `Today` from Intl also

* Correct capitalisation blunder

* Fix formatTime include weekday

* Iterate

* Fix tests

* use jest setSystemTime

* Discard changes to cypress/e2e/settings/general-user-settings-tab.spec.ts

* Discard changes to res/css/_components.pcss

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

* Discard changes to src/components/views/elements/LanguageDropdown.tsx

* Add docs & tests for getDaysArray & getMonthsArray

* Discard changes to test/components/structures/__snapshots__/MatrixChat-test.tsx.snap

* Consolidate consts

* Improve testing & documentation

* Update snapshot

* Apply suggestions from code review

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Iterate

* Clarify comments

* Update src/DateUtils.ts

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Specify hourCycle

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

* Update comments

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-08-21 19:38:59 +00:00
Michael Telatynski
dd6097c568
Polish & delabs Exploring public spaces feature (#11423)
* Iterate search public spaces UX

* Tweak iconography in spotlight

* Delabs `Exploring public spaces`

* Tweak msc3827 v1.4 support discovery

* i18n

* Delete stale test

* Fix tests

* Iterate

* Iterate PR based on review

* Improve types

* Add shortcut to search for public spaces to create space menu

* Update import

* Add org.matrix.msc3827.stable filtering

* Fix tests

* silence some errors
2023-08-21 09:39:20 +00:00
Michael Telatynski
d81f71f993
Load SAS Emoji translations from @matrix-org/spec (#11429)
* Remove last instance of componentWillMount

* Load SAS Emoji translations from @matrix-org/spec

* Fix import

* Test normalisation on both sides

* update comment for @richvdh

* Delint
2023-08-21 08:15:22 +00:00
Richard van der Hoff
7a6d81c3b8
Update Jest to more recent release (#11409)
* Update Jest to more recent release

I want to use things like `jest.advanceTimersByTimeAsync`

* more jest updates

* add dep on types/prettier

* fix LegacyRoomHeader-test

* fix MatrixChat-test

* fix RoomView-test

* fix PollHistory-test

* update SidebarUserSettingsTab-test

* fix PipContainer-test

* fix UserOnboardingPage-test

* fix WidgetContextMenu-test.tsx

* Avoid `mockImplementation` for mock `matchMedia` impl

`mockImplementation` is (now) reset by `jest.resetAllMocks` and
`jest.restoreAllMocks`, which we don't really want here.

Fixes `theme-test`

* Move `mediaDevices` mock out of `setupManualMocks`

This doesn't work well in test suites with multiple tests, because the
`mockReturnValue` is reset for subsequent tests.

In any case, having it mocked out automagically is *magical*. Let's make it
opt-in.

* fix FormattingButtons-test.tsx

* fix DeviceListenerTest

* fix RoomTile-test
2023-08-16 10:20:48 +00:00
Richard van der Hoff
3fda0299a5
Move mediaDevices mock out of setupManualMocks (#11413)
* Move `mediaDevices` mock out of `setupManualMocks`

This doesn't work well in test suites with multiple tests, because the
`mockReturnValue` is reset for subsequent tests.

In any case, having it mocked out automagically is *magical*. Let's make it
opt-in.

* clarify ts-ignore
2023-08-16 08:29:34 +00:00
Charly Nguyen
d569ba0cfe
Allow managing room knocks (#11404)
* Allow managing room knocks

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>

* Apply PR feedback

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>

* Apply Sonar feedback

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>

---------

Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>
2023-08-16 08:16:19 +00:00
Michael Telatynski
ad73b0c16e
Switch to importing most things from the main matrix-js-sdk export (#11406)
* Switch to importing most things from the main matrix-js-sdk export

* fix imports

* Iterate

* Fix tests
2023-08-15 15:00:17 +00:00
Neeraj Vageele
6f455217d1
correct home server URL (#11391)
* correct home server URL

* update snapshot

---------

Co-authored-by: Neeraj <neerajv@thirdrocktechkno.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-14 09:08:34 +00:00
Michael Telatynski
d2c6577024
Switch to importing more things from the main js-sdk export (#11394) 2023-08-14 08:58:55 +00:00
Travis Ralston
180fcaa70f
Support Matrix 1.1 (drop legacy r0 versions) (#9819)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-14 09:25:13 +01:00
Milton Moura
d240f06810
Include non-matching DMs in Spotlight recent conversations when the DM's userId is part of the search API results (#11374)
* This addresses two issues:

     1. Include non-matching DMs in Spotlight suggestions if the userId of the DM is included in the user directory search results
     2. The user directory search results order is kept when there is no relevant activity between users, instead of sorting by MXID

* Applying feedback from PR:
1. Updated comments
2. Renamed users to userDirectorySearchResults
3. Makes sure linter is happy
2023-08-10 17:27:24 +00:00
Michael Telatynski
ef385e6028
Switch to importing more things from the main js-sdk export (#11377) 2023-08-10 08:01:14 +00:00
Michael Telatynski
a1328d8ef7
Switch to importing more things from the main js-sdk export (#11376) 2023-08-09 15:10:54 +00:00
Michael Telatynski
57a0d99dc8
Improve randomString mock for better snapshots (#11375) 2023-08-09 09:39:48 +01:00
Michael Telatynski
c3574c2050
Switch to importing client from main js-sdk export (#11370) 2023-08-09 07:18:41 +00:00
Kerry
e0d498e338
Enable jsx-a11y/click-events-have-key-events eslint rule (#10362)
* enable "jsx-a11y/alt-text" lint rule

* enable "jsx-a11y/label-has-associated-control"

* make Spoilers keyboard accessible

* make invite reason keyboard accessible

* make invite suggestions keyboard accessible

* make avatar upload in space basic settings keyboard accessible

* ignore jsx-a11y/click-events-have-key-events issues in tests

* Update test expectation

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-09 06:27:31 +00:00
Michael Telatynski
2b17fc3221
Show error when searching public rooms fails (#11378)
* Show error when searching public rooms fails

* Fix types

* Improve test coverage

* Improve coverage
2023-08-08 14:08:17 +00:00
Michael Telatynski
033c600fa2
Switch to importing @types/{event,partials} from main js-sdk export (#11369) 2023-08-08 10:12:12 +00:00
Michael Telatynski
368b6b9355
Switch to importing models/{event-timeline{,set},user,device,event-status} from main js-sdk export (#11368) 2023-08-08 07:16:04 +00:00
Michael Telatynski
24703eea8f
Switch to importing models/event from main js-sdk export (#11363) 2023-08-07 08:24:58 +00:00
Charly Nguyen
5152aad059
Allow knocking rooms (#11353)
Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>
2023-08-07 06:27:09 +00:00
Michael Telatynski
e6af09e424
Switch to importing models/room-state & models/room-member from main js-sdk export (#11362)
* Switch to importing TypedEventEmitter from main js-sdk export

* Switch to importing js-sdk/matrix in cypress

* Remove duplicated imports

* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess

* Add lint rule

* Switch to importing models/Room from main js-sdk export

* Switch to importing models/room-state & models/room-member from main js-sdk export

* Fix cypress-axe import

* Fix more imports

* Fix cypress-axe import

* Fix bad merge
2023-08-04 11:22:08 +00:00
Michael Telatynski
e67ca33c4a
Switch to importing models/Room from main js-sdk export (#11361)
* Switch to importing TypedEventEmitter from main js-sdk export

* Switch to importing js-sdk/matrix in cypress

* Remove duplicated imports

* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess

* Add lint rule

* Switch to importing models/Room from main js-sdk export

* Fix cypress-axe import

* Fix more imports

* Fix cypress-axe import

* Fix duplicated lint rule
2023-08-04 07:36:16 +00:00
Peter Scheu
5ee8e61bf5
Search for users on paste (#11304)
Signed-off-by: Peter Scheu <peter.scheu@aceart.de>
2023-08-04 07:19:56 +00:00
Travis Ralston
771d7e95e7
Support adding space-restricted joins on rooms not members of those spaces (#9017)
* Support adding space-restricted joins on rooms not members of those spaces

* add react dependencies

* Add snapshot test

* Fix snapshot stability

* Update snapshot

* Increase coverage

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-08-03 15:56:53 +00:00
Michael Telatynski
47877ba2da
Switch to importing matrix-js-sdk from its main export (#11360)
* Switch to importing TypedEventEmitter from main js-sdk export

* Switch to importing js-sdk/matrix in cypress

* Remove duplicated imports

* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess

* Add lint rule

* Fix cypress-axe import

* Fix cypress-axe import
2023-08-03 12:56:30 +00:00
Michael Telatynski
755f8d7ab0
Fix AppTile context menu not always showing up when it has options (#11358)
* Fix AppTile context menu not always showing up when it has options

* Comment

* Update snapshots
2023-08-03 09:23:20 +00:00
Germain
d94808a197
Make room model mandatory on the RoomHeader (#11355)
* Remove oobData from RoomHeader

It is never used as the RoomHeader is not shown unless a Room model exists

* Make room model mandatory on the RoomHeader
2023-08-02 15:29:19 +00:00
Germain
d49581344e
Integrate @vector-im/compound-web (#11354)
* Create useRoomName hook

Mark RoomName component as deprecated

* Pass out-of-band data to relevant RoomHeader component

* Mark LegacyRoomHeader as deprecated

* Fix incorrect search&replace in _RoomHeader.pcss

* lintfix

* Mark room as optional in room topic hook

* Fix i18n

* Discard use of useCallback

* Change export of useRoomName

* fix ts issue

* lints

* Add room topic to room header

* lintfix

* lintfix & clamp to one line

* Revert optimisations to DecoratedRoomAvatar

* Add test for opening the room summary

* Make transition honour prefer-reduced-motion

* Integrate @vector-im/compound-web

* Use compound type styles

* Use latest version of @vector-im/compound-web

* Change component name

* Fallback when room is undefined

* fix snapshot
2023-08-02 13:03:04 +00:00
Germain
33299af5c9
Add room topic and animation (#11352)
* Create useRoomName hook

Mark RoomName component as deprecated

* Pass out-of-band data to relevant RoomHeader component

* Mark LegacyRoomHeader as deprecated

* Fix incorrect search&replace in _RoomHeader.pcss

* lintfix

* Mark room as optional in room topic hook

* Fix i18n

* Discard use of useCallback

* Change export of useRoomName

* fix ts issue

* lints

* Add room topic to room header

* lintfix

* lintfix & clamp to one line

* Revert optimisations to DecoratedRoomAvatar

* Add test for opening the room summary

* Make transition honour prefer-reduced-motion

* Fallback when room is undefined

* fix snapshot
2023-08-02 10:54:06 +00:00
Michael Telatynski
2f2067e434
Fix home/all rooms context menu in space panel (#11350)
* Fix home/all rooms context menu in space panel

* Fix tests
2023-08-01 15:26:14 +00:00
Germain
5d9f5ccf0b
Create useRoomName hook (#11346)
* Create useRoomName hook

Mark RoomName component as deprecated

* Pass out-of-band data to relevant RoomHeader component

* Mark LegacyRoomHeader as deprecated

* Fix incorrect search&replace in _RoomHeader.pcss

* lintfix

* Fix i18n

* Discard use of useCallback

* Change export of useRoomName

* fix ts issue

* lints
2023-08-01 13:47:09 +00:00
Michael Telatynski
340e301844
Make keyboard handling in and out of autocomplete completions consistent (#11344)
* Make keyboard handling in and out of autocomplete completions consistent

* Add test
2023-08-01 09:06:37 +00:00
Germain
6ae7c033d5
Add feature flag 'feature_new_room_decoration_ui' and segrate legacy UI component (#11345)
* Move RoomHeader to LegacyRoomHeader

* Create new RoomHeader component
2023-08-01 07:32:53 +00:00
Richard van der Hoff
ddb8e0aa3a
Update SecureBackupPanel to use getCrypto() (#11322)
`MatrixClient.crypto` is going away, so let's switch over to `getCrypto()`.

There doesn't seem to be anything else relying on the `crypto` stub in
`mockClientMethodsCrypto()`, so let's get rid of that.
2023-07-28 09:24:28 +00:00
Richard van der Hoff
f6fc5cad5c
Remove display of key backup signatures from backup settings (#11333)
* Remove display of Key backup signatures

This is *fiddly* to support in Element-R, and we don't really think it's
offering any value.

* update snapshot

* clean up i18n
2023-07-27 19:52:02 +00:00
Michael Telatynski
d405160080
Use PassphraseFields in ExportE2eKeysDialog to enforce minimum passphrase complexity (#11222)
* Use PassphraseFields in ExportE2eKeysDialog to enforce minimum passphrase complexity

* Tweak copy

* Iterate

* Add tests

* Improve variable naming

* Improve coverage
2023-07-27 09:21:20 +00:00
Germain
22f83e7917
Use correct translation function for WYSIWYG buttons (#11315)
* Use correct translation function for WYSIWYG buttons

* Add tests
2023-07-26 11:30:54 +00:00
Michael Telatynski
9136a581d2
Prevent re-filtering user directory results in spotlight (#11290)
* Prevent re-filtering user directory results in spotlight

As they were already filtered by the server and may be fuzzier than any filtering we can do locally,
e.g. matching against email addresses or other fields not available to the client

* deduplicate work

* Improve coverage
2023-07-25 08:05:54 +00:00
Michael Telatynski
a70fcfd0bc
Fix invite dialog showing the same user multiple times (#11308)
* Fix invite dialog showing the same user multiple times

* Add test

* Improve coverage
2023-07-24 09:12:37 +00:00
Charly Nguyen
9a31cd0fa8
Allow setting room join rule to knock (#11248)
Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>
2023-07-19 10:48:24 +00:00
Germain
150e97744d
Fix changelog dialog heading size (#11286) 2023-07-19 08:03:56 +00:00
Michael Telatynski
d9d0b84152
Revert "Do not filter users post search (#9556)" (#11288) 2023-07-18 09:26:54 +01:00
Maximilian Malek
f1db2b3687
Do not filter users post search (#9556)
* Do not filter users post search

Signed-off-by: Maximilian Malek <maximilian.malek@uni-graz.at>

* Iterate

* Iterate

---------

Signed-off-by: Maximilian Malek <maximilian.malek@uni-graz.at>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-07-17 15:31:38 +00:00
Michael Telatynski
f04a0e2860
Populate info.duration for audio & video file uploads (#11225)
* Improve m.file m.image m.audio m.video types

* Populate `info.duration` for audio & video file uploads

* Fix tests

* Iterate types

* Improve coverage

* Fix test

* Add small delay to stabilise cypress test

* Fix test idempotency

* Improve coverage

* Slow down

* iterate
2023-07-17 12:07:58 +00:00
Michael Telatynski
8b8ca425d7
Hide widget menu button if it there are no options available (#11257)
* Hide widget menu button if it there are no options available

* Update snapshots
2023-07-17 10:37:07 +00:00
Michael Telatynski
3ccc0fd8df
Increase timeout for wysiwyg composer test due to wasm being slow in CI (#11267) 2023-07-17 08:17:35 +00:00
Michael Telatynski
2760bfc836
Prevent user from accidentally double clicking user info admin actions (#11254)
* Prevent user from accidentally double clicking user info admin actions

* Iterate

* Improve coverage

* Improve coverage

* Simplify

* Simplify
2023-07-14 14:48:20 +00:00
Michael Telatynski
cdffd1ca1f
Fix missing metaspace notification badges (#11269)
* Fix missing metaspace notification badges

* Simplify conditional types
2023-07-14 14:40:59 +00:00
Michael Telatynski
f5f31eb7d8
Fix jest/valid-expects lints (#11238) 2023-07-13 15:19:44 +00:00
Richard van der Hoff
2cfbd73cd3
Replace getQRCodeBytes with generateQRCode (#11241)
* Replace `getQRCodeBytes` with `generateQRCode`

* another test update

* remove obsolete snapshot
2023-07-13 13:55:55 +00:00
Kerry
c5befa1ef8
Stabilize support for MSC3952: intentional mentions (#10967)
* enable feature_intentional_mentions with v1.7

* org.matrix.msc3952.mentions -> m.mentions

* update push rules test util

* only support stable version 1.7

* use stable values for msc3952 push rules

* use stable intentional mentions rule sin test models

* unstable feature in settings controller
2023-07-11 22:29:54 +00:00
Charly Nguyen
fd749172e1
Allow creating knock rooms (#11182)
Signed-off-by: Charly Nguyen <charly.nguyen@nordeck.net>
2023-07-10 08:01:03 +00:00
Travis Ralston
8a97e5f351
Expose and pre-populate thread ID in devtools dialog (#10953)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-07-07 15:40:25 +01:00
Michael Telatynski
cfd48b36aa
Enable strictPropertyInitialization (#11203) 2023-07-07 14:46:12 +01:00
Aaron Raimist
71fe08ea0f
Change wording from avatar to profile picture (#7015)
* Change wording from avatar to profile picture

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

* lint

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

* Update EventListSummary

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

* Delete MembershipEventListSummary.tsx

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

* delint

* Update tests

---------

Signed-off-by: Aaron Raimist <aaron@raim.ist>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-07-07 10:54:43 +00:00
Enrico Schwendig
902263d7c9
force to allow calls without video and audio in embedded mode (#11131)
* force to allow calls without video and audio in embedded mode

* Check device access permission and introduce a only screen share call mode

* Fix strict typ check issue

* Fix i18n check issue

* Add unit tests for device selection

* Fix mocked media device query
2023-07-06 14:40:14 +00:00
Michael Telatynski
8107f1d271
Conform more of the codebase to strict types (#11191) 2023-07-05 11:53:22 +01:00
Germain
2a7780052e
Compound Typography pass regression fixes (#11189)
* Compound Typography pass regression fixes

* updates to the room list sizing

* fix subtitle clipping

* revert display name to use medium variant
2023-07-04 16:54:28 +00:00
Michael Telatynski
a294ba2ad4
Conform more of the codebase to strictNullChecks + noImplicitAny (#11179) 2023-07-04 14:49:27 +01:00
Janne Mareike Koschinski
f62fe2626c
GYU: Account Notification Settings (#11008)
* Implement new notification settings UI

* Sort new keywords at the front

* Make ts-strict happier

* Make ts-strict happier

* chore: fixed lint issues

* update beta card

* Fix issue with the user settings test

* chore: fixed lint issues

* Add tests for notification settings

* chore: fixed lint issues

* fix: spurious text failures

* improve tests further

* make ts-strict happier

* improve tests further

* Reduce uncovered conditions

* Correct snapshot

* even more test coverage

* Fix an issue with inverted rules

* Update res/css/views/settings/tabs/_SettingsIndent.pcss

Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Fix license headers

* Improve i18n

* make linters happier

* Improve beta labels

* improve i18n

* chore: fixed lint issues

* fix: more lint issues

* Update snapshots to match changed text

* Update text as requested

* Remove labs image

* Update snapshots

* Correct an issue with one of the tests

* fix: keyword reconcilation code

* Determine mute status more accurately

* Address review comments

* Prevent duplicate updates

* Fix missing license header

* slight change to avoid ts-strict complaining

* fix test issue caused by previous merge

---------

Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
2023-06-29 15:46:31 +00:00
Germain
9c7d935aae
Compound Typography pass (#11103)
* Integrate compound design tokens

The icons should not be included in this repo, and should live in the compound design token repo, but for simplicity sake at this phase of the integration they will be added here

* Delete unused or incorrect - sass variables

* Typography pass

* Deprecate _font-weights.pcss and use Compound instead

* lint fix

* Fix snapshot

* Fix typography pass feedback

* Remove unwanted e2e test

cypress tests should test functionality not visual output. And we should not test visual output by inspecting CSS properties

* lintfix

* Migration script for baseFontSize

* Updates after design review

* Update font scaling panel to use min/max size

* Fix custom font

* Fix font slider e2e test

* Update custom font

* Update new baseFontSizeV2

* Disambiguate heading props

* Fix appearance test

* change max font size

* fix e2ee test

* fix tests

* test baseFontSize migration code

* typescript strict

* Migrate baseFontSize account setting

* Change assertion for font size

* Fix font size controller test
2023-06-29 10:30:25 +00:00
Michael Weimann
c0db739d81
Apply strictNullChecks to src/components/views/spaces/* (#10517)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-06-28 15:39:19 +01:00
Michael Telatynski
6836a5fa7b
Conform more code to strictNullChecks and noImplicitAny (#11156) 2023-06-28 14:05:36 +01:00
Richard van der Hoff
46eb34a55d
Kill off references to deprecated getStoredDevice and getStoredDevicesForUser (#11152)
* Use new `CryptoEvent.VerificationRequestReceived` event

https://github.com/matrix-org/matrix-js-sdk/pull/3514 deprecates
`CryptoEvent.VerificationRequest` in favour of
`CryptoEvent.VerificationRequestReceived`. Use the new event.

* Factor out `getDeviceCryptoInfo` function

I seem to be writing this logic several times, so let's factor it out.

* Factor out `getUserDeviceIds` function

Another utility function

* VerificationRequestToast: `getStoredDevice` -> `getDeviceCryptoInfo`

* SlashCommands: `getStoredDevice` -> `getDeviceCryptoInfo`

* MemberTile: `getStoredDevicesForUser` -> `getUserDeviceIds`

* Remove redundant mock of `getStoredDevicesForUser`
2023-06-28 12:39:34 +00:00
Richard van der Hoff
36c81f6416
VerificationPanel: avoid use of getStoredDevice (#11129)
* VerificationPanel: avoid use of `getStoredDevice`

This is deprecated and doesn't work with the rust-sdk.

* fix types
2023-06-23 12:38:06 +00:00
Michael Telatynski
d935da2844
Fix server picker not allowing you to switch from custom to default (#11127) 2023-06-22 13:48:15 +00:00
Kerry
9f580a8680
Disable encryption toggle in room settings when force disabled (#11122)
* force disable encryption on room creation

* test allowChangingEncryption

* move into utils/room directory

* tests

* unit test CreateRoomDialog

* remove debug

* wait for constructor promises to settle

* test case for force_disable

* comment

* set forced value after resolving checkUserIsAllowedToChangeEncryption

* tidy and comments

* use label text in test

* disable encryption switch in room settings when force disabled
2023-06-21 23:17:30 +00:00
Kerry
a692fe2181
Add .well-known config option to force disable encryption on room creation (#11120)
* force disable encryption on room creation

* test allowChangingEncryption

* move into utils/room directory

* tests

* unit test CreateRoomDialog

* remove debug

* wait for constructor promises to settle

* test case for force_disable

* comment

* set forced value after resolving checkUserIsAllowedToChangeEncryption

* tidy and comments

* use label text in test
2023-06-21 21:50:01 +00:00
Johannes Marbach
9d9c55d92e
Handle permalinks in room topic (#11115)
* Handle permalinks in room topic

Fixes: vector-im/element-web#23395

* Add test for clicking non-link
2023-06-21 18:09:22 +00:00
Michael Telatynski
9b5b053148
Use MatrixClientPeg::safeGet for strict typing (#10989) 2023-06-21 17:29:44 +01:00
alunturner
d64018ce26
Improve message body output from plain text editor (#11124)
* add failing test

* WIP - pause work until we can implement with new patch release of RTE

* focus tests purely on the body output

* remove unused import
2023-06-21 15:02:52 +00:00
Kerry
a4cf2af187
Unit test CreateRoomDialog (#11121)
* unit test CreateRoomDialog

* remove debug

* wait for constructor promises to settle

* use label text in test
2023-06-21 08:01:01 +00:00
alunturner
ac3d6ab7dd
Add at room avatar for RTE (#11106)
* add at room avatar logic

* fix broken test

* fix TS error

* add param comment

* increase test coverage

* update code to solve conflict
2023-06-21 07:57:22 +00:00
Germain
8aa46b3005
Restore breadcrumb preference setting (#11116)
* Restore breadcrumb preference setting

* restore snapshot
2023-06-20 11:58:03 +00:00
Germain
aca6a66f6a
Remove new room breadcrumbs (#11104)
* Deprecate new room breadcrumbs

* i18n
2023-06-19 08:18:46 +00:00
alunturner
fa31ed55d2
Update rich text editor dependency and associated changes (#11098)
* fix logic error

* update types

* extract message content to variable

* use the new messageContent property

* sort out mention types to make them a  map

* update getMentionAttributes to use AllowedMentionAttributes

* add plain text handling

* change type and handling for attributes when creating a mention in plain text

* tidy, add comment

* revert TS config change

* fix broken types in test

* update tests

* bump rte

* fix import and ts errors

* fix broken tests
2023-06-19 08:00:11 +00:00
Suguru Hirahara
2972219959
Conform class names of mx_AppTileBody for a widget and PiP widget to our naming policy (#11002)
* Rename classes of appTileBodyClass

Include mx_AppTileBody_fadeInSpinner in mx_AppTileBody, the class name applied by default

* Apply a common CSS declaration to mx_AppTileBody

* Strictify style rule specificity to avoid visual regressions - mx_AppTileBody--*

* Run prettier

* Change --normal to --large

* Edit and add comments

When you add, edit, or remove style rules from mx_appTileBody without causing a visual regression, it is imperative to keep in mind which selector should be worked on. The comments should help developers who are not familiar with the style codebase to avoid a regression.

* Rename classes of appTileBodyClass

Include mx_AppTileBody_fadeInSpinner in mx_AppTileBody, the class name applied by default

* Apply a common CSS declaration to mx_AppTileBody

* Strictify style rule specificity to avoid visual regressions - mx_AppTileBody--*

* Run prettier

* Change --normal to --large

* Edit and add comments

When you add, edit, or remove style rules from mx_appTileBody without causing a visual regression, it is imperative to keep in mind which selector should be worked on. The comments should help developers who are not familiar with the style codebase to avoid a regression.

* Update a Jest snapshot

* Update a Jest snapshot
2023-06-16 18:24:10 +00:00
Florian Duros
77da949fd4
CreateKeyBackupDialog.tsx: Remove logic for servers which are not supporting cross-signing (#11076) 2023-06-16 13:25:24 +01:00
Richard van der Hoff
06fa49a9da
Use new accessors for VerificationRequest (#11092)
* Switch verification request accessors to go via CryptoApi

part of https://github.com/vector-im/crypto-internal/issues/97

* Update references to `requestVerification`

https://github.com/vector-im/crypto-internal/issues/98
2023-06-16 10:27:56 +00:00
Michael Telatynski
7236e48765
Allow maintaining a different right panel width for thread panels (#11064)
* Move Room context threadId our of RoomView state

* Allow maintaining a different right panel width for thread panels

* Fix types

* Fix types

* Add tests

* Increase coverage

* Increase coverage

* Add comments

* Update src/components/structures/MainSplit.tsx

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-06-15 11:57:58 +00:00
Michael Telatynski
cb2b1718ff
Remove feature_favourite_messages as it is has been abandoned for now (#11097)
* Remove `feature_favourite_messages` as it is has been abandoned for now

* i18n

* Fix test

* Remove unused css
2023-06-15 11:02:45 +00:00
Michael Weimann
386a459b9f
Remove unknown MXIDs from invite suggestions (#11055) 2023-06-15 09:07:26 +00:00
Michael Telatynski
280f6a9d93
Use MatrixClientPeg::safeGet in src/components/views/* (#10987) 2023-06-15 08:46:19 +01:00
Richard van der Hoff
b9b93264b6
Remove references to VerificationRequest (#11050)
* Update references to `VerificationRequestEvent`

* Update references to `Phase`

* update references to legacy `PHASE_*` constants

* Replace `request.canAccept` with `canAcceptVerificationRequest`

* Replace `VerificationRequest` with the interface throughout

* Minor strict type fixes

* Add a couple of tests
2023-06-14 14:35:32 +00:00
Michael Telatynski
9c48487d85
Prefer MatrixClientContext over MatrixClientPeg (#10986) 2023-06-14 13:42:07 +01:00
Suguru Hirahara
b40f29f04c
Fix visual regressions around widget permissions (#10954)
* Add a Jest snapshot of AppPermission

* Move the test inside 'for a pinned widget' category

* Make only spinner message bold

* Set font size specified with "mx_AppPermission_smallText" by default

- Add "mx_AppPermission_largeText" for elements whose size has not been specified with mx_AppPermission_smallText
- Create _AppWarning.pcss for AppWarning

* Make AppPermission panel scrollable, keeping the content at the center

* Run prettier

* Use Heading component

* Use Icon component

* Fix the test
2023-06-14 11:11:06 +00:00
Florian Duros
127b542233
Use crypto.isCrossSigningReady in CrossSigningPanel (#11080) 2023-06-14 09:46:14 +00:00
Suguru Hirahara
0ce3664434
Conform to the naming policy - AppsContainer resizer (#11042)
* Add a snapshot to track AppTile in AppsDrawer

* Conform to the naming policy - AppsContainer resizer

* Nest 'mx_AppsContainer_resizer_container_handle' to enforce the style

- mx_AppsContainer_resizer
- mx_AppsContainer_resizer_container
- mx_AppsContainer_resizer_container_handle

* Rename "mx_AppsContainer_resizer" to "mx_AppsDrawer_resizer"

PersistentVResizer is defined by mx_AppsDrawer (see const "classes")
2023-06-13 11:13:07 +00:00
Florian Duros
d5d1ec775c
Use new api CryptoApi.getCrossSigningStatus in CrossSigningPanel (#11052)
* Use new api `CryptoApi.getCrossSigningStatus` in `CrossSigningPanel`

* Update `CrossSigningPanel-test.tsx`

* Update `publicKeysOnDevice`

* Fix `CryptoApi` import

* Fix strict type

* Fix tests

* Remove `crossSigningInfo` in `mockClientMethodsCrypto`

* Move matrix client initialization in `beforeEach`
2023-06-12 18:33:39 +00:00
alunturner
e32823e5fe
Allow image pasting in plain mode in RTE (#11056)
* get rough funcitonality working

* try to tidy up types

* fix merge error

* fix signature change error

* type wrangling

* use onBeforeInput listener

* add onBeforeInput handler, add logic to onPaste

* fix type error

* bring plain text listeners in line with useInputEventProcessor

* extract common function to util file, move tests

* tidy comment

* tidy comments

* fix typo

* add util tests

* add text paste test
2023-06-12 11:28:00 +00:00
Richard van der Hoff
47ab99f908
remove references to VerificationBase (#10996) 2023-06-09 15:49:44 +00:00
maheichyk
53b42e3217
Show room options menu if "UIComponent.roomOptionsMenu" is enabled (#10365)
* Show room options menu if "UIComponent.roomOptionsMenu" is enabled

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

* Explicit type is removed.

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-06-09 12:33:54 +00:00
alunturner
53415bfdfe
Allow image pasting in rich text mode in RTE (#11049)
* add comments to rough first solution

* allow eventRelation prop to pass to both composers

* use eventRelation in image paste

* add image pasting to rich text mode of rich text editor

* extract error handling to function

* type the error handler

* add tests

* make behaviour mimic SendMessage

* add sad path tests

* refactor to use catch throughout

* update comments

* tidy up tests

* add special case and change function signature

* add comment

* bump rte to 2.2.2
2023-06-09 09:11:38 +00:00
Richard van der Hoff
34439ee652
Simplify references to VerificationRequest (#11045)
* Use new `VerificationRequest.getQRCodeBytes()`

* Use new `VerificationRequest.otherDeviceId`

* Remove references to `VerificationRequest.channel`

* Replace references to `VerificationRequest.{requesting,receiving}UserId`

Normally these are guarded by `request.initiatedByMe` so we can trivially
replace it with `request.otherUserId` or `client.getUserId()`. In one place we
actually need to apply some logic.

* increase test coverage

* Even more test coverage

* Even more test coverage
2023-06-07 14:43:44 +00:00
Michael Weimann
1091e14a3d
Migrate broadcast MSC3912 redaction (#11014) 2023-06-07 13:24:01 +00:00
Richard van der Hoff
4c73903274
Use getShowSasCallbacks() and getReciprocateQrCodeCallbacks() (#11015)
* Use `getShowSasCallbacks()` and `getShowQrCodeCallbacks()`

... instead of type-casting

* Update method names

These methods got renamed in the js-sdk PR

* Fix strict typing errors
2023-06-07 13:05:23 +00:00
Richard van der Hoff
2801afe570
Inline VerificationRequest.{invalid,ready,started,done,cancelled} (#11013)
* Inline `VerificationRequest.{invalid,ready,started,done,cancelled}`

These methods are all just shortcuts for checks on `phase`, so let's get rid of
them

* update test

* Add some more tests

* even more coverage

* fix tests
2023-06-06 08:27:53 +00:00
Florian Duros
68ebcd2956
Removed DecryptionFailureBar.tsx (#11027) 2023-06-05 15:02:20 +00:00
Michael Telatynski
6b46d6e4f8
Add MatrixClientPeg::safeGet and use it in tests (#10985) 2023-06-05 18:12:23 +01:00
Suguru Hirahara
43d9e30673
Fix fadein spinner placement on AppTileBody (#10970) 2023-06-01 15:17:28 +00:00
Michael Telatynski
21ffc50f1e
Pass around MatrixClients instead of using MatrixClientPeg (#10984)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-06-01 14:43:24 +01:00
Michael Weimann
b5727cb463
Include thread replies in message previews (#10631)
* Include thread replies to message previews

* Extend tests

* Fix type issue

* Use currentColor for thread icon

* Fix long room name overflow

* Update snapshots

* Fix preview

* Fix typing issue

* Fix type issues

* Tweak thread reply detection

* Extend tests

* Fix type issue

* Fix test
2023-06-01 07:53:48 +00:00
Kerry
143ffccb0a
Fix: server picker validates unselected option (#11020)
* add aria-label to default homeserver checkbox

* test ServerPickerDialog

* remove debug

* strict fixes

* dont validate unselected server field on ServerPickerDialog

* i18n
2023-06-01 01:08:44 +00:00
Kerry
a28f44a075
OIDC: unit test ServerPickerDialog (#11019)
* add aria-label to default homeserver checkbox

* test ServerPickerDialog

* remove debug

* strict fixes

* use testid instead of aria-label

* i18n
2023-05-31 21:22:47 +00:00
Kerry
e9a8f4a11d
Use semantic headings in space preferences (#11021)
* remove mx_SettingsTab_heading style

* use semantic headings in space preferences dialog

* remove unused settings style: mx_SettingsTab_subheading
2023-05-31 21:22:03 +00:00
Kerry
7ef6e1b6f8
Use semantic headings in user settings - Ignored users (#11006)
* account password section

* account email and phone numbers

* update cypress selectors

* use settingsection for General section

* use semantic headings for profile settings

* fix show advanced spacing

* udpate snapshot

* use semantic headings in mjolnir settings

* remove debug

* unit test UI changes for mjolnir settings
2023-05-30 22:42:53 +00:00
Kerry
b35fb4fed2
Use semantic headings in user settings - profile (#10973)
* account password section

* account email and phone numbers

* update cypress selectors

* use settingsection for General section

* use semantic headings for profile settings

* fix show advanced spacing

* udpate snapshot
2023-05-29 01:36:09 +00:00
Kerry
520659242b
Fix spacing regression in user settings - roles & permissions (#10993)
* add content container to settingsfieldset

* fix spacing
2023-05-28 22:20:44 +00:00
Kerry
9080f3dd55
await promises (#10992) 2023-05-28 22:19:37 +00:00
Richard van der Hoff
810b8ff6d7
Update references to QrCodeEvent, SasEvent and VerificationEvent (#10991)
* Basic test for IncomingSasDialog

* Basic test for VerificationPanel

* Replace references to IGeneratedSas and ISasEvent

* Some secret references to the callbacks types

* Update references to `QrCodeEvent`, `SasEvent` and `VerificationEvent`
2023-05-26 09:29:32 +00:00
Kerry
530197bfcd
Move session manager out of beta (#10968)
* remove old device manager

* undo type fix for cypress crypto

* update test case
2023-05-26 01:58:28 +00:00
Kerry
e326526c10
set correct action for view device list button (#10979) 2023-05-25 22:44:40 +00:00
Kerry
d0d9a36d07
Use semantic headings in user settings - account (#10972)
* account password section

* account email and phone numbers

* update cypress selectors
2023-05-25 22:42:01 +00:00
Richard van der Hoff
5593872b7a
Fix display of devices without encryption support in Settings dialog (#10977)
* Update tests to demonstrate broken behaviour

* Fixes and comments

* Remove exception swallowing

This seems like it causes more problems than it solves.
2023-05-25 16:12:01 +00:00
Michael Telatynski
f52fab39fc
Use aria descriptions instead of labels for TextWithTooltip (#10952)
* Use aria descriptions instead of labels for TextWithTooltip

to prevent clobbering the reading of the content

* Update snapshot

* Fix snapshots

* Iterate

* Update snapshots

* delint
2023-05-25 08:42:09 +00:00
Michael Telatynski
277a3c0146
Conform more of the codebase to strict typescript (#10841) 2023-05-25 09:39:23 +01:00
Suguru Hirahara
0c30f0c838
Simplify nodes on ThirdPartyMemberInfo (#10889)
* Remove mx_MemberInfo_profileField

* Merge mx_MemberInfo_profile with mx_MemberInfo_container

* Remove redundant div elements

* Update a Jest snapshot
2023-05-24 08:28:15 +00:00
Kerry
9f011b955b
Use semantic headings in user settings - discovery (#10838)
* allow testids in settings sections

* use semantic headings in LabsUserSettingsTab

* put back margin var

* use SettingsTab wrapper

* use semantic headings for deactivate acc section

* use semantic heading in manage integratios

* i18n

* use currentColor in warning-triangle svg, update use in RoomStatusBar

* use semantic headings for discovery section

* test manage integration settings

* test deactivate account section display

* remove SettingsFieldset margins

* threepids styles

* remove debug

* test discovery email and phone
2023-05-24 02:37:10 +00:00
Kerry
9211da20f4
Use semantic headings in user settings - Notifications (#10948)
* use semantic headings in user notif settings

* unset margin for subsection content when no heading

* remove debug
2023-05-23 23:36:09 +00:00
Michael Telatynski
30429df948
Eliminate the use of MatrixClientPeg in utils (#10910) 2023-05-23 16:24:12 +01:00
Richard van der Hoff
161e19dfb6
Settings panels: avoid exceptions with rust crypto (#10962)
* Settings panels: avoid exceptions with rust crypto

If we are using rust crypto, `client.crypto` is undefined. We'll need to fix
these up better in future, but for now, just return early.

* Update tests
2023-05-23 12:01:27 +00:00
Suguru Hirahara
b7cd1f00fc
Use Icon component for icons on AppTile's menu bar (#10955)
* Use icon component for buttons on mx_AppTileMenuBar_widgets

* Remove redundant declarations

* Add a Percy snapshot test

* Set color value to mx_Icon, fill and stroke with currentColor

* Iterate
2023-05-22 07:48:40 +00:00
Kerry
74d30187a4
Apply strictNullChecks to src/components/views/rooms/* (#10875)
* fix everything except notificationbadge

* unit test ThirdPartyMemberInfo

* fix RoomPreviewBar dm tests

* lint

* test PinnedEventTile
2023-05-21 23:53:23 +00:00
Kerry
b3b03e5dcb
Use semantic headings in user settings Appearance (#10827)
* split SettingsSection out of SettingsTab, replace usage

* correct copyright

* use semantic headings in GeneralRoomSettingsTab

* use SettingsTab and SettingsSubsection in room settings

* fix VoipRoomSettingsTab

* use SettingsSection components in space settings

* settingssubsection text component

* use semantic headings in HelpUserSetttings tab

* use ExternalLink components for external links

* test

* strict

* lint

* semantic heading in labs settings

* semantic headings in keyboard settings tab

* semantic heading in preferencesusersettingstab

* tidying

* use new settings components in eventindexpanel

* findByTestId

* prettier

* semantic headings and style refresh for crypto settings

* e2e panel

* use semantic headings in User settings appearance tab

* update selectors in tests

* tidy
2023-05-21 21:12:11 +00:00
Suguru Hirahara
c6f44d3053
Add Jest snapshots for AppTile (#10946)
- on PiP widget (PersistentApp)
- on RightPanel
2023-05-19 10:34:55 +00:00
Kerry
55336bf932
Use semantic heading in user settings Sidebar & Voip (#10782)
* split SettingsSection out of SettingsTab, replace usage

* correct copyright

* use semantic headings in GeneralRoomSettingsTab

* use SettingsTab and SettingsSubsection in room settings

* fix VoipRoomSettingsTab

* use SettingsSection components in space settings

* settingssubsection text component

* use semantic headings in HelpUserSetttings tab

* use ExternalLink components for external links

* test

* strict

* lint

* semantic heading in labs settings

* semantic headings in keyboard settings tab

* semantic heading in preferencesusersettingstab

* tidying

* use new settings components in eventindexpanel

* findByTestId

* prettier

* semantic headings and style refresh for crypto settings

* e2e panel

* semantic headings and cleanup in Sidebar user settings

* semantic heading in voice user settings

* sonarcloud bug and test
2023-05-19 00:03:39 +00:00
Kerry
d9a61c093c
Use semantic headings in user settings Security (#10774)
* split SettingsSection out of SettingsTab, replace usage

* correct copyright

* use semantic headings in GeneralRoomSettingsTab

* use SettingsTab and SettingsSubsection in room settings

* fix VoipRoomSettingsTab

* use SettingsSection components in space settings

* settingssubsection text component

* use semantic headings in HelpUserSetttings tab

* use ExternalLink components for external links

* test

* strict

* lint

* semantic heading in labs settings

* semantic headings in keyboard settings tab

* semantic heading in preferencesusersettingstab

* tidying

* use new settings components in eventindexpanel

* findByTestId

* prettier

* semantic headings and style refresh for crypto settings

* e2e panel

* test cross signing panel

* strict

* more strict

* tweak

* test eventindexpanel

* strict fixes
2023-05-18 22:32:10 +00:00
Suguru Hirahara
8637a5d77d
Take Jest snapshots of widgets (AppTile) (#10897)
* Take a Jest snapshot of a widget (AppTile)

* Fix the comment

* Update test/components/views/elements/AppTile-test.tsx

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

* Add container

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-05-18 08:30:55 +00:00
Michael Telatynski
d9d53870e3
Fix roving tab index getting confused after dragging space order (#10901)
* Fix roving tab index getting confused after dragging space order

* Fix roving tab index for drag reordering

* delint

* Add test

* Make types happier

* Remove snapshot
2023-05-17 14:18:21 +00:00
Michael Telatynski
2da199c41d
Remove url npm dependency and use Web URL constructor (#10930) 2023-05-17 12:50:00 +01:00
Kerry
8cd84b0e7b
Use semantic headings in user settings - integrations and account deletion (#10837)
* allow testids in settings sections

* use semantic headings in LabsUserSettingsTab

* put back margin var

* use SettingsTab wrapper

* use semantic headings for deactivate acc section

* use semantic heading in manage integratios

* i18n

* explicit cast to boolean

* Update src/components/views/settings/shared/SettingsSubsection.tsx

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* test manage integration settings

* test deactivate account section display

* remove debug

* fix cypress test

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-05-17 07:52:44 +00:00
Kerry
68b1930852
Use semantic headings in user settings Keyboard (#10793)
* settingssubsection text component

* use semantic headings in HelpUserSetttings tab

* test

* strict

* lint

* semantic heading in labs settings

* semantic headings in keyboard settings tab

* semantic heading in preferencesusersettingstab

* tidying

* findByTestId

* prettier

* allow testids in settings sections

* use semantic headings in LabsUserSettingsTab

* use semantic headings in usersettingspreferences

* rethemendex

* put back margin var
2023-05-17 02:34:55 +00:00
Kerry
38ae8e98e4
Use semantic headings in user settings Preferences (#10794)
* allow testids in settings sections

* use semantic headings in LabsUserSettingsTab

* use semantic headings in usersettingspreferences

* rethemendex

* put back margin var
2023-05-17 01:16:49 +00:00
Suguru Hirahara
e01d47923d
Deprecate mx_RightPanel_headerButton class (#10821)
* Replace: %s/mx_RightPanel_headerButton/mx_RoomHeader_button/g

* Conform the selectors to our naming policy: with flag (--)

- %s/mx_RoomHeader_button_highlight/mx_RoomHeader_button--highlight/g
- %s/mx_RoomHeader_button_unread/mx_RoomHeader_button--unread/g

* Update a Jest snapshot

* Move the declarations and Sass variables

- Move Sass variables to the place where they are used
2023-05-16 15:42:58 +00:00
alunturner
0d981326ac
RTE plain text mentions as pills (#10852)
* insert mentions as links styled as pills

* post merge fix and update test

* update comments, move typeguard out

* create a text node instead of setting innerText

* update test

* update test

* fix broken cypress test, remove .only

* make it able to deal with inserting in middle of blank lines

* update comment

* fix strict null error

* use typeguard

* avoid implicit truth check

* add hook tests

* add comment

* Update test/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners-test.tsx

Co-authored-by: Andy Balaam <andy.balaam@matrix.org>

---------

Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2023-05-16 11:54:16 +00:00
Kerry
9bab356e20
Use semantic headings in user settings Labs (#10773)
* allow testids in settings sections

* use semantic headings in LabsUserSettingsTab

* put back margin var

* explicit cast to boolean

* Update src/components/views/settings/shared/SettingsSubsection.tsx

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-05-16 01:22:45 +00:00
Michael Telatynski
296ed2273e
Use semantic list elements for menu lists and tab lists (#10902)
* Use semantic list elements for pop up menu lists

* Use semantic list elements for tab lists

* Fix tests

* Update snapshot
2023-05-15 13:33:49 +00:00
David Baker
1aa9860743
Fix the state shown for call in rooms (#10833)
* Fix the state shown for call in rooms

We split out a separate state for 'missed' separate to 'ended' which
caused confusion as the state got set to this when it shouldn't have,
so calls that wouldn't have been shown as missed were.

Remove the csutom call state and just have the missed state as a
variant of the ended state. Re-order the if clauses so they hit the
right ones. Also don't pass the callState variable into renderContent()
which is a class method and so has access to the same info anyway.

* Fix test

* i18n (reorder only)

* Fix test

* Fix types

* Add test for legacy call event tile
2023-05-15 08:37:40 +00:00
Suguru Hirahara
70b67fca77
Add a snapshot for RoomHeaderButtons (#10807) 2023-05-12 19:49:07 +00:00
Michael Telatynski
f758cbd38a
Make more of the codebase conform to strict types (#10859) 2023-05-12 09:49:37 +01:00
Michael Telatynski
2cee8a4b01
Specify lazy loading for avatars (#10866)
* Specify lazy loading for avatars

so browser doesn't fetch eagerly if off-screen

* Update snapshots
2023-05-11 18:29:48 +00:00
alunturner
0889dc55da
Room and user mentions for plain text editor (#10665)
* update useSuggestion

* update useSuggestion-tests

* add processMention tests

* add test

* add getMentionOrCommand tests

* change mock href for codeQL reasons

* fix TS issue in test

* add a big old cypress test

* fix lint error

* update comments

* reorganise functions in order of importance

* rename functions and variables

* add endOffset to return object

* fix failing tests

* update function names and comments

* update comment, remove delay

* update comments and early return

* nest mappedSuggestion inside Suggestion state and update test

* rename suggestion => suggestionData

* update comment

* add argument to findSuggestionInText

* make findSuggestionInText return mappedSuggestion

* fix TS error

* update comments and index check from === -1 to < 0

* tidy logic in increment functions

* rename variable

* Big refactor to address multiple comments, improve behaviour and add tests

* improve comments

* tidy up comment

* extend comment

* combine similar returns

* update comment

* remove single use variable

* fix comments
2023-05-11 14:28:42 +00:00
Michael Telatynski
68ff19fb4b
Fix regression in emoji picker order mangling after clearing filter (#10854)
* Add regression test for emoji picker order mangling after clearing filter

* Fix regression in emoji picker order mangling after clearing filter

* Iterate

* Update src/components/views/emojipicker/EmojiPicker.tsx
2023-05-11 13:24:39 +00:00
Michael Telatynski
949557b5c6
Fall back from server generated thumbnail to original image (#10853)
* Add test for falling back from thumbnail to original

* Fall back from server generated thumbnail to original image
2023-05-11 09:20:14 +00:00
Michael Telatynski
82e32035fd
Conform more of the codebase to strictNullChecks (#10842) 2023-05-11 09:56:56 +01:00
Suguru Hirahara
16ec3b5d7b
Add appearance-user-settings-tab.spec.ts (#10697)
* Add `appearance-user-settings-tab.spec.ts`

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

* Empty commit

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

* Fix a comment

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

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-05-11 06:33:50 +00:00
Suguru Hirahara
c4f59d4d56
Add E2E test of ThemeChoicePanel (#10469)
* Add E2E test of ThemeChoicePanel

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

* Edit a comment

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

* Apply feedback

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

* Remove obsolete data-testId attributes

They has become obsolete with bfa8152538a3a0804ac14e231578d0cba73aa308.

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

* Update a jest snapshot

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

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-05-09 13:48:55 +00:00
Michael Telatynski
08368860f4
Avoid calling prepareToEncrypt onKeyDown (#10828)
* Avoid calling prepareToEncrypt onKeyDown

* Iterate
2023-05-09 10:56:12 +00:00
Suguru Hirahara
ed5c02be6d
Fix long room address and name not being clipped on room info card and update _RoomSummaryCard.pcss (#10811)
* Handle a long room address and name with ellipsis on RoomSummaryCard

* Use a class selector for maintainability

Sort the selectors
2023-05-09 07:56:09 +00:00
Kerry
727c885687
Fix: Threads button is highlighted when I create a new room (#10819)
* fix thread button highlight logic

* lint
2023-05-08 20:58:27 +00:00
Kerry
b8482b6bc4
Fix: No feedback when waiting for the server on a /delete_devices request with SSO (#10795)
* add spinner while requests in progress during sso interactive auth

* strict
2023-05-07 21:12:45 +00:00
alunturner
01364ebf45
Apply strictNullChecks to src/components/views/voip/* (#10692)
* change interface to discriminated union

* fix ts errors

* use definite assertion operator

* use | undefined, instead of assertion operator

* correct the button press arguments for dial button

* update props to have `Props` suffix

* add comment

* remove unnecessary default

* remove unnecessary comment

* make classname match filename

* setup test file

* export consts for testing

* add initial test

* add another DialPad test

* fix imports
2023-05-05 13:26:31 +00:00
Michael Telatynski
99ac9e5029
Ensure tooltip contents is linked via aria to the target element (#10729)
* Ensure tooltip contents is linked via aria to the target element

* Iterate

* Fix tests

* Fix tests

* Update snapshot

* Fix missing aria labels for more tooltips

* Iterate

* Update snapshots
2023-05-05 08:26:11 +00:00
Michael Telatynski
4dd214506b
Move reaction message previews out of labs (#10601)
* Update reaction message previews to match designs

* Delabs reaction message previews

* tsc strict

* Iterate

* Add test

* Iterate
2023-05-05 07:45:14 +00:00
Kerry
1f4d857283
Apply strictNullChecks to src/components/views/settings (#10724) 2023-05-05 09:13:50 +01:00
Kerry
542bf68c63
Fix: reveal images when image previews are disabled (#10781)
* fix image wrapping when showImage previews is disabled

* strict v2
2023-05-05 03:41:42 +00:00
Andy Balaam
36ea338064
Add a waitFor in case it fixes flaky SecurityRoomSettingsTab test (#10785) 2023-05-04 10:40:49 +00:00
Kerry
692d73dfe8
Use semantic headings in user settings Help & About (#10752)
* split SettingsSection out of SettingsTab, replace usage

* correct copyright

* use semantic headings in GeneralRoomSettingsTab

* use SettingsTab and SettingsSubsection in room settings

* fix VoipRoomSettingsTab

* use SettingsSection components in space settings

* settingssubsection text component

* use semantic headings in HelpUserSetttings tab

* use ExternalLink components for external links

* test

* strict

* lint
2023-05-03 22:35:43 +00:00
Kerry
37b7dfe943
use ExternalLink components for external links (#10758)
* use ExternalLink components for external links

* test

* strict
2023-05-03 21:26:26 +00:00
Kerry
5a73d8e1b0
Use semantic headings in space settings (#10751)
* split SettingsSection out of SettingsTab, replace usage

* correct copyright

* use semantic headings in GeneralRoomSettingsTab

* use SettingsTab and SettingsSubsection in room settings

* fix VoipRoomSettingsTab

* use SettingsSection components in space settings
2023-05-03 01:55:55 +00:00
Kerry
4736f0e44c
Use semantic headings for room settings content (#10734)
* split SettingsSection out of SettingsTab, replace usage

* correct copyright

* use semantic headings in GeneralRoomSettingsTab

* use SettingsTab and SettingsSubsection in room settings

* fix VoipRoomSettingsTab
2023-05-02 21:14:36 +00:00
Kerry
0adf465397
Flaky test SecurityRoomSettingsTab enables encryption after confirmation (#10750)
* try killing all modals before test

* lint
2023-05-02 07:46:32 +00:00
Kerry
58c942be45
split SettingsSection out of SettingsTab, replace usage (#10735)
* split SettingsSection out of SettingsTab, replace usage

* correct copyright

* fix VoipRoomSettingsTab
2023-04-30 22:37:40 +00:00
Michael Weimann
35376996b0
Revert "Implement new toast UI (#10467)" (#10740)
This reverts commit 7632f36624.
2023-04-28 14:56:26 +00:00
Michael Telatynski
1281c0746b
Conform more of the codebase to strictNullChecks (#10731) 2023-04-28 09:45:36 +01:00
Suguru Hirahara
326e217d3f
Enable Jest and Percy snapshots for PreferencesUserSettingsTab (#10701)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-27 18:11:48 +00:00
Michael Telatynski
e1f7b0af2c
Offload some more waveform processing onto a worker (#9223) 2023-04-27 11:02:20 +01:00
alunturner
ca25c8f430
Commands for plain text editor (#10567)
* add the handlers for when autocomplete is open plus rough / handling

* hack in using the wysiwyg autocomplete

* switch to using onSelect for the behaviour

* expand comment

* add a handle command function to replace text

* add event firing step

* fix TS errors for RefObject

* extract common functionality to new util

* use util for plain text mode

* use util for rich text mode

* remove unused imports

* make util able to handle either type of keyboard event

* fix TS error for mxClient

* lift all new code into main component prior to extracting to custom hook

* shift logic into custom hook

* rename ref to editorRef for clarity

* remove comment

* try to add cypress test for behaviour

* remove unused imports

* fix various lint/TS errors for CI

* update cypress test

* add test for pressing escape to close autocomplete

* expand cypress tests

* add typing while autocomplete open test

* refactor to single piece of state and update comments

* update comment

* extract functions for testing

* add first tests

* improve tests

* remove console log

* call useSuggestion hook from different location

* update useSuggestion hook tests

* improve cypress tests

* remove unused import

* fix selector in cypress test

* add another set of util tests

* remove .only

* remove .only

* remove import

* improve cypress tests

* remove .only

* add comment

* improve comments

* tidy up tests

* consolidate all cypress tests to one

* add early return

* fix typo, add documentation

* add early return, tidy up comments

* change function expression to function declaration

* add documentation

* fix broken test

* add check to cypress tests

* update types

* update comment

* update comments

* shift ref declaration inside the hook

* remove unused import

* update cypress test and add comments

* update usePlainTextListener comments

* apply suggested changes to useSuggestion

* update tests

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-27 07:37:47 +00:00
Kerry
223892bf0e
Bail out of RoomSettingsDialog when room is not found (#10662)
* hack to fix console noise from unfaked timers and clearAllModals

* remove old debug logging in AsyncWrapper

* pass room to room settings tabs

* add errorboundary for roomsettingsdialog

* apply strictnullchecks to tabs/room

* dedupe code to set toom in roomsettingdialog

* add unit tests

* test SecurityRoomSettingsTab

* remove snapshot

* strict fixes

* more tests

* 2% more test coverage

* remove roomName from RoomSettingsDialogs state
2023-04-27 01:20:02 +00:00
Florian Duros
5328f6e5fe
Element-R: Populate device list for right-panel (#10671)
* Use `getUserDeviceInfo` instead of `downloadKeys` and `getStoredDevicesForUser`

* Use new `getUserDeviceInfo` api in `UserInfo.tsx` and `UserInfo-test.tsx`

* Fix missing fields

* Use `getUserDeviceInfo` instead of `downloadKeys`

* Move `ManualDeviceKeyVerificationDialog.tsx` from class to functional component and add tests

* Fix strict errors

* Update snapshot

* Add snapshot test to `UserInfo-test.tsx`

* Add test for <BasicUserInfo />

* Remove useless TODO comment

* Add test for ambiguous device

* Rework `<BasicUserInfo />` test
2023-04-26 10:23:32 +00:00
Michael Telatynski
6166dbb661
Make existing and new issue URLs configurable (#10710)
* Make existing and new issue URLs configurable

* Apply a deep merge over sdk config to allow sane nested structures

* Defaultize

* Fix types

* Iterate

* Add FeedbackDialog snapshot test

* Add SdkConfig snapshot tests

* Iterate

* Fix tests

* Iterate types

* Fix test
2023-04-26 09:36:00 +00:00
Michael Telatynski
a1a087f755
Fix usages of ARIA tabpanel (#10628)
* RovingTabIndex handle looping around start/end

* Make TabbedView expose aria tabpanel/tablist/tab roles

* Fix right panel being wrongly specified as aria tabs

Not all right panels map to the top right header buttons so we cannot describe it as a tabpanel relation

* tsc strict

* Update snapshots

* Fix ARIA AXE violation

* Update tests
2023-04-25 09:31:54 +01:00
Richard van der Hoff
d7bb8043ea
Replace uses of checkDeviceTrust with getDeviceVerificationStatus (#10663)
matrix-org/matrix-js-sdk#3287 and matrix-org/matrix-js-sdk#3303 added a new API called getDeviceVerificationStatus. Let's use it.
2023-04-24 14:19:46 +01:00
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 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
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
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