Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Jan 14, 2021

Although the grid component is capable of performing pagination until now it was enabled only in stripe mode. When the call view was in grid mode and the participants did not fit a notification was shown to the user, but the buttons to change between grid view pages were not shown. However, (with some tweaks) the pagination does not require the grid view to be in stripe mode to work, so the buttons are now shown when needed also in the main grid view (centered vertically instead of close to the top, as they would clash with the top bar buttons).

The notification was removed too, as now it does not make sense, at least with its previous message. However I wonder if we should still show the notification with a different message (something like "Too many participants to fit in the window. Please use the buttons in the grid to change between different sets of participants.") when a new page is added so the user realizes it (as just showing the buttons may not be noticeable enough, and they could be hidden if the user has not recently interacted with the grid view).

Note that I tested all this using the devMode of the grid view. It should be the same when using real participants, but it would be better to test it to ensure that the local participant is still always shown as expected in all pages.

Besides that this pull request also fixes the grid view jumping back to the first page when the window is resized or a participant joins or leaves, and it also cleans a bit the code.

Pending:

  • Reset current page when changing between speaker mode and grid view
  • Do not focus previous page button when changing from first page to second page - I gave up, it is not related to the changes in this pull request, I spent enough time already and I am still clueless, so I just opened an issue
  • Bring back the layout hint notification but with a different text?

This ensures that the grid view in development mode will behave like the
grid view in normal mode.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
This will be needed for proper calculations once pagination is enabled
in the full grid view, as the local video will be shown in all pages and
thus its slot will not be available.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Besides being cleaner this will make possible to fix the grid jumping
back to the first page when the  number of videos change.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When the number of participants changed or the window was resized the
current page was reset to the first one. However, now that
"displayedVideos" is a computed property and no longer reset directly in
"makeGrid()" it is no longer necessary to go back to the first page.

Moreover, as "numberOfPages" is also a computed property it can be
watched to restrict the current page to be always in range.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When there was no longer an overflow the layout hint event was not
triggered with a false value, so even if the window was resized to
accomodate the larger number of participants the hint was not
automatically removed. Now the hint is removed whenever there is no
longer an overflow or the grid is shown as a stripe.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Instead of being explicitly emitted in "makeGrid" the layout hint is now
automatically emitted based on the value of the computed properties that
it depends on.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
As it is now possible to paginate in the main grid view the layout hint
to change to speaker mode is no longer needed.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu danxuliu marked this pull request as ready for review January 15, 2021 12:44
@nickvergessen
Copy link
Member

Seems to work, but

Bring back the layout hint notification but with a different text?

I would show it the first time it overflows the first page, because when you don't have the mouse moving you won't see that it just started to happen.

@nickvergessen nickvergessen merged commit 8438568 into master Jan 18, 2021
@nickvergessen nickvergessen deleted the enable-pagination-for-main-grid-view branch January 18, 2021 09:36
@danxuliu
Copy link
Member Author

/backport to stable20.1

@backportbot-nextcloud
Copy link

The backport to stable20.1 failed. Please do this backport manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants