chore(moduleServer): use more modern module server for network server#172
chore(moduleServer): use more modern module server for network server#172tonywu1999 merged 2 commits intodevelfrom
Conversation
📝 WalkthroughWalkthroughvisualizeNetworkServer is converted to a Shiny module: signature changed to accept Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
R/server.R (1)
64-65: Update stale inline comment near the new module call.Line 65 is already using the refactored call style, but Line 64 still references
callModule.Suggested cleanup
- # visualizeNetworkServer - keep callModule if not yet refactored + # visualizeNetworkServer - module-style invocation visualizeNetworkServer("network", parent_session = session, dataComparison = data_comparison)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@R/server.R` around lines 64 - 65, Update the stale inline comment above the module invocation: replace or remove the "keep callModule if not yet refactored" note since the code already uses the refactored call visualizeNetworkServer("network", parent_session = session, dataComparison = data_comparison); ensure the comment references the current refactored usage (or remove it entirely) so the inline comment accurately reflects the use of visualizeNetworkServer rather than mentioning callModule.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@R/module-visualize-network-server.R`:
- Around line 319-320: The DESCRIPTION Imports currently lists shiny without a
version; because visualizeNetworkServer uses moduleServer (which requires shiny
>= 1.5.0), update DESCRIPTION to require Shiny >= 1.5.0 by modifying the Imports
entry for shiny to "shiny (>= 1.5.0)" so package installs/loaders on older
systems will pull a compatible Shiny version.
---
Nitpick comments:
In `@R/server.R`:
- Around line 64-65: Update the stale inline comment above the module
invocation: replace or remove the "keep callModule if not yet refactored" note
since the code already uses the refactored call
visualizeNetworkServer("network", parent_session = session, dataComparison =
data_comparison); ensure the comment references the current refactored usage (or
remove it entirely) so the inline comment accurately reflects the use of
visualizeNetworkServer rather than mentioning callModule.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
NAMESPACER/module-visualize-network-server.RR/server.Rman/visualizeNetworkServer.Rd
Motivation and Context
This PR modernizes the network visualization server by migrating from Shiny's older callModule pattern to the contemporary moduleServer pattern. The change aligns the package with current Shiny best practices, improves namespacing and composability of server logic, and clarifies the public API for initializing the network module.
Solution Summary
Refactor visualizeNetworkServer into a Shiny module initializer using moduleServer, update invocation sites and documentation, add the required NAMESPACE import for moduleServer, and set a minimum shiny version in DESCRIPTION.
Detailed Changes
NAMESPACE
R/module-visualize-network-server.R
R/server.R
man/visualizeNetworkServer.Rd
DESCRIPTION
Unit Tests
Coding Guidelines / Potential Issues