msyavuz opened a new pull request, #42473:
URL: https://github.com/apache/superset/pull/42473

   ### SUMMARY
   
   Hitting Back while editing a chart no longer undid the change. #38887 
migrated `updateHistory` to the React Router API but made it *always* 
`history.replace()` and removed the `popstate` handler, so chart changes 
stopped creating history entries and nothing restored the form data of a popped 
one.
   
   Restores the behavior in Router terms:
   
   - `updateHistory` pushes an entry when the chart state actually changed, and 
replaces otherwise (`isReplace`, first entry, or identical form data) — so no 
phantom entries and no re-push after an undo.
   - Entries carry their chart's form data, marked via a new 
`exploreUtils/exploreHistory` helper. `ExplorePage` restores that state in 
place on POP (`setExploreControls` + `postChartFormData`) instead of a full 
reload, so undo/redo is instant. A POP into another chart's entry still 
reloads, so state can't leak across charts.
   - `useUnsavedChangesPrompt` gains an opt-in `isInPlaceTransition`; Explore 
passes a same-chart predicate so editing a dirty chart doesn't prompt on every 
push, while actually leaving it still does.
   
   Undo granularity is per query run / render-trigger change (the points that 
previously pushed). Full in-app undo/redo is a separate, larger effort.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — no visual change; the difference is Back button behavior.
   
   ### TESTING INSTRUCTIONS
   
   1. Open a saved chart in Explore, change a control (e.g. row limit) and 
click *Update chart*; repeat once more.
   2. Press Back: the previous chart state is restored in place, without a page 
reload or the unsaved-changes modal. Forward redoes it.
   3. Press Back past the first state: you leave Explore, and the 
unsaved-changes modal appears if the chart is dirty.
   4. Open chart A, navigate to chart B, press Back: chart A fully reloads (no 
mixing of A's controls into B).
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue: No
   - [ ] Required feature flags: None
   - [x] Changes UI — Back/Forward now step through chart states in Explore
   - [ ] Includes DB Migration: No — frontend only
     - [ ] Migration is atomic, supports rollback & is backwards-compatible: N/A
     - [ ] Confirm DB migration upgrade and downgrade tested: N/A
     - [ ] Runtime estimates and downtime expectations provided: N/A
   - [ ] Introduces new feature or API: No — restores pre-#38887 behavior
   - [ ] Removes existing feature or API: No


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