Commit Graph

5076 Commits

Author SHA1 Message Date
Michael Telatynski
8ae67aa4dd Only show mini avatar uploader in room intro when no avatar yet exists (#9479) 2022-10-21 14:45:38 +01:00
Germain
be281fd735 Fix threads fallback incorrectly targets root event (#9229)
* Use RelationType enum instead of hardcoded value

* Fix threads replies fallback to target last reply

* Only unsubscribe from threads events if needed

* fix strict null check

* fix strict null checks

* strict null checks

* fix typing

* Unsubscribe listeners if new thread is `null`

Co-authored-by: Faye Duxovni <fayed@element.io>

* Update strict null checks

* Type HTMLElement as nullable

* Add thread fallback integration test

* lint fix

* Update snapshots

* Add test after changing thread

* Remove test comment

* update snapshot

* fix room context test utility

* Add ThreadListContextMenu test

* lint fix

* fix thread rendering

Co-authored-by: Faye Duxovni <fayed@element.io>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-10-20 12:48:25 +01:00
Travis Ralston
dade38086c Fix slightly noisy warning when switching spaces (#9468)
Sometimes `spaceName` can be `undefined` because of function timing - use a different method for getting the space's name when this happens.
2022-10-20 00:52:06 -06:00
kegsay
13fbd096b0 Stores refactor: convert TypingStore; rename TestStores to TestSdkContext (#9454) 2022-10-19 14:14:14 +01:00
Michael Weimann
bb0c175b7e Display info dialogs if unable to start voice broadcasts (#9453) 2022-10-19 15:01:14 +02:00
kegsay
e946674df3 Store refactor: use non-global stores in components (#9293)
* Add Stores and StoresContext and use it in MatrixChat and RoomView

Added a new kind of class:
- Add God object `Stores` which will hold refs to all known stores and the `MatrixClient`. This object is NOT a singleton.
- Add `StoresContext` to hold onto a ref of `Stores` for use inside components.

`StoresContext` is created via:
- Create `Stores` in `MatrixChat`, assigning the `MatrixClient` when we have one set. Currently sets the RVS to `RoomViewStore.instance`.
- Wrap `MatrixChat`s `render()` function in a `StoresContext.Provider` so it can be used anywhere.

`StoresContext` is currently only used in `RoomView` via the following changes:
- Remove the HOC, which redundantly set `mxClient` as a prop. We don't need this as `RoomView` was using the client from `this.context`.
- Change the type of context accepted from `MatrixClientContext` to `StoresContext`.
- Modify alllll the places where `this.context` is used to interact with the client and suffix `.client`.
- Modify places where we use `RoomViewStore.instance` and replace them with `this.context.roomViewStore`.

This makes `RoomView` use a non-global instance of RVS.

* Linting

* SDKContext and make client an optional constructor arg

* Move SDKContext to /src/contexts

* Inject all RVS deps

* Linting

* Remove reset calls; deep copy the INITIAL_STATE to avoid test pollution

* DI singletons used in RoomView; DI them in RoomView-test too

* Initial RoomViewStore.instance after all files are imported to avoid cyclical deps

* Lazily init stores to allow for circular dependencies

Rather than stores accepting a list of other stores in their constructors,
which doesn't work when A needs B and B needs A, make new-style stores simply
accept Stores. When a store needs another store, they access it via `Stores`
which then lazily constructs that store if it needs it. This breaks the
circular dependency at constructor time, without needing to introduce
wiring diagrams or any complex DI framework.

* Delete RoomViewStore.instance

Replaced with Stores.instance.roomViewStore

* Linting

* Move OverridableStores to test/TestStores

* Rejig how eager stores get made; don't automatically do it else tests break

* Linting

* Linting and review comments

* Fix new code to use Stores.instance

* s/Stores/SdkContextClass/g

* Update docs

* Remove unused imports

* Update src/stores/RoomViewStore.tsx

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

* Remove empty c'tor to make sonar happy

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-10-19 13:07:03 +01:00
Andy Balaam
e0ab0ac5c9 Allow pressing Enter to send messages in new composer (#9451)
* Allow pressing Enter to send messages in new composer

* Cypress tests for composer send behaviour
2022-10-19 03:07:21 +00:00
Johannes Marbach
26f3d107fd Set relations helper when creating event tile context menu (#9253)
* Set relations helper when creating event tile context menu

Fixes vector-im/element-web#22018

Signed-off-by: Johannes Marbach <johannesm@element.io>

* Add e2e tests

* Use idiomatic test names

Signed-off-by: Johannes Marbach <johannesm@element.io>
Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-10-18 13:06:43 -06:00
Michael Telatynski
0ef8c80815 Fix usages of useContextMenu which never pass the ref to the element (#9449) 2022-10-18 13:39:59 +01:00
Robin
57eec824d9 Don't show call banners in video rooms (#9441) 2022-10-17 21:47:05 -06:00
Timo
372720ec8b Room call banner (#9378)
Signed-off-by: Timo K <timok@element.io>
Co-authored-by: Timo K <timok@element.io>
Co-authored-by: Robin <robin@robin.town>
2022-10-17 21:36:17 +02:00
Michael Telatynski
13db1b17be Prevent useContextMenu isOpen from being true if the button ref goes away (#9418) 2022-10-17 17:42:04 +01:00
Andy Balaam
e38c9e036c Automatically focus the WYSIWYG composer when you enter a room (#9412)
Automatically focus the WYSIWYG composer when you enter a room
2022-10-17 11:48:47 +00:00
Florian Duros
4ba3f99489 Add reply support to WysiwygComposer 2022-10-14 15:52:05 +02:00
Michael Telatynski
ba5bd74ac8 Inhibit clicking on sender avatar in threads list (#9417) 2022-10-14 12:48:17 +01:00
Florian Duros
c0bf45fddc Rename wysiwyg prop into composer 2022-10-14 10:56:34 +02:00
Florian Duros
6b6af28ea9 Use MouseEventHandler as type 2022-10-14 10:28:04 +02:00
Florian Duros
0f2652c866 Change icon 2022-10-13 17:50:46 +02:00
Florian Duros
ac8397aa0f Fix test 2022-10-13 16:46:47 +02:00
Florian Duros
f85f53248b Merge remote-tracking branch 'origin/develop' into feat/add-formating-buttons-to-wysiwyg 2022-10-13 12:42:21 +02:00
Florian Duros
01858354f8 Add formatting buttons for WysisygComposer 2022-10-13 12:20:31 +02:00
Michael Telatynski
8b54be6f48 Move from browser-request to fetch (#9345) 2022-10-12 18:59:07 +01:00
Florian Duros
0dd9aba47f Fix aria-disabled 2022-10-11 10:10:15 +02:00
Florian Duros
70f57797f5 Add more todo in message.ts 2022-10-10 17:38:41 +02:00
Florian Duros
5bdac78fc7 Merge remote-tracking branch 'origin/develop' into feat/matrix-wysisyg-integration 2022-10-10 17:04:27 +02:00
Florian Duros
101fd629df Add WysiwygComposer test 2022-10-10 16:50:36 +02:00
Florian Duros
200af78c2a Use published matrix-wysisyg 2022-10-10 14:28:30 +02:00
Florian Duros
3080d14c00 Remove unused localstorage hook 2022-10-10 11:17:39 +02:00
Florian Duros
667e8ef10f Add tests to message.ts 2022-10-10 11:16:42 +02:00
Šimon Brandner
5680d13acf Handle missing Element Call brand (#9376) 2022-10-07 21:55:48 +02:00
Šimon Brandner
26a74a193f Add Element Call room settings (#9347)
Co-authored-by: Robin <robin@robin.town>
2022-10-07 18:10:17 +00:00
Florian Duros
bcc53fc337 Add style for WysiwygComposer 2022-10-07 11:46:57 +02:00
Florian Duros
c7f912529d Move mxClient to object in sendMessage 2022-10-07 11:02:22 +02:00
Florian Duros
21677e67e8 Remove unused MatrixClient 2022-10-07 10:56:50 +02:00
Florian Duros
4938aa8f74 Remove unused code 2022-10-07 10:53:50 +02:00
Florian Duros
a50329fb97 Focus and clear content after sending a message 2022-10-07 10:52:19 +02:00
Robin
06dbea6255 New group call experience: Room header and PiP designs (#9351)
* Update our cancel icon

The cancel icon we're using in the app has drifted out of sync with the ones used in our designs. We also had two identical-looking icons, so this consolidates them into one.

I've simultaneously updated our chevron icons, since in the case of the 'jump to unread' timeline button, it became clear that the weight of the new close icon did not match the thinner chevron.

* Don't squish bottom/top-aligned tooltips near the edge of the screen

* Close the timeline panel when returning to the fullscreen timeline view

* Add layout switching capabilities to ElementCall

* Bring the room header in line with the group call designs

* Bring the PiP header in line with the group call designs

* Fix lints

* Clarify tooltip CSS calculations

* Test PipView

* Expand RoomHeader test coverage

* Test PipView more
2022-10-07 02:27:28 +00:00
Šimon Brandner
6356a8c056 Add notifications and toasts for Element Call calls (#9337) 2022-10-06 14:27:12 +00:00
Oliver Sand
191b0a1517 Fix applying programmatically set height for "top" room layout (#9339)
* Fix applying programmatically set height for "top" room layout

When applying a room layout automatically (e.g. via `io.element.widgets.layout` state event), in cases the layout mode container it set to "top", the height was previously not correctly updated.

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>

* Add cypress tests

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
2022-10-05 14:58:27 -06:00
Florian Duros
1d820cf837 Remove console, unused variables... 2022-10-05 14:59:02 +02:00
Florian Duros
bfb1638ff3 Add wysisyg composer (can only send message, enable behind a labs flag) 2022-10-05 12:01:41 +02:00
Robin
ff59f68a9f New group call experience: Call tiles (#9332)
* Add call tiles

* Factor CallDuration out into a reusable component

* Correct the separator character in LiveContentSummary
2022-09-30 19:26:08 +00:00
Michael Weimann
7a33818bd7 Extract createVoiceMessageContent (#9322) 2022-09-29 13:06:49 -06:00
owi92
3c5ff30177 Fix quote shortcut for most keyboard layouts (#9298) 2022-09-29 15:51:50 +00:00
RiotRobot
d3029b5967 Merge branch 'master' into develop
# Conflicts:
#	package.json
#	yarn.lock
2022-09-28 14:13:01 +01:00
RiotRobot
66b21e96ca Resolve multiple CVEs
CVE-2022-39249
CVE-2022-39250
CVE-2022-39251
CVE-2022-39236
2022-09-28 13:57:36 +01:00
Michael Weimann
d775e403c4 Add voice broadcast recording stores (#9319)
* Add voice broadcast recording stores

* Refactor startNewVoiceBroadcastRecording
2022-09-28 10:22:50 +02:00
Michael Weimann
8e719d57a2 Add voice broadcast recording body (#9316)
* Add voice broadcast recording body

* Change icon element; update css variables

* Update Icon-test snapshots
2022-09-26 15:29:38 +02:00
Robin
d077ea1990 New group call experience: Room header call buttons (#9311)
* Make useEventEmitterState more efficient

By not invoking the initializing function on every render

* Make useWidgets more efficient

By not calling WidgetStore on every render

* Add new group call experience Labs flag

* Add viewingCall field to RoomViewStore state

Currently has no effect, but in the future this will signal to RoomView to show the call or call lobby.

* Add element_call.use_exclusively config flag

As documented in element-web, this will tell the app to use Element Call exclusively for calls, disabling Jitsi and legacy 1:1 calls.

* Make placeCall return a promise

So that the UI can know when placeCall completes

* Update start call buttons to new group call designs

Since RoomView doesn't do anything with viewingCall yet, these buttons won't have any effect when starting native group calls, but the logic is at least all there and ready to be hooked up.

* Allow calls to be detected if the new group call experience is enabled

* Test the RoomHeader changes

* Iterate code
2022-09-25 10:57:25 -04:00
Michael Weimann
c182c1c706 Generalise VoiceRecording (#9304) 2022-09-21 18:46:28 +02:00