Skip to content

recompute live-search in updateoptionalselectinput #292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025

Conversation

donyunardi
Copy link
Contributor

@donyunardi donyunardi commented Apr 3, 2025

Fixes #291

  • Recompute the option value for live-search in updateOptionalSelectInput.
    This is to anticipate choices being resolved in delayed data scenario. The logic to recompute is the same with this line:
    "live-search" = ifelse(length(choices) > 10, TRUE, FALSE)
  • Update NEWS.
Code for testing
library(teal.modules.clinical)

tdm <- teal_data_module(
  ui = function(id) {},
  server = function(id) {
    moduleServer(id, function(input, output, session) {
      reactive({
        data <- cdisc_data(
          ADSL = tmc_ex_adsl
        )
      })
    })
  }
)

app <- init(
  data = tdm,
  modules = modules(
    tm_t_summary(
      label = "Demographic Table",
      dataname = "ADSL",
      arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
      add_total = TRUE,
      summarize_vars = choices_selected(
        variable_choices("ADSL"),
        c("SEX", "RACE")
      ),
      useNA = "ifany"
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

@donyunardi donyunardi linked an issue Apr 3, 2025 that may be closed by this pull request
3 tasks
Copy link
Contributor

github-actions bot commented Apr 3, 2025

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  ------------------------------------------------------
R/basic_table_args.R             23       0  100.00%
R/draggable_buckets.R            87      87  0.00%    4-163
R/get_dt_rows.R                  13      13  0.00%    44-56
R/ggplot2_args.R                 49       0  100.00%
R/nested_closeable_modal.R       16      16  0.00%    83-98
R/optionalInput.R               256     211  17.58%   150-447, 508, 567, 573, 588-601
R/panel_group.R                  39      39  0.00%    50-136
R/plot_with_settings.R          319      23  92.79%   299-312, 334, 372-373, 384-385, 401, 589-590, 592, 594
R/standard_layout.R              52      20  61.54%   81-99, 106
R/table_with_settings.R         158       1  99.37%   100
R/utils.R                        10       0  100.00%
R/verbatim_popup.R              105      50  52.38%   75-90, 116-117, 119, 127-156, 177
R/white_small_well.R              7       7  0.00%    19-25
TOTAL                          1134     467  58.82%

Diff against main

Filename             Stmts    Miss  Cover
-----------------  -------  ------  -------
R/optionalInput.R       +5      +3  +0.45%
TOTAL                   +5      +3  -0.08%

Results for commit: 799b7e9

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Unit Tests Summary

  1 files   11 suites   11s ⏱️
118 tests  99 ✅ 19 💤 0 ❌
219 runs  200 ✅ 19 💤 0 ❌

Results for commit e638046.

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Unit Tests Summary

  1 files   11 suites   10s ⏱️
117 tests  98 ✅ 19 💤 0 ❌
217 runs  198 ✅ 19 💤 0 ❌

Results for commit 799b7e9.

♻️ This comment has been updated with latest results.

@donyunardi donyunardi requested a review from gogonzo April 14, 2025 18:57
Copy link
Contributor

@gogonzo gogonzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@donyunardi with fresh look I accept a PR. I see the point of setting only live-search option when many choices available.

@donyunardi donyunardi merged commit f3a1a3a into main May 14, 2025
29 checks passed
@donyunardi donyunardi deleted the 291_enable_livesearch_delayed@main branch May 14, 2025 14:34
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: enable live-search option in pickerInput for delayed choices
2 participants