Skip to content

Conversation

@Gero1999
Copy link
Collaborator

@Gero1999 Gero1999 commented Jan 19, 2026

Issue

Closes #638

Description

This PR refactors and enhances the ZIP export functionality for NCA results in the Shiny application. It introduces a new modular UI for ZIP export, adds user-selectable output formats and objects, and cleans up the codebase:

  • Added a new zip_ui and zip_server module (tab_nca/zip.R) that provides a user interface for selecting which results to export and in which formats (plots, tables, slides). The module uses a tree widget for object selection and supports multiple export formats per object.
  • Refactored the save_output function to support more flexible export options, including selective export of objects and multiple formats for plots and tables. Helper functions for saving different object types were added for better code organization.
  • Refactored relevant code into the ZIP module, to simplify the changes on this App section.
  • Added a new "ZIP Download" tab to the NCA analysis UI, moving ZIP export out of the results panel and into its own dedicated workflow.
  • Added utility functions to build a tree structure from the results list and to retrieve selected leaf node IDs, supporting the new tree-based selection UI for exports.

Definition of Done

  • Relocate the ZIP download button to a better place
  • Include a download tree so the user can mark the outputs they want (suggestion: shinyWidgets tree)

How to test

Map Data > Run NCA > ZIP Results > Play with the different options > Press Export ZIP

Contributor checklist

  • Code passes lintr checks
  • Code passes all unit tests
  • New logic covered by unit tests
  • New logic is documented
  • App or package changes are reflected in NEWS
  • Package version is incremented
  • R script feat if not yet merged (Create R script to replicate App outputs (#467) #789), the feat should be made available in there

@Gero1999 Gero1999 linked an issue Jan 19, 2026 that may be closed by this pull request
2 tasks
@Gero1999 Gero1999 changed the title 638 enhancement zip UI Allow user to customize their exported ZIP using the UI (#638) Jan 19, 2026
@Gero1999 Gero1999 changed the title Allow user to customize their exported ZIP using the UI (#638) Allow user to customize their exported ZIP using new UX/UI (#638) Jan 19, 2026
@Gero1999 Gero1999 marked this pull request as ready for review January 19, 2026 10:36
Copy link
Collaborator

@js3110 js3110 left a comment

Choose a reason for hiding this comment

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

Functionally this works really well, nice work!

UI wise I think it could do with improvement, its not very clear to the user that this is an option. I think the original idea is that we move the button to export somewhere that is always visible in NCA results tab, and then upon clicking the user is shown a modal pop up with the export options. I think that this would look much nicer.

Or even have the button available at any point (eg near project name) because technically they can export plots and settings which don't require NCA to be run yet...

@Gero1999
Copy link
Collaborator Author

Agreed to put a ZIP button at top right-edge opening a modal

@Shaakon35
Copy link
Collaborator

  • Let's make it a button (that is disabled if NCA have not been run already) on top right on the screen
  • If you click on the button, a pop-up appears

In the Zip file list is not working:

  • R script button

@Gero1999
Copy link
Collaborator Author

@Shaakon35 the r-script feat is still not available/merged (#789). If that PR is not merged before this one I will remove it

@Gero1999 Gero1999 requested review from Shaakon35 and js3110 and removed request for Shaakon35 January 20, 2026 13:15
Copy link
Collaborator

@Shaakon35 Shaakon35 left a comment

Choose a reason for hiding this comment

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

LGTM

Last remarks:

  1. is presentations_slides a category? (It has an arrow)
  2. if your can align left with css that would be great.
image

Copy link
Collaborator

@js3110 js3110 left a comment

Choose a reason for hiding this comment

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

I get a bug:

Download Error:
In argument: `across(any_of(info_vars))`.
Warning: Error in group_by: ℹ In argument: `across(any_of(info_vars))`.
Caused by error in `across()`:
ℹ In argument: `any_of(info_vars)`.
Caused by error in `any_of()`:
! Can't subset elements.
✖ Subscript must be numeric or character, not a <PKNCAdata/list> object.

I had the following:

image

basic settings (and I also did additional analysis and excretion)

Leading on from that, could we have additional analysis and excretion results in the output please (I think we used to have it at one point?)

Also, nitpick, style: Please can you centre the "Export results as ZIP" modal title, and if possible move the Export ZIP button to bottom- centre or bottom right of the modal (ie take it out of the fluidRow for export formats)

@Gero1999 Gero1999 marked this pull request as draft January 21, 2026 07:26
@Gero1999 Gero1999 removed the request for review from m-kolomanski January 21, 2026 07:26
@Gero1999 Gero1999 marked this pull request as ready for review January 21, 2026 08:16
@Gero1999 Gero1999 requested a review from js3110 January 21, 2026 08:16
@Shaakon35
Copy link
Collaborator

@Gero1999 Instead of naming the button: Export Zip,

Maybe be better to just name it "Save"

Copy link
Collaborator

@js3110 js3110 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks :)

@Gero1999 Gero1999 merged commit 89b9ef6 into main Jan 22, 2026
10 checks passed
@Gero1999 Gero1999 deleted the 638-enhancement-zip-ui branch January 22, 2026 08:17
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.

Enhancement: Zip UX/UI location and output selection

4 participants