-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Refactor editor 'feature' preferences to interface package #33774
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
Merged
talldan
merged 35 commits into
trunk
from
refactor/editor-preferences-to-interface-package
Aug 18, 2021
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
3827a18
Add basic store state for preferences
talldan c52bf90
Add more menu component
talldan 23f7920
Persist preferences
talldan f9fb645
Fix translator comment
talldan 2a3073d
Add a few refinements to the dropdown menu component
talldan e19f5e2
Add dropdown menu styles
talldan 5a27418
Use more menu for edit widgets
talldan 0b67393
Update edit widgets to use feature toggles
talldan 8b664e2
Remove some dead code
talldan d5497d1
Allow setting default feature values
talldan 6329f05
Update some newer preferences after rebase
talldan ed0bba4
Remove invalid tests
talldan 2891d29
Update package.json
talldan 1704f95
Migrate editor preferences to edit-widgets
talldan b98850a
Update e2e test code for disabling the welcome guide
talldan 6a2e2c7
Move preference defaults to a separate reducer to avoid persistence
talldan 51442e1
Fix - export defaults reducer
talldan 5f4e4c0
Add component docs and missing selector doc
talldan 6d50c38
Add main readme docs
talldan 9dd1b0e
Addthe example to the component docs as well
talldan a6e40c8
Update changelogs
talldan fcdbb3d
Add tests for selector
talldan 0fcaf7c
Ensure toggling takes into account the default value
talldan f44f392
Rename MoreMenuDropdown to OptionsMenuDropdown
talldan 4e6b560
Rename MoreMenuFeatureToggle to OptionsMenuFeatureTogle
talldan 4b48a36
Rename OptionsMenuDropdown to OptionsMenu
talldan 0b2b8c0
Fix style import
talldan b0f879b
Fix migration handling for multiple stores
talldan ef7da49
Update docs for migration function
talldan 028565d
Fix store name
talldan e9c80c4
Revert "Fix style import"
talldan 9931b6d
Revert "Rename OptionsMenuDropdown to OptionsMenu"
talldan b9e6fd3
Revert "Rename MoreMenuFeatureToggle to OptionsMenuFeatureTogle"
talldan 5067fc2
Revert "Rename MoreMenuDropdown to OptionsMenuDropdown"
talldan 9f58d3a
Remove setFeatureDefaults as an API
talldan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Will we at a later stage be consolidating the features that are to be shared across editors (not necessarily all of them) under a "shared" key or something?
Uh oh!
There was an error while loading. Please reload this page.
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.
This aspect wasn't something I'd considered when working on this task, but it's absolutely possible after this change now that the values are stored in one place.
I think the challenge will be how we reconcile that a user might already have conflicting values for preferences across editors. If I have Top Toolbar active in the post editor, but not active in customize widgets, which one is right?
Other than that, I don't think the implementation of a shared preference would be difficult now, I can think of a few different ways to do it, it all depends on how we'd want it to work. Would it be as simple as one value to rule them all, or might we allow a combination of a global and local preferences?
Some thoughts:
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.
These are all great points.
Regarding global vs local, I was thinking for some options - mostly the a11y/usability related ones, such as text labels on buttons and keeping the cursor inside the block - it make sense to just set them globally, as it's unlikely someone would want to use them in only one editor. For the others, maybe a global option with local override, or local-only makes more sense.
I initially thought of site settings as the best place to put global options, but might be good to get some design input on that too.