-
Notifications
You must be signed in to change notification settings - Fork 16.5k
fix: save button was enabled even no changes were made to the dashboard #35817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: save button was enabled even no changes were made to the dashboard #35817
Conversation
…rd (on edit mode)
Code Review Agent Run #bfddc5Actionable 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've completed my review and didn't find any issues.
Files scanned
| File Path | Reviewed |
|---|---|
| superset-frontend/src/dashboard/components/Header/index.jsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
Interaction Diagram by BitosequenceDiagram
participant USER as User
participant HDR as Dashboard Header<br/>🔄 Updated | ●●○ Medium
participant REF as previousThemeRef<br/>🟩 Added | ●○○ Low
participant EFFECT as useEffect Hook<br/>🔄 Updated | ●●○ Medium
participant ACT as boundActionCreators
participant STORE as Redux Store
participant STATE as dashboardState Reducer
Note over HDR, REF: Theme tracking enhancement<br/>prevents false positives
USER->>HDR: Navigate to dashboard
HDR->>REF: Initialize with dashboardInfo.theme
HDR->>EFFECT: Monitor theme & editMode changes
EFFECT->>REF: Compare current vs previous theme
alt Edit Mode & Theme Changed
EFFECT->>ACT: setUnsavedChanges(true)
ACT->>STORE: Dispatch SET_UNSAVED_CHANGES
STORE->>STATE: Update hasUnsavedChanges
EFFECT->>REF: Update previousThemeRef
else Not Edit Mode
EFFECT->>REF: Sync previousThemeRef
end
USER->>HDR: Click Edit Dashboard button
HDR->>ACT: setUnsavedChanges(false)
ACT->>STORE: Reset unsaved changes flag
Critical path: User->Dashboard Header->useEffect Hook->boundActionCreators->Redux Store
|
msyavuz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, this looks testable, can we get some tests?
|
🎪 Showtime deployed environment on GHA for 5e64f4a • Environment: http://34.215.78.155:8080 (admin/admin) |
EnxDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! We just need to address this comment
EnxDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
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:
previousThemeRefto track the actual previous theme valueBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION