richardfogaca opened a new pull request, #35817:
URL: https://github.com/apache/superset/pull/35817
### SUMMARY
Fixes issue where the "Save" button in dashboard edit mode was incorrectly
enabled even when no changes were made. This occurred because the theme change
detection effect was running on every render, treating the existing theme value
as a "change" and marking the dashboard as having unsaved modifications.
Changes:
- Added `previousThemeRef` to track the actual previous theme value
- Modified theme change detection to compare against the previous value
instead of just checking if theme exists
- Only mark as unsaved when theme actually changes (not on initial render
or navigation)
- Reset the theme ref when exiting edit mode to prevent false positives
when navigating between dashboards
- Clear unsaved changes flag when entering edit mode to ensure clean state
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
- Save button now disabled when clicking on "Edit dashboard" (on initial
page load):
<img width="295" height="173" alt="Screenshot 2025-10-23 at 08 06 53"
src="https://github.com/user-attachments/assets/f3993570-6c4a-4262-bfda-0b56a63cc7bf"
/>
### TESTING INSTRUCTIONS
1. Open a dashboard and enter edit mode
2. Verify the "Save" button is disabled (no changes made yet)
3. Change the dashboard theme
4. Verify "Save" button is now enabled
5. Save the changes and exit edit mode
6. Navigate to another dashboard and enter edit mode
7. Verify "Save" button is disabled (should not show false positive)
### 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]