Commit graph

1322 commits

Author SHA1 Message Date
Šimon Brandner
7e425ce939
Empty object if nothing saved
This isn't nice but I'll rework this soon anyway

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-26 08:18:49 +01:00
Šimon Brandner
efb8c89433
Don't save if isSpaceRoom()
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-26 08:18:42 +01:00
Šimon Brandner
c26da1bce6
Use this.activeSpace
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-26 07:58:09 +01:00
Šimon Brandner
e39f7caf59
Don't export as we don't need to
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-26 07:55:52 +01:00
Šimon Brandner
2dcb60b489
Move persisting of last viewed into SpaceStore
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-26 07:54:27 +01:00
Šimon Brandner
67dcb3a448
If no roomId was saved go to space home
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-25 20:51:21 +01:00
Šimon Brandner
ef3d87f8e8
First implementation of context switching
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-03-25 20:44:15 +01:00
Michael Telatynski
1b22cc8f6d delint 2021-03-25 17:41:26 +00:00
Michael Telatynski
a2fe964a31 Fix case where room list did not show DM when user joined space after filtering 2021-03-25 17:37:39 +00:00
Michael Telatynski
a61f4c1811 Auto-select space if joined whilst being viewed 2021-03-24 20:01:21 +00:00
Michael Telatynski
56dbd5f628 Remove unused autoJoin prop and move viaServers logic into RVS
this fixes the issue where autoJoining ignored viaServers
2021-03-24 16:45:53 +00:00
Michael Telatynski
d873791369 update comments 2021-03-24 14:01:24 +00:00
Michael Telatynski
796bfd851d Fix left spaces not disappearing from the space panel 2021-03-22 17:47:48 +00:00
Michael Telatynski
128c7db28e
Merge pull request #5777 from matrix-org/t3chguy/spaces4.9
Spaces improve creation journeys
2021-03-22 13:24:10 +00:00
David Baker
8a765cf67a
Merge pull request #5770 from matrix-org/dbkr/jitsi_display_name
Fix username showing instead of display name in Jitsi widgets
2021-03-19 13:41:35 +00:00
Michael Telatynski
2b4c670b89 Fix favourites not showing up in home until a refresh 2021-03-19 13:20:30 +00:00
Michael Telatynski
c6f6d24b32 Iterate space creation and previews 2021-03-19 13:20:30 +00:00
David Baker
4a734ef70b Clear displayname / vatar if they're unset 2021-03-19 11:29:14 +00:00
Travis Ralston
1d43c8b791 Remove forgotten rooms from the room list once forgotten
Fixes https://github.com/vector-im/element-web/issues/15559

This isn't exactly perfect as an implementation: if the user refreshes immediately after forgetting then there is a good chance the room re-appears because of the sync accumulator. At the very least this change makes it so in *most* cases the room goes away, which is probably good enough until https://github.com/vector-im/element-web/issues/14038 can be implemented properly.
2021-03-18 23:28:59 -06:00
David Baker
2b608aa919
Remove blank line 2021-03-17 19:18:32 +00:00
David Baker
d95955d90b
Merge branch 'develop' into dbkr/jitsi_display_name 2021-03-17 19:17:52 +00:00
David Baker
f6a87386bc Fix username showing instead of display name in Jitsi widgets
If you opened element and entered a jitsi conference straight away
in the room you landed in, your jitsi display name would be your
matrix username rather than your display name. This was because
OwnProfileStore was still busy fetching your profile from the server
while the room, and therefore jitsi widget, was rendered.

Blocking these widgets loading on this profile fetch completing isn't
really an option, so store the profile data in localstorage and seed
OwnProfileStore with the values from there.

Bonus: the name in the top left will now be your display name as
soon as the app is loaded, rather than being your username for the
first several seconds after you load the app.

Fixes https://github.com/vector-im/element-web/issues/16577
2021-03-17 19:09:43 +00:00
Travis Ralston
a9a4bd50ca Merge branch 'develop' into travis/media-customization 2021-03-11 08:37:49 -07:00
J. Ryan Stinnett
6a939c4de8
Merge pull request #5727 from matrix-org/matthew/rework-cross-signing-login
Rework cross-signing login flow
2021-03-11 12:53:55 +00:00
Travis Ralston
1ac12479ca Convert cases of mxcUrlToHttp to new media customisation 2021-03-10 12:32:18 -07:00
J. Ryan Stinnett
0583ea6a25 Ignore to-device decryption in the room list store
This avoids meaningless warnings about "unknown" rooms.
2021-03-10 12:11:48 +00:00
Michael Telatynski
98338f1505
Merge pull request #5736 from matrix-org/t3chguy/spaces4.5
Spaces suggested rooms support
2021-03-10 10:56:17 +00:00
Michael Telatynski
e6370a970b Tweak call handler stuff to not explode the room list on unsupported servers 2021-03-09 14:03:58 +00:00
Michael Telatynski
1cfeb36927 Update suggested room on join 2021-03-09 13:41:37 +00:00
Matthew Hodgson
41c87c7570 remove obsolete comment 2021-03-09 13:35:45 +00:00
Matthew Hodgson
d388f877b4 add PHASE_LOADING to SetupEncryptionStore to avoid flashing cross-signing setup 2021-03-08 23:28:44 +00:00
Matthew Hodgson
9d99b2f239 remove errand whitespace 2021-03-08 17:59:10 +00:00
Michael Telatynski
6a5efad142 Show suggested rooms from the selected space 2021-03-08 15:52:21 +00:00
David Baker
d71999114b
Merge pull request #5707 from matrix-org/dbkr/audiostream
Option for audio streaming
2021-03-08 11:50:45 +00:00
Matthew Hodgson
997d6e1281 lint 2021-03-08 05:08:01 +00:00
Matthew Hodgson
c02d03cc5b Merge branch 'develop' of git+ssh://github.com/matrix-org/matrix-react-sdk into develop 2021-03-08 04:57:10 +00:00
Matthew Hodgson
d477f964d2 only prompt to verify if we have an MSK or we have devices to verify against 2021-03-08 04:49:59 +00:00
Michael Telatynski
ab4220b20d Defer auto-joining within spaces and switch to using suggested 2021-03-04 13:04:58 +00:00
Michael Telatynski
d1a75885a7 Protect onAction dispatch handler on the SpaceStore with Spaces disabled 2021-03-02 15:35:02 +00:00
David Baker
20e57d15fd Option for audio streaming 2021-03-02 15:20:54 +00:00
Michael Telatynski
c10512fd56 Initial SpaceRoomView work 2021-03-01 18:53:11 +00:00
Michael Telatynski
bfe3d648e2
Update src/stores/room-list/algorithms/Algorithm.ts
Co-authored-by: Travis Ralston <travpc@gmail.com>
2021-02-26 22:08:36 +00:00
Michael Telatynski
f21aedc6cf Add Space Panel with Room List filtering 2021-02-26 10:41:26 +00:00
Michael Telatynski
7030c636f0 Initial Space Store for keeping track of space hierarchies from sync 2021-02-25 16:36:35 +00:00
Michael Telatynski
79daf615e4 First special treatment of space-rooms 2021-02-19 14:20:57 +00:00
Michael Telatynski
6b3f05a3cd Switch RoomListStore to only including the filtered subset
Without this it'd include notification counts from Community B when Community A is selected and such.
2021-02-19 14:10:36 +00:00
Michael Telatynski
63d95706e9 Create setHasDiff helper and use it
The usage here is identical to how it'll work in Spaces
2021-02-19 12:58:23 +00:00
Michael Telatynski
8fc244452c Prevent error being thrown so that we can throw our own better one 2021-02-18 18:06:26 +00:00
Travis Ralston
64974eb3ee
Merge pull request #5661 from matrix-org/travis/clear-preview
Clear message previews when the maximum limit is reached for history
2021-02-18 07:31:54 -07:00
Travis Ralston
47d73bef57 Clear message previews when the maximum limit is reached for history 2021-02-17 22:36:26 -07:00
David Baker
6130bdf0d2 Use creation content to signal virtual-ness
This makes things a lot simpler.
2021-02-17 18:51:21 +00:00
David Baker
e787d11c73 Merge remote-tracking branch 'origin/develop' into dbkr/virtual_rooms_v2 2021-02-16 19:41:54 +00:00
David Baker
79455d99b4 Unused import 2021-02-15 19:38:17 +00:00
David Baker
89b2dae035 Send onNewInvitedRoom via VisibilityProvider 2021-02-15 18:13:13 +00:00
David Baker
196507a730 VoIP virtual rooms, mk II
Does a thirdparty protocol lookup to the homeserver to get the
corresponding native/virtual user for a matrix ID. Stores the
mappings in room account data. Involves some slightly nasty workarounds
for that fact that room account data has no local echo.
2021-02-12 20:55:54 +00:00
Jason Robinson
6ccce7142c Merge branch 'develop' into jaywink/hosting-provider-iframe-minimize-wip 2021-02-03 22:35:22 +02:00
J. Ryan Stinnett
e4629878bc Lock widget room ID when added
This changes the widget room ID available to widget URL templates so that it's
locked to the room the widget was added in.

Fixes https://github.com/vector-im/element-web/issues/16337
2021-02-02 14:36:44 +00:00
J. Ryan Stinnett
2c313e0c5e Add managed hybrid call widgets when supported
If your homeserver is configured with an experiment `widget_build_url`, this
will take over the functionality of the call buttons and turn them into a
general widget installer.
2021-01-29 14:45:25 +00:00
Travis Ralston
d6dbe5596a
Merge pull request #5581 from matrix-org/travis/widgets/sticker-picker
Allow stickerpickers the legacy "visibility" capability
2021-01-28 07:46:17 -07:00
Travis Ralston
61f6fa0633
Merge pull request #5582 from matrix-org/travis/widgets/fix-jitsi-unpin
Remove check that prevents Jitsi widgets from being unpinned
2021-01-27 14:59:34 -07:00
Travis Ralston
c1b33d3e2c Fix Jitsi widgets causing localized tile crashes
Seems to be that as part of the layout work the timing sequence for when `.getRoom().widgets` will work changed. We can get around this with `initIfNeeded` which will no-op in the worst case.

This also includes a copy change to make ended conferences stop lying about where to find the widget. This is work towards https://github.com/vector-im/element-web/issues/15739
2021-01-27 14:40:04 -07:00
Travis Ralston
08b067fd68 Remove check that prevents Jitsi widgets from being unpinned
Later in the code we do a conditional on the widget type to auto-pin the widget, so we don't need this one to force the widget higher.

Fixes https://github.com/vector-im/element-web/issues/16280
2021-01-27 14:31:48 -07:00
Travis Ralston
edb363b751 Allow stickerpickers the legacy "visibility" capability
Fixes https://github.com/vector-im/element-web/issues/16237
2021-01-27 14:22:55 -07:00
J. Ryan Stinnett
84b1f2e6c6 Resolve typing errors after TypeScript upgrade 2021-01-27 12:42:37 +00:00
Travis Ralston
d3281db2bf Update widgets in the room upon join 2021-01-22 17:49:18 -07:00
David Baker
f703383ab6
Merge pull request #5560 from matrix-org/dbkr/voip_user_mapper
Add VoIP user mapper
2021-01-22 14:12:08 +00:00
Travis Ralston
f023fc50e2
Update src/stores/widgets/WidgetLayoutStore.ts
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2021-01-21 13:22:44 -07:00
David Baker
0a90c982c7 Add VoIP user mapper
The accompanying element-web PR with the config documentation should
explain what this is & why. Internally, this breaks the assumption
that call.roomId is the room that the call appears in for the user.
call.roomId may now be a 'virtual' room while the react SDK actually
displays it in a different room. React SDK always stores the calls
under the user-facing rooms, and provides a function to get the
user-facing room for a given call.
2021-01-21 19:20:35 +00:00
Travis Ralston
29780d902c Try to reduce WidgetStore causing downstream problems 2021-01-20 14:44:30 -07:00
Travis Ralston
f8fe454c59 Replace looping resizer with actual math 2021-01-20 14:42:24 -07:00
Travis Ralston
ab51404421 Appease the tests? 2021-01-18 21:07:44 -07:00
Travis Ralston
6d770cb4d1 Appease the linter 2 2021-01-18 21:00:47 -07:00
Travis Ralston
6227d3c183 Appease the linters 2021-01-18 20:53:15 -07:00
Travis Ralston
04d1f5dd28 Implement a "Copy my layout to the room" button 2021-01-18 20:42:21 -07:00
Travis Ralston
5c393cc2d0 Add in some local echo support to make changes appear faster 2021-01-18 20:29:51 -07:00
Travis Ralston
7ff76b2500 Don't forget to run cleanup 2021-01-18 20:28:09 -07:00
Travis Ralston
1768d6ea5f Move all widget pinning logic to the WidgetLayoutStore 2021-01-18 20:26:47 -07:00
Travis Ralston
0d29d15a46 Support room-defined height as well
Much like widget widths, it is acceptable for us to forget what everyone's height was previously at.
2021-01-18 19:27:11 -07:00
Travis Ralston
cfb583d193 Calculate widget widths in the WidgetLayoutStore
Note that this ditches all previously set width values, however this is probably acceptable for now. Trying to remain backwards compatible gets tricky on top of already tricky code, and the impact of Element forgetting widths is not as severe as forgetting which widgets were/are pinned.
2021-01-18 18:50:36 -07:00
Travis Ralston
0001e1e684 Support initial ordering and calculation for widgets by layout 2021-01-18 17:41:42 -07:00
Travis Ralston
4ee29d4e63 Split out ready states of stores to its own store 2021-01-18 17:41:17 -07:00
Travis Ralston
83fb698bbc
Merge pull request #5527 from matrix-org/travis/widget-nav
Wire up MSC2931 widget navigation
2021-01-18 09:09:32 -07:00
J. Ryan Stinnett
8a341446aa Use room-specific listeners for community prototype
Similar to message previews, this changes another area to use room-specific
listeners for better performance and avoiding warnings.
2021-01-15 14:34:56 +00:00
J. Ryan Stinnett
729356394e Use room-specific listeners for message previews
This should be a bit faster (since we now only notify one tile instead of all
for each update). It also resolves the max listener warning.

Fixes https://github.com/vector-im/element-web/issues/15121
2021-01-15 14:21:21 +00:00
Jason Robinson
d6af5b3bbd WIP minimize 2021-01-14 12:20:42 +02:00
Jason Robinson
d4a58bdb2a WIP minimize 2021-01-14 11:53:20 +02:00
Travis Ralston
7e0cf5c783 Wire up MSC2931 widget navigation
Fixes https://github.com/vector-im/element-web/issues/16006
**Requires https://github.com/matrix-org/matrix-widget-api/pull/27**
2020-12-29 12:35:48 -07:00
Travis Ralston
b870de14ed
Merge pull request #5488 from matrix-org/travis/chat-effects-widgets
Run chat effects on events sent by widgets too
2020-12-11 21:52:24 -07:00
Travis Ralston
c80ccf6386 Remove unused import 2020-12-11 08:27:46 -07:00
Travis Ralston
b6123506d4 Run chat effects on events sent by widgets too 2020-12-10 21:00:37 -07:00
Travis Ralston
10930b8404 Fix being unable to pin widgets
Turns out that we were obliterating the entire store of widgets each time we loaded a widget, which is less than helpful. This commit fixes that.

This commit also improves the cleanup of the pinned event object to remove unpinned widgets, reducing accumulation over time.

Fixes https://github.com/vector-im/element-web/issues/15948
2020-12-10 20:57:20 -07:00
Travis Ralston
d38a6ad1be Add more widget sanity checking
This is for https://github.com/vector-im/element-web/issues/15705

https://github.com/matrix-org/matrix-react-sdk/pull/5459 was unable to track down all the instances of where the issue happens, so this commit tries to do a more complete job.

Specifically, this replaces the getRoomId() function given widgets cannot reliably be referenced by widget ID in this way, and the store has been updated to handle a more unique widget ID for the store (just in case).

Further sanity checking has also been added to ensure that we are at least returning a valid result.
2020-12-02 12:20:59 -07:00
Travis Ralston
5df6932051 Add various amounts of sanity checking for widget pinning
This should also help https://github.com/vector-im/element-web/issues/15705 by either implicitly fixing the problem, causing chaos as described in the issue, or by forcing a crash to identify the problem more easily.
2020-12-01 13:19:51 -07:00
Travis Ralston
bd1de8d45b Require a room ID for WidgetStore's pinned widget contracts
This should alleviate https://github.com/vector-im/element-web/issues/15705 from happening, though the cause is still unknown.

Requiring a room ID is safe for this because only room widgets can be pinned, and widget IDs are not globally unique which means from a logical standpoint the contract still makes sense here.
2020-12-01 13:05:48 -07:00
Travis Ralston
f4979065e4
Merge pull request #5445 from matrix-org/travis/hide-rooms
Make it possible in-code to hide rooms from the room list
2020-11-27 07:07:18 -07:00
Travis Ralston
c2c328e23c Appease the linter 2020-11-26 08:06:48 -07:00
Travis Ralston
b9c57f47b0 Remove example 2020-11-26 08:01:38 -07:00
Travis Ralston
24f3ecb69a
Merge branch 'develop' into travis/modal-widget-fixes 2020-11-26 08:00:02 -07:00
Travis Ralston
80b93e0843 Mute all updates from rooms that are invisible 2020-11-25 20:03:58 -07:00
Travis Ralston
b9af446c1b Make it possible in-code to hide rooms from the room list
Fixes https://github.com/vector-im/element-web/issues/15745

This was surprisingly easy given the number of errors I remember last time, but here it is. This also includes an over-engineered VisibilityProvider with the intention that it'll get used in the future for things like Spaces and other X as Rooms stuff.
2020-11-25 19:42:57 -07:00
Travis Ralston
c2cb791f7d Appease the linter 2020-11-25 18:58:30 -07:00
Travis Ralston
fc820c4b1a Construct modal widgets in the same way we do any other widget
Fixes https://github.com/vector-im/element-web/issues/15800
2020-11-25 18:51:27 -07:00
Travis Ralston
5da27aed94 Replace the concept of a Widget Security Key with an OIDC state
The security key naming/practice was misguided, so let's call it what it is (a settings key) and abstract away the complexity to a new store.

Fixes https://github.com/vector-im/element-web/issues/15820 while we're here.
2020-11-25 18:39:11 -07:00
Travis Ralston
c91dc55bc1 Make modal widgets static to avoid being destroyed
Fixes https://github.com/vector-im/element-web/issues/15818
2020-11-25 18:35:00 -07:00
Travis Ralston
3780afff7d Fix existing widgets not having approved capabilities for their function
Fixes https://github.com/vector-im/element-web/issues/15827

This also fixes sticker pickers.
2020-11-25 14:40:01 -07:00
Travis Ralston
1db130b8f0
Merge pull request #5440 from matrix-org/travis/openid2
Use the WidgetDriver to run OIDC requests
2020-11-24 09:44:27 -07:00
Travis Ralston
28c78509a1 Use the WidgetDriver to run OIDC requests
Fixes https://github.com/vector-im/element-web/issues/15775
2020-11-23 14:10:14 -07:00
Travis Ralston
da32d9decd Add a customisation point for widget permissions and fix amnesia issues
The "remember my selection" option wasn't working because the `missing` set still included the approved permission. Solution: remove it from `missing`.

The customisation point is to allow forks to change which widgets get which additional capabilities dependent on their own rules.
2020-11-23 11:59:38 -07:00
Travis Ralston
107fa98180 Support arbitrary widgets sticking to the screen + sending stickers
Following https://github.com/matrix-org/matrix-react-sdk/pull/5385, it is now possible for a widget to request these capabilities without being a video conference or sticker picker. This commit actually enables this support for those kinds of widgets.

This commit also fixes an issue in the URL templating where some variables might get set to 'undefined' - this appears to be a scoping issue, so StopGapWidget now stores the definition alongside the superclass. 

Fixes https://github.com/vector-im/element-web/issues/15001
2020-11-20 16:53:15 -07:00
Travis Ralston
dec47a260c Appease the linter 2020-11-19 12:12:00 -07:00
Travis Ralston
21663314ee Minor touchups to the dialog 2020-11-19 11:24:17 -07:00
Travis Ralston
55592d365c Merge branch 'develop' into travis/msc-send-widget-events 2020-11-18 15:57:53 -07:00
Travis Ralston
a212dab84c Developer design a permissions dialog 2020-11-17 20:38:59 -07:00
Travis Ralston
94550546eb Merge branch 'develop' into travis/msc-send-widget-events 2020-11-16 15:08:52 -07:00
Travis Ralston
33b7367d82 Fix room ID handling 2020-11-12 10:36:30 -07:00
Michael Telatynski
36ef9ec341 Update styling of the Analytics toast to try and decrease number of users blindly pressing No 2020-11-09 14:21:45 +00:00
Michael Telatynski
0da23e2cbd Fix copy for call hangup previews 2020-11-03 15:22:23 +00:00
Travis Ralston
fc90531c9f Appease the linter 2020-11-02 21:38:59 -07:00
Travis Ralston
f5cd079a16 Add support for sending/receiving events from widgets
Part of MSC2762: https://github.com/matrix-org/matrix-doc/pull/2762
Requires: https://github.com/matrix-org/matrix-widget-api/pull/9

This is the bare minimum required to send an event to a widget and receive events from widgets. Like the view_room action, this is controlled by a well-known permission key.

**Danger**: This allows widgets to potentially modify room state. Use the permissions with care.
2020-11-02 21:32:49 -07:00
Travis Ralston
e15041bd53 Add a custom widget API action for viewing a different room 2020-11-02 15:21:18 -07:00
Michael Telatynski
997679e648 Fix Widget OpenID Permissions for realsies 2020-10-30 22:12:46 +00:00
Michael Telatynski
bf124c4379 Fix regression with OpenID permissions on widgets 2020-10-30 21:13:01 +00:00
Michael Telatynski
c3a355097d Initial Countly work 2020-10-29 15:57:16 +00:00
Michael Telatynski
17717e27c6 Fix theme variable passed to Jitsi 2020-10-27 11:26:16 +00:00
Michael Telatynski
0004dd4475 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/modal-widgets 2020-10-22 21:40:05 +01:00
Michael Telatynski
5f2058a6a0 Fix WidgetStore wrongly hanging onto old Widget definitions during removal
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-21 16:06:22 +01:00
Michael Telatynski
4e12aeca9e Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/room-list-widgets
 Conflicts:
	src/components/views/elements/AppTile.js
2020-10-21 12:48:51 +01:00
Michael Telatynski
2b9c2daaf4 Fix auto-pinned widget ordering
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-20 16:07:21 +01:00
Michael Telatynski
b0acae6e77 fix remaining type mismatches
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-19 21:13:31 +01:00
Michael Telatynski
5ee0262da2 Post-merge tidy up
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-19 20:56:41 +01:00
Michael Telatynski
bec1d718e0 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/room-list-widgets
 Conflicts:
	src/components/views/elements/AppTile.js
	src/utils/WidgetUtils.ts
2020-10-19 20:50:16 +01:00
Michael Telatynski
16362440b3 Iterate Modal Widgets
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-19 20:39:43 +01:00
Michael Telatynski
00b1a03a3e Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/modal-widgets
 Conflicts:
	src/@types/global.d.ts
	src/FromWidgetPostMessageApi.js
	src/WidgetMessaging.js
	src/widgets/WidgetApi.ts
2020-10-19 19:46:07 +01:00
Michael Telatynski
5fcdaf66cc Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets 2020-10-19 18:50:02 +01:00
J. Ryan Stinnett
7fe98b4e9d Adjust for new widget messaging APIs
As part of changing to the `events` package, the API surface changed slightly.

Related to https://github.com/vector-im/element-web/issues/15493
2020-10-19 16:42:20 +01:00
Michael Telatynski
744a4abd1c Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets 2020-10-19 13:08:17 +01:00
Michael Telatynski
81990d36b5 Fix Jitsi OpenIDC auth
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-19 10:49:07 +01:00
Michael Telatynski
f198b95579 Iterate PR; tidy and improve widget context menu
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-15 15:24:42 +01:00
Michael Telatynski
a6c81a903c Iterate with new buttons and resize locking
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-15 11:14:48 +01:00
Travis Ralston
edcdd950f7
Merge pull request #5323 from matrix-org/travis/jitsi-popout-fix
Don't supply popout widgets with widget parameters
2020-10-14 16:37:06 -06:00
Travis Ralston
3edb6b2234
Merge pull request #5309 from RinkiyaKeDad/fix-final-10
Renamed TagPanel and TagOrderStore
2020-10-14 16:33:31 -06:00
Travis Ralston
3a88b263c8 Don't supply popout widgets with widget parameters
Fixes https://github.com/vector-im/element-web/issues/15443
2020-10-14 13:54:27 -06:00
Travis Ralston
dccea97762 Fix/clarify boolean logic for reaction previews 2020-10-14 08:56:08 -06:00
Arsh Sharma
49d99c6dc7 Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into fix-final-10 2020-10-14 16:58:05 +05:30
Arsh Sharma
f705796477 fixing errors 2020-10-14 16:04:41 +05:30
Michael Telatynski
d36fafd0c6 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets
 Conflicts:
	res/css/views/rooms/_AppsDrawer.scss
	src/components/views/elements/AppTile.js
	src/components/views/rooms/AppsDrawer.js
2020-10-14 10:23:44 +01:00
Travis Ralston
f9ac390842 Appease the linter 2020-10-13 14:56:27 -06:00
Travis Ralston
294c35347c Ensure widgets are destroyed cleanly when minimized
Fixes https://github.com/vector-im/element-web/issues/15444 (an artifact of joining a call then minimizing the widget)

Also fixes other issues relating to widgets not loading when being minimized/maximized.
2020-10-13 14:55:44 -06:00
Travis Ralston
40038a6100 Run templating on the popout URL too
Fixes https://github.com/vector-im/element-web/issues/15443
2020-10-13 14:54:02 -06:00
Michael Telatynski
758a4b79ce stash
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-13 16:18:02 +01:00
Michael Telatynski
a1d25efceb Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets
 Conflicts:
	src/components/structures/RoomView.tsx
2020-10-13 13:45:22 +01:00
Michael Telatynski
7be5ff0fe6 First cut of app drawer tiled resizing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-13 12:29:12 +01:00
Michael Telatynski
37558f1f0d Improve the context menu
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-12 09:51:49 +01:00
RinkiyaKeDad
f5a40eff4b updated TagFilterStore 2020-10-10 18:02:58 +05:30
RinkiyaKeDad
4f8b0afc41 updated TagPanel 2020-10-10 18:00:06 +05:30
Travis Ralston
1af8d96db9 Fix templating for v1 jitsi widgets
Fixes https://github.com/vector-im/element-web/issues/15427
2020-10-09 09:26:52 -06:00
Michael Telatynski
317dc68135 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets
 Conflicts:
	src/components/views/elements/AppTile.js
2020-10-09 08:45:11 +01:00
Travis Ralston
d38b544a42 Use new preparing event for widget communications
Fixes https://github.com/vector-im/element-web/issues/15404

We need to make sure we don't accidentally call the widget before its ready, but we can happily show it once it is loaded/prepared.
2020-10-08 15:35:22 -06:00
Michael Telatynski
b8080a7d2d Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets 2020-10-08 13:04:59 +01:00
J. Ryan Stinnett
779e43b8dd
Merge pull request #5296 from matrix-org/jryans/sso-4s-integration
Convert auth lifecycle to TS, remove dead ILAG code
2020-10-07 15:42:42 +01:00
J. Ryan Stinnett
f2b72efe39 Remove various remaining bits of ILAG flows
TypeScript helpfully pointed me towards this dead code, which has been floating
around unused for a while. If we want to bring back ILAG in the future, we can
always revive it from history.
2020-10-07 12:53:59 +01:00
Michael Telatynski
67193b0ea7 Fix StopGapWidget infinitely recursing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-07 10:39:52 +01:00
Michael Telatynski
c784039cf6 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/widgets
 Conflicts:
	src/components/views/right_panel/WidgetCard.tsx
	src/stores/WidgetStore.ts
2020-10-07 10:04:45 +01:00
Michael Telatynski
17a04f2915 Fix naive pinning limit and app tile widgetMessaging NPE
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-06 10:48:55 +01:00
Michael Telatynski
1e34365caa
Merge pull request #5268 from matrix-org/t3chguy/fix/15349
Fix right panel for peeking rooms
2020-10-06 00:32:05 +01:00
Travis Ralston
0570deffa2 Fix iterableUnion types 2020-10-01 10:01:13 -06:00
Michael Telatynski
a9cee7cf70 Fix right panel for peeking rooms
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-10-01 12:30:41 +01:00
Travis Ralston
2ec94e8a69 Appease the linter 2020-09-30 20:49:31 -06:00
Travis Ralston
f27071ee64 Transition all remaining messaging over (delete the old stuff) 2020-09-30 20:20:31 -06:00
Travis Ralston
b46f58274e Fix the hangup button and other custom actions 2020-09-30 20:09:23 -06:00
Travis Ralston
b710d42832 Fix stickerpicker to use new messaging 2020-09-30 16:12:00 -06:00
Michael Telatynski
edfef2df0b Increase max pinned widgets to 3
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-30 17:09:45 +01:00
Travis Ralston
9190c921d2 Clean up failed experiment 2020-09-29 15:35:04 -06:00
Travis Ralston
ca76ba5cf1 Fix widget persistence 2020-09-29 15:09:52 -06:00
Travis Ralston
cd93b2c22a First rough cut of cutting AppTile over to the ClientWidgetApi 2020-09-29 14:14:51 -06:00
Travis Ralston
14766e24b8 Merge branch 'develop' into travis/widget-api 2020-09-29 13:18:18 -06:00
Travis Ralston
5534206e77
Merge pull request #5223 from matrix-org/travis/ft-sep1620/04-jitsi-hangup
Make the hangup button do things for conference calls
2020-09-29 11:06:21 -06:00
Travis Ralston
9df175212e Merge branch 'develop' into travis/ft-sep1620/04-jitsi-hangup 2020-09-28 13:43:47 -06:00
Travis Ralston
42955856d5 Merge branch 'develop' into travis/ft-sep1620/03-jitsi-obvious 2020-09-28 13:41:48 -06:00
Travis Ralston
4ea3376abf WIP on AppTile2 transformation 2020-09-28 13:34:13 -06:00
Travis Ralston
96fa34eecf Add stop functions 2020-09-26 18:40:26 -06:00
Travis Ralston
634ffb0140 Add structure for widget messaging layer 2020-09-25 09:39:21 -06:00
Michael Telatynski
e3b0bf1915 Fix url encoding issue for modal widgets widgetId
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-25 15:03:54 +01:00
Michael Telatynski
fbbba75f81 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/feat/modal-widgets 2020-09-25 14:31:44 +01:00
Michael Telatynski
44bc8fc67e Initial Modal Widget work tweaks MSC2790
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-25 14:08:27 +01:00
Michael Telatynski
2e6bad8b07 Convert WidgetUtils to TS and improve typing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-09-23 11:01:19 +01:00
Travis Ralston
342f1d5b43 Extremely bad support for "temporary widgets" 2020-09-21 14:36:24 -06:00
Travis Ralston
26b18811ce Add some permission checks to the communities v2 prototype
Prototype behaviour:
* If you can't create a room in the community, say so.
  * The UX for this could probably be improved, but for now the intention is to not break muscle memory by hiding the create room option.
* If you can't change settings in the community, or can't invite people, don't show those respective options.
  * Breaking muscle memory here is moderately okay.
2020-09-18 16:04:19 -06:00
Michael Telatynski
1ca20dffc8
Merge pull request #5204 from matrix-org/t3chguy/fix/15164
Retry joinRoom up to 5 times in the case of a 504 GATEWAY TIMEOUT
2020-09-17 13:34:07 +01:00
Travis Ralston
e849cd8fe5 Null-check the widget before continuing
Deleted widgets should return isPinned=false
2020-09-16 22:51:39 -06:00
Travis Ralston
1ffc6d5bd3 Make the hangup button do things for conference calls
Behaviour constraints:
* If you're not in the conference, use a grey button that does nothing.
* If you're in the conference, show a button:
  * If you're able to modify widgets in the room, annotate it in the context of ending the call for everyone and remove the widget. Use a confirmation dialog.
  * If you're not able to modify widgets in the room, hang up.

For this we know that persistent Jitsi widgets will mean that the user is in the call, so we use that to determine if they are actually participating.
2020-09-16 14:35:55 -06:00
Travis Ralston
61e8d3e3d7 Merge branch 'develop' into travis/3pid-invites 2020-09-14 11:50:08 -06:00
Michael Telatynski
229967aa33 Retry joinRoom up to 5 times in the case of a 504 GATEWAY TIMEOUT 2020-09-14 15:16:29 +01:00
Michael Telatynski
73608c4aa9 Don't count widgets which no longer exist towards pinned count 2020-09-14 14:03:51 +01:00
Travis Ralston
fc2173a789 Appease the linter
It's almost like I copy/pasted some stuff
2020-09-11 21:05:54 -06:00
Travis Ralston
803badba1b Show the user's 3PID invite after they've reloaded the page
This is a step towards https://github.com/vector-im/element-web/issues/13430

Since we've stored the invite, we can send the user to it once they reload the page or revisit Element. We currently only support one invite at a time, but this should be fine for most cases. 

We only do this restoration if the next screen isn't set to avoid breaking the user out of an expected flow.

As an added touch, this also ensures that the email address is pre-filled on the registration page if needed, just in case the user refreshes before getting to the submit button.
2020-09-11 20:20:33 -06:00
Travis Ralston
dc44b9ef59 Store and thread 3pid invite through the app
This doesn't do anything with the stored value (yet), but enables us to do something with it in a future commit.
2020-09-11 19:49:48 -06:00
Michael Telatynski
04d2f93902 Fix WidgetStore handler bindings 2020-09-09 13:15:19 +01:00
Michael Telatynski
a17b2ba1e5 use constant 2020-09-08 17:38:13 +01:00
Michael Telatynski
1532048f33 Fix behaviour WidgetStore for new/unknown rooms 2020-09-08 16:49:50 +01:00
Michael Telatynski
8d14d26e2b do the todos 2020-09-08 16:27:09 +01:00
Michael Telatynski
ef0843d4ad Iterate to match design 2020-09-08 15:43:40 +01:00
Michael Telatynski
98b59fb217 Consolidate all the work thus far 2020-09-08 15:43:38 +01:00
Michael Telatynski
31cca5e0f2 Create new right panel cards 2020-09-08 15:42:31 +01:00
Michael Telatynski
eb7f6f4c4b Create new WidgetStore to track all widgets stuff 2020-09-08 15:42:31 +01:00
Michael Telatynski
8f94a42daf Update Right Panel phase recall behaviour 2020-09-08 15:42:31 +01:00
Michael Telatynski
b75e2aa299 WidgetEchoStore improve update event to include roomId and widgetId 2020-09-08 11:01:55 +01:00
J. Ryan Stinnett
7b1031d6a6
Merge pull request #5169 from matrix-org/jryans/defer-cross-signing-setup
Prep work for Settings changes with cross-signing deferral
2020-09-04 12:51:25 +01:00
Michael Telatynski
368571bcff Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into t3chguy/dpsah/6785.2 2020-09-03 16:07:37 +01:00
Michael Telatynski
8b4250c142 expose RightPanelStore in window 2020-09-03 15:04:49 +01:00
J. Ryan Stinnett
fb2bde94fa Rename CrossSigningManager to SecurityManager
The file encompasses bits of cross-signing and also secret storage / secure
backup.
2020-09-03 14:50:49 +01:00
Travis Ralston
6d62d85ad2 Merge branch 'develop' into travis/communities/proto/userinfo 2020-09-02 10:33:52 -06:00
J. Ryan Stinnett
dd87e9a2f1 During verification, only check user trust status
As part of new device verification, we were waiting for "cross-signing ready"
which means _both_ the public keys are trusted by this device _and_ private keys
are available. There's no guarantee that the private keys will ever arrive, so
it's too strict to wait for this as a blocking flow. This relaxes things to wait
only for the current device to trust public keys.

Fixes https://github.com/vector-im/element-web/issues/14970
2020-09-02 14:13:36 +01:00
Travis Ralston
b4f62e9c88 use valid jsdoc 2020-08-31 11:07:29 -06:00
Travis Ralston
7f7414ed5a Appease the linter 2020-08-31 10:59:37 -06:00
Travis Ralston
fdbaddbace Add a simple edit dialog for communities 2020-08-31 10:52:08 -06:00
Travis Ralston
133f981fa8 Run the tag selection behaviour through the prototype store too 2020-08-31 10:22:29 -06:00
Travis Ralston
724e3f6905 Run all selected prototype community logic through one store 2020-08-31 10:19:05 -06:00
Travis Ralston
93d67a6689 Wire up members button to member view
Ideally this would open up the group members panel, but that's exceedingly difficult. Instead, we switch to the general chat and rename the button to be a bit more helpful.
2020-08-31 10:12:12 -06:00
Travis Ralston
281e2ab27b Null guard new function to reduce error spam 2020-08-28 20:13:26 -06:00
Travis Ralston
90d9d7128d Use FlairStore's cache for group naming
Turns out GroupStore doesn't really know much.
2020-08-28 14:56:59 -06:00
Travis Ralston
fd71bca7c0 Change menu label if in a community 2020-08-26 10:33:05 -06:00
Travis Ralston
b294ec6427
Merge pull request #5145 from matrix-org/travis/communities/proto/switcher
Communities v2 prototype: Tag panel selection changes
2020-08-26 10:22:50 -06:00
Travis Ralston
55001f3193 Select the general chat for a community when viewing it 2020-08-25 21:52:48 -06:00
Travis Ralston
2d4ac548d0 Override invite metadata if the server wants a group profile 2020-08-25 21:03:11 -06:00
Travis Ralston
ae04c5ce9d Appease the linter 2020-08-20 19:59:44 -06:00
Travis Ralston
beb5c2627c Disable CTRL+Click and SHIFT+Click actions on tag panel 2020-08-20 19:45:22 -06:00
Travis Ralston
96087d61f6 Convert feature setting usages to regular settings 2020-08-17 13:12:18 -06:00
Michael Telatynski
50b9da7597 Put message previews for Emoji behind Labs 2020-08-13 16:40:18 +01:00
J. Ryan Stinnett
7748e3ae1a
Merge pull request #5083 from matrix-org/jryans/riot-to-element
Replace Riot with Element in docs and comments
2020-08-05 12:25:45 +01:00
Michael Telatynski
9ce96bc28d delint 2020-08-04 21:35:42 +01:00
Michael Telatynski
80dff8706c Merge branch 'develop' of https://github.com/matrix-org/matrix-react-sdk into t3chguy/room-list/13981
 Conflicts:
	src/@types/global.d.ts
	src/stores/RoomViewStore.tsx
2020-08-04 21:33:27 +01:00
J. Ryan Stinnett
ce226ab534 Replace Riot with Element in docs and comments
This only covers the simple cases of references to issues and repos. More
complex areas, such as deployment scripts, will be handled separately.

Part of https://github.com/vector-im/element-web/issues/14864
2020-08-03 18:33:36 +01:00
Travis Ralston
7022d86a3c Handle tag changes in sticky room updates
Fixes https://github.com/vector-im/element-web/issues/14848

When we're filtering the sticky room will be excluded from the filtered set, and thus won't even appear in the `getOrderedRoomsWithoutSticky()` result. Further, we will likely have to update the position ourselves to ensure the sticky room can be placed appropriately in the list.
2020-07-31 16:26:03 -06:00
J. Ryan Stinnett
e9fcbfe3c8
Merge pull request #5075 from matrix-org/jryans/rm-tslint
Remove leftover bits of TSLint
2020-07-31 20:30:51 +01:00
Travis Ralston
e8d1024c45
Merge pull request #5076 from matrix-org/travis/cleanup/1
Clean up documentation of Whenable + fix other code concerns
2020-07-31 11:27:19 -06:00
Travis Ralston
3443761007
Merge pull request #5062 from matrix-org/travis/settings/ts
Convert SettingsStore to TypeScript
2020-07-31 11:07:07 -06:00
Travis Ralston
c888b1f401 It's a Context Transaction (ctxn) now 2020-07-31 10:00:53 -06:00
Travis Ralston
7645fe6b23 Update context transaction states 2020-07-31 10:00:02 -06:00
J. Ryan Stinnett
40cba3b3a7 Remove leftover bits of TSLint 2020-07-31 14:36:18 +01:00
J. Ryan Stinnett
af49639bd8
Merge pull request #5065 from matrix-org/travis/echo/audit
Add local echo for notifications in the new room list
2020-07-31 12:20:20 +01:00
Travis Ralston
49abfc1fb2 Ensure sublists are updated when rooms are removed from them
Fixes https://github.com/vector-im/riot-web/issues/14798 (part 2)

This is in two parts itself: The `RoomSublist` needs to break its references to the `RoomListStore`, so it now clones the room arrays. The `Algorithm` is the other part, which is slightly more complicated.

It turns out that we weren't handling splicing as a change in the `ImportanceAlgorithm`, therefore the `Algorithm` wasn't really feeling like it needed to change anything. Further, the `Algorithm` was using the wrong reference to where it should be dumping rooms (`this.cachedRooms` is a getter which returns a different object depending on conditions), so having fixed that we need to ensure that the filtered and sticky maps are also updated when we remove a room. Because we send the new tag through a Timeline update, we'll end up updating the tag later on and don't need to update the filter and sticky collections.
2020-07-30 15:06:04 -06:00
Travis Ralston
da05cac1b6 Listen for our own membership changes on notification states
Fixes https://github.com/vector-im/riot-web/issues/14798 (part 1)

When we transition from invite to not-invite we need to ensure we clear the invite notification state.
2020-07-30 14:33:38 -06:00
Travis Ralston
80d072171f Merge remote-tracking branch 'origin/develop' into travis/echo/audit 2020-07-30 13:12:20 -06:00
David Baker
aaf0c7d269 Put back code
with comment hopefully explaining why it's necessary
2020-07-30 19:46:27 +01:00
David Baker
9d247321f5 Fix crash on logging in again after soft logout
Fixes https://github.com/vector-im/riot-web/issues/14834
2020-07-30 18:52:47 +01:00
Travis Ralston
968fbd5cba Merge branch 'develop' into travis/echo/audit 2020-07-30 10:18:30 -06:00
Travis Ralston
fca6def588 Rename and document what local echo is 2020-07-30 09:15:19 -06:00
Travis Ralston
19fa08aafa Fix RightPanelStore imports 2020-07-30 08:53:54 -06:00
Travis Ralston
9bbb7a5310 Merge branch 'develop' into travis/settings/ts 2020-07-30 08:51:42 -06:00
Jorik Schellekens
b1f8fe40d6
Merge pull request #5036 from swapnilraj/swapnilraj/right-panel-ts
Convert right_panel to TS
2020-07-30 13:37:01 +01:00
Bruno Windels
bb685cd37a change message priority 2020-07-30 10:33:36 +02:00
Travis Ralston
e3765ea8c5 Appease the linters 2020-07-29 20:47:32 -06:00
Travis Ralston
c5574219bb Implement dialog for resending local echo transactions 2020-07-29 20:36:04 -06:00
Travis Ralston
14b0def143 Fix echo handling and show a barebones toast on error
The EchoTransaction was wrongly assuming that it knew better than the caller for when the success condition was met, so the echo marking has been left an exercise for the caller. In this case, we mark when we finally receive the sync with the updated rules.

We also have to cancel previous transactions otherwise if the user mashes buttons we could forever show the toast, and that would be bad.
2020-07-29 19:11:24 -06:00
Travis Ralston
8f1af4be14 Add local echo capabilities for rooms
The structure here might need some documentation and work, but overall the idea is that all calls pass through a CachedEcho instance, which are self-updating.
2020-07-29 16:53:26 -06:00
Travis Ralston
75f53e4118 Ensure AsyncStoreWithClient can start mid-lifecycle
In some cases we're likely to miss the PREPARED sync, so just handle ourselves as ready if we have a client set.
2020-07-29 16:52:20 -06:00
Travis Ralston
14757cacd5 Introduce a concept of "non-urgent" toasts
This is somewhat expected to be temporary.
2020-07-29 12:43:35 -06:00
Bruno Windels
d8baad31da provide nicer error for no known servers error when accepting an invite 2020-07-29 16:51:37 +02:00
Travis Ralston
1f7f40736b Fix imports for SettingLevel to point at new file 2020-07-28 11:53:43 -06:00
Travis Ralston
900c234434 Internalize notification state handling for lists
This reduces the update cost of rooms changing, and fixes a bug where when a sublist became filtered it would change the notification count of the sublist.

This does change the expected usage of the state store to ensuring that only one place updates the rooms on the list states, which is currently the room list store. Ideally the state store could listen to the room list store to update itself, however due to a complicated require() loop it is not possible.
2020-07-27 17:33:27 -06:00
Travis Ralston
b91026fa89 Ensure CustomRoomTagStore doesn't fire useless updates
This could in theory cause double rendering of the room list under some conditions.
2020-07-27 17:18:01 -06:00
Travis Ralston
a15aae4daf Apply a throttle to filter condition updates 2020-07-27 16:35:48 -06:00
Travis Ralston
42498d32cc Move community filtering into the sublist
This is a step towards the room list not having to concern itself with the search parameters.
2020-07-27 16:35:48 -06:00
Travis Ralston
fd15fc3984 Ensure message previews update when needed
In 9969b01c5f we stopped updating the sublist whenever we felt like it, which indirectly froze message previews for room tiles (badges, unread state, etc were unaffected because that is managed by a different store). To fix this, we simply have to listen for changes and perform an update.
2020-07-23 22:24:07 -06:00
Travis Ralston
c22cb6c325 Short-circuit room list store dispatch handling if not ready
We were taking 0.2ms to handle the registration of a timer per event during startup, even before the app is visible to the user. These timers would be short-circuited too, leading to a bunch of wasted time.

0.2ms isn't a lot of time, but multiplied by thousands of events at startup it's pretty significant.

On my account this reduces the full page spinner time from ~50 seconds to just over 20 seconds.
2020-07-22 13:35:41 -06:00
Travis Ralston
f27afc6ff8 Fix message previews not updating on their own 2020-07-22 12:43:10 -06:00
Travis Ralston
0ef6696c0a Don't re-freeze AsyncStore's state all the time 2020-07-22 10:52:45 -06:00
Travis Ralston
d593d24aea Switch to an internal Map for previews
This means we're abusing the AsyncStoreWithClient to get access to a lifecycle, but overall that seems like a minor crime compared to the time spend abusing the store's state as a map.

With thousands of rooms shown, we can save on average 743ms per preview. The new preview time is 0.12ms on average.
2020-07-22 10:50:54 -06:00
Travis Ralston
67fd6e6122
Merge pull request #5034 from matrix-org/travis/fix-perf
Mixed bag of performance improvements: ScrollPanel and notifications
2020-07-22 08:24:04 -06:00
Travis Ralston
61c5b4f9bf deunderscore 2020-07-22 08:23:47 -06:00
Swapnil Raj
2c8b5b49ed lint 2020-07-22 15:14:50 +05:30
Swapnil Raj
1d3635e1c8 Replaced string actions with their corresponding types 2020-07-22 15:14:50 +05:30
Swapnil Raj
344185a375 Translate right panel stuff to ts
Add actions for right panel
2020-07-22 15:14:50 +05:30
Michael Telatynski
6bb9be56cd
Merge pull request #5025 from matrix-org/t3chguy/room-list/14662
Update message previews
2020-07-22 10:03:30 +01:00
Travis Ralston
cd77434a69 Appease the linter 2020-07-21 20:59:33 -06:00
Travis Ralston
c9da1e1874 Remove even more tags from the notification state fetching for a room 2020-07-21 20:58:59 -06:00
Travis Ralston
dd16ec070c Replace countRoomsWithNotif with a dedicated NotificationState
Fixes https://github.com/vector-im/riot-web/issues/14694

Instead of spending 10-1000ms in a function iterating over a whole lot of room events, we can use our cached state from the Notification State Store. 

This commit sets up a structure that could be applied to communities in the TagPanel too, as that could probably use a similar optimization.

This reduces the updateStatusIndicator() time to just 4ms on average.
2020-07-21 20:24:44 -06:00
Travis Ralston
6a29cd33c1 Remove tag specificity from notification states
We don't need this complexity now that we aren't doing per-tag logic.
2020-07-21 19:59:17 -06:00
Travis Ralston
6a38833a2b Ensure incremental updates to the ImportanceAlgorithm trigger A-Z order
Fixes https://github.com/vector-im/riot-web/issues/14475

Background: Sticky rooms are actually a pair of lies to the underlying algorithm as a combination of REMOVE_ROOM/NEW_ROOM calls so they don't get considered as needing to be sorted. When a room is added under the importance algorithm, it is expected that the category it is being added to will be re-sorted to account for the change, however we weren't doing that since we optimized the NewRoom path to be a splice operation.
2020-07-21 14:12:58 -06:00
Michael Telatynski
95854a2f67 Merge branches 'develop' and 't3chguy/room-list/13981' of github.com:matrix-org/matrix-react-sdk into t3chguy/room-list/13981
 Conflicts:
	src/@types/global.d.ts
2020-07-21 17:56:30 +01:00
Jorik Schellekens
a06cc77411 Remove unused imports 2020-07-21 15:34:00 +01:00
Jorik Schellekens
501e0c29ca Merge remote-tracking branch 'origin' into joriks/eslint-config 2020-07-21 15:32:50 +01:00
Jorik Schellekens
be5db851ca Revert unsafe rename and use boolean coercion 2020-07-21 10:29:05 +01:00
Michael Telatynski
a69560d0de add comment
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-21 10:22:03 +01:00
Michael Telatynski
0db66313e2 Add more causes to blank out active room
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-21 10:20:30 +01:00
Michael Telatynski
9aff56afcc add more types
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-21 10:15:05 +01:00
Michael Telatynski
8cacf1ff97 Convert RoomViewStore and ActiveRoomObserver to typescript
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-21 10:14:12 +01:00
Michael Telatynski
193a0d89af Prefix message previews for emotes with a *
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-21 09:31:22 +01:00
Michael Telatynski
eb0e9ecab4 Remove message previews for state events
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-21 09:28:27 +01:00
Travis Ralston
a0b2859436 Support custom tags in the room list again
Fixes https://github.com/vector-im/riot-web/issues/14091

Design needs work, however this is behind labs anyways. This re-implements the behaviour of the old room list.

The implementation ended up being a lot easier due to early confusion with what the TagOrderStore and TagPanel take care of. Turns out they don't deal with tags, but groups. As such, we don't need to do anything with filtering (though we keep some sanity checks in place for safety), and just have to wire up the CustomRoomTagPanel and CustomRoomTagStore.
2020-07-20 16:51:16 -06:00
Jorik Schellekens
6433e163f7 Use variable name instead of _ 2020-07-20 20:55:35 +01:00
Jorik Schellekens
4ba1f91a2b Fix lint issues in new code 2020-07-20 20:43:55 +01:00
Jorik Schellekens
c3ffbdbdbc Fix naming format errors 2020-07-20 20:02:21 +01:00
Jorik Schellekens
b3fa855bd8 Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into joriks/eslint-config 2020-07-20 16:22:32 +01:00
Michael Telatynski
29defa3e57 Tag Watcher don't create new filter if not needed, confuses references
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-20 14:36:12 +01:00
Travis Ralston
2dfd636a9e Appease the linter 2020-07-17 16:28:49 -06:00
Travis Ralston
7fc5ba50c8 Update references to issues 2020-07-17 16:22:33 -06:00
Travis Ralston
a4f7f666cf Remove useless TagSpecificNotificationState
FTUE Notifications won't be needing this.
2020-07-17 16:20:19 -06:00
Travis Ralston
1cce6e2e32 Enable new room list store forever 2020-07-17 15:14:58 -06:00
Travis Ralston
2b15ba21dd Rename RoomListStore file 2020-07-17 15:11:34 -06:00
Travis Ralston
209a5d2220 Rename RoomListStore2 class name
We use `RoomListStore` as a singleton, and don't want the ugly `2` at the end of the actual store instance, so here we rename it to something half-decent.
2020-07-17 15:10:30 -06:00
Travis Ralston
1f9c07861e Remove the old room list store 2020-07-17 14:27:45 -06:00
Travis Ralston
62b58e18e9 Remove the temporary room list store proxy 2020-07-17 14:25:56 -06:00
Travis Ralston
1810711380 Dismantle usage of the proxy store class 2020-07-17 14:25:09 -06:00
Travis Ralston
06336a88b3 Remove setting for old room list 2020-07-17 14:06:30 -06:00
Travis Ralston
c29da883db Convert room list log setting to a real setting
To debug https://github.com/vector-im/riot-web/issues/14554 and https://github.com/vector-im/riot-web/issues/14508
2020-07-16 14:43:43 -06:00
Michael Telatynski
725fa7df9b
Merge pull request #4997 from matrix-org/t3chguy/fix/14526
Fix filtering by community not showing DM rooms with community members
2020-07-16 12:41:50 +01:00
Michael Telatynski
b1d57ca13e
Merge pull request #4996 from matrix-org/t3chguy/room-list/14491
Fix enter in new room list filter breaking things
2020-07-16 12:41:39 +01:00
Michael Telatynski
3498922882 Fix filtering by community not showing DM rooms with community members
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-16 09:13:23 +01:00
Michael Telatynski
2f959a974a Fix enter in new room list filter breaking things
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-16 06:31:06 +01:00
Michael Telatynski
0097ba24a4 When removing a filter condition, try recalculate in case it wasn't the last one
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-16 05:52:39 +01:00
Travis Ralston
945dab6b1f Revert "Turn previews on for DMs and ensure they get rendered"
This reverts commit b19ae3ac93.
2020-07-14 13:36:28 -06:00
Travis Ralston
f6b9d44e4b Invert logging 2020-07-14 13:18:06 -06:00
Travis Ralston
b19ae3ac93 Turn previews on for DMs and ensure they get rendered 2020-07-14 12:49:29 -06:00
Travis Ralston
d74e803fa9 Remove potential source of room duplication issues
This is an estimated fix as the problem cannot be easily identified. We don't appear to need these lines, unlike what the comment implies.
2020-07-14 12:40:48 -06:00
Travis Ralston
e955feb12d Revert "Merge pull request #4972 from matrix-org/travis/room-list/prelaunch/3-remove-debug"
This reverts commit e1b34acdc8.
2020-07-14 12:02:40 -06:00
Travis Ralston
e1b34acdc8
Merge pull request #4972 from matrix-org/travis/room-list/prelaunch/3-remove-debug
Remove debug logging from new room list
2020-07-14 09:56:17 -06:00
J. Ryan Stinnett
f16962bb41
Merge pull request #4970 from matrix-org/travis/room-list/prelaunch/1-cleanup
Clean up TODOs, comments, and imports in the new room list
2020-07-14 09:38:30 +01:00
Travis Ralston
6632db01cf Remove debug logging from new room list
Fixes https://github.com/vector-im/riot-web/issues/14408

Yes, all the issue references are wrong :(
2020-07-13 20:34:05 -06:00
Travis Ralston
4a8a59c578 Make EffectiveMembership utils generic
Fixes https://github.com/vector-im/riot-web/issues/14460

Just have to move them to utils.
2020-07-13 20:29:46 -06:00
Travis Ralston
bdb136e24e Clean up TODOs, comments, and imports in the new room list
Fixes https://github.com/vector-im/riot-web/issues/14412
2020-07-13 20:25:02 -06:00
Travis Ralston
80cf2839d9 Ensure breadcrumbs don't keep turning themselves back on
Fixes https://github.com/vector-im/riot-web/issues/14452
2020-07-13 18:46:17 -06:00
Travis Ralston
19500cf96a Allow the tests to force a MatrixClient 2020-07-13 13:24:02 -06:00
Travis Ralston
eb78b1b328 Export the matrix client from the store 2020-07-13 13:18:01 -06:00
Travis Ralston
a8829f09d0 Ensure RoomListStore2 gets reset when the client becomes invalidated
Fixes https://github.com/vector-im/riot-web/issues/14384

We also make use of the new AsyncStore type to handle this more safely.
2020-07-13 13:15:44 -06:00
Travis Ralston
1f57b85b30
Merge pull request #4962 from matrix-org/travis/room-list/leave-fix
Ensure tag changes (leaving rooms) causes rooms to move between lists
2020-07-13 12:44:23 -06:00
Travis Ralston
d2c7a55fa0 Ensure tag changes (leaving rooms) causes rooms to move between lists
Fixes https://github.com/vector-im/riot-web/issues/14442

Turns out that we are so good at moving a room that when it flows through as a TIMELINE update the algorithm no-ops and does nothing, so don't do that.
2020-07-13 12:00:56 -06:00
Travis Ralston
40ab3e23c6 Add a null guard on the client 2020-07-13 10:09:46 -06:00
Travis Ralston
9a3744ebb2 Fix default sorting mechanics for new room list
Fixes https://github.com/vector-im/riot-web/issues/14445
2020-07-13 09:54:15 -06:00
Travis Ralston
0908e813fb Merge branch 'develop' into travis/room-list/enable 2020-07-12 22:50:27 -06:00
Travis Ralston
1c52c2777e
Merge pull request #4949 from matrix-org/travis/room-list/mute-floats
Convert ImportanceAlgorithm over to using NotificationColor instead
2020-07-12 11:00:18 -06:00
Travis Ralston
31f1fbd962
Merge pull request #4951 from matrix-org/travis/room-list/fix-sublist-menu
Internalize algorithm updates in the new room list store
2020-07-11 12:15:53 -06:00
Travis Ralston
b924dcc6ad
Merge pull request #4950 from matrix-org/travis/room-list/cleanup-resizing
Remove now-dead code from sublist resizing
2020-07-11 12:11:51 -06:00
Travis Ralston
0e49c4343c Internalize algorithm updates in the new room list store
Fixes https://github.com/vector-im/riot-web/issues/14411

The act of setting/changing the algorithm was causing the update function to be marked, meaning we wouldn't trigger an update until something else happened later. To get around this, and still support internal functions spamming calls without multiple updates, we simply move the guts to an internalized function and make the public interface do a trigger.
2020-07-10 21:59:12 -06:00
Travis Ralston
c153232575 Merge branch 'develop' into travis/room-list/enable 2020-07-10 21:33:35 -06:00
Travis Ralston
cfc39dc4a9 Remove now-dead code from sublist resizing 2020-07-10 16:10:05 -06:00
Travis Ralston
3062d14a78 Convert ImportanceAlgorithm over to using NotificationColor instead
Fixes https://github.com/vector-im/riot-web/issues/14362 implicitly

By re-using constructs we already have, we don't need to invent code which figures it out.
2020-07-10 16:07:40 -06:00
Travis Ralston
87120c6c26 Ensure triggered updates get fired for filters in the new room list
Fixes https://github.com/vector-im/riot-web/issues/14404
2020-07-10 15:58:39 -06:00
Travis Ralston
bb6d46f926 When the algorithm changes, re-add the filter listener 2020-07-10 15:57:05 -06:00
Travis Ralston
bdb641279a Merge branch 'develop' into travis/room-list/enable 2020-07-10 11:11:25 -06:00
Travis Ralston
9e76a2cebf Handle off-cycle filtering updates in the new room list 2020-07-10 11:07:47 -06:00
Travis Ralston
477472c178 Merge branch 'develop' into travis/room-list/showmore2 2020-07-10 10:57:17 -06:00
Travis Ralston
314250a6e4 Add a test mode flag to the store 2020-07-10 10:38:07 -06:00
Travis Ralston
f8db0a4637 Resolve complex merge conflicts 2020-07-10 10:21:00 -06:00
Travis Ralston
bf0a503e44 [WITH CONFLICTS] Merge branch 'develop' into travis/room-list/enable 2020-07-10 10:18:12 -06:00
Travis Ralston
26427817f2 Fix potential listener conflict with RVS
If the RVS ever emits something that contains `trigger: false`, we're pretty screwed, so avoid that.
2020-07-10 08:18:40 -06:00
Travis Ralston
a5ba0cad1f Rename to trigger and add docs 2020-07-10 08:13:23 -06:00
Travis Ralston
ef18cd5ca1 Merge branch 'develop' into travis/room-list/perf/dedupe-recalc 2020-07-10 07:18:12 -06:00
Travis Ralston
75dbd5f1d4 Merge branch 'develop' into travis/room-list/enable 2020-07-09 22:28:16 -06:00
Travis Ralston
cf154ec9cf Add an option to disable room list logging, and improve logging
For https://github.com/vector-im/riot-web/issues/14035

**This option is not recommended as it completely obliterates all chances of being able to support someone with a broken room list. It is intended for specific testing scenarios only.**
2020-07-09 18:19:38 -06:00
Travis Ralston
8624e8beeb Break up the event loop tasks for the room list
The room list does a hefty amount of work, so instead of blocking the event loop with a `/sync` request and a bunch of room updates (as we can get multiple per sync) we can instead run it over several smaller tasks. The smaller tasks help the event loop do other things between our tasks, ensuring we don't inadvertently block the UI from rendering too slowly.

On my account and machine, this cuts the time to render in half (~30ms, down from ~60ms) .
2020-07-09 15:11:21 -06:00
Travis Ralston
1315f34662 Dedupe room list store updates by marking for updates
The core of this is in the MarkedExecution class, with the remainder of the commit ensuring that the right marks and triggers are in place to do the firing.

Because everything is async/await and run through the RoomListStore, we don't have to worry about self-fed updates in the algorithm classes. This also means we have to trigger pretty much all the time. 

Changes to tag ordering / list sorting get hit through two paths, so we mark before we do a bulk update and otherwise assume the call is coming in from outside.
2020-07-09 14:53:14 -06:00
Travis Ralston
859f65659c Attempt to support a hard cutoff with the show more button
Known issues:
* Causes scroll jumps when the button gets added to DOM
* Resize handle is invisible when there's a show more button

TODO:
* Clean up comments
* Clean up useless code (all the padding stuff isn't needed)
2020-07-09 13:07:13 -06:00
Bruno Windels
ce68314de9 Revert "Merge pull request #4932 from matrix-org/travis/room-list/invisible-show-more"
This reverts commit f58a0a7538.
2020-07-09 12:13:12 -06:00
Travis Ralston
f8e1996e2f Handle NewRoom and PossibleTagChange updates correctly
For new rooms, we need to append to our list of known rooms. For tag changes, we need to be sure to update our cache when the tag can reasonably be assumed to have changed.

Fixes https://github.com/vector-im/riot-web/issues/14389
2020-07-09 12:08:40 -06:00
Travis Ralston
00fc34924c Fix rooms disappearing that were created by the user
Fixes https://github.com/vector-im/riot-web/issues/14388

We were receiving a read receipt before a room object, leading to the algorithm to assume the room is archived (no membership), which was causing later index issues when the room tried to get moved from archived to untagged.

To prevent this, we just ignore nonsensical updates.
2020-07-09 11:39:40 -06:00
Travis Ralston
ae09bfb8fd Don't destroy room notification states when replacing them
The "should never happen" now happens a lot by design. We shouldn't destroy the state as it'll stop badge counts for everything.

Fixes https://github.com/vector-im/riot-web/issues/14391
2020-07-09 10:22:04 -06:00
Bruno Windels
f58a0a7538
Merge pull request #4932 from matrix-org/travis/room-list/invisible-show-more
Potential solution to supporting transparent 'show more' buttons
2020-07-09 14:43:20 +00:00
Travis Ralston
57b2ae9a0d Merge branch 'develop' into travis/room-list/perf/notifications 2020-07-09 07:46:01 -06:00
Travis Ralston
8aa2ed0c8b
Merge pull request #4934 from matrix-org/travis/room-list/perf/layout
Move list layout management to its own store
2020-07-09 07:44:44 -06:00
Jorik Schellekens
ecc109c45d
Merge pull request #4933 from matrix-org/joriks/room-list-noop-first-breadcrumb
Noop first breadcrumb
2020-07-09 13:47:38 +01:00
Travis Ralston
47380306c2 Move and improve notification state handling
Previously we were creating a notification state whenever we needed one, which was leading to hundreds of listeners even on a small account. To ease the burden, and reduce the load of having to wake so many listeners, we now record a single listener for each tag ID and room combination.

This commit also introduces a number of utilities to make future notification work a bit of an easier transition, such as the `isX` and `hasX` getters on the new NotificationState abstract class. Similarly, "snapshots" have been added to reduce code duplication between different kinds of states checking for updates.

The ListNotificationState is now heavily tied into the store which offers it to help reuse the cache of room notification states. 

Fixes https://github.com/vector-im/riot-web/issues/14370
2020-07-08 19:26:25 -06:00
Travis Ralston
62b4596c04 Be consistent with other stores 2020-07-08 18:36:56 -06:00
Travis Ralston
c8f90be81d Ensure the map gets cleared upon logout 2020-07-08 18:32:12 -06:00
Jorik Schellekens
2baa78d26b Move no-op to breadcrumb store 2020-07-09 01:31:44 +01:00
Travis Ralston
c5812d6c27 Move list layout management to its own store
This is more general maintenance than performance as the RoomList doesn't need to be generating layouts for the sublists, and it certainly doesn't need to be creating a bunch of extra ones. 

The sublists are perfectly capable of getting their own layout instance and using it, and we are perfectly able to limit the number of these things we create through the session's lifespan.
2020-07-08 18:28:21 -06:00
Travis Ralston
8972cf9378 Potential solution to supporting transparent 'show more' buttons
In this demonstration, we remove the cutting line (as it collides with the tile in a weird spot) and instead replace the tile with a placeholder when the text is about to collide with the avatar in the tile. We use a `round()` for this because through some amazing coincidence the collision happens at 0.47, which is close enough to 0.5 for people not to notice.
2020-07-08 16:09:45 -06:00
Travis Ralston
9b48130f4f Protect rooms from getting lost due to complex transitions
Fixes https://github.com/vector-im/riot-web/issues/14378

Rooms transitioning between multiple states are often at risk of going missing due to the sticky room handling. We now protect that transition by bluntly ensuring the room can't go missing, and by always ensuring we have an updated reference to the room.
2020-07-08 11:48:34 -06:00
Travis Ralston
3912f2d21c Merge remote-tracking branch 'origin/develop' into travis/room-list/resizable 2020-07-08 07:55:10 -06:00
Travis Ralston
b4f3b8ab11 Use the right variables when detecting max height 2020-07-08 07:53:55 -06:00
Michael Telatynski
5ef93686d9
Merge pull request #4925 from matrix-org/t3chguy/room-list/14352
Use html innerText for org.matrix.custom.html m.room.message room list previews
2020-07-08 13:23:58 +01:00
Michael Telatynski
8d5d3b1c92 Use html innerText for org.matrix.custom.html m.room.message room list previews
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-08 08:50:25 +01:00
Travis Ralston
15b6a273c9 Swap out the resizer lib for something more stable
react-resizer appears to be okay at tracking state, but it often desyncs from reality. re-resizer is more maintained and more broadly used (160k downloads vs 110k), and appears to generally do a better job of tracking the cursor.

The new library has some oddities though, such as deltas, touch support (hence the polyfill), and calling handles "Enable".

For https://github.com/vector-im/riot-web/issues/14022
2020-07-07 22:21:00 -06:00
Travis Ralston
8357461c9b Merge branch 'develop' into travis/room-list/enable 2020-07-07 16:20:38 -06:00
Travis Ralston
774e32ecf0 Fix DM handling in new room list 2020-07-07 16:16:46 -06:00
Travis Ralston
0b83926201 Merge branch 'develop' into travis/room-list/enable 2020-07-07 15:46:05 -06:00
Travis Ralston
f89fcd1fe9 Fix tests and add general safety
We don't need the fake clock anymore, but we do have to wait for async actions to complete before moving forward.

This also exposes a number of functions for the store to be puppetted with.
2020-07-07 15:45:59 -06:00
Travis Ralston
85e018111b
Merge pull request #4918 from matrix-org/travis/room-list/respect-old-settings
Respect and fix understanding of legacy options in new room list
2020-07-07 15:19:56 -06:00
Travis Ralston
3dfb9711ed
Merge pull request #4916 from matrix-org/travis/room-list/dm-handle
Ensure DMs are not lost in the new room list, and clean up tag logging
2020-07-07 15:14:27 -06:00
Travis Ralston
a59a8b76a9 Update TODO comments to point to new issue 2020-07-07 14:51:43 -06:00
Travis Ralston
a4ef5909f9 Respect and fix understanding of legacy options
Fixes https://github.com/vector-im/riot-web/issues/14372

We read/use the options in multiple places, and those places were not in sync. Now when algorithms change and on initial load, both will come to the same conclusions about how to order & sort the rooms.
2020-07-07 14:45:08 -06:00
Travis Ralston
8ef4b1b2e7 Replace labs flag with a real setting 2020-07-07 13:56:46 -06:00
Travis Ralston
34ea8342fb Remove comment claiming encrypted rooms are handled incorrectly
Fixes https://github.com/vector-im/riot-web/issues/14238

The encrypted rooms are loaded on startup (eventually), so we don't need to worry about the problem described.
2020-07-07 13:49:36 -06:00
Travis Ralston
2488520263 Clean up tag logging in setKnownRooms
We don't need this anymore
2020-07-07 13:46:29 -06:00
Travis Ralston
be1b2fddaf Ensure DMs are not lost in the new room list
Fixes https://github.com/vector-im/riot-web/issues/14236
2020-07-07 13:46:10 -06:00
Michael Telatynski
8ba2be0be5
Merge pull request #4900 from matrix-org/t3chguy/room-list/1234
New Room List implement view_room_delta for keyboard shortcuts
2020-07-07 15:36:30 +01:00
Travis Ralston
7173ea71a5
Merge pull request #4905 from matrix-org/travis/room-list/room-safety
Improve room safety in the new room list
2020-07-07 06:59:59 -06:00
Travis Ralston
b3b404f121
Merge pull request #4906 from matrix-org/travis/room-list/invites-list
Fix a number of issues with the new room list's invites
2020-07-07 06:55:30 -06:00
Travis Ralston
2c502ed2fe Decrease default visible rooms down to 5 2020-07-06 20:48:49 -06:00
Travis Ralston
56333ae017 Ensure the recents algorithm is aware of invites 2020-07-06 20:42:43 -06:00
Travis Ralston
8739e2f781 Fix room duplication when the sticky room reference changes 2020-07-06 20:12:25 -06:00
Travis Ralston
34bd59c151 Remove the lock around the algorithm
This isn't needed
2020-07-06 19:38:13 -06:00
Travis Ralston
70e5da677b Clean up debug logging 2020-07-06 19:38:13 -06:00
Travis Ralston
dd833f4f2f Ensure the sticky room changes if the tag changes
This fixes a case where a user accepts an invite, which causes a tag change, but the room stays stuck in the invites list. The tag change additionally gets swallowed when the user moves away, causing the room to get lost. 

By moving it when we see it, potentially during a sticky room change itself (though extremely rare), we avoid having the room get lost in the wrong lists. A side effect of this is that accepting an invite puts it at the top of the tag it's going to (usually untagged), however this feels like the best option for the user.

A rare case of a tag change happening during a sticky room change is when a leave event comes in for the sticky room, but because it's come through as a tag change it can get swallowed. If it does get swallowed and the user clicks away, the tag change will happen when the room is re-introduced to the list (fake NewRoom event).
2020-07-06 19:38:13 -06:00
Travis Ralston
4345f972e0 Handle sticky room to avoid accidental removal
Plus a bunch of logging.

This fixes a case where switching rooms would cause the last room you were on to disappear due to an optimization where known NewRoom fires would be translated to tag change fires, which wouldn't re-add the room to the underlying tag algorithm.

By tracking the last sticky room, we can identify when we're about to do this and avoid it. 

This commit also adds a check to ensure that we have the latest reference of a room stored as rooms changing from invite -> join change references.

This commit additionally updates the PossibleTagChange handling to be faster and smarter, leading to a more stable generation of the room list. We convert the update cause to a Timeline update in order to indicate it is a change within the same tag rather than having to jump tags. This also means that PossibleTagChange should no longer make it as far as the underlying algorithm.

New logging has also been added to aid debugging.
2020-07-06 19:38:13 -06:00
Travis Ralston
18df29b627 Flag & add some debugging 2020-07-06 19:38:13 -06:00
Travis Ralston
0b6f744a58 Wrap handleRoomUpdate in a lock
Dev note: this is removed in a later commit
2020-07-06 19:38:13 -06:00
Michael Telatynski
1849ed90d2 Implement ViewRoomDelta for the new Room List
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-07-06 17:58:29 +01:00
Travis Ralston
9c1efe728c
Revert "Remove a bunch of noisy logging from the room list" 2020-07-03 08:54:54 -06:00