Skip to content

Conversation

@Anpro88
Copy link

@Anpro88 Anpro88 commented Aug 13, 2025

This is my first attempt at contributing to the OH WebUI.
The goal is to add an optional refresh interval to the photos action so that images in the Framework7 Photo Browser can automatically reload after a defined number of seconds or milliseconds.

Changes include:

  • Added actionPhotosRefreshSec (seconds) and actionPhotosRefreshMs (milliseconds) configuration parameters.
  • Adjusted the photos action handling to trigger periodic refreshes when one of these values is set.

Status:

  • This PR is still a work in progress (WIP).
  • I currently have no test environment available, so I cannot verify the changes myself.
  • Feedback from maintainers and other contributors is highly appreciated, especially regarding implementation style and any potential side effects.

Thanks in advance for your patience with my first PR attempt!

This PR introduces a new configuration option to set the display duration for photos in the Photo Browser component. The duration can now be specified in milliseconds (ms) or seconds (s), giving users more flexibility when displaying images or videos.

Changes:

Added a new property displayDuration to actionPhotoBrowserConfig.
Supports numeric values in milliseconds (e.g., 5000) or string values in seconds (e.g., "5s").
Updated documentation and examples to show usage with both ms and s formats.

Signed-off-by: Anpro88 <[email protected]>
- Added `actionPhotosRefreshSec` and `actionPhotosRefreshMs` parameters.
- Parameters are only active when action is set to 'photos'.
- Allows automatic photo refresh with configurable interval.

Signed-off-by: Anpro88 <[email protected]>
Add configurable display duration for photos in Photo Browser
@ghys
Copy link
Member

ghys commented Aug 17, 2025

This is my first attempt at contributing to the OH WebUI.

And you are most welcome!

Added actionPhotosRefreshSec (seconds) and actionPhotosRefreshMs (milliseconds) configuration parameters.

Maybe from a UX perspective you could merge those and have the value be 5s or 200ms instead.

Otherwise, the code looks good!

@Anpro88
Copy link
Author

Anpro88 commented Aug 17, 2025

Thanks a lot for the feedback! 🙏
Just to clarify your suggestion:
Did you mean that instead of having both actionPhotosRefreshSec and actionPhotosRefreshMs, I should just provide one single parameter (e.g. always in seconds or always in milliseconds)?
Or were you actually suggesting to support a string format like 5s or 200ms?
I just want to make sure I understood you correctly before trying to update the PR.

@lolodomo lolodomo added enhancement New feature or request main ui Main UI labels Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request main ui Main UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants