RinteRface / bs4Dash

Bootstrap 4 shinydashboard using AdminLTE3
https://bs4dash.rinterface.com
Other
437 stars 81 forks source link

Display the help switch but keep tooltips disabled #343

Closed akulumbeg closed 1 year ago

akulumbeg commented 1 year ago

Hello! Currently the behavior of dashboardPage()'s "help" parameter is the following:

If help = TRUE, the switch on the top right is shown and enabled. If help = FALSE, the switch is not shown at all (and obviously disabled)

As the app I am developing is pretty self-explanatory, from the UX/UI perspective, I find it more reasonable to know that there is a help feature (tooltips, popovers), and enable it on-demand if necessary, rather than to have to disable it every time the app is loaded (particularly if you are an experienced user).

This being said, I would like to have it shown but disabled initially, so that a user can turn the popovers on later. Is this possible?

Thanks!

DivadNojnarg commented 1 year ago

Hi,

Do you agree to proceed like for the dark parameter (for consistency):

@param dark Whether to display toggle to switch between dark and light mode in the \link{dashboardHeader}.

' Default to FALSE, app starts in light mode, with possibility to switch to dark.

' If TRUE, the app starts in dark with possibility to switch back to light. If NULL,

' not toggle is shown and the app starts in light, as it has always been.

In that case, setting to FALSE would show the button but it would be disabled. To hide it, you would need to set help = NULL.

akulumbeg commented 1 year ago

That is exactly as I would imagine it!

DivadNojnarg commented 1 year ago

Please test from the dev branch and let me know. I'll push it to CRAN soon.

akulumbeg commented 1 year ago

Upon setting to FALSE, it starts with the switch visible and disabled, so that's good. However, regardless, the tooltips still appear. Once I click to enable them and then disable them again, they appear no more. However, I should say that I am using tooltips from the bsplus package, so perhaps that could be the issue. Cannot afford to rewrite the code fully to do more testing though :(

DivadNojnarg commented 1 year ago

Yes {bsplus} is not compatible with {bs4Dash}. I believe it uses Bootstrap 3, while we need Bootstrap 4 (and soon Bootstrap 5).

akulumbeg commented 1 year ago

Anyway, I just tried making a new button with the {bs4Dash} inbuilt tooltips and the bug persists. I still need to enable and disable the help switch to have tooltips turned off.

DivadNojnarg commented 1 year ago

Could be a caching issue. Did you reset your web browser cache?

akulumbeg commented 1 year ago

Unfortunately, this does not seem to be the issue, tried both on Chrome and Firefox with cache purged.

DivadNojnarg commented 1 year ago

I added an extra commit. There was an issue in my JS file. You can test again.

akulumbeg commented 1 year ago

Now it works like a charm, both on Chrome and Firefox. Thank you SO much!

EDIT - works with both bsplus and bs4dash tooltips!

DivadNojnarg commented 1 year ago

Great. I'll close it when released to CRAN.

JsLth commented 1 year ago

This currently leaves one option uncovered.

help = TRUE displays a switch and enables tooltips help = FALSE displays a switch and disables tooltips help = NULL does not display a switch and disables tooltips

What do we do if we want to not display a switch but enable tooltips, or in other word expect to have working tooltips by default? Wouldn't it be a good idea to have two arguments help and help_switch?

D3SL commented 1 year ago

shinyJS makes hiding elements pretty trivial.