korbit-ai[bot] commented on code in PR #34777:
URL: https://github.com/apache/superset/pull/34777#discussion_r2288762806
##########
superset-frontend/src/dashboard/reducers/undoableDashboardLayout.js:
##########
@@ -33,20 +33,69 @@ import { HYDRATE_DASHBOARD } from '../actions/hydrate';
import dashboardLayout from './dashboardLayout';
-export default undoable(dashboardLayout, {
+// List of actions that should trigger undo history
+const TRACKED_ACTIONS = [
+ HYDRATE_DASHBOARD,
+ UPDATE_COMPONENTS,
+ DELETE_COMPONENT,
+ CREATE_COMPONENT,
+ CREATE_TOP_LEVEL_TABS,
+ DELETE_TOP_LEVEL_TABS,
+ RESIZE_COMPONENT,
+ MOVE_COMPONENT,
+ HANDLE_COMPONENT_DROP,
+];
Review Comment:
### Problematic Hydration Action Tracking <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
Including HYDRATE_DASHBOARD in tracked actions could cause issues with
undo/redo when the dashboard is rehydrated from a saved state.
###### Why this matters
If hydration is undoable, users might accidentally undo to a stale state,
losing their current dashboard configuration unexpectedly.
###### Suggested change ∙ *Feature Preview*
Remove HYDRATE_DASHBOARD from tracked actions:
```javascript
const TRACKED_ACTIONS = [
UPDATE_COMPONENTS,
DELETE_COMPONENT,
CREATE_COMPONENT,
CREATE_TOP_LEVEL_TABS,
DELETE_TOP_LEVEL_TABS,
RESIZE_COMPONENT,
MOVE_COMPONENT,
HANDLE_COMPONENT_DROP,
];
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ae07a14-be7b-4e5e-ad3b-ffcd0819661d/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ae07a14-be7b-4e5e-ad3b-ffcd0819661d?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ae07a14-be7b-4e5e-ad3b-ffcd0819661d?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ae07a14-be7b-4e5e-ad3b-ffcd0819661d?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8ae07a14-be7b-4e5e-ad3b-ffcd0819661d)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:2cf2a996-2138-4beb-86ed-3a4a7e2b01ae -->
[](2cf2a996-2138-4beb-86ed-3a4a7e2b01ae)
--
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]