Skip to content

fix protein turnover download zipfile - #220

Merged
tonywu1999 merged 1 commit into
develfrom
fix-turnover
Jul 13, 2026
Merged

fix protein turnover download zipfile#220
tonywu1999 merged 1 commit into
develfrom
fix-turnover

Conversation

@tonywu1999

@tonywu1999 tonywu1999 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Protein turnover plot downloads lacked the turnover_ratios reactive required by response-curve templates, causing zipfile download behavior to fail. The download handler now receives this reactive explicitly.

Changes

  • Added turnover_ratios to create_download_plot_handler() as an optional reactive argument.
  • Passed turnover_ratios from statmodelServer into the download handler.
  • Preserved a reactive(NULL) default for compatibility.
  • Updated the initialization test to expect nine handler arguments.

Unit Tests

  • Modified test-module-statmodel-server.R to verify the updated nine-argument handler initialization.

Coding Guidelines

  • No coding guideline violations identified.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The plot download handler now accepts a turnover_ratios reactive, statmodelServer passes it during initialization, and the corresponding test expects the additional argument.

Changes

Plot download handler input wiring

Layer / File(s) Summary
Handler contract and server wiring
R/statmodel-server-visualization.R, R/module-statmodel-server.R, tests/testthat/test-module-statmodel-server.R
create_download_plot_handler accepts turnover_ratios, the server passes the reactive, and the initialization test expects nine arguments.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: swaraj-neu, rudhik1904, deril2605

Poem

A bunny wired the ratios in,
So plots can hop when downloads begin.
The handler counts one more thread,
Tests nod their ears: “Well fed!”
Response curves bounce ahead.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main change: fixing the protein turnover download zipfile behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-turnover

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.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
tests/testthat/test-module-statmodel-server.R (1)

784-785: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the new reactive arguments, not only the count.

length(handler_args) == 9 still passes if turnover_ratios and condition_metadata are swapped or replaced. Pass distinct sentinel reactives and verify positions 8 and 9 (or capture named arguments) so this test covers the wiring this PR changes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/testthat/test-module-statmodel-server.R` around lines 784 - 785,
Strengthen the test around create_download_plot_handler by supplying distinct
sentinel reactives for turnover_ratios and condition_metadata, then assert that
handler_args positions 8 and 9 contain the corresponding reactives rather than
only checking the argument count. Preserve the existing nine-argument assertion
while verifying the changed wiring.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/testthat/test-module-statmodel-server.R`:
- Around line 784-785: Strengthen the test around create_download_plot_handler
by supplying distinct sentinel reactives for turnover_ratios and
condition_metadata, then assert that handler_args positions 8 and 9 contain the
corresponding reactives rather than only checking the argument count. Preserve
the existing nine-argument assertion while verifying the changed wiring.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6ff26d83-5726-4d58-9f1a-b42bc7c2e872

📥 Commits

Reviewing files that changed from the base of the PR and between f8f426b and f2231ee.

📒 Files selected for processing (3)
  • R/module-statmodel-server.R
  • R/statmodel-server-visualization.R
  • tests/testthat/test-module-statmodel-server.R

@tonywu1999
tonywu1999 merged commit 4bd63b6 into devel Jul 13, 2026
2 checks passed
@tonywu1999
tonywu1999 deleted the fix-turnover branch July 13, 2026 18:06
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.

1 participant