gabotorresruiz opened a new pull request, #34777: URL: https://github.com/apache/superset/pull/34777
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> Fixed a bug where undo/redo buttons in dashboard edit mode weren't getting enabled when adding or removing dashboard components. The issue was caused by a known bug in the redux-undo library where the `includeAction` filter incorrectly filters out actions that should be tracked. **Root Cause**: Redux-undo's filter functionality is broken in multiple versions (including the beta version used by Superset), causing layout actions like `DELETE_COMPONENT` to be incorrectly excluded from undo history. **Solution**: Implemented reducer-level filtering by wrapping the base `dashboardLayout` reducer before passing it to redux-undo. This approach: - Prevents non-layout actions from reaching the reducer (no state change = no undo entry) - Allows redux-undo to work without filtering (which works correctly) - Maintains proper action filtering while avoiding the redux-undo bug - Is well-documented with references to upstream bug reports for future removal ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> Before:  After:  ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. Open a dashboard in edit mode 2. Add a new chart component to the dashboard 3. Verify the undo button becomes enabled 4. Delete a chart component from the dashboard 5. Verify the undo button becomes enabled 6. Click undo to verify the action is reversed 7. Verify the redo button becomes enabled after undoing 8. Click redo to verify the action is re-applied ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
