Skip to content

Harden Shiny package execution by namespacing external UI/render helpers - #5

Merged
amelia-m merged 2 commits into
mainfrom
copilot/fix-shiny-app-errors
Aug 6, 2026
Merged

amelia-m merged 2 commits into
mainfrom
copilot/fix-shiny-app-errors

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Running the app via shiny::runApp() in package-directory mode intermittently failed with unresolved function errors (notably renderDT and visNetwork helpers). The failures were caused by unqualified external-package calls in module/UI startup paths.

  • Scope: DT call sites

    • Replaced unqualified DT helpers with explicit DT:: usage in:
      • /home/runner/work/table-explorer/table-explorer/R/mod_name_changes.R
      • /home/runner/work/table-explorer/table-explorer/R/mod_table_details.R
    • Updated DTOutput, renderDT, datatable, formatStyle, and styleEqual.
  • Scope: visNetwork call sites

    • Replaced unqualified visNetwork helpers with explicit visNetwork:: usage in:
      • /home/runner/work/table-explorer/table-explorer/R/mod_erd.R
    • Updated visNetworkOutput, renderVisNetwork, visNetwork, and chained vis helpers (visOptions, visEdges, visNodes, visInteraction, visEvents, visHierarchicalLayout, visPhysics, visLayout).
  • Scope: app bootstrap/UI entrypoints

    • Added explicit namespaces in app startup/UI wiring:
      • /home/runner/work/table-explorer/table-explorer/R/app_ui.R: shinythemes::shinytheme(...)
      • /home/runner/work/table-explorer/table-explorer/R/run_app.R: shiny::addResourcePath(...), shiny::shinyApp(...)
# before
output$dt_rename_log <- renderDT({ datatable(log) })

# after
output$dt_rename_log <- DT::renderDT({ DT::datatable(log) })

Copilot AI and others added 2 commits August 6, 2026 02:04
Co-authored-by: amelia-m <22108551+amelia-m@users.noreply.github.com>
Co-authored-by: amelia-m <22108551+amelia-m@users.noreply.github.com>
@amelia-m
amelia-m marked this pull request as ready for review August 6, 2026 02:28
Copilot AI lite review requested due to automatic review settings August 6, 2026 02:28
@amelia-m
amelia-m merged commit 83cdd71 into main Aug 6, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the Shiny app when executed in package-directory mode by explicitly namespacing calls to external-package UI/render helpers, preventing “function not found” errors when packages aren’t attached on startup.

Changes:

  • Qualified DT UI/render/formatting helpers with DT:: in the Name Changes and Table Details modules.
  • Qualified visNetwork output/render/build + chained vis helpers with visNetwork:: in the ERD module.
  • Qualified app bootstrap helpers with shiny:: and theme helper with shinythemes::.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
R/run_app.R Namespaces Shiny bootstrap calls (addResourcePath, shinyApp).
R/app_ui.R Namespaces the theme helper (shinythemes::shinytheme).
R/mod_name_changes.R Namespaces DT output + render + datatable calls.
R/mod_table_details.R Namespaces DT output/render and DT formatting helpers (formatStyle, styleEqual).
R/mod_erd.R Namespaces visNetwork output/render/build and chained vis helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants