* 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>
* 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
* Fix all rooms search generating permalinks to wrong room id
* Iterate
* Add comment
* Iterate
* Add coverage
* Iterate
* Add comment
* Restore src/utils/permalinks/Permalinks.ts
* Update src/components/structures/RoomSearchView.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>
* 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
* 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
* Use `cli.getUserDeviceInfo` instead of `cli.downloadKeys` to create a room
* Use `client.getCrypto().getUserDeviceInfo` instead of `client.getUserDeviceInfo`
* Update `createRoom-test.ts` to use `getUserDeviceInfo`
* Remove duplicate field
* Honour feature toggles in guest mode
* Suppress TS warning about returning null MatrixClient
* Revert "Suppress TS warning about returning null MatrixClient"
Don't ts-ignore this - we will eventually fix it via the strict work.
This reverts commit 0c657e6afd4c69d07c39bc2783184f36feaf940f.
* Conform more of the codebase to `strictNullChecks`
* Iterate
* Iterate
* Iterate
* Iterate
* Conform more of the codebase to `strictNullChecks`
* Iterate
* Update record key
* 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
* 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`
* 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
* 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
* 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
* 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>
* 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
* 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
* 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
* 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>
* 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
* 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
* 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>
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.
* 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
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.
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.
* 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>
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"]]`
* 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`
* 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
* 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
* 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
* 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)
* 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>
* Test MessagePanel rendering with hidden events
* Cache the results of shouldShowEvent in MessagePanel
* Combine an event and its shouldShow info into a single object
* 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>
* 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
* Tests for BreadcrumbsStore.meetsRoomRequirements
* Tests for appending rooms to BreadcrumbsStore
* Support dynamic room predecessors in BreadcrumbsStore
* 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
* 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>