Repository navigation
Editor: Make distraction-free mode appearance settings configurable - #74546
youknowriad wants to merge 1 commit into
Conversation
This PR makes the UI behavior of distraction-free mode independently configurable. Instead of bundling all UI changes together when distraction-free mode is enabled, users can now customize which settings are applied in each mode through the preferences modal. The key change is introducing a `distractionFreeConfig` object in preferences that mirrors the normal mode settings. When distraction-free mode is active, these config values are used instead of the normal defaults. Two new preferences are added: - `showSimpleTopbar`: Controls visibility of inserter, list view, and zoom out toggles - `showBlockHelpers`: Controls visibility of insertion points, in-between inserter, grid visualizer, and block highlight effects A new `getEditorUIPreference` selector handles fetching the appropriate value based on current mode, making it easy for components to get the right setting without needing to know about the dual-mode system. The preferences modal now has two sections - "Normal mode" and "Distraction-free mode" - allowing users to configure each independently while sharing the same toggles through a common component pattern. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @davemart-in. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +427 B (+0.01%) Total Size: 3.08 MB
ℹ️ View Unchanged
|
|
I find two opinionated modes that are entirely configurable a little bit confusing to be honest. It makes the overall experience somewhat overwhelming and kind of undermines the whole point of having modes because you can configure "Distraction free" to be normal and "Normal" to be distraction free. My instinct is that most users will only ever need a single configuration and rarely swap between modes. They're more likely to toggle individual features as and when. But that's just an assumption so take it with a grain of salt. If this is the direction we want to head in I wonder if the UI could be simplified by including a "Mode" control in the preferences modal, and you only see options for the currently selected mode. |
|
Nice PR. A quick before: A quick after: I tend to high level agree with what Jay said just a moment ago, but I also think that's mostly something we can address and fix. For me, the main thing I like about this is:
So for the sake of simplifying controls, there's something here that I think we can work with. I'm also fundamentally a fan of allowing configurability of this UI, because no user or context is the same, and having the ability to flow in and out of these things feels useful. For my own use case, I could see myself using distraction free by default in the post editor where I want the top toolbar and "normal mode" in the site editor where I want the contextual toolbar. But to be honest, the main differnce here is top toolbar or not: the auto hiding toolbar causes a layout shift which makes me not use it. And this change would afford me to turn off the auto hiding header. In that vein, some things to discuss: I've "mode" fatigue. I'd love to eliminate the word. If we do keep things as just a single distraction free toggle, can we call it "Distraction free" and "Default", also for the sake of preferences? Spotlight mode grew on me the moment we started using it for notes and isolated editing. The fact that it's off by default for both default and distraction free modes feels like a way to compartmentalize what is perhaps an esoteric option, yet not remove it. For that reason, I like the expanded preferences. But there's also a lot:
Going through each, these stand out:
But mainly: it's a bit many options on this screen, is there a way we can combine "Block helpers" and "Simplified topbar" into one? Conceptually they fall into "reduced interface", and if we were ever to expand what each of these options allowed us to do, it might be nice to be more abstract in the feature knobs, so we could expand what they controlled. For example, minimized notes might be on by default if this was toggled. It would allow us categories of options, rather than individual features. What do you think? The final thought relates to Fullscreen mode:
In that dropdown, it's the odd one out. I feel like we should either move that option elsewhere in the ellipsis, perhaps into a flyout, make it part of these appearance modes (on by default), or move it elsewhere in preferences. Perhaps controversial, but in the reduction of the menu, it gains undue prominence, and if we were to move it, we could do radios:
An alternative could be to keep Fullscreen, but add something else there, such as move over "Show template" from the responsive dropdown:
That might be useful to do regardless, given some of the responsive editing tools that are underway, which recasts that responsive dropdown to be much more about responsive editing, perhaps exclusively about responsive editing as in this concept:
Overall, I think this can grow on us all, if we adjust the phrasing, menu items, combine a few things, and ensure we set the right defaults. What do you think? I would also like @fcoveram's instincts on this too, he's a good one to ping for nuanced configuration cases like this. |
|
Good thoughts, I largely agree with both what you said. I think one thing that this unlocks though that is not entirely visible at first is that it also allows hosts or special environments (think AI tools) to tailor the distraction free mode to their liking (and not just users). |
|
Is it worth considering making it configurable, but not adding a UI for it? |
I wonder if users actually have different preferences for their "distraction free" mode like @jasmussen mentioned. For instance, I can see myself switching to distraction free mode when writing, but I don't like the "hover" disappearing of the top bar, I like spotlight mode and I like a fixed top toolbar in these cases. I'm sure there are folks that disagree with my preferences here. How common is this need is not something I can answer though. |
draganescu
left a comment
There was a problem hiding this comment.
I haven't tested the PR but reading the code it seems comprehensive. The subject of the change I agree with very much - we've improved some of the preferences and how the UI responds to them quite extensively since distraction free was introduced that today DF is bit a mode (like zoom out) but a collection of applied prefs - a preset. This code change reflects that.
| ( select ) => | ||
| ( state, preferenceName, scope = 'core' ) => { | ||
| const { get } = select( preferencesStore ); | ||
| const isDistractionFree = get( 'core', 'distractionFree' ); |
There was a problem hiding this comment.
I find this interesting. While we treat in this PR distraction free as a set of applied editor preferences that together construct the experience, in this getter why do we need to know of this mode and not just return whatever prefs are set?
There was a problem hiding this comment.
We need to know two things:
- If the user is in "distraction free" mode or not
- The list of presets of the distraction free mode.
This check is the former. When it's true, we use the latter for the different UI elements, but this flag doesn't control the UI directly.
|
A couple of related thoughts:
|
Reviewing #79971, jasmussen noted that turning the pinned notes button into a dropdown was surprising: it reads as a boolean toggle, and until now it opened the notes sidebar. Restore the pinned "All notes" toggle and move the Full / Minimized / Hidden choices into a Notes group in the editor's Options (ellipsis) menu instead, filled through ViewMoreMenuGroup. A true flyout item awaits the ellipsis menu revamp discussed in #74546. Adds e2e coverage for the menu choices and the responsive collapse tiers.
Reviewing the combined try PR #79971, jasmussen noted that turning the pinned notes button into a dropdown was surprising: it reads as a boolean toggle, and until now it opened the notes sidebar. Restore the pinned "All notes" toggle and move the Show / Hide choices into a Notes group in the editor's Options (ellipsis) menu instead, filled through ViewMoreMenuGroup. The "Show all notes" choice is dropped from the menu: the pinned toggle (and the Panels section of the same menu) covers it. A true flyout item awaits the ellipsis menu revamp discussed in #74546.







What?
This is an experiment to make "distraction-free" more of a configurable experience. Distraction Free doesn't mean the same thing per user, this PR allows the user to tweak what happens when you go into distraction free. All the other configs are now "sub configs" of normal or distraction free modes.
Why?
Currently, enabling distraction-free mode applies a fixed set of UI changes all at once. Users have no way to customize which elements are hidden or shown in each mode. This PR introduces a
distractionFreeConfigobject that allows per-setting customization, giving users control over their editing experience in both normal and distraction-free modes.How?
The implementation introduces a dual-mode preference system:
New preferences:
showSimpleTopbar- Controls the inserter, list view, and zoom out togglesshowBlockHelpers- Controls insertion points, in-between inserter, grid visualizer, and block highlight effectsArchitecture changes:
distractionFreeConfigobject in edit-post and edit-site initialization that mirrors normal mode settingsgetEditorUIPreferenceselector that returns the appropriate value based on whether distraction-free mode is activeshowBlockHelpersthrough settings instead of checkingisDistractionFreedirectlyPreferences modal:
AppearanceTogglescomponent, just with different toggle implementationsDistractionFreeConfigControlcomponent manages values within the config objectthemeStylespreference through the shared component systemTesting Instructions
🤖 Generated with Claude Code