Skip to content

Bug: Missing changes from merge for version control settings #1176

@js3110

Description

@js3110

Description

After merging #1103 and #1059, some changes from #1103 were lost during the merge of #1059 into main. The merge conflict resolution in inst/shiny/modules/tab_nca/zip.R dropped the settings comment UI that #1103 added to the export modal.

Root cause

PR #1059 heavily restructured the export modal in zip.R (added slide customisation, validation, multi-step flow). When it was merged after #1103, the conflict resolution dropped the settings comment UI elements that #1103 had added.

What's missing in zip.R

Two pieces from #1103 were lost in the export modal:

1. Settings comment UI element (container + textInput)

The settings_comment_container div with the textInput should appear in the export modal (inside .show_export_modal()) after the "Data tables" format selector, hidden by default and shown when settings_file is selected in the tree. On the #1103 branch this was:

shinyjs::hidden(
  div(
    id = ns("settings_comment_container"),
    tags$br(),
    h4("Comment ", tags$small("(optional)")),
    textInput(
      ns("settings_comment"),
      label = NULL,
      placeholder = "e.g. final NCA, first draft"
    )
  )
)

The observer that shows/hides this container is still present (lines 435-442 on main) but is orphaned — it references a UI element that no longer exists.

2. Settings comment storage in ZIP download handler

The line that stores the comment value for use by .export_settings() is missing from the ZIP download handler:

session$userData$settings_save_comment <- input$settings_comment

Without this, zip-utils.R::.export_settings() always gets an empty comment (session$userData$settings_save_comment is never set during ZIP export), so versioned settings in the ZIP always have a blank comment.

To reproduce

  1. Upload data, run NCA
  2. Open the export modal (Save button)
  3. Select settings_file in the export tree
  4. No comment field appears (it should)
  5. Export ZIP — the settings.yaml inside has an empty comment field

Expected behaviour

  1. When settings_file is selected in the export tree, a "Comment (optional)" text input appears
  2. The comment entered is stored in session$userData$settings_save_comment before ZIP creation
  3. The comment appears in the versioned settings.yaml inside the exported ZIP

Fix scope

  • Add the settings_comment_container div with textInput back into .show_export_modal() in zip.R, after the "Data tables" format selector
  • Add session$userData$settings_save_comment <- input$settings_comment to the ZIP download handler (in the confirm_export or download_zip_configured observer, before the export runs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions