Skip to content

Make comment box trigger options configurable via config.yaml - #78

Merged
IvoLeist merged 3 commits into
mainfrom
copilot/update-comment-box-configuration
Mar 30, 2026
Merged

Make comment box trigger options configurable via config.yaml#78
IvoLeist merged 3 commits into
mainfrom
copilot/update-comment-box-configuration

Conversation

Copilot AI commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

The voting UI's comment box visibility was hardcoded to trigger only for diff_var and none_of_above. This PR makes that list configurable so operators can show the comment box for any combination of radio options (or all of them).

Changes

  • config.yaml — New comment_trigger_options field:

    comment_trigger_options:
    - diff_var
    - none_of_above
  • load_config.R

    • Defaults to c("diff_var", "none_of_above") when field is absent (backward compatible)
    • Validates all listed values exist in radio_options2val_map; errors on unknown values
  • mod_voting.R (UI) — JS condition for conditionalPanel is now generated from config; empty list produces "false" (panel hidden)

    comment_condition <- paste(
      sapply(cfg$comment_trigger_options, function(opt) {
        sprintf("input['%s'] == '%s'", ns("agreement"), opt)
      }),
      collapse = " || "
    )
  • mod_voting.R (server) — Comment persistence check replaced from hardcoded || comparisons to %in% cfg$comment_trigger_options

Copilot AI changed the title [WIP] Update comment box options to be configurable Make comment box trigger options configurable via config.yaml Mar 30, 2026
Copilot AI requested a review from IvoLeist March 30, 2026 20:28
- Added configuration options for comment boxes in voting options via `radio_options` in config.yaml.
- Updated functions and documentation to reflect changes in configuration structure.
- Adjusted tests to validate new configuration mappings and behaviors.
@IvoLeist
IvoLeist marked this pull request as ready for review March 30, 2026 22:25
@IvoLeist
IvoLeist merged commit a0481f0 into main Mar 30, 2026
1 check passed
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.

Options triggering the display/usage of the comment box should no longer be hardcoded

2 participants