Conversation
Author
|
Note: this is entirely AI-coded, but the functionality it provides is immense. I started with a wrapper around reactable that has worked well for my org, so I figured it might be of use in the base package. |
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.
R details callbacks currently run for every row while a table is constructed, including rows whose details are never
opened. This adds
lazyDetails = TRUEto defer those callbacks until expansion. Existing behavior remains eager by default.Each opening captures a fresh snapshot. Reactive changes do not recalculate it; sorting, paging, and virtual scrolling
retain it while expanded. Closing discards the result and recursively releases nested lazy tables and Shiny bindings.
Reopening runs the callback again, with the existing one-based row index and column-name arguments.
The implementation uses a session registry, batched JSON requests, and unique table/panel identities. Rerendering
invalidates old registrations even when data is unchanged. A dedicated output binding delegates HTML and dependency
rendering to Shiny, including cleanup when dependencies finish after collapse and widget initialization after an
offscreen panel returns. Existing keyboard expansion and
aria-expandedare retained; loading uses a status and busy state.Limitations:
updateReactable(data = ...)and JavaScriptsetData()reject lazy callback tables;state-only updates remain available.
bindCache()are unsupported.NULL.Validation:
devtools::document()completed.The small development fixtures under
design/lazy-details/cover nesting and delayed-dependency regressions and areexcluded from the built R package. The larger dashboard, benchmark, and dashboard acceptance script are excluded from
this PR. Earlier 10,000-row lazy acceptance results are supplemental review evidence; no performance claim is made here.