Conversation
📝 WalkthroughWalkthroughThis PR adds confirmation modal dialogs for removing MEAC and Interaction plots from the visualization. Single-click now triggers a removal confirmation modal for these plot types, while double-click is ignored. The hit-testing logic for determining clicked plot identity has been updated to use yaxis panel mappings. ChangesPlot Removal Confirmation Flow
Sequence DiagramsequenceDiagram
participant User
participant ClickHandler as Single-Click Handler
participant Modal as Removal Modal
participant Observer as Confirmation Observer
participant Plot as addedPlots State
User->>ClickHandler: Click on MEAC/Interaction plot
ClickHandler->>ClickHandler: Parse drug from panelvar1 & yaxis
ClickHandler->>Modal: Invoke showRemoveAddedPlotModal(plot)
Modal->>User: Display "Remove <plot> plot?" dialog
User->>Modal: Confirm removal
Modal->>Observer: Trigger input$confirmRemove<Plot>
Observer->>Plot: Remove plot from addedPlots
Plot->>User: Visualization updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to remove 'MEAC' and 'Interaction' plots through a new confirmation modal and updates the plot identification logic. Additionally, the fade effect has been removed from several modal dialogs across the application. Review feedback suggests adding a null check for e$panelvar1 to prevent potential crashes when clicking non-faceted areas and refactoring duplicated observeEvent logic using lapply for better maintainability.
|
Preview Deployment This PR has been deployed to: https://steveshafer.shinyapps.io/stanpumpr_PR_235/ This deployment will be automatically cleaned up when the PR is closed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/app_server.R`:
- Around line 761-768: In imgDrugTime(), guard access to e$panelvar1 before
calling gsub: if e$panelvar1 is NULL, return early or set yaxis to
plottedDrugs[1] (matching the pattern used in xy_str()); then derive drug from
yaxis as currently done. Specifically, add a null-check for e$panelvar1 prior to
computing yaxis (the variable used in the current gsub call) so that gsub is
never called on NULL and the fallback plottedDrugs[1] is used when panelvar1 is
missing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a5c20de4-7f89-4b36-8f74-c4ae9e583931
📒 Files selected for processing (3)
R/app_globals.RR/app_server.RR/server-helpers.R
💤 Files with no reviewable changes (1)
- R/server-helpers.R
Summary by CodeRabbit
New Features
Style