Skip to content

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

Merged
gadenbuie merged 3 commits into
mainfrom
fix/259-hide-close-button-in-app-when-non-interactive
Jun 26, 2026
Merged

fix(pkg-r): Hide close button in $app() when non-interactive#262
gadenbuie merged 3 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
@gadenbuie gadenbuie merged commit ac99be7 into main Jun 26, 2026
9 of 10 checks passed
@gadenbuie gadenbuie deleted the fix/259-hide-close-button-in-app-when-non-interactive branch June 26, 2026 13:37
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