alexandrusoare commented on code in PR #42473:
URL: https://github.com/apache/superset/pull/42473#discussion_r3664925167


##########
superset-frontend/src/explore/components/ExploreViewContainer/index.tsx:
##########
@@ -227,7 +235,20 @@ const updateHistory = debounce(
           force,
           false,
         );
-        history.replace(url, payload);
+        const previousChartState = getChartStateFromHistoryState(
+          history.location.state,
+        );
+        const state = toChartStateHistoryState(payload, sliceId);
+        if (
+          isReplace ||
+          !previousChartState ||
+          isEqual(previousChartState, getChartStateFromHistoryState(state))

Review Comment:
   Nit: the `isEqual` check compares the previous history state against form 
data that was round-tripped through the control panel. Some controls normalize 
values during that round-trip (e.g. `null` → a default via `mapStateToProps`), 
so the two sides can differ even when the user didn't change anything. This 
would cause a `push` instead of `replace`, creating extra history entries the 
user has to Back through with no visible effect.



-- 
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]

Reply via email to