Skip to content

shinychat: Move live_browser() implementation to shinychat #397

Description

@gadenbuie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions