I'd like to move the implementation of live_browser() into the shinychat package, while retaining the same functionality. shinychat::chat_app() would return a shiny app object, where live_browser() would wrap that app into a gadget.
live_browser <- function(chat, quiet = FALSE) {
check_installed(c("bslib", "shiny", "shinychat"))
app <- shinychat::chat_app(chat, options = list(quiet = TRUE))
if (!isTRUE(quiet)) {
cli::cat_boxx(
c("Entering interactive chat", "Press Ctrl+C to quit."),
padding = c(0, 1, 0, 1),
border_style = "double"
)
}
tryCatch(
shiny::runGadget(app),
interrupt = function(cnd) NULL
)
invisible(chat)
}
This change would give shinychat more freedom to update the chat logic more easily as we iterate on shinychat. It also opens the door to refactoring the code, e.g. to create a Shiny module that provides an easy way to go from a Chat object to a shinychat interface.
I'd like to move the implementation of
live_browser()into theshinychatpackage, while retaining the same functionality.shinychat::chat_app()would return a shiny app object, wherelive_browser()would wrap that app into a gadget.This change would give shinychat more freedom to update the chat logic more easily as we iterate on shinychat. It also opens the door to refactoring the code, e.g. to create a Shiny module that provides an easy way to go from a
Chatobject to a shinychat interface.