Add "Reset active module" button to snapshot manager (#1707)#1711
Open
stefanlinner wants to merge 1 commit into
Open
Add "Reset active module" button to snapshot manager (#1707)#1711stefanlinner wants to merge 1 commit into
stefanlinner wants to merge 1 commit into
Conversation
Contributor
|
✅ All contributors have signed the CLA |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1707
TrackB_RMedicine_Hackathon_Apr2026
Summary
When
module_specific = TRUE, the snapshot manager now has an additional button ("Reset active module") that resets the filter panel of only the currently active module back to its initial state. The existing "Reset initial state" button continues to reset all modules at once.What changed
The new button (a rotate-left icon) appears in the snapshot manager modal, next to the existing undo icon. It is only rendered when
module_specific = TRUEfiltering is enabled, since it has no meaning in global filtering mode.Clicking the button restores both the mapping (which filters are active) and the filter values for the active module to their initial application state, while leaving all other modules untouched.
To make this work,
srv_teal_modulenow exposes theactive_module_idreactive in its return value, which gets threaded through to the snapshot manager.Files changed
R/module_nested_tabs.Rsrv_teal_modulereturns a list includingactive_module_id(+ updated@returndocs)R/module_teal.Ractive_module_idfrom the new return value and passes it tosrv_snapshot_manager_panelR/module_snapshot_manager.Ractive_module_idparameter, implements the per-module reset logictests/testthat/test-module_teal.Rmodule_specific = FALSENotes
If a filter slice is shared across modules (e.g. via
global_filtersin the mapping), resetting the active module will also restore that slice's value for all other modules that use it. This is consistent with how the existing "Reset initial state" button works.