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

Improve progress bars #1236

Merged
merged 23 commits into from
Jun 7, 2024
Merged

Conversation

chlebowa
Copy link
Contributor

@chlebowa chlebowa commented May 29, 2024

Related to #1234.

Update progress bars to improve user experience.

  • modules_datasets receives optional progress argument that accepts a Progress object
  • ui_nested_tabs and ui_tabs_with_filters receive progress argument that accepts a Progress object
  • rewrote progress bar management in srv_teal

Added a large app for testing in __stress_test.R, to be removed before merging.

NOTE

Once the module UI is prepared, there is still a delay before the app starts, so the progress bar can be improved further. So far I was unable to identify the reason for the delay.

@chlebowa chlebowa marked this pull request as ready for review May 29, 2024 07:58
@m7pr
Copy link
Contributor

m7pr commented Jun 4, 2024

Hey @chlebowa thanks for the input! I think it's gonna be highly useful!

I allowed CI check to be executed on this PR. I see a Warning in R CMD Check - would you be able to check in your free time?

@chlebowa
Copy link
Contributor Author

chlebowa commented Jun 4, 2024

Thanks @m7pr, I had forgotten to re-create documentation after removing the faulty defaults.

@chlebowa
Copy link
Contributor Author

chlebowa commented Jun 4, 2024

There is one more failure, I think this is something on your end.

@m7pr
Copy link
Contributor

m7pr commented Jun 5, 2024

Yeah, this is something @walkowif is investing on our end

@m7pr m7pr self-assigned this Jun 5, 2024
@walkowif
Copy link
Contributor

walkowif commented Jun 5, 2024

The urlchecker failure should be gone after retriggering the checks.

@m7pr
Copy link
Contributor

m7pr commented Jun 5, 2024

Thank you @chlebowa for the time and energy you invested to provide this feature. I just test in on the branched cloned from your fork. Works like a charm! I think we are good to merge this excellent feature, once we figure out the details from the comments.

@kumamiao would you mind providing a NEWS entry for this feature?

video1729290070.mp4

@chlebowa
Copy link
Contributor Author

chlebowa commented Jun 6, 2024

I had a thought this morning that may be a slightly more orderly implementation. Rather than creating tro Progress objects, one in a reactive expression and one in an observer, instantiate one Progress in srv_teal and work with it throughout the function by first passing it to modules_datasets and later reset the progress and pass to ui_tabs_with_filters.

The user would see only one progress bar, whereas now two bars can be seen, the filter one is moved up and later disappears as the module one appears. On the code seide, there would be a little less clutter.

What do you think?

@m7pr
Copy link
Contributor

m7pr commented Jun 6, 2024

If one waits for the other, then it's probably better for the end user to see just one progress bar at a time :)
Depending on how much time you have. This is already in good condition

@chlebowa
Copy link
Contributor Author

chlebowa commented Jun 6, 2024

Have a look.

@m7pr
Copy link
Contributor

m7pr commented Jun 6, 2024

Wow @chlebowa nice and clean. Really ready to be merged!

Can you

  • delete __stres_test.R file
  • extend NEWS.md with an Enhancement * Provided progress bar for modules loading and data filtering during teal app startup.

Then I will merge. Thank you. Really great job!

@m7pr m7pr enabled auto-merge (squash) June 7, 2024 12:22
Copy link
Contributor

@m7pr m7pr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really useful stuff!

@m7pr m7pr merged commit 22e1c4a into insightsengineering:main Jun 7, 2024
27 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2024
@pawelru
Copy link
Contributor

pawelru commented Jun 11, 2024

Hi all. Apologies for jumping into the old PR - just got back from the break of mine. May I ask for a follow-up PR before the release that will make progress argument optional for all modified functions? The rationale here is simplicity - we would like to keep the requirements to run the funcs to the meaningful minimum which is in these case: id, modules and datasets. If you look at the functions definitions all the other arguments (incl. filter which is also quite important) has some defaults. In case of progress this could be NULL and if it's Progress we will increment it. Another benefits are in testing - no need to create a dummy progress object to execute functions.

(*) I know the is.missing() stuff but IMHO having x = NULL in the function definition exposes this better without reading docs or function body

@m7pr
Copy link
Contributor

m7pr commented Jun 13, 2024

@pawelru I created a ticket for that in here #1243

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants