Commit Graph

16 Commits

Author SHA1 Message Date
Robin 169ccd9de5 Start refactoring some business logic into view models
As Element Call grows in complexity, it has become a pain point that our business logic remains so tightly coupled to the UI code. In particular, this has made testing difficult, and the complex semantics of React hooks are not a great match for arbitrary business logic. Here, I show the beginnings of what it would look like for us to adopt the MVVM pattern. I've created a CallViewModel and TileViewModel that expose their state to the UI as rxjs Observables, as well as a couple of helper functions for consuming view models in React code.

This should contain no user-visible changes, but we need to watch out for regressions particularly around focus switching and promotion of speakers, because this was the logic I chose to refactor first.
2023-12-01 17:09:21 -05:00
Robin 42c8677be1 Fix jumpy speaker tiles in spotlight mode
reorderTiles was programmed to only place a tile in the speaker section if that tile's previous position was off-screen. But for speakers that started off-screen, this would cause them to oscillate in and out of the speaker section on each render, because the speaker section is, of course, on-screen. The solution I've gone with here is to avoid referencing the previous position, and instead go by the computed natural ordering, which ought to be more stable.
2023-11-20 01:02:08 -05:00
Robin 614bc82402 Format code 2023-10-11 10:42:04 -04:00
Daniel Abramov 0105162ffa Enable strict lints
An attempt to fix https://github.com/vector-im/element-call/issues/1132
2023-07-11 16:02:58 +01:00
Robin Townsend 3ac98c8865 Make the expand and collapse interactions inverses of one another
For the most part, at least. If the edge cases where they differ still feel weird, I can iterate on this further.

The diff is unfortunately a bit impenetrable, because I had to change both the fillGaps and cycleTileSize core algorithms used by the big grid layout. But: the main change of significance is the addition of a function vacateArea, which clears out an area within the grid in a specific way that mirrors the motion performed by fillGaps.
2023-07-06 00:59:14 -04:00
Robin Townsend cc35f243f2 Make NewVideoGrid support arbitrary layout systems
In preparation for adding layouts other than big grid to the NewVideoGrid component, I've abstracted the grid layout system into an interface called Layout. For now, the only implementation of this interface is BigGrid, but this will allow us to easily plug in Spotlight, SplitGrid, and OneOnOne layout systems so we can get rid of the old VideoGrid component and have One Grid to Rule Them All™.

Please do shout if any of this seems obtuse or underdocumented, because I'm not super happy with how approachable the NewVideoGrid code looks right now…

Incidentally, this refactoring made it way easier to save the state of the grid while in fullscreen / another layout, so I went ahead and did that.
2023-06-27 14:20:45 -04:00
Robin Townsend c3c26e235b Merge branch 'grid-interactions' into livekit-experiment 2023-06-18 01:13:45 -04:00
Robin Townsend 4e5a75074a Fix tiles not collapsing toward their center 2023-06-18 01:01:24 -04:00
Robin Townsend 391ba5196c Make screenshares appear near the presenter's tile and be larger 2023-06-18 00:47:37 -04:00
Robin Townsend d1e7d963a3 Merge branch 'grid-interactions' into livekit-experiment 2023-06-17 22:32:19 -04:00
Robin Townsend afbcea7b66 Allow the grid to resize with the window width 2023-06-17 22:31:07 -04:00
Robin Townsend 4f582c6ad7 Don't change tile size when dragging 2023-06-17 22:31:07 -04:00
Robin Townsend 8b8d6fd0e0 Push large tiles upwards back into the grid 2023-06-17 22:31:01 -04:00
Robin Townsend ab97f12947 Merge branch 'main' into livekit-experiment 2023-06-09 17:22:34 -04:00
Robin Townsend 8c818b9ce1 Get 100% test coverage on grid operations 2023-02-13 22:24:04 -05:00
Robin Townsend 8d0bf4cacc Test grid operations 2023-02-13 18:35:50 -05:00