Commit Graph

1139 Commits (2adc972eeca00805d6da6d2ce07e5b591cb76384)

Author SHA1 Message Date
Kerry bc8fdac491
fix more type issues in unit tests (#8053)
* fix ts issues in test/components/structures

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix ts issues in test/components/views/context_menus

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-15 10:30:48 +01:00
Šimon Brandner 8d13e238b9
Keybinding code unification #6 (#8042) 2022-03-14 13:25:51 +00:00
Travis Ralston 4a36f9b470
Fix logging in end-to-end tests (#8028)
* Nullcheck the argument being stringified

* Improve null handling of responses in requestfinished

Apparently puppeteer can race on this
2022-03-11 10:00:22 -07:00
Kerry df6c53ff41
include /test/stores in tsconfig (#8026)
* fix space store emits

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix spacestore-test imports

* fix export-test.tsx

Signed-off-by: Kerry Archibald <kerrya@element.io>

* include test/utils to tsconfig

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix types in SpaceStore-test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix ts issues in rest of test/stores

Signed-off-by: Kerry Archibald <kerrya@element.io>

* include test/stores in tsconfig

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-11 17:03:33 +01:00
Germain 21d3cb08a9
Switch to using stable values for threads (#8019) 2022-03-11 09:04:22 +00:00
Kerry d38a1fa201
fallback to event text in location body when map unavailable (#7982)
* center icon better

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug

Signed-off-by: Kerry Archibald <kerrya@element.io>

* retrigger all builds

Signed-off-by: Kerry Archibald <kerrya@element.io>

* set assetType on share event

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use pin marker on map for pin drop share

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test events

Signed-off-by: Kerry Archibald <kerrya@element.io>

* pin drop helper text

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use generic location type

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add navigationcontrol when in pin mode

Signed-off-by: Kerry Archibald <kerrya@element.io>

* allow pin drop without location permissions

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove geolocate control when pin dropping without geo perms

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test locationpicker

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test marker type, tidy

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move findMapStyleUrl

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fallback to event content when cant render map

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update mocks in location picker, show same messages as timeline

Signed-off-by: Kerry Archibald <kerrya@element.io>

* style error message in location share menu

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* forgotten copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update style

Signed-off-by: Kerry Archibald <kerrya@element.io>

* icon bigger

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-11 09:52:57 +01:00
Kerry 9082e07ff4
include test/utils in tsconfig (#8024)
* fix export-test.tsx

Signed-off-by: Kerry Archibald <kerrya@element.io>

* include test/utils to tsconfig

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-10 18:15:31 +00:00
Robin 3608fdb2ae
Paginate responses to pinned polls (#8025)
* Paginate responses to pinned polls

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that pinned polls display paginated responses

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-10 18:14:34 +00:00
Kerry e96d9157a9
update location event types (#8022)
* update types

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix tests

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* trigger

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-10 18:03:31 +00:00
Kerry 14684c6296
Send pin drop location share events (#7967)
* center icon better

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug

Signed-off-by: Kerry Archibald <kerrya@element.io>

* retrigger all builds

Signed-off-by: Kerry Archibald <kerrya@element.io>

* set assetType on share event

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use pin marker on map for pin drop share

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test events

Signed-off-by: Kerry Archibald <kerrya@element.io>

* pin drop helper text

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use generic location type

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add navigationcontrol when in pin mode

Signed-off-by: Kerry Archibald <kerrya@element.io>

* allow pin drop without location permissions

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove geolocate control when pin dropping without geo perms

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test locationpicker

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test marker type, tidy

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tweak style

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-09 18:14:07 +01:00
Kerry 2ab8b46ba3
include test/test-utils in tsconfig (#8000)
* move js utils into directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typescripterize js test-utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move test utils to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move remaining mock functions to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update imports

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* type wait for update

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add tests/test-utils to tsconfig

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix wrapper type

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-09 14:23:58 +01:00
Robin c10ac9e4a0
Fix a variety of issues with HTML → Markdown conversion (#8004)
* Fix a variety of issues with HTML → Markdown conversion

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix lint

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix @room pill formatting not being applied to link text

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-09 07:43:05 -05:00
Michael Telatynski 782ce016d1
Wrap EventTile rather than its children in an error boundary (#7945) 2022-03-09 11:22:36 +00:00
Robin 1f4e286db9
Fix formatting not being applied after links (#7990) 2022-03-08 13:12:36 +00:00
Robin 77ed1e3ef8
More pinned messages tests (#7988)
* Test basic pinned message functionality

Signed-off-by: Robin Townsend <robin@robin.town>

* Test pinned polls

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix test

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-04 18:15:03 -05:00
Travis Ralston b981a96b29
Add unexposed account setting for hiding poll creation (#7972)
* Add unexposed account setting for hiding poll creation

This is to match the sticker picker setting we already have, but not exposed in the user settings until we decide if we actually want it to be there.

This is primarily intended to be used in environments that disable it at the config level, though given there's multiple people in the wild who have asked for this, it seems reasonable to expose it as a hidden setting instead. Note that as of writing it's not clear if any of those requests made it as far as an issue tracker.

Typically for the usecase presented we'd add a new UIFeature flag, however this *feels* wrong for the case at hand.

* Move visibility check way higher

* Fix i18n post-merge
2022-03-04 18:04:30 +00:00
Michael Telatynski 0e60ad98c1
Hide composer and call buttons when the room is tombstoned (#7975) 2022-03-04 15:53:22 +00:00
Šimon Brandner a58b1e9d79
Document keyboard shortcuts (#7908) 2022-03-04 12:14:52 +00:00
Michael Telatynski 15cbc6c26c
Fix wrongly asserting that PushRule::conditions is non-null (#7973) 2022-03-04 09:39:16 +00:00
Michael Telatynski afbe3d16b4
Fix account & room settings race condition (#7953) 2022-03-03 22:09:06 +00:00
Michael Telatynski b8f37a46f0
Fix bug with some space selections not being applied (#7971) 2022-03-03 21:42:18 +00:00
Robin 8a7ffb4f90
Test that pinned messages reflect edits correctly (#7960)
* Hide unpinnable pinned messages in more cases

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix typo

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that unpinnable pinned messages get hidden

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix cli.relations error in test

Signed-off-by: Robin Townsend <robin@robin.town>

* Use event: true shortcut when calling mkEvent

Signed-off-by: Robin Townsend <robin@robin.town>

* Use mockResolvedValue instead of mockReturnValue for async mock

Signed-off-by: Robin Townsend <robin@robin.town>

* Actually mock redacted messages correctly

Signed-off-by: Robin Townsend <robin@robin.town>

* Ensure that panel is updated before assertions are made

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that pinned messages reflect edits correctly

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix warning about missing date

Signed-off-by: Robin Townsend <robin@robin.town>

* Move calls to update out of act

They don't need to be there.

Signed-off-by: Robin Townsend <robin@robin.town>

* Move calls to update out of act

They don't need to be there.

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix lint

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-03 12:20:13 -05:00
James Salter 6be61c4693
Add an e2e test to check the app reloads when a new version is available (#7956)
this includes an update to the puppeteer version to support request.isInterceptResolutionHandled
2022-03-03 15:44:34 +00:00
Travis Ralston 75abf03fed
Improve end-to-end test logging by rendering JSHandles (#7959)
Fixes https://github.com/vector-im/element-web/issues/13276

It's still not super pretty, but it works.
2022-03-03 07:59:29 -07:00
Robin f9ad2a5151
Hide unpinnable pinned messages in more cases (#7921)
* Hide unpinnable pinned messages in more cases

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix typo

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that unpinnable pinned messages get hidden

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix cli.relations error in test

Signed-off-by: Robin Townsend <robin@robin.town>

* Use event: true shortcut when calling mkEvent

Signed-off-by: Robin Townsend <robin@robin.town>

* Use mockResolvedValue instead of mockReturnValue for async mock

Signed-off-by: Robin Townsend <robin@robin.town>

* Actually mock redacted messages correctly

Signed-off-by: Robin Townsend <robin@robin.town>

* Ensure that panel is updated before assertions are made

Signed-off-by: Robin Townsend <robin@robin.town>

* Move calls to update out of act

They don't need to be there.

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-03 07:54:44 -05:00
Robin d883309dcd
Avoid using .render() in forward dialog test (#7961)
Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-03 07:54:20 -05:00
Kerry ebc2267e52
Location sharing > back button (#7958)
* add back/cancel buttons to share dialog

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test buttons

Signed-off-by: Kerry Archibald <kerrya@element.io>

* improve weird indentation

Signed-off-by: Kerry Archibald <kerrya@element.io>

* relint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* PR tweaks

Signed-off-by: Kerry Archibald <kerrya@element.io>

* quotes

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-03 11:30:46 +01:00
Kerry 7aefa34420
use LocationAssetType (#7965)
* use LocationAssetType

Signed-off-by: Kerry Archibald <kerrya@element.io>

* center icon better

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug

Signed-off-by: Kerry Archibald <kerrya@element.io>

* retrigger all builds

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-03 10:04:38 +00:00
Eric Eastwood 3572b36648
Fix room list being laggy while scrolling 🐌 (#7939)
Fix https://github.com/vector-im/element-web/issues/21262

Optimizations:

 1. Don't update the `style` (positioning) of hidden tooltips
 1. Don't add DOM elements to the page for hidden tooltips

> ## Performance problems broken down
>
>
> ### Hidden tooltips rendering on `scroll`
>
> You can see that the Tooltip render is attached to the `scroll` event  at [`src/components/views/elements/Tooltip.tsx#L78-L81`](31f0a37ca2/src/components/views/elements/Tooltip.tsx (L78-L81))
>
> The rendering calls [`src/components/views/elements/Tooltip.tsx#L101` -> `updatePosition`](36adba101c/src/components/views/elements/Tooltip.tsx (L101)) which ends up as an expensive "Recalculate Style" because it uses [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). This happens many many times within a single `scroll` event. Probably once for each tooltip within the room list **even though no tooltips are event visible as I scroll**. I can see that we're just updating the `style` attribute for a bunch of `.mx_Tooltip_invisible` elements at the end of the document.
>
> Each one of the purple spans below the `scroll` span ends up as a call to `updatePosition`. And a `scroll` event takes 35ms to 60ms to complete which is way over the 16.6ms 60 FPS budget (on a powerful desktop PC), granted these times are with the performance profiling running. This is without the Passbolt extension explained below.
>
> And the room list contains about 141 rooms (`document.querySelectorAll('.mx_RoomTile').length`):
>
> ![](https://user-images.githubusercontent.com/558581/156273551-e744d3d6-93c6-4b07-bb12-6aad361f96a2.png)
>
>
>
> ### Passbolt Chrome browser extension exacerbates the problem
>
> In order to login to Passbolt, it requires a browser extension which defaults to mucking up all pages:
>
> <img src="https://user-images.githubusercontent.com/558581/156275644-bc26b1f5-5d99-4eae-b74b-c2028f2f1baf.png" width="300">
>
>
> The extension source seems to be available: https://github.com/passbolt/passbolt_browser_extension
>
> The Passbolt Chrome extension has a `MutationObserver` listening to all attribute and element changes to the whole `<body>` of the `document` so it can `findAndSetAuthenticationFields` (find form elements and autofill).
>
>
> [`passbolt/passbolt_styleguide` -> `src/react-web-integration/lib/InForm/InFormManager.js#L143`](1c5eddc910/src/react-web-integration/lib/InForm/InFormManager.js (L143))
> ```js
> this.mutationObserver.observe(document.body, { attributes: true, childList: true, subtree: true });
> ```
>
> This causes a bunch of `Forced reflow` because the Tooltip `updatePosition` is mutating the element `style` attribute and Passbolt `MutationObserver` callbacks are querying the whole DOM looking for form elements all in the same frame.
>
> Under the `scroll` event, all of the little spans are the `MutationObserver` -> `findAndSetAuthenticationFields`. With the Passbolt extension, scrolling is verrrrry crunchy and bad.
>
> ![](https://user-images.githubusercontent.com/558581/156144998-8cf7686f-3c7b-42f8-8d81-ff780bae0ab5.png)
>
>
> #### Workaround
>
> Instead of running Passbolt on all sites, we can enable the extension to only run on the domain for Passbolt instance itself. I'm guessing the Passbolt extension also does autofill stuff on sites but I always login manually to the Passbolt instance so this solution works for me �
>
> **Extensions** -> **Passbolt** -> **Details** -> Change **Site access** to `On specific sites` -> Enter in your Passbolt instance `https://passbolt.example.com/`
>
> ![](https://user-images.githubusercontent.com/558581/156275630-a53ef6a1-c058-4ac9-aa08-ae50b90e72c9.png)
>
> *-- https://github.com/vector-im/element-web/issues/21262*
2022-03-02 13:20:01 -06:00
Robin aadb64615f
Fix duplicate EventListSummarys (#7952)
* Fix duplicate EventListSummarys

Signed-off-by: Robin Townsend <robin@robin.town>

* Add regression test

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-02 11:46:51 -05:00
Kerry b480bffab0
Location share type UI (#7924)
* copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* empty line

Signed-off-by: Kerry Archibald <kerrya@element.io>

* functional picker

Signed-off-by: Kerry Archibald <kerrya@element.io>

* most style

Signed-off-by: Kerry Archibald <kerrya@element.io>

* nice style for options

Signed-off-by: Kerry Archibald <kerrya@element.io>

* get ShareType test passing

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add maplibre mock

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint and test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add section to themes for location sharing cols

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add svg mock

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use same mock string as imageMock

Signed-off-by: Kerry Archibald <kerrya@element.io>

* newline

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add live location icon

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rename useEnabledShareTypes

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use solid color for live border

* use ternary

Signed-off-by: Kerry Archibald <kerrya@element.io>

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-02 13:00:40 +00:00
Germain d01ea1824b
[Update thread info after MSC3440 updates] (#7911) 2022-03-02 10:52:14 +00:00
Travis Ralston 31f0a37ca2
Fix js-sdk imports (#7938) 2022-03-01 23:51:05 +00:00
Michael Telatynski f25e6813bb
Mandate use of js-sdk/src/matrix import over js-sdk/src (#7933) 2022-03-01 20:42:05 +00:00
Travis Ralston 5f51ba1592
Add support for overriding strings in the app (#7886)
* Add support for overriding strings in the app

This is to support a case where certain details of the app need to be slightly different and don't necessarily warrant a complete fork. 

Intended for language-controlled deployments, operators can specify a JSON file with their custom translations that override the in-app/community-supplied ones.

* Fix import grouping

* Add a language handler test

* Appease the linter

* Add comment for why a weird class exists
2022-03-01 11:53:09 -07:00
Travis Ralston a5ce1c9dcb
Add support for redirecting to external pages after logout (#7905)
* Add support for redirecting to external pages after logout

This is primarily useful for deployments where the account is managed and needs to be logged out in other places too, like an SSO system.

See docs for more information.

* Add e2e test and fix Windows instructions

* Fix performance gathering stats

* use logger
2022-03-01 11:06:17 -07:00
Kerry ac36234068
update snap (#7932)
Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-01 17:26:30 +00:00
Kerry 3f1951b5b8
Prep for pin drop location sharing (#7919)
* add labs flag feature_location_share_pin_drop

Signed-off-by: Kerry Archibald <kerrya@element.io>

* split LocationButton into two components

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rethemendex

Signed-off-by: Kerry Archibald <kerrya@element.io>

* copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* one more (c)

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* empty line

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use same matrix client import

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-01 18:00:07 +01:00
Michael Telatynski 3818dfc859
Add end-to-end test for the user view (#7926) 2022-03-01 13:05:30 +00:00
Kerry 4bf42babc7
dont re-prepare voice messages (#7897)
* dont reprepare voice messages

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test Playback

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test RecordingPlayback

Signed-off-by: Kerry Archibald <kerrya@element.io>

* forgotten copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add comments

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-01 09:43:32 +01:00
Michael Telatynski 08c47ac473
Fix changing space sometimes bouncing to the wrong space (#7910) 2022-03-01 08:33:29 +00:00
Michael Telatynski 482d756bd0
Ensure EventListSummary key does not change during backpagination (#7915) 2022-03-01 08:33:07 +00:00
Šimon Brandner df591ee835
Make everything use the `KeyBindingManager` (#7907) 2022-02-28 16:05:52 +00:00
David Baker 1a6134e441
Fix another freeze on room switch (#7900)
* Fix another freeze on room switch

This switches permalinks to use the batch state update event and
removes the incremental updates, as commented. We now spend, on my
profiling, about 450ms in setOutOfBandMembers itself and another
120ms in permalinks.

Fixes https://github.com/vector-im/element-web/issues/21127

* Just bind to the currentstate state updates
2022-02-25 19:48:35 +00:00
Robin ece2b8572a
Fix edge case in context menu chevron positioning (#7899)
* Fix edge case in context menu chevron positioning

Signed-off-by: Robin Townsend <robin@robin.town>

* Expand context menu positioning regression tests

Signed-off-by: Robin Townsend <robin@robin.town>
2022-02-25 17:49:57 +00:00
Kerry 130bd6aa63
manage voicerecording state when deleting or sending a voice message (#7896)
* manage voicerecording state when deleting or sending a voice message

Signed-off-by: Kerry Archibald <kerrya@element.io>

* comment

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-24 18:54:06 +01:00
Robin 85dc58a504
Try harder to keep context menus inside the window (#7863)
* Try harder to keep context menus inside the window

Signed-off-by: Robin Townsend <robin@robin.town>

* Use UIStore for window dimensions

Signed-off-by: Robin Townsend <robin@robin.town>

* Test ContextMenu positioning

Signed-off-by: Robin Townsend <robin@robin.town>
2022-02-24 10:25:27 -05:00
Kerry f4cd71fd47
Check 'useSystemTheme' in quick settings theme switcher (#7809)
* mock Element.scrollIntoView in jest setup

Signed-off-by: Kerry Archibald <kerrya@element.io>

* extract theme switcher from quick settings, add match system option, test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* forgotten copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* stylelint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove old class

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-24 10:01:06 +01:00
Kerry 889b0cebb2
Fix 'my threads' filtering to include participated threads (#7882)
* move js utils into directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typescripterize js test-utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move test utils to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move remaining mock functions to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update imports

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* threads test helpers

Signed-off-by: Kerry Archibald <kerrya@element.io>

* forgotten copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* comments

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix threads helper unsigned

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test filter creation when thread capabilities enabled

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-24 09:44:34 +01:00
David Baker 81cda7c749
Fix freeze on room switch (#7884)
* Fix freeze on room switch

updateServerCandidates was called on every room member event and
not throttled.

Fixes https://github.com/vector-im/element-web/issues/21127

* Move import

* Disable throttling in tests

* Types

Co-authored-by: Travis Ralston <travisr@matrix.org>

Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-02-23 19:16:12 +00:00
Kerry 1830de2733
Thread test utilities (#7881)
* move js utils into directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typescripterize js test-utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move test utils to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move remaining mock functions to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update imports

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* threads test helpers

Signed-off-by: Kerry Archibald <kerrya@element.io>

* forgotten copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* comments

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add unsigned to root event

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-23 17:12:48 +01:00
J. Ryan Stinnett d8ac7cf202
Fix thread summary layout for narrow right panel timeline (#7838) 2022-02-23 14:03:46 +00:00
Kerry 5e76d988ca
convert test-utils to typescript (#7877)
* move js utils into directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typescripterize js test-utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move test utils to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move remaining mock functions to directory

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update imports

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* type wait for update

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-23 11:21:11 +00:00
Šimon Brandner 93a9af7b3a
Keybinding code unification #3 (#7850) 2022-02-23 09:12:04 +00:00
Michael Telatynski 7fa01ffb06
Improve typing around event emitter handlers (#7816) 2022-02-22 12:18:08 +00:00
Robin bb79c6086a
Don't pillify code blocks (#7861)
* Don't pillify code blocks

Signed-off-by: Robin Townsend <robin@robin.town>

* Test that pills do not appear in code blocks

Signed-off-by: Robin Townsend <robin@robin.town>

* Use snapshot instead for test

Signed-off-by: Robin Townsend <robin@robin.town>
2022-02-22 06:46:34 -05:00
Michael Telatynski 8fccef86d8
Wire up drag-drop file uploads for the thread view (#7860) 2022-02-22 11:14:56 +00:00
Michael Telatynski 2a55d22916
Wire up CallEventGroupers for Search Results (#7866) 2022-02-22 10:39:08 +00:00
Kerry 5b8d440406
type Actions (#7862)
* type ViewHomPage action

Signed-off-by: Kerry Archibald <kerrya@element.io>

* type spacestore actions

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add action types

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use new action types in stores

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove debug change

Signed-off-by: Kerry Archibald <kerrya@element.io>

* stricter keyboard shortcut types

Signed-off-by: Kerry Archibald <kerrya@element.io>

* action comments

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-22 10:04:27 +00:00
Kerry 9db59d75b9
Bump react-focus-lock (#7858)
* react-focus-lock to 2.5.1

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use enzyme in ASSD test so focus lock finds active element

Signed-off-by: Kerry Archibald <kerrya@element.io>

* findById and flushPromises to test utils

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-21 17:09:01 +00:00
Kerry 8b9263c808
Clean up some unit test logs (#7857)
* kill some unit test logs in arrays-test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove mock logs that are asserted against anyway

* remove more logs

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix safeCOunterpartTranslate warnings in tests

Signed-off-by: Kerry Archibald <kerrya@element.io>

* more safeCounterpartTranslate warnings

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove more logs

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add helper

Signed-off-by: Kerry Archibald <kerrya@element.io>

* naming

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-21 16:57:44 +00:00
David Baker 572fa99e67
Fix virtual / native room mapping on call transfers (#7848)
* Fix virtual / native room mapping on call transfers

By just sending them through the same code path as regular calls.

Also re-do the tests & add a test for transfer specifically.

* Optional arg

* Types
2022-02-21 12:17:09 +00:00
Andy Balaam f1e1b7be86
Support "closed" polls whose votes are not visible until they are ended (#7842) 2022-02-21 10:21:35 +00:00
Kerry fc9a221371
Focus trap in poll creation dialog (#7847)
* add autofocus

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* scope ids

Signed-off-by: Kerry Archibald <kerrya@element.io>

* whitespace

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-18 16:35:08 +00:00
Michael Telatynski 38a547b5d0
Remove ResizeObserver Polyfill (#7844) 2022-02-18 13:51:27 +00:00
Kerry 6fccd6b183
add cursor: pointer to actionable poll options (#7826)
* add cursor: pointer to actionable poll options

Signed-off-by: Kerry Archibald <kerrya@element.io>

* eof

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-18 11:43:07 +01:00
Kerry 08a0c6f86c
Don't aggregate rooms and users in SpaceStore (#7723)
* add direct child maps

* track rooms, users and space children in flat hierarchy in spacestore

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update spacefiltercondition to use new spacestore

* remove unused code

Signed-off-by: Kerry Archibald <kerrya@element.io>

* typos

Signed-off-by: Kerry Archibald <kerrya@element.io>

* only build flattened rooms set once per space when updating notifs

* copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove unnecessary currying

Signed-off-by: Kerry Archibald <kerrya@element.io>

* rename SpaceStore spaceFilteredRooms => roomsIdsBySpace, spaceFilteredUsers => userIdsBySpace

Signed-off-by: Kerry Archibald <kerrya@element.io>

* cache aggregates rooms and users by space

Signed-off-by: Kerry Archibald <kerrya@element.io>

* emit events recursively up parent spaces on changes

Signed-off-by: Kerry Archibald <kerrya@element.io>

* exclude meta spaces from aggregate cache

Signed-off-by: Kerry Archibald <kerrya@element.io>

* stray log

* fix emit on member update

Signed-off-by: Kerry Archibald <kerrya@element.io>

* call order

Signed-off-by: Kerry Archibald <kerrya@element.io>

* extend existing getKnownParents fn

Signed-off-by: Kerry Archibald <kerrya@element.io>

* refine types and comments

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-17 21:24:05 +01:00
Michael Telatynski 658590e5bc
More posthog tracking around joining rooms and room search (#7807) 2022-02-17 18:03:27 +00:00
J. Ryan Stinnett a939184e10
Tear down AppTile using lifecycle tracking (#7833) 2022-02-17 16:30:36 +00:00
Andy Balaam 93d4364455
Prevent forwarding polls (#7819) 2022-02-17 10:57:12 +00:00
David Baker 3be74d38d6
Fix src/lib import (#7825) 2022-02-17 10:06:19 +00:00
David Baker 01b00bf3fe
Add test for RoomNotificationState (#7820)
Regression test for https://github.com/vector-im/element-web/issues/20859
2022-02-17 09:18:37 +00:00
Andy Balaam 7387f3c80a
Allow editing polls (#7806) 2022-02-17 09:13:05 +00:00
Šimon Brandner 81f52283cf
Don't change `KEYBOARD_SHORTCUTS` and do some refactoring (#7818) 2022-02-16 15:24:00 +00:00
J. Ryan Stinnett 0dc1355441
Fix right panel data flow (#7811) 2022-02-16 11:19:28 +00:00
dependabot[bot] b5e3ba28d9
Bump ajv from 6.10.0 to 6.12.6 in /test/end-to-end-tests (#7792)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.0 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.10.0...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kerry Archibald <kerrya@element.io>
2022-02-15 13:52:35 -07:00
David Baker 5fe8442f44
Add an end-to-end test for stickers (#7733)
* Add an end-to-end test for stickers

* More logs on login

* Wait for spinners to go away

* Factor out spinner waiting as it seems useful

* Move stickers to the end

* More waiting

* When all else fails... add sleeps

* Waiting for the server picker to appear seems to work..?

* Typos

Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>

* remove commented code from registration usecase

Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2022-02-15 11:49:53 +00:00
Andy Balaam 84e15fa148
Display '(edited)' next to edited polls (#7789) 2022-02-15 08:52:51 +00:00
Michael Telatynski cfa6e266cd
Wire up new fields on the ViewRoom posthog event and more interactions (#7787) 2022-02-14 19:31:13 +00:00
David Baker 1c3507bc11
Use the shared secret registration API directly (#7774)
* Use the shared secret registration API directly

rather than invoking the synapse module to do it. It's probably
a bit simpler, if anything, and allows for synapse to be run in
a separate container (or rather, avoids the javascript having to have
a copy of synapse source & server config).

* Make registration secret required

Update commander (8 major versions!) to get requiredOption

* Wrong options object :/
2022-02-11 17:03:22 +00:00
Kerry b5e7d12f76
Add config option to autorageshake when key backup is not enabled (#7741)
* report on not enabled

Signed-off-by: Kerry Archibald <kerrya@element.io>

* add setting

Signed-off-by: Kerry Archibald <kerrya@element.io>

* check key backup status after crypto init

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove log

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test encryption setup in DeviceListener

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* sendLogs for key backup auto-report event

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove reloadOnChagneController

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-11 14:00:37 +01:00
Michael Telatynski ac6a356027
End-to-end test alias publishing flow (#7779) 2022-02-11 11:37:31 +00:00
Charlie Calendre 8103e606c4
Fix translation for keyboard shortcut displaynames (#7758) 2022-02-10 09:11:35 +00:00
Kerry 818fddd72c
Add customisation point to disable space creation (#7766)
* mock matchMedia in jest setup

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use UIComponent.CreateSpaces in space panel

Signed-off-by: Kerry Archibald <kerrya@element.io>

* lint

Signed-off-by: Kerry Archibald <kerrya@element.io>

* hide add space in spacecontextmenu

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use UIComponent customistations in space oom view add space button

Signed-off-by: Kerry Archibald <kerrya@element.io>

* copyright

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-09 17:21:40 +01:00
Michael Telatynski 5620b83d34
Wire up more Posthog tracking (#7689) 2022-02-09 14:25:58 +00:00
Michael Telatynski 714136d4f7
Consolidate RedactionGrouper and HiddenEventGrouper into MELS (#7739) 2022-02-09 10:51:12 +00:00
Kerry 30d1ac1eea
unit test basic paths in UserInfo (#7740)
* unit test main paths in UserInfo component

Signed-off-by: Kerry Archibald <kerrya@element.io>

* one more test case

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove BasicUserInfo export

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-08 12:14:52 +00:00
Germain 544957bdad
Use typographical quotes in no threads UI (#7713) 2022-02-07 15:13:34 +00:00
Michael Telatynski 5d89230271
Remove IA 1.1 feedback toast (#7720) 2022-02-07 12:46:48 +00:00
Michael Telatynski 78e78292cb
Update PollCreateDialog-test to snapshot the html and not react tree (#7712) 2022-02-03 11:54:03 +00:00
Kerry 292971dd0e
Upgrade to jest 27 (#7699)
* use jest@27.4.0, replace jest-environment-jsdom-sixteen with jest-environment-jsdom

Signed-off-by: Kerry Archibald <kerrya@element.io>

* polyfill setImmediate

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove done from async test cases

* useRealTimers in test relying on promise flushing

Signed-off-by: Kerry Archibald <kerrya@element.io>

* remove jest environment file

Signed-off-by: Kerry Archibald <kerrya@element.io>

* replace ts-jest mocked with jest utils mocked

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-02 13:02:17 +01:00
Kerry cb1c94dd2b
Fix leaks in Login unit tests (#7704)
* make Login-test tsx, fix leaks

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed lint

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-02-02 11:18:55 +00:00
Andy Balaam f5226f9d5b
Simplify Composer buttons (#7678)
* Render a CollapsibleButton's children (needed by UploadButton)

* Make UploadButton ready to live inside an overflow menu

* Always show overflow menu in composer: main buttons are emoji and attach

* Re-order composer buttons as per design

* Re-word composer button captions to be simple nouns

* Don't rotate More options button when clicked

* Move the composer menu and dialogs 16px in from right

* Reduce shadow on composer More menu

* From review: remove else clause

* From review: take input out of button

* Update test snapshots

* Update snapshots
2022-02-02 09:30:53 +00:00
Germain 5973d725e0
Add new threads to the panel as they are discovered (#7688) 2022-02-01 15:01:00 +00:00
Michael Telatynski 991257cbc3
Fix accessibility and consistency of MessageComposerButtons (#7679) 2022-01-31 16:05:05 +00:00
Šimon Brandner a17d585a12
Work towards unifying `KeyboardShortcuts` and `KeyBindingsDefaults` #2 (#7674) 2022-01-31 15:55:45 +00:00
Kerry 085ecc7f5f
Chat export parameter customisation (#7647)
* use export settings and hide fields

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix exporter tests

Signed-off-by: Kerry Archibald <kerrya@element.io>

* test ExportDialog with settings

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tidy debugs, rename setting to Parameters

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use reasonable 100gb limit

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use normal setting instead of UIFeature

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use a customisation

Signed-off-by: Kerry Archibald <kerrya@element.io>

* move validateNumberInRange to utils

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use nullish coalesce

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use 8gb size limit for customisation

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update comments

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-01-31 12:54:14 +01:00
Andy Balaam 2229437424
Refactor renderButtons() into MessageComposerButtons component (#7664) 2022-01-28 15:44:03 +00:00
Eric Eastwood 7fa27f5834
Add jump to date functionality to date headers in timeline v2 (#7339)
Fix https://github.com/vector-im/element-web/issues/7677

Utilizes MSC3030: https://github.com/matrix-org/matrix-doc/pull/3030

https://user-images.githubusercontent.com/558581/150060664-79627573-f4fd-497c-b726-dc3485854bd0.png
2022-01-27 16:32:12 -06:00
Šimon Brandner 57a5647079
Work towards unifying `KeyboardShortcuts` and `KeyBindingsDefaults` #1 (#7651) 2022-01-27 11:37:53 +00:00