From ec2fc81405a23e85a0166195fb55d2343db8f529 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 20:23:24 +0000 Subject: [PATCH 1/2] Initial plan From c3fd76a0b2d1b18fa197c7570e1ac798190741c6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 20:27:56 +0000 Subject: [PATCH 2/2] fix: resolve CI failures - tryCatch handler, example return(), and flow-typed install Agent-Logs-Url: https://github.com/rstudio/reactlog/sessions/fa714002-0190-4876-bcdc-33c3a8eabae7 Co-authored-by: karangattu <4220325+karangattu@users.noreply.github.com> --- R/shinyModule.R | 55 ++++++++++++++++++++---------------------- bin/postinstall.sh | 3 ++- man/reactlog_module.Rd | 53 +++++++++++++++++++--------------------- 3 files changed, 53 insertions(+), 58 deletions(-) diff --git a/R/shinyModule.R b/R/shinyModule.R index 830dd1f..121397e 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"), +#' # 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() +#' 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() +#' 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(cond) { # package not found FALSE }) diff --git a/bin/postinstall.sh b/bin/postinstall.sh index 6c14877..5055584 100755 --- a/bin/postinstall.sh +++ b/bin/postinstall.sh @@ -2,6 +2,7 @@ # do not create stubs from missing libraries # ignore dev dependencies -yarn flow-typed install --skip true --ignoreDeps dev +# Allow failure: flow-typed may fail if the GitHub API is unavailable +yarn flow-typed install --skip true --ignoreDeps dev || true yarn build-only diff --git a/man/reactlog_module.Rd b/man/reactlog_module.Rd index 16dccf7..5d23a54 100644 --- a/man/reactlog_module.Rd +++ b/man/reactlog_module.Rd @@ -32,44 +32,41 @@ To open the reactlog at a particular step, be sure to mark your time points with \code{Cmd+Shift+F3} (Windows: \code{Ctrl+Shift+F3}) } \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"), + # 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() + 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() + reactlog_module_server() ### end server module -} + } -if (interactive()) { - shinyApp(ui = ui, server = server) + if (interactive()) { + shinyApp(ui = ui, server = server) + } } } \seealso{