Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Slideshow #931

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Simple Slideshow #931

wants to merge 4 commits into from

Conversation

printfuck
Copy link

@printfuck printfuck commented Apr 7, 2024

This is a simple slideshow feature with a setting for the time interval.

I also admittedly changed the icon placement inside the buttons - this is not necessary, but it made the alignment nicer (in my opinion).

firefox_4th9rIfvZ9.mp4

Copy link

codecov bot commented Apr 7, 2024

Codecov Report

Attention: Patch coverage is 80.45113% with 26 lines in your changes are missing coverage. Please review.

Project coverage is 57.53%. Comparing base (b2d591b) to head (66eebf8).
Report is 7 commits behind head on master.

Current head 66eebf8 differs from pull request most recent head 14c041f

Please upload reports for the commit 14c041f to get more accurate results.

Files Patch % Lines
...omponents/photoGallery/presentView/icons/Pause.tsx 13.04% 20 Missing ⚠️
...toGallery/presentView/PresentNavigationOverlay.tsx 93.10% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #931      +/-   ##
==========================================
+ Coverage   57.34%   57.53%   +0.18%     
==========================================
  Files         196      198       +2     
  Lines       15607    15738     +131     
  Branches      533      542       +9     
==========================================
+ Hits         8950     9055     +105     
- Misses       6408     6434      +26     
  Partials      249      249              
Flag Coverage Δ
api 25.18% <ø> (ø)
ui 70.11% <80.45%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jordy2254
Copy link
Member

Thanks for your PR. Sounds like a useful feature. I will checkout your changes during the week to review them.

@kkovaletp
Copy link
Contributor

kkovaletp commented Apr 7, 2024

I like the slideshow feature from the functionality point of view. It will be definitely useful for many users.
Sure, we could start with something simple and then enhance it iteratively.
@printfuck, it would be great if you could describe it with some more details and probably attach some screenshots, so we could clearly understand all the functions and limitations: for instance, is it possible to start it for an album or it can run for all the gallery? will it play videos or skip them? etc...

@printfuck
Copy link
Author

I like the slideshow feature from the functionality point of view. It will be definitely useful for many users. Sure, we could start with something simple and then enhance it iteratively. @printfuck, it would be great if you could describe it with some more details and probably attach some screenshots, so we could clearly understand all the functions and limitations: for instance, is it possible to start it for an album or it can run for all the gallery? will it play videos or skip them? etc...

Thanks for your reply.
It basically just iterates on all images inside of an album from within the presentView; videos won't be started. My focus was entirely on images, but I think it would make sense to play each video once and cycle by default. I think, there would be need for another switch to change video playback behaviour.

Possible options:

  • only Images
  • only Videos, played once
  • both, videos played once

@kkovaletp
Copy link
Contributor

Thanks for the explanation and the video attachment with the demo!

there would be need for another switch to change video playback behaviour.

Possible options:

  • only Images
  • only Videos, played once
  • both, videos played once

I like the idea of having 1 more setting for this.
However, there is a tricky moment: according to your demo video, the timeout setting is controlled by an on-screen button, shown for the currently opened media. Then the new switch setting needs to be consistent with the timeout setting, it could be a 3-stages-button near the timeout one with:

  • picture icon (default)
  • video icon
  • an icon with both picture and video icons, located as a stack or sequence
    corresponding to proposed states. But here we might confuse users, as showing these buttons on screen while a media is shown automatically sets an expectation for a user that the setting is connected to the context of the current media:
  • in the case of the currently shown picture user sets the video only, what is expected and actually performed? what if the current album doesn't contain videos - should we check for that in advance and not allow users to change the setting? how might this check impact the performance of starting the view?
  • in the opposite case, should we set the 'videos only' value in advance and disable the setting?

While the described scenario looks consistent to me, I'd like to read your and @jordy2254 opinions, and probably start some discussion to make sure that we understand all possible use cases and design the workflow in an optimal way)

@kkovaletp kkovaletp added discussion Raises questions that are up for discussion feature A new idea or feature UI Related to the frontend web ui written in Javascript pending response A issue or PR which is waiting for clarifications from OP labels Apr 29, 2024
@@ -1,4 +1,4 @@
import React from 'react'
import React, { useRef } from 'react'

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import useRef.
@printfuck
Copy link
Author

I have added the modes Video+Image, Image-only and Video-only. By default Video+Image is selected. The image-only and respectively the video-only modes will simply stop on the current element, if the demanded media type is not present within the album.

The svg images are placeholders. For demonstration purposes, I used images to which would be easily recognizable. If you could point me at a source for images free of copyright, for usage with this project, I'd happily use those. (The Play and Pause Buttons are done by me so they can be used - just the other three aren't mine)

There is a quirky implementation using the aux variable in PresentMediaOverlay.tsx, which covers the edge case of only one video in an album on video-only mode.

The Video doesn't demonstrate much, but it displays the look:

firefox_QgovwZMvkv.mp4

@kkovaletp
Copy link
Contributor

@printfuck, Thanks for the implementation and your explanation!
I like how it works now)
However, in your video, it is demonstrated that when some bright content is displayed on the background of the control buttons, they are not readable at all. Is it possible to put some lower-transparency background behind the buttons to make sure they are readable even when displayed on top of some bright content?
Or, as an alternative, invert the buttons' colors depending on the background displayed.
It is difficult for me to predict which solution would be better from the UX side and better fit the product design (I guess that is the 1st one), so, I think that you need to play a bit with them (and probably some other possible solutions) to choose the best one.

Regarding the icons sources, I'm not aware of any project-specific icons library. In general, the reuse of some publicly available content is regulated by the content's policies and licenses. Do you know what they are for those icons? If they are compatible with the project's license, then it should be totally fine to use them here. If not, then you need to search for some alternative icons, compatible with our license (or manually recreate them)

@kkovaletp
Copy link
Contributor

also, please fix the failed tests and double-check the coverage of your code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Raises questions that are up for discussion feature A new idea or feature pending response A issue or PR which is waiting for clarifications from OP UI Related to the frontend web ui written in Javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants