Skip to content

fix(pkg-r): Hide close button in $app() when non-interactive#262

Open
gadenbuie wants to merge 2 commits into
mainfrom
fix/259-hide-close-button-in-app-when-non-interactive
Open

fix(pkg-r): Hide close button in $app() when non-interactive#262
gadenbuie wants to merge 2 commits into
mainfrom
fix/259-hide-close-button-in-app-when-non-interactive

Conversation

@gadenbuie

Copy link
Copy Markdown
Contributor

Closes #259

Summary

$app() renders a fixed close button that calls shiny::stopApp() when clicked. In a deployed app, stopApp() crashes the session for all users. This fix gates both the button (UI) and the observeEvent (server) on rlang::is_interactive(), so neither exists when the app is running in a non-interactive context such as a deployed Shiny app.

Verification

Run querychat(ames) from an interactive R session — the close button appears in the top-right corner and clicking it returns the result as before. In a deployed app the button is absent.

@gadenbuie gadenbuie marked this pull request as ready for review June 24, 2026 20:52
@gadenbuie gadenbuie requested a review from cpsievert June 24, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide close button in $app() when non interactive

2 participants