JohnCoene / waiter

🕰️ Loading screens for Shiny
https://waiter.john-coene.com/
Other
499 stars 25 forks source link

Waiter doesn't cover all the page #95

Closed agronomofiorentini closed 3 years ago

agronomofiorentini commented 3 years ago

Dear john, First of all thanks to solve the bs4dash-waiter issue.

I am a strong user of uiOutput and renderUI and therefore my pages with the following of the processing steps become larger and larger. In fact when I arrived at the second/third step of the processing that performs the shinyapp and I insert inside an observeEvent waiter, it happens that waiter covers only the first portion of the page and not all the rest.

So I wanted to know if there is any tool I can use to enlarge the loading of waiter to the whole page.

Thanks again.

JohnCoene commented 3 years ago

Is the loading screen over the uiOutput or over the entire page?

agronomofiorentini commented 3 years ago

sorry maybe I didn't explain myself well.

Over the entire page. I mean when I use waiter in a page that is larger than the starting page, waiter does not cover the entire page but only covers the starting portion.

JohnCoene commented 3 years ago

OK, can you install the latest dev version, I think this is an issue I already fixed.

remotes::install_github("JohnCoene/waiter")
agronomofiorentini commented 3 years ago

Of course, and i will let you know as soon as possible.

And for now thanks.

agronomofiorentini commented 3 years ago

I have downloaded and installed the github version but the issue persist.

I will attach some picture that show my issue, maybe can be more representative.

Screenshot_1 Screenshot_2 Screenshot_3

Thanks a lot john.

JohnCoene commented 3 years ago

Ok, apologies.

I just pushed something I think fixes it, could you try to install the Github version again and try?

agronomofiorentini commented 3 years ago

I have installed again but the issue persist.

sorry for this.

Screenshot_1

JohnCoene commented 3 years ago

Don't be sorry, it's not your fault.

After resintalling from Github did you restart the R session to make sure the latest version was loaded?

library(shiny)
library(waiter)

ui <- fluidPage(
  use_waiter(),
    div(
    h1("Content"),
    actionButton("show", "Show"),
    style = "min-height:8000px;"
  )
)

server <- function(input, output, session){
  w <- Waiter$new()

  observeEvent(input$show, {
    w$show()
  })
}

shinyApp(ui, server)

The above works for me

agronomofiorentini commented 3 years ago

Yes i restart the R session.

I tried your code and worked perfectly, while in my web app the problem persist.

I worked a lot of with golem, and before to load again the app i removed the waiter from the description file and then i re-inserted by using usethis.

Maybe could be something related with bs4dash?

JohnCoene commented 3 years ago

There was an issue with the preloader in bs4Dash. David merged my PR fixing this but it's not yet on CRAN. See issue: https://github.com/JohnCoene/waiter/issues/93 PR: https://github.com/RinteRface/bs4Dash/pull/213

Though I don't think this can be it. When you restarted the R session did you, after in the browser with the app opened, did you refresh clearing the cache? It could be that it was the old JavaScript was still loaded/cached.

CTRL/CMD + SHIFT + R

agronomofiorentini commented 3 years ago

There was an issue with the preloader in bs4Dash. David merged my PR fixing this but it's not yet on CRAN. See issue: #93 PR: RinteRface/bs4Dash#213

yes I have known of this change in fact now works perfectly.

Though I don't think this can be it. When you restarted the R session did you, after in the browser with the app opened, did you refresh clearing the cache? It could be that it was the old JavaScript was still loaded/cached.

besides this suggestion I have tried to turn off and on the computer but the problem persists.

JohnCoene commented 3 years ago

Oh, sorry it persists. Would you have a small reproducible example for me to debug this?

agronomofiorentini commented 3 years ago

I will create one and i will provide to you as soon as possible.

For now, again, thanks.

agronomofiorentini commented 3 years ago
library(shiny)
library(bs4Dash)
library(waiter)
library(DT)
library(palmerpenguins)

ui <- dashboardPage(

  title = "Waiter Issue",

  fullscreen = TRUE,

  preloader = list(html = spin_1(), color = "#333e48"),

  header = bs4DashNavbar(title = "Home",
                         compact = TRUE),

  sidebar = bs4DashSidebar(collapsed = FALSE,
                           bs4SidebarMenu(bs4SidebarMenuItem(text = "Waiter Issue",
                                                             tabName = "issue", 
                                                             icon = icon("exclamation")))),

  controlbar = dashboardControlbar(),

  footer = dashboardFooter(left = "Waiter issue",
                           right = "2021"),

  body = bs4DashBody(bs4TabItems(bs4TabItem(tabName = "issue",
                                            actionButton("show",
                                                         label = "Waiter Works"),
                                            br(),
                                            dataTableOutput("first_table"),
                                            actionButton("new_issue",
                                                         label = "Waiter cover all the page?"),
                                            uiOutput("first_ui_output"),
                                            br(),
                                            uiOutput("second_ui_output"),
                                            uiOutput("third_ui_output")))))

server <- function(input, output) {

  observeEvent(input$show, {

    waiter_show(html = spin_fading_circles())

    Sys.sleep(3)

    waiter_hide()
  })

  output$first_table<-renderDataTable({
    datatable(penguins)
  })

  observeEvent(input$new_issue, {

    waiter_show(html = spin_fading_circles())

    Sys.sleep(3)

    output$first_ui_output<-renderUI({
      dataTableOutput("second_table")
    })

    output$second_table<-renderDataTable({
      datatable(penguins)
    })

    output$second_ui_output<-renderUI({
      actionButton("new_issue_1",
                   label = "Let's see again")
    })

    waiter_hide()

    observeEvent(input$new_issue_1, {

      waiter_show(html = spin_fading_circles())

      Sys.sleep(3)

      output$second_ui_output<-renderUI({
        dataTableOutput("third_table")
      })

      output$third_table<-renderDataTable({
        datatable(penguins)
      })

      waiter_hide()
    })
  })
}

shinyApp(ui = ui, server = server)
aylapear commented 3 years ago

I am having the same problem with the current app I am building where the waiter does not cover the "whole" screen. The code in my app is equivalent to the regex above.

Screen Shot 2021-06-25 at 9 05 57 AM

JohnCoene commented 3 years ago

Apologies for this but this time I think I really fixed it.

Could you reinstall the dev version and try again?

remotes::install_github("JohnCoene/waiter")
agronomofiorentini commented 3 years ago

Dear Jhon, from my side, it is working perfectly now.

Thanks for the support.