Reset selected widget when exiting record page layout edit mode#18603
Reset selected widget when exiting record page layout edit mode#18603
Conversation
Co-authored-by: Devessier <29370468+Devessier@users.noreply.github.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Pull request overview
This PR ensures that when a user exits record page layout edit mode, the currently “selected/edited” widget is cleared so the UI doesn’t keep showing a widget as selected outside of edit mode.
Changes:
- Reset
pageLayoutEditingWidgetIdtonullwhen toggling page layout edit mode off. - Wire the widget-editing state into the existing
useSetIsPageLayoutInEditModehook to centralize the cleanup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| } else { | ||
| store.set(pageLayoutEditingWidgetIdState, null); |
There was a problem hiding this comment.
This new behavior (clearing pageLayoutEditingWidgetId when leaving edit mode) isn’t covered by an automated test. Given the existing hook test suite under page-layout/hooks/__tests__, please add a regression test that sets a non-null pageLayoutEditingWidgetId, calls setIsPageLayoutInEditMode(false), and asserts the widget id is reset to null (and ideally that it doesn’t change when toggling true).
|
Hey @Devessier! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
1 similar comment
|
Hey @Devessier! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
LogDetails |
Before
CleanShot.2026-03-12.at.18.27.29.mp4
After
CleanShot.2026-03-12.at.18.26.37.mp4