Skip to content

Conversation

@tonywu1999
Copy link
Contributor

@tonywu1999 tonywu1999 commented Nov 6, 2025

Pending: Removal of API key

Summary by CodeRabbit

  • New Features
    • Added a "Filter out statements curated as incorrect" checkbox in the Data Upload section to exclude curated-incorrect statements from network generation, producing cleaner, more reliable visualizations.
    • Enhanced UI tooltips (including the Force Include Proteins tooltip) to clarify search behavior and available search options.
    • Checkbox defaults to off when unspecified to ensure consistent behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

📝 Walkthrough

Walkthrough

Adds a boolean filterByCuration option (UI checkbox) to the visualize-network module; the value is collected by getInputParameters, propagated through extractSubnetwork/visualizeNetworkServer, and passed as filter_by_curation to getSubnetworkFromIndra and generated network code.

Changes

Cohort / File(s) Change Summary
Curation Filter UI Component
R/module-visualize-network-ui.R
Added exported createCurationFilterCheckbox(ns) to render a "Filter out statements curated as incorrect" checkbox with tooltip; integrated into the Data Upload UI.
Server-side Parameter Propagation & Codegen
R/module-visualize-network-server.R
getInputParameters now includes filterByCuration (defaults NULL→FALSE). extractSubnetwork(…) signature gains filterByCuration and forwards it as filter_by_curation (with api_key = "") to getSubnetworkFromIndra. visualizeNetworkServer and generate_network_code updated to pass/emit filter_by_curation = params$filterByCuration.

Sequence Diagram(s)

sequenceDiagram
    participant UI as UI (checkbox)
    participant Server as visualizeNetworkServer
    participant Params as getInputParameters
    participant Extract as extractSubnetwork
    participant Indra as getSubnetworkFromIndra
    participant Codegen as generate_network_code

    UI->>Server: user toggles filterByCuration
    Server->>Params: collect input params (includes filterByCuration)
    Params-->>Server: params{filterByCuration}
    Server->>Extract: call extractSubnetwork(params, filterByCuration)
    Note right of Extract: filterByCuration forwarded\nas filter_by_curation
    Extract->>Indra: getSubnetworkFromIndra(..., filter_by_curation=BOOL, api_key="")
    Server->>Codegen: generate_network_code(params) (emits filter_by_curation=params$filterByCuration)
    Codegen-->>Server: generated network construction code
    Server-->>UI: render updated network
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I found a tiny checkbox in the meadow of code,
"Filter wrong statements" — I nudged it down the road.
I carried that boolean through server and stream,
Hopped past indra and codegen — a tidy little dream.
🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add curation filtering on Shiny for network interpretation' directly and clearly describes the main change: adding curation filtering functionality to the Shiny UI for network visualization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Failed to generate code suggestions for PR

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @R/module-visualize-network-server.R:
- Around line 616-618: The generated code now adds filter_by_curation but the
server runtime path forces api_key = "" creating a mismatch; update
generate_network_code to include api_key = "" when the server path forces it, or
better remove the forced api_key = "" in the server runtime so both
code-generation (generate_network_code) and server runtime rely on the same
default behavior; locate generate_network_code and the server runtime block that
sets api_key = "" and either add the same forced api_key parameter to
generate_network_code or eliminate the hard-coded api_key = "" in the server
path so both paths are consistent.
🧹 Nitpick comments (1)
R/module-visualize-network-server.R (1)

244-260: Prefer isTRUE() to coerce filterByCuration into a strict scalar boolean.

Current code works, but as.logical() can yield NA if the input ever becomes a non-boolean string; isTRUE() safely normalizes NULL/FALSE/TRUE into FALSE/TRUE.

Proposed refactor
-  filterByCuration <- if(is.null(input$filterByCuration)) {
-    FALSE  # Default to FALSE if somehow NULL 
-  } else {
-    as.logical(input$filterByCuration)
-  }
+  filterByCuration <- isTRUE(input$filterByCuration)
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4c6f7a and b1ff54d.

📒 Files selected for processing (1)
  • R/module-visualize-network-server.R
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
R/module-visualize-network-server.R (2)

531-535: Propagation of filterByCuration into extractSubnetwork() looks consistent.


286-303: This review comment is based on incorrect assumptions about parameter support. Both filter_by_curation and api_key are documented, supported parameters in getSubnetworkFromIndra() and will not cause runtime errors. Passing api_key = "" is equivalent to the function default, so no change is necessary.

Likely an incorrect or invalid review comment.

Comment on lines +616 to 618
codes <- paste(codes, ",\n filter_by_curation = ", params$filterByCuration, "\n", sep = "")

codes <- paste(codes, ")\n\n", sep = "")
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Generated code now includes filter_by_curation, but runtime path also forces api_key = "" (mismatch).

If you keep api_key = "" in the server path, consider reflecting the same behavior in generate_network_code (or, preferably, remove the forced empty key in the server path so both paths rely on the same default behavior).

🤖 Prompt for AI Agents
In @R/module-visualize-network-server.R around lines 616 - 618, The generated
code now adds filter_by_curation but the server runtime path forces api_key = ""
creating a mismatch; update generate_network_code to include api_key = "" when
the server path forces it, or better remove the forced api_key = "" in the
server runtime so both code-generation (generate_network_code) and server
runtime rely on the same default behavior; locate generate_network_code and the
server runtime block that sets api_key = "" and either add the same forced
api_key parameter to generate_network_code or eliminate the hard-coded api_key =
"" in the server path so both paths are consistent.

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.

2 participants