Skip to content

Add view_lt() for interactive browser and editor previews - #56

Open
keaven wants to merge 3 commits into
yihui:mainfrom
keaven:GitHub/view-lt-browser
Open

keaven wants to merge 3 commits into
yihui:mainfrom
keaven:GitHub/view-lt-browser

Conversation

@keaven

@keaven keaven commented Oct 26, 2026

Copy link
Copy Markdown

Add a View()-style helper for inspecting a data frame or an existing lt_tbl in a browser, with column filters enabled by default.

view_lt() serves the generated table over loopback HTTP using the existing xfun dependency. It opens the default browser, or prints and returns the URL with open = FALSE so an editor or AI tool can open its own preview. Non-interactive sessions keep serving until interrupted. The browser callback supports other viewers, and serve = FALSE retains direct HTML-file viewing.

view_lt(mtcars, pager = FALSE)

# Hand the URL to an editor or AI tool:
url = view_lt(mtcars, open = FALSE)

The helper accepts lt_interactive() options, preserves existing table formatting, and can save the HTML at a caller-supplied path. Only the generated table is served; the preview lasts for the R session. Tools on another machine may need port forwarding. No new dependencies are added.

Validation:

  • CI=true Rscript tests/test-all.R: passed.
  • _R_CHECK_FORCE_SUGGESTS_=false R CMD check --no-manual: status OK; optional chromote, magick, and repr were unavailable.
  • Separate-process HTTP smoke test verified the preview remains reachable while Rscript runs, includes the default filters, and does not serve filesystem paths.

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