-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Editor: Unify the distraction free preference #57590
Conversation
Size Change: -65 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
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.
Tests well. I can toggle Distraction free in the site editor/post editor and the setting is matched when reloading the other. Just had a question about the useMemo being removed.
}; | ||
|
||
const sections = useMemo( () => [ |
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.
Why remove the useMemo
?
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.
Because it was useless (it had no dependencies) so it's like there's no useMemo to start with.
canvasMode: getCanvasMode(), | ||
settings: getSettings(), | ||
postWithTemplate: _context?.postId, | ||
}; | ||
}, | ||
[ isLargeViewport ] |
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.
Looks like this was only used for the top toolbar setting, which got moved to core by #57531. Good catch on removing this.
Related #52632
Similar to #57468
What?
This PR continues the work on the great unification between post and site editors. In this PR we're unifying the "Distraction free mode" preference. If the user enables it in the post editor, the setting should be used in the site editor as well.
Testing instructions