Skip to content

Replace reactable with lt for the AE listing table - #267

Draft
yihui wants to merge 2 commits into
mainfrom
replace-reactable-with-lt
Draft

yihui wants to merge 2 commits into
mainfrom
replace-reactable-with-lt

Conversation

@yihui

@yihui yihui commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

react_ae_listing() rendered the interactive AE listing with reactable. This migrates it to the lightweight lt package, mirroring forestly's reactable→lt migration (Merck/forestly#168, #169).

The exported function keeps its name and signature (react_ae_listing(outdata, default_page_size, searchable, striped, highlight, patient_folding, width)). The one API change is the return type: it now returns an lt_tbl object (which prints / knits to an interactive HTML table) instead of a reactable htmlwidget.

What changed

R/react_ae_listing.R

  • Build the table with lt::lt() (raw column names as data keys; display labels applied via lt_label()), then lt::lt_interactive():
    • non-folding (default): per-column filter boxes (filter = TRUE), global search, pagination (requested default_page_size first, then 10/25/50/100), resizable columns.
    • patient_folding: global search off; only the patient-ID column is filterable, as a "select" dropdown of full IDs (box = FALSE, exact match). Seeded with a control-character selected sentinel absent from the data, so the table starts empty until a participant is picked.
  • striped / highlight are scoped CSS rules via lt_css() (lt has no zebra/hover default).
  • width sizes the container via lt_wrap(style = "width:...;overflow-x:auto").

Packaging / docs

  • DESCRIPTION: drop reactable from Suggests, add lt to Imports, add Remotes: yihui/lt (lt is not on CRAN).
  • Rename vignette ae-listing-reactable.Rmd → ae-listing.Rmd (the old name referenced reactable) and update _pkgdown.yml; also fix an AREL → AEREL typo in the vignette's define_parameter() subset.
  • Regenerate man/react_ae_listing.Rd.
  • Rewrite the tests for the lt_tbl output.
  • Add a NEWS entry.

Differences from the reactable version

  • Return type is lt_tbl, not a reactable htmlwidget.
  • patient_folding exact match is now a dropdown pick (lt "select" filter) rather than a free-text exact-match box; privacy "start empty" behavior is preserved.
  • The per-column minWidth = 120 and the bordered/compact/wrap cosmetic flags have no direct lt equivalent and are dropped; striped/highlight are reproduced via CSS.

Test plan

  • devtools::load_all() + testthat::test_dir(filter = "react_ae_listing") — all pass.
  • Smoke-rendered both modes to HTML (format()); the folding spec serializes the select filter + sentinel, striping and width rules are present.

🤖 Generated with Claude Code

Rewrite react_ae_listing() to render the interactive AE listing with the
lightweight lt package instead of reactable. The function keeps its name and
signature but now returns an lt_tbl object built with lt_interactive()
(per-column filters, global search, pagination, resizable columns) plus
striped/hover styling via lt_css() and a container width via lt_wrap().

In patient_folding mode the patient-ID column becomes a dropdown of full IDs
(exact match, no free-text box), global search is off, and the table starts
empty via a control-character sentinel until a participant is selected.

- DESCRIPTION: drop reactable from Suggests, add lt to Imports, add
  Remotes: yihui/lt (lt is not on CRAN).
- Rename the vignette ae-listing-reactable.Rmd -> ae-listing.Rmd and update
  _pkgdown.yml; fix an AEREL typo in the metadata definition.
- Rewrite the tests for the lt_tbl output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yihui yihui linked an issue Nov 5, 2026 that may be closed by this pull request
Co-Authored-By: Claude Code <noreply@anthropic.com>

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.

Make react_ae_listing() from a reactable to lt

1 participant