Skip to content

Resolve open TODOs and add missing documentation and tests#1306

Merged
h5hoang merged 13 commits into
mainfrom
1299-enhancement/resolve-todos-docs-tests
May 20, 2026
Merged

Resolve open TODOs and add missing documentation and tests#1306
h5hoang merged 13 commits into
mainfrom
1299-enhancement/resolve-todos-docs-tests

Conversation

@h5hoang

@h5hoang h5hoang commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #1299

Description

Resolves open TODOs, adds missing documentation and tests, fixes typos, and standardizes metadata CSV values across the codebase.

Task 1: Add documentation to units_table.R

  • Replaced TODO with proper roxygen documentation for units_table_ui().

Task 2: Resolve TODO in flexible_violinboxplot.R

  • Removed cut-off TODO comment; improved @param descriptions for xvars, colorvars, and varvalstofilter.

Task 3: Add tests for R/utils-plots.R

  • Created tests/testthat/test-utils-plots.R with 9 tests covering .handle_tooltips() and error_plot().

Task 4: Standardize T/F to TRUE/FALSE in metadata CSV

  • Updated can_* columns in data-raw/metadata_nca_parameters.csv and regenerated .rda.
  • Fixed related bug in parameter_selection.R:462 where identical(can_exc, "T") was comparing a logical to a string (always FALSE). Changed to isTRUE(can_exc). Refer to the issue comment.

Task 5: Fix typo "miliseconds" → "milliseconds"

  • Fixed in inst/shiny/www/index.js.

Task 6: Fix typo "infering" → "inferring"

  • Fixed in 4 TLG option modules (8 occurrences). Also fixed resulting line-length lint violations.

Definition of Done

  • units_table.R has proper roxygen documentation for UI function
  • TODO in flexible_violinboxplot.R resolved — parameters documented, comment removed
  • test-utils-plots.R created with tests for .handle_tooltips() and error_plot()
  • metadata_nca_parameters.csv uses TRUE/FALSE in can_* columns, .rda regenerated
  • Typo "miliseconds" fixed in index.js
  • Typo "infering" fixed in TLG option modules

How to test

  • Tests: Review logic makes sense
  • Documentaiton: Review the doocumentation changes were applied
  • The App keeps working regarding metadata_nca_parameters.csv (input widgets in NCA > Parameter Selection

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

Anything that the reviewer should know before tacking the pull request?

  • Task 4 included a related bug fix: parameter_selection.R:462 used identical(can_exc, "T") which always returned FALSE because read.csv() converts unquoted T to logical TRUE. Changed to isTRUE(can_exc). See issue comment for details.

@h5hoang h5hoang linked an issue May 11, 2026 that may be closed by this pull request
6 tasks
@h5hoang h5hoang requested a review from Gero1999 May 11, 2026 18:04
@h5hoang h5hoang marked this pull request as ready for review May 11, 2026 18:04

@Gero1999 Gero1999 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.

Nice work on this PR! Just to be very nitpicky:

Merge conflict risk: The T/F → TRUE/FALSE CSV rewrite touches every row, which will conflict with PRs #1245 that also modify this file to fix a bug found. Might be worthy be a bit careful while merging and making sure what was fixed there still remains here

Issue: This is my bad. The identical(can_exc, "T") was indeed always FALSE (logical vs string comparison), but the resulting behavior was actually correct. The can_excretion column indicates whether a parameter can be computed from excretion data — it's used for parameter matrix defaults, not for UI location. Only TYPE == "Urine" parameters (RCAMINT, FREXINT) are actually configurable in the Excretion tab.

Changing to isTRUE(can_exc) makes the condition work as written, but what was written was wrong — it now shows "Additional Analysis > Excretion" for ~30 standard parameters (CMAX, TMAX, etc.) that aren't available there. See the images below. To fix perhaps just remove the can_exc variable and simplify the condition to just if (type == "Urine").

Image Image

Let me know if there are questions. Once you are done feel free to bump the package version. Overall good job! :)

@h5hoang

h5hoang commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

Hi Gerardo! Thanks for the feedback!

I've addressed the concerns you had, it should run properly now. Attached are the screenshots that show that the "Additional Analysis > Excretion" is now limited to just these 5 params.

Screenshot 2026-05-13 at 12 52 55 PM Screenshot 2026-05-13 at 12 46 00 PM

I also merged main and preserved the show_in_matrix_selection column from #1245 before re-applying the T/F → TRUE/FALSE fix.

@h5hoang h5hoang requested a review from Gero1999 May 13, 2026 20:03

@Gero1999 Gero1999 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.

Good job, LGTM!

Only thing would be to update the PR description for the later change made. But the solution itself is wonderful 😉

@AngelaManginelli AngelaManginelli 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.

I checked whether the "definition of done" was correctly implemented and did not fine any inconsistency. Thanks!

@h5hoang h5hoang merged commit 638801a into main May 20, 2026
11 of 12 checks passed
@h5hoang h5hoang deleted the 1299-enhancement/resolve-todos-docs-tests branch May 20, 2026 22:02
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: Resolve open TODOs and add missing documentation and tests

3 participants