Skip to content

Fix Next button stuck disabled after incomplete mapping error - #1403

Merged
Gero1999 merged 6 commits into
mainfrom
1402-next-button-error-blocks-permanently
Jul 30, 2026
Merged

Fix Next button stuck disabled after incomplete mapping error#1403
Gero1999 merged 6 commits into
mainfrom
1402-next-button-error-blocks-permanently

Conversation

@Gero1999

@Gero1999 Gero1999 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #1402

Description

In the Data tab, submitting an incomplete column mapping (a required variable unmapped) correctly showed an error notification, but the Next button then stayed permanently disabled — the user could not correct the mapping and continue, and had to restart the app.

Root cause

In inst/shiny/modules/tab_data.R (.setup_step_navigation):

  • On click, the button is disabled unconditionally, and on the mapping step it only bumps trigger_mapping_submit (it does not change the step).
  • The re-enable observer depended only on data_step():
    observe({
      data_step()
      shinyjs::enable("next_step")
    })
  • On an incomplete mapping, apply_mapping() throws, mapped_data() catches it and returns NULL, so adnca_mapped() is NULL, req(adnca_mapped()) halts, and the step never advances. Since data_step() never changes, the re-enable observer never re-fires and the button stays disabled.

Fix

Make the re-enable observer also depend on trigger_mapping_submit(), which increments on every mapping submission. The Next button is now re-enabled after each submission is processed, whether the mapping succeeds or fails. This is safe because trigger_mapping_submit is the same reactiveVal that drives the (synchronous) mapping and strictly increments on every click, so repeated failed attempts each re-enable the button.

Definition of Done

  • After an incomplete-mapping error, the user can fix the mapping and click Next again without restarting the app.
  • The Next button is re-enabled after every mapping submission, on success or failure.
  • No regression to the normal upload → mapping → filtering → preview flow.

How to test

  1. devtools::load_all() then aNCA::run_app().
  2. Upload a dataset and open the Mapping step.
  3. Leave a required variable unmapped and click Next — an error notification appears (Unmapped required columns detected: ...).
  4. Map the missing variable and click Next again — the button is clickable and the flow proceeds (previously: button stuck disabled, app restart required).

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 works with the new implementation (if applicable)
  • Settings upload works with the new implementation (if applicable)
  • If any .scss change was done, run data-raw/compile_css.R
  • If a package dependency was added/changed, run data-raw/test_suggests_hidden.R

Notes to reviewer

  • The change is a reactive-dependency fix in Shiny module code, so there is no pure function to unit-test; please verify interactively.
  • R was not available in the authoring environment, so devtools::test() and lintr::lint_package() were not run here. Line lengths were checked manually (all <=100).
  • Version bumped to 0.1.0.9186.

@Gero1999 Gero1999 changed the title 1402 next button error blocks permanently Fix Next button stuck disabled after incomplete mapping error Jul 20, 2026
@Gero1999
Gero1999 requested a review from h5hoang July 21, 2026 06:04
@Gero1999
Gero1999 requested review from KOBANAK and Shaakon35 July 21, 2026 06:04
@Gero1999
Gero1999 requested a review from Belubbit July 21, 2026 06:04
@Gero1999
Gero1999 merged commit 95c6378 into main Jul 30, 2026
13 checks passed
@Gero1999
Gero1999 deleted the 1402-next-button-error-blocks-permanently branch July 30, 2026 12:56
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.

Bug: Next button permanently disabled after incomplete mapping error

3 participants