From 64e2dfa5797c8d3c99a03ae5e7c8d67e80fdb531 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 02:58:30 +0000 Subject: [PATCH 1/2] Initial plan From 47d9d875eeee271314df266f24b0ed68efe4a1ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 03:03:38 +0000 Subject: [PATCH 2/2] Fix R CMD check failures: example return(), error handler argument, vignette rmarkdown Agent-Logs-Url: https://github.com/rstudio/reactlog/sessions/8a4f4a4c-8c6f-4dff-9c5d-e0b5c39b5b78 Co-authored-by: karangattu <4220325+karangattu@users.noreply.github.com> --- DESCRIPTION | 2 +- R/shinyModule.R | 63 +++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1a4dcc2..fd79b6d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,6 +32,6 @@ Encoding: UTF-8 RoxygenNote: 7.2.1 URL: https://rstudio.github.io/reactlog/, https://github.com/rstudio/reactlog, https://community.rstudio.com/tag/reactlog BugReports: https://github.com/rstudio/reactlog/issues -VignetteBuilder: knitr +VignetteBuilder: knitr, rmarkdown Language: en-US Roxygen: list(markdown = TRUE) diff --git a/R/shinyModule.R b/R/shinyModule.R index 830dd1f..eff4441 100644 --- a/R/shinyModule.R +++ b/R/shinyModule.R @@ -16,44 +16,41 @@ #' @rdname reactlog_module #' @export #' @examples -#' if (!require("shiny")) { -#' message("`shiny` required to run example") -#' return() -#' } -#' -#' library(shiny) -#' # Enable reactlog -#' reactlog_enable() +#' if (require("shiny")) { +#' library(shiny) +#' # Enable reactlog +#' reactlog_enable() #' -#' # Define UI for app that draws a histogram ---- -#' ui <- fluidPage( -#' tags$h1("Pythagorean theorem"), -#' numericInput("a", "A", 3), -#' numericInput("b", "B", 4), -#' "C:", verbatimTextOutput("c"), -#' ### start ui module -#' reactlog_module_ui() -#' ### end ui module -#' ) +#' # Define UI for app that draws a histogram ---- +#' ui <- fluidPage( +#' tags$h1("Pythagorean theorem"), +#' numericInput("a", "A", 3), +#' numericInput("b", "B", 4), +#' "C:", verbatimTextOutput("c"), +#' ### start ui module +#' reactlog_module_ui() +#' ### end ui module +#' ) #' -#' server <- function(input, output, session) { -#' a2 <- reactive({a <- input$a; req(a); a * a}, label = "a^2") -#' b2 <- reactive({b <- input$b; req(b); b * b}, label = "b^2") -#' c2 <- reactive({a2() + b2()}, label = "c^2") -#' c_val <- reactive({sqrt(c2())}, label = "c") +#' server <- function(input, output, session) { +#' a2 <- reactive({a <- input$a; req(a); a * a}, label = "a^2") +#' b2 <- reactive({b <- input$b; req(b); b * b}, label = "b^2") +#' c2 <- reactive({a2() + b2()}, label = "c^2") +#' c_val <- reactive({sqrt(c2())}, label = "c") #' -#' output$c <- renderText({ -#' c_val() -#' }) +#' output$c <- renderText({ +#' c_val() +#' }) #' -#' ### start server module -#' reactlog_module_server() -#' ### end server module +#' ### start server module +#' reactlog_module_server() +#' ### end server module #' -#' } +#' } #' -#' if (interactive()) { -#' shinyApp(ui = ui, server = server) +#' if (interactive()) { +#' shinyApp(ui = ui, server = server) +#' } #' } reactlog_module_ui <- function(include_refresh = TRUE, id = "reactlog_module") { ns <- shiny::NS(id) @@ -135,7 +132,7 @@ shiny_version_required <- function() { test_shiny_version <- function() { tryCatch({ utils::packageVersion("shiny") >= shiny_version_required() - }, error = function() { + }, error = function(e) { # package not found FALSE })