element-call-Github/src/grid
Robin d3f069e763
Keep tiles in a stable order (#2670)
* Keep tiles in a stable order

This introduces a new layer of abstraction on top of MediaViewModel: TileViewModel, which gives us a place to store data relating to tiles rather than their media, and also generally makes it easier to reason about tiles as they move about the call layout. I have created a class called TileStore to keep track of these tiles.

This allows us to swap out the media shown on a tile as the spotlight speaker changes, and avoid moving tiles around unless they really need to jump between the visible/invisible regions of the layout.

* Don't throttle spotlight updates

Since we now assume that the spotlight and grid will be in sync (i.e. an active speaker in one will behave as an active speaker in the other), we don't want the spotlight to ever lag behind due to throttling. If this causes usability issues we should maybe look into making LiveKit's 'speaking' indicators less erratic first.

* Make layout shifts due to a change in speaker less surprising

Although we try now to avoid layout shifts due to the spotlight speaker changing wherever possible, a spotlight speaker coming from off screen can still trigger one. Let's shift the layout a bit more gracefully in this case.

* Improve the tile ordering tests

* Maximize the spotlight tile in portrait layout

* Tell tiles whether they're actually visible in a more timely manner

* Fix test

* Fix speaking indicators logic

* Improve readability of marbles

* Fix test case

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2024-11-06 09:36:48 +00:00
..
CallLayout.ts Keep tiles in a stable order (#2670) 2024-11-06 09:36:48 +00:00
Grid.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
Grid.module.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
Grid.tsx Keep tiles in a stable order (#2670) 2024-11-06 09:36:48 +00:00
GridLayout.module.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
GridLayout.tsx Keep tiles in a stable order (#2670) 2024-11-06 09:36:48 +00:00
OneOnOneLayout.module.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
OneOnOneLayout.tsx Keep tiles in a stable order (#2670) 2024-11-06 09:36:48 +00:00
SpotlightExpandedLayout.module.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
SpotlightExpandedLayout.tsx Keep tiles in a stable order (#2670) 2024-11-06 09:36:48 +00:00
SpotlightLandscapeLayout.module.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
SpotlightLandscapeLayout.tsx Keep tiles in a stable order (#2670) 2024-11-06 09:36:48 +00:00
SpotlightPortraitLayout.module.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
SpotlightPortraitLayout.tsx Keep tiles in a stable order (#2670) 2024-11-06 09:36:48 +00:00
TileWrapper.module.css Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
TileWrapper.tsx Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00