insightsengineering / insightsengineering/teal.widgets
[Bug]: Resize popover is not properly rendering with new version of `shiny`
- Dominant language
- R
- Stars
- 6
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
### What happened?
`shinytests2` tests are failing on `plot_with_settings` when the resize popup does not render any contents
When inspecting the DOM, the `recalculating` class appears on the elements, hence the contents of the resize popup is empty
```r
pkgload::load_all("/home/averissimo/work/roche🟦/packages📦/teal.widgets")
shiny::shinyApp(
ui = bslib::page_fluid(
shiny::actionButton("button", "Show/Hide"),
plot_with_settings_ui(
id = "plot_with_settings"
)
),
server = function(input, output, session) {
plot_r <- shiny::reactive({
ggplot2::ggplot(data.frame(x = 1:5, y = 1:5)) +
ggplot2::geom_point(ggplot2::aes(x = 1:5, y = 1:5))
})
show_hide_signal <- shiny::reactiveVal(TRUE)
shiny::observeEvent(input$button, {
show_hide_signal(
!show_hide_signal()
)
})
plot_data <- plot_with_settings_srv(
id = "plot_with_settings",
plot_r = plot_r,
height = c(400, 100, 1200),
width = c(500, 250, 750),
brushing = TRUE,
clicking = TRUE,
dblclicking = TRUE,
hovering = TRUE,
show_hide_signal = show_hide_signal
)
shiny::exportTestValues(
plot_r = plot_r,
plot_data = plot_data
)
}
)
```
### sessionInfo()
```R
```
### Relevant log output
```R
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct.
### Contribution Guidelines
- [x] I agree to follow this project's Contribution Guidelines.
### Security Policy
- [x] I agree to follow this project's Security Policy.
Contributor guide
Research direction
Reproduce the failure with the supplied shinyApp example and inspect plot_with_settings_ui and plot_with_settings_srv, focusing on the resize popup and its recalculating state. Run the shinytests2 test for plot_with_settings to compare behavior with the new shiny version. Done means the resize popup renders its contents and the test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100