Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg-r/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

* Fixed `data_description` and `extra_instructions` being HTML-escaped in the system prompt. Special characters like `<`, `>`, and `&` in developer-provided descriptions and instructions are now passed to the LLM verbatim. (#258)

* The close button in `$app()` is now hidden when running in a non-interactive context (e.g. a deployed Shiny app), preventing `stopApp()` from crashing the session for other users. (#259)

# querychat 0.3.0

## New features
Expand Down
36 changes: 20 additions & 16 deletions pkg-r/R/QueryChat.R
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,14 @@ QueryChat <- R6::R6Class(
),
DT::DTOutput("dt")
),
shiny::actionButton(
"close_btn",
label = "",
class = "btn-close",
style = "position: fixed; top: 6px; right: 6px;"
)
if (rlang::is_interactive()) {
shiny::actionButton(
"close_btn",
label = "",
class = "btn-close",
style = "position: fixed; top: 6px; right: 6px;"
)
}
)
}

Expand Down Expand Up @@ -777,17 +779,19 @@ QueryChat <- R6::R6Class(
)
})

shiny::observeEvent(input$close_btn, label = "on_close_btn", {
name <- active_table_name()
shiny::stopApp(
list(
df = qc_vals$.tables[[name]]$df(),
sql = qc_vals$.tables[[name]]$sql(),
title = qc_vals$.tables[[name]]$title(),
client = qc_vals$client
if (rlang::is_interactive()) {
shiny::observeEvent(input$close_btn, label = "on_close_btn", {
name <- active_table_name()
shiny::stopApp(
list(
df = qc_vals$.tables[[name]]$df(),
sql = qc_vals$.tables[[name]]$sql(),
title = qc_vals$.tables[[name]]$title(),
client = qc_vals$client
)
)
)
})
})
}
}

shiny::shinyApp(ui, server, enableBookmarking = bookmark_store)
Expand Down
Loading