Commit Graph

42069 Commits (c0c447ab9bb7cfb9319e56cbbc1cb87048ca3322)

Author SHA1 Message Date
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
Travis Ralston f882466329
Add a few more UIComponent flags, and ensure they are used in existing code (#7937)
* UIComponent flag: Explore rooms

To disable the room directory access on the Home space. Can be controlled with the existing ComponentVisibilityCustomisation

* Make "plus menu" respect component visibility

* UIComponent flag: Add integrations

To disable the widgets section of the room info card and addwidget slashcommand. Can be controlled with the existing ComponentVisibilityCustomisation

* Make sure invite users component applies to space rooms too

* Appease the linter
2022-03-02 10:37:18 -07:00
Kerry d304e24a45
Revert "remove code related to encrypted file download button in iframe" (#7957)
* Revert "remove code related to encrypted file download button in iframe (#7940)"

This reverts commit 26216ec527.

* udpate icon import in MFileBody

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-02 18:27:36 +01:00
Robin 8f68a43ee3
Make pinned messages more reliably reflect edits (#7920)
* Inject edits from /relations API into pinned messages

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

* Limit returned relations, because we only need one

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

* Fetch pinned message edits in parallel

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-02 12:21:23 -05: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
Michael Telatynski 560f8f7ee7
Improve accessibility of the BetaPill (#7949) 2022-03-02 16:31:47 +00:00
Michael Telatynski c727942095
Autofocus correct composer after sending reaction (#7950) 2022-03-02 16:31:34 +00:00
Kerry 61cd463a3b
replace all require(svgs) with esm import (#7948)
Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-02 17:14:33 +01:00
Suguru Hirahara 522ad1aafb
Make "Match system" on QuickThemeSwitcher.tsx translatable (#7951) 2022-03-02 16:10:14 +00:00
David Baker b789d252b9
Add logging to diagnose non-disappearing toasts (#7947)
For https://github.com/vector-im/element-web/issues/17667
2022-03-02 14:30:04 +00:00
Michael Telatynski a39473810a
Fix react warnings (#7946) 2022-03-02 14:29:45 +00:00
Michael Telatynski 3c858a723b
Fix sending locations into threads and fix i18n (#7943) 2022-03-02 14:27:16 +00:00
Michael Telatynski 0f4125dfd5
Consider polls as message events for rendering redactions (#7944) 2022-03-02 14:27:02 +00:00
Michael Telatynski 71ddd9d78d
Prevent event tiles being shrunk/collapsed by flexbox (#7942) 2022-03-02 14:24:43 +00: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
Kerry 547144a565
Jest mock for svgr icons (#7941)
* 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>
2022-03-02 12:05:50 +00:00
Kerry 26216ec527
remove code related to encrypted file download button in iframe (#7940)
* remove code related to encrypted file download button in iframe

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

* i18n

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

* remove getIframeFn in mfilebody filedownloader

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

* remove iframe ref too

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-02 11:55:03 +00:00
Germain d01ea1824b
[Update thread info after MSC3440 updates] (#7911) 2022-03-02 10:52:14 +00:00
Germain 3a82163127
Disable pending events in thread panel event timeline set (#7874) 2022-03-02 10:39:22 +00:00
David Baker 2d58704d26
Clean up asserted identity code (#7934)
* Clean up asserted identity code

Add logging when we received asserted identity events but ignore them,
and just disable the whole code path if it's not enabled in the config.

* Actually, put the check back - better to check anyway

* Update to ? syntax

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

* Put back lost return

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-02 09:59:01 +00:00
Kerry e6ea58e84d
Load icons using @svgr (#7928)
* extend svg module

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

* POC in QuickSettingsButton

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

* stylelint

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

* update copyright

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

* remove aria-hidden, quick docs

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-02 10:18:45 +01:00
Germain d50dae5208
Decrypt thread last reply on EventTile mount and update (#7930)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-02 09:02:14 +00:00
Germain cc389120c7
Render thread summary for events discovered on scrollback (#7925) 2022-03-02 09:02:06 +00:00
Suguru Hirahara 865dddbb62
Fix ExportDialog title on export cancellation (#7936) 2022-03-02 08:58:41 +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
Šimon Brandner 8f128ef0dc
Expose redaction power level in room settings (#7599) 2022-03-01 16:41:58 +00:00
Šimon Brandner 928b086e05
Fix backspace not working in the invite dialog (#7931) 2022-03-01 16:35:48 +00:00
David Baker f9140718b0 Merge remote-tracking branch 'weblate/develop' into develop 2022-03-01 15:49:28 +00:00
Michael Telatynski 3818dfc859
Add end-to-end test for the user view (#7926) 2022-03-01 13:05:30 +00:00
RiotRobot b7787eaf2e Merge branch 'master' into develop 2022-03-01 11:57:55 +00:00
RiotRobot 915d8385d4 v3.41.1 2022-03-01 11:52:59 +00:00
RiotRobot 33b334cdf7 Prepare changelog for v3.41.1 2022-03-01 11:52:58 +00:00
David Baker e502fafad2
Fix right panel soft crashes due to missing room prop (#7923) (#7927)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-01 11:49:23 +00:00
Michael Telatynski 7a32a68a0b
Fix right panel soft crashes due to missing room prop (#7923) 2022-03-01 11:15:23 +00:00
Kerry 36adba101c
fix color of location share caret (#7917)
Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-01 08:53:28 +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 16e67e7716
Wrap all EventTiles with a TileErrorBoundary and guard parsePermalink (#7916)
Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-03-01 08:41:48 +00: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
Michael Telatynski 115e17b097
Fix positioning of the thread context menu (#7918) 2022-03-01 08:32:29 +00:00
RiotRobot b02d5ecb97 Merge branch 'master' into develop 2022-02-28 17:01:22 +00:00
RiotRobot bf2bb26cda v3.41.0 2022-02-28 16:51:08 +00:00
RiotRobot e5c7b424c8 Prepare changelog for v3.41.0 2022-02-28 16:51:07 +00:00
RiotRobot 9feae296f4 Upgrade matrix-js-sdk to 15.6.0 2022-02-28 16:48:46 +00:00
Šimon Brandner df591ee835
Make everything use the `KeyBindingManager` (#7907) 2022-02-28 16:05:52 +00:00