Skip to content

Add "Reset active module" button to snapshot manager (#1707)#1711

Open
stefanlinner wants to merge 1 commit into
insightsengineering:mainfrom
stefanlinner:feature/1707-reset-active-module
Open

Add "Reset active module" button to snapshot manager (#1707)#1711
stefanlinner wants to merge 1 commit into
insightsengineering:mainfrom
stefanlinner:feature/1707-reset-active-module

Conversation

@stefanlinner

@stefanlinner stefanlinner commented Apr 23, 2026

Copy link
Copy Markdown

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 = TRUE filtering 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_module now exposes the active_module_id reactive in its return value, which gets threaded through to the snapshot manager.

Files changed

File What
R/module_nested_tabs.R srv_teal_module returns a list including active_module_id (+ updated @return docs)
R/module_teal.R Extracts active_module_id from the new return value and passes it to srv_snapshot_manager_panel
R/module_snapshot_manager.R Adds conditional "Reset active module" button UI, accepts active_module_id parameter, implements the per-module reset logic
tests/testthat/test-module_teal.R Two new tests: (1) reset only affects the active module's filters, (2) button is not rendered when module_specific = FALSE

Notes

If a filter slice is shared across modules (e.g. via global_filters in 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.

@github-actions

github-actions Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

✅ All contributors have signed the CLA
Posted by the CLA Assistant Lite bot.

@stefanlinner

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Snapshot Manager Reset Initial State enhancement

3 participants