richardfogaca opened a new pull request, #39908: URL: https://github.com/apache/superset/pull/39908
### SUMMARY Explore preview routes can carry a staged chart name in form data, for example when `update_chart` is called with `generate_preview=true` and a new `chart_name`. Before this change, Explore hydration left the active Explore slice name unset for that preview state, so downstream UI fell back to the persisted saved slice name. The preview page could show the staged name in form data, but the Save overwrite dialog initialized its chart-name input from the old saved chart name, making it easy to overwrite without applying the staged rename. This updates Explore hydration so the active `sliceName` comes from current preview form data before falling back to the saved slice. The Save overwrite dialog already consumes the active Explore name, so it now pre-fills with the staged chart name without adding Save-modal-specific branching. #### What Changed - Hydration now derives the active Explore chart name from preview form data first. - The saved slice name remains the fallback when preview form data does not include a chart name. - Added focused coverage for the hydration boundary and the Save modal's initial chart-name value when the saved slice has a stale name. #### Reviewer Focus Please focus on the Explore hydration boundary in `superset-frontend/src/explore/actions/hydrateExplore.ts`. The fix intentionally avoids special-casing the Save modal; the modal should keep reading the current Explore name it already receives through props. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A - behavior was verified in browser QA, but no public screenshot is attached. ### TESTING INSTRUCTIONS #### Validation Manual QA performed: 1. Opened an Explore preview URL generated for a saved chart where preview form data had a new `slice_name` and the persisted chart still had the old name. 2. Confirmed the Explore title used the preview name. 3. Opened Save and confirmed `Save (Overwrite)` initialized the chart-name input from the preview name. 4. Saved the overwrite and confirmed the chart API reported the new name afterward. Automated checks: ```bash cd superset-frontend npm run test -- src/explore/actions/hydrateExplore.test.ts src/explore/components/SaveModal.test.tsx -t 'hydrates sliceName from preview form data before saved slice name|initializes chart name from current Explore slice name' ``` Also ran `git diff --check` on the changed files. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [x] 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]
