Skip to content

feat: Share the Reactlog report viewer across R and Python - #166

Open
karangattu wants to merge 2 commits into
mainfrom
feat/python-report-viewer
Open

karangattu wants to merge 2 commits into
mainfrom
feat/python-report-viewer

Conversation

@karangattu

@karangattu karangattu commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

R and Python now open the same interactive Reactlog report. Both packages ship the HTML, CSS, and JavaScript built from viewer/. A report opens offline and includes its trace, graph, timeline, and playback controls.

  • Move the R package to pkg-r/. reactlog_show(), the live Shiny shortcut, and the iframe module all use the shared report through reactlog_render(). Session filtering and the time argument are preserved. The pkgdown demo uses the same renderer.
  • Add the Python reactlog package in pkg-py/. It renders saved R or Python traces and can include source code and a session video when provided.
  • Move the viewer and its standalone tests into this repository. CI opens reports from both installed packages for the same R trace and checks their graph state, timeline, bookmarks, and controls in Chromium.

Recording and CLI integration belong in py-shiny. Switching the py-shiny feature branches to import this package is a follow-up. py-shiny#2467 · py-shiny#2531

Try the same trace in both languages

From a checkout, install the R package with R CMD INSTALL pkg-r and the Python package with uv pip install ./pkg-py. Given a trace saved with reactlog_write(), open it from R:

reactlog::reactlog_show(reactlog::reactlog_read("trace.json"))

Or write the report from Python and open report.html:

from pathlib import Path
from reactlog import format_reactlog_html, load_reactlog_json

trace = load_reactlog_json(Path("trace.json").read_text(encoding="utf-8"))
Path("report.html").write_text(format_reactlog_html(trace, source_code=""), encoding="utf-8")

Verification

  • 83 Python and browser tests passed using the installed Python 3.10 wheel and R package, including the cross-language comparison.
  • Opened the live R Shiny shortcut in Chromium and confirmed that the report displayed the running app's trace. Also opened the generated cranwhales demo.
  • All nine JavaScript tests passed, and the TypeScript and R lint checks passed.
  • R package tests passed. R CMD check finished with zero errors and warnings and one note about the existing rmarkdown import. The pkgdown site and reference index built successfully.

@karangattu karangattu changed the title feat: Add the standalone Reactlog viewer and Python package feat: Share the Reactlog report viewer across R and Python Nov 20, 2026

This branch has not been deployed

No deployments
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.

1 participant