fix(explore): preserve preview chart name on save#39908
Conversation
Code Review Agent Run #421d25Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
kgabryje
left a comment
There was a problem hiding this comment.
lgtm with a nonblocking readability nit
|
The destructuring approach you suggested improves readability by clearly separating the primary and fallback assignments based on the condition, avoiding the nested ternary operators. It achieves the same logic with better clarity. If you prefer if/else for even more explicit control flow, that could work too, but the destructuring is concise and effective. |
SUMMARY
Explore preview routes can carry a staged chart name in form data, for example when
update_chartis called withgenerate_preview=trueand a newchart_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
sliceNamecomes 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
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:
slice_nameand the persisted chart still had the old name.Save (Overwrite)initialized the chart-name input from the preview name.Automated checks:
Also ran
git diff --checkon the changed files.ADDITIONAL INFORMATION