* 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>
* 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>
* 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>
* 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
* 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>
* 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>
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*
* 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
* 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
* 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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* 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 :/
* 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>
* 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
* runAllTimers -> runOnlyPendingTimers in SpaceStore-test
Signed-off-by: Kerry Archibald <kerrya@element.io>
* runAllTimers for switch to first valid space when selected metaspace is disabled
Signed-off-by: Kerry Archibald <kerrya@element.io>
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
Co-authored-by: Dariusz Niemczyk <dariuszn@element.io>
Co-authored-by: Timo K <toger5@hotmail.de>
With this pr all href use matrix matrix.to links. As a consequence right-click copy link will always return get you a sharable matrix.to link.
Previously, the `left` positioning seemed to only work with icons which are all about the same size so the arbitrary offset worked. Now we actually position off to the left of the element and we have equal `margin-left` and `margin-right` to determine the offset.
Spawned from https://github.com/matrix-org/matrix-react-sdk/pull/7339#discussion_r767154349
* Start a conference call in a room with 2 people + invitee rather than a 1:1
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Fix tests
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Move all polls processing to events-sdk
This makes polls support the full range of extensible events (both parsing and generation).
* Appease the linter
* Fix & update tests
* Update events-sdk for polls bugfix
* Update events-sdk for typechecking
* Add missing type cast
* Update per review
* fix fallback for pluralized cases
Signed-off-by: Kerry Archibald <kerrya@element.io>
* add test case for no pluralizer
Signed-off-by: Kerry Archibald <kerrya@element.io>
* add disabler elative dates setting
Signed-off-by: Kerry Archibald <kerrya@element.io>
* test existing DateSeparator
Signed-off-by: Kerry Archibald <kerrya@element.io>
* use full date format when TimelineDisableRelativeDates is truthy
Signed-off-by: Kerry Archibald <kerrya@element.io>
* add comment
Signed-off-by: Kerry Archibald <kerrya@element.io>
* flip timelineDisableRelativeDates -> timelineEnableRelativeDates to fit convention
Signed-off-by: Kerry Archibald <kerrya@element.io>
* mock date constructor in test
Signed-off-by: Kerry Archibald <kerrya@element.io>
* Add matrix-analytics-events as a dependency
* Make IEvent look like a stub definition
* Update pageview tracking to track screens, using a hypothetical definition of a screen event
* Remove distinction between pseudo and anon tracking, will need to rework it considering stubs
Adds maplibre as a dependency, and behind a labs flag, lets users send and receive [MSC3488](https://github.com/matrix-org/matrix-doc/blob/matthew/location/proposals/3488-location.md) style location shares - with backwards compatibility with old school `m.location` `msgtype` location shares too.
For this to work, you have to define a valid maptile server and API in your config.json's `map_style_url`.
* Add a new flag pseudonymousAnalyticsOptIn replacing analyticsOptIn, stored at account level, so people only need to opt in once.
* Show a toast in login to users that have analyticsOptIn set but not yet pseudonymousAnalyticsOptIn prompting them confirm the new method is okay. Update the copy of the existing opt-in toast. Don't notify users that previously opted out.
* Update the copy in settings
* Add a new learn more dialog
* Support a new config flag analyticsOwner which is used in these toasts when explaining which entity the data is sent to ("Help improve %(analyticsOwner)"). If unset, display brand. This allows deployments whose brand differs from the receiver of the analytics to explain the situation to their users (e.g. AcmeCorp badges their app, but explains the data is sent to Element, not them)
* The new opt-in and flags are only used when posthog is configured; prior to that there are no changes to UX or tracking behaviour.
* sharedInstance() -> instance
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Use CallState event instead of dispatching
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Simplifie some code
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Use a method to start a call instead of the dispatcher
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Use a method instead of place_conference_call
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Make terminateCallApp() and hangupCallApp() public
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Use hangupAllCalls() instead of the dispatcher
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Make dialNumber(), startTransferToMatrixID() and startTransferToPhoneNumber() public instead of using the dispatcher
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Use answerCall() instead of using the dispatcher
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Use hangupOrReject() instead of the dispatcher
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Update docs
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Improve TS
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Dispatch call_state, see https://github.com/vector-im/element-web/pull/18823#issuecomment-917377277
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Add missing import
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
* Move user avatar to Space panel
* Add room list header for 'Home' or 'Space Name' to room list
Add existing Space context menus to room list header
* Re-add pending room join spinner
* Iterate RoomListHeader plus context menu
* Iterate space context menu
* Iterate room list + interactions
* Move DND to new iA model
* Replace composer custom status management with usermenu one
* Cull Quick Actions
* Iterate minimized room list state
* delint
* Merge the RoomListNumResults into the RoomListHeader
* Make the search shortcut prompt semi-bold
* Iterate RoomListHeader based on design review
* Iterate UserMenu based on feedback
* Add name to expanded spacepanel usermenu button
* i18n
* Make room sub list aux button components more generic
* Change left panel explore button to only refer to room directory
* Iterate RoomListHeader
* Fix custom user status input field width in Chrome
* Bring back Notification settings button
* delint
* i18n
* post-merge fix
* iterate pr
* Remove unused state
* update copy
* Apply suggestions from PR review
* delint
* Update invite iconography
* Iterate Space context menu to match Figma
* Fix chevron alignment
* Fix edge case for RoomListHeader on metaspaces
* Wire up general rageshake-driven feedback mechanism
* Add IA1.1 info toast
* add missing alt attribute
* delint
* delint
* tweak ia toast priority
* e2e test account for new toast
* autofocus feedback field and remove old subheading
* tweak copy
* Iterate space panel colours to match Figma
* Iterate PR
* delint
* Fix feedback submission with object setting values
* iterate based on review
* Tweak colours and update splash image
* Tweaks based on review
* Remove room list prompt, made redundant by the big fat `+`
* Fix edge cases around User Menu positioning and dnd
* Add missing import, bad merge?
* Update aria label in e2e test
* Fix room list space rooms context menu explore button behaviour
* Tweak copy
* Revert order of options in the UserMenu
* Tweak copy
* i18n
Add a "kind" param for StyledCheckbox, allowing designers to choose different styles of checkbox as needed. In addition to the preexisting default kind (now called Solid), there's an Outline kind with a green checkmark and a transparent fill. This is used in the device trust view, since the default checkbox style looks too much like the green "verified" shield and it's awkward to have those next to each other.
* Improve visibility of font size chooser
* Move slider dot sizes into variables
* Use a standard font size instead of percentage in Slider
* Use shorthand for padding in FontScalingPanel
* Change Slider text pos to px to be consistent when font changes
* Cleaner dot size for Slider selection
Implement https://github.com/vector-im/element-web/issues/18957 following requirements:
* Create a new right panel view to list all the threads in a given room.
* Change ThreadView previous phase to be ThreadPanel rather than RoomSummary
* Implement local filters for My and All threads
In addition:
* Create a new TileShape for proper rendering requirements (hiding typing indicator)
* Create new timelineRenderingType for proper rendering requirements
* Fix infinite rerender loop when editing message
* Refactor "edit_event" to Action.EditEvent
* Make up-arrow edit working in Threads
* Properly handle timeline events edit state
* Properly traverse messages to be edited
* Add MatrixClientContextHOC
* Refactor RoomContext to use AppRenderingContext
* Typescriptify test
Co-authored-by: Germain <germains@element.io>