Repository navigation
Conversation
reactlog_widget() inlines the reactlog page and shows it in an iframe, so it can be embedded in R Markdown or Quarto. Like reactlog_show(), log defaults to shiny::reactlog(). htmlwidgets is a suggested package, checked at run time with rlang::check_installed().
…test2 tests Add reactlog_widget_output() and render_reactlog_widget(), plus reactlog_widget_module_ui() and reactlog_widget_module_server(), which show the widget with a refresh button. Add shinytest2 tests that check the iframe module, the render function, and the widget module load new log entries after a refresh.
schloerke
added this pull request to stack #163
October 22, 2026 20:20
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #160. Adds
reactlog_widget(), which shows the reactlog as an htmlwidget so it can be embedded in R Markdown or Quarto documents or shown in the RStudio viewer. Likereactlog_show(),logdefaults toshiny::reactlog(), and...(such assession_token) is passed on. For Shiny apps, addsreactlog_widget_output()/render_reactlog_widget()and a module,reactlog_widget_module_ui()/reactlog_widget_module_server(), which shows the widget with a refresh button.htmlwidgets,shinytest2, andwithrare added to Suggests;rlangis added to Imports forrlang::check_installed().The widget puts the CSS, JS, and SVG images into one HTML string and shows it in an
<iframe srcdoc>, which keeps the app's globals and element ids apart from the host page. The page-building part ofreactlog_render()moved into a helper,reactlog_page_html(). Both modules share one refresh button helper. Nosrcts/changes.Each widget carries its own copy of the ~590 KB JS file, and the log is a snapshot taken when the widget renders. In Shiny, the first render runs before Shiny's first idle, so the widget needs one refresh to show a full step. New shinytest2 tests check that the iframe module,
render_reactlog_widget(), and the widget module each load new log entries after a refresh; unit tests check that the widget renders and has no leftover asset paths or broken base64 data.