Skip to content

Commit 2600726

Browse files
Gero1999ona-agent
andcommitted
fix: align slope_selector interval filter with get_halflife_plots
Use the same half.life | if_any(hl_dep_params) filter so change-detection and UI widgets operate on the correct interval set. Co-authored-by: Ona <no-reply@ona.com>
1 parent 48b978d commit 2600726

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

inst/shiny/modules/tab_nca/setup/slope_selector.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,15 @@ slope_selector_server <- function( # nolint
140140
req(processed_pknca_data())
141141

142142
new_pknca_data <- processed_pknca_data()
143+
# Keep main intervals where half.life or any dependent param is selected.
144+
# get_halflife_plots() handles the rest (forcing half.life, clearing impute).
145+
hl_dep_params <- intersect(
146+
PKNCA::get.parameter.deps("half.life"),
147+
names(new_pknca_data$intervals)
148+
)
143149
new_pknca_data$intervals <- new_pknca_data$intervals %>%
144-
filter(type_interval == "main", half.life) %>%
150+
filter(type_interval == "main") %>%
151+
filter(half.life | if_any(all_of(hl_dep_params))) %>%
145152
unique()
146153
changes <- detect_pknca_data_changes(
147154
old = pknca_data(),

0 commit comments

Comments
 (0)