Skip to content

Default empty module selection to the first module in filter_data() - #353

Merged
Schiano-NOAA merged 3 commits into
mainfrom
copilot/fix-selection-panel-behavior
Aug 25, 2026
Merged

Default empty module selection to the first module in filter_data()#353
Schiano-NOAA merged 3 commits into
mainfrom
copilot/fix-selection-panel-behavior

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

filter_data() treated an empty submission from the interactive module_name chooser as "no filter", which left all modules selected. This change makes an empty Enter submission behave like the non-interactive path and default to the first available module.

  • Selection behavior

    • preselect the first module_name in utils::select.list()
    • if the interactive chooser returns an empty selection, fall back to the first module instead of bypassing filtering
  • Implementation

    • centralize the available module names in a local module_names vector
    • reuse that vector across interactive and non-interactive branches so the default path is consistent
  • Targeted test coverage

    • add coverage for empty interactive selection returning the first module
    • add coverage for multi-module, non-interactive input continuing to select the first module
question1 <- utils::select.list(
  options,
  multiple = TRUE,
  preselect = options[1],
  title = "Select one or more of the following module names"
)

selected_module <<- intersect(module_names, question1)
if (length(selected_module) < 1) {
  selected_module <<- module_names[1]
}

Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix selection panel for module_name to select first option on enter Default empty module selection to the first module in filter_data() Aug 25, 2026
Copilot AI requested a review from Schiano-NOAA August 25, 2026 13:38

@Schiano-NOAA Schiano-NOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fantastic

@Schiano-NOAA
Schiano-NOAA marked this pull request as ready for review August 25, 2026 18:21
Co-authored-by: Schiano-NOAA <125507018+Schiano-NOAA@users.noreply.github.com>
Copilot AI requested a review from Schiano-NOAA August 25, 2026 19:05
@Schiano-NOAA
Schiano-NOAA merged commit c1265b6 into main Aug 25, 2026
8 checks passed
@Schiano-NOAA
Schiano-NOAA deleted the copilot/fix-selection-panel-behavior branch August 25, 2026 19:48
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.

[fix]: selection panel for module_name selects all if just "enter" is pressed

2 participants