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.
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
Add a basic Options modal #10215
Add a basic Options modal #10215
Changes from 13 commits
8db3ac6
d193be2
3d0342f
d8e6ce8
54ddf62
abdfba3
9022168
110f079
b74dfa6
9c20409
1d59164
e3e1c4f
fed61bb
501221b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Those panel names seem to be very inconsistent. Should we do something about it? This is what we have:
post-status
taxonomy-panel-*
featured-image
post-excerpt
discussion-panel
We have related fills and filters named as follows:
PluginPostStatusInfo
editor.PostTaxonomyType
editor.PostFeaturedImage
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.
🤔🤔🤔
OK, so currently we have:
PostStatus
post-status
PostTaxonomies
taxonomy-panel-*
FeaturedImage
featured-image
PostExcerpt
post-excerpt
DiscussionPanel
discussion-panel
PageAttributes
page-attributes
Here's my proposal:
StatusPanel
status
PostTaxonomiesPanel
post-taxonomy-*
FeaturedImagePanel
featured-image
PostExcerptPanel
post-excerpt
DiscussionPanel
discussion
PageAttributesPanel
page-attributes
These names ensure:
panel
.Panel
which properly describes what the UI component actually is.post-
.page-
.What do you think? Is it worth changing the names? It's tricky to do this and ensure backwards compatibility with the stored
preferences
.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.
When you check closely code of the panels, it seems like all of them but
PageAttributesPanel
should be prefixed withPost
. I also agree that all of components should end withPanel
. My vote would be for:PostStatusPanel
post-status
PostTaxonomiesPanel
post-taxonomy-*
PostFeaturedImagePanel
post-featured-image
PostExcerptPanel
post-excerpt
PostDiscussionPanel
post-discussion
PageAttributesPanel
page-attributes
What do you think?
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.
By the way, this can be done in a seperate PR, this isn't a blocker at all as it existed before. It would be nice to have it standardized as we will be referencing them in the modal dialog. By they way, do you think we should put those values in constants or would it be overkill?
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.
It's probably overkill. We don't use constants for other identifiers e.g. block names and modal names.
I disagree. I think:
PostExcept
) should have aPost
prefixPageAttributes
) should have aPage
prefixThere 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 like your reasoning. I think it's more complex in the WordPress world because everything is a post both
Post
andPage
which makes it all even more confusing.I'm wondering how Classic Editor handles it. Well, it depends:
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 file is very compositiony! Really nice use of composition. 😄
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.
Yeah I'm pretty pleased with this!